Gringotts.Domain.Venture.ChangeStateToStarted C# (CSharp) Method

ChangeStateToStarted() public method

public ChangeStateToStarted ( ) : void
return void
        public virtual void ChangeStateToStarted()
        {
            AddEventToVentureHistory(VentureEvent.STARTED);
            State = STARTED_STATE;
        }

Usage Example

Esempio n. 1
0
        public virtual IEnumerable<Venture> Split(TermsOfSplit termsOfSplit)
        {
            if(!IsStarted()){
                throw new Exception("Cannot split a venture that is not started.");
            }
            // Splitting of OutLay
            var aVentures = new List<Venture>();
            var aFirstVenture = new Venture(termsOfSplit.FirstVentureName,termsOfSplit.Ratio.Apply(Outlay));
            var aSecondVenture = new Venture(termsOfSplit.SecondVentureName, termsOfSplit.Ratio.ApplyRemaining(Outlay));

            // Splitting of Holding's Investments
            var holdings = Holding.Split(termsOfSplit.Ratio);
            aFirstVenture.holding = holdings[0];
            aSecondVenture.holding = holdings[1];

            AddEventToVentureHistory(VentureEvent.SPLIT);
            CloseTheVenture();

            aFirstVenture.AddEventToVentureHistory(VentureEvent.SPLIT);
            aSecondVenture.AddEventToVentureHistory(VentureEvent.SPLIT);
            aFirstVenture.ChangeStateToStarted();
            aSecondVenture.ChangeStateToStarted();

            aVentures.Add(aFirstVenture);
            aVentures.Add(aSecondVenture);
            return aVentures;
        }
All Usage Examples Of Gringotts.Domain.Venture::ChangeStateToStarted