public void Process(SimulationState state, DateTime date)
        {
            var total = Total;

            foreach (var deposit in _deposits)
            {
                state.Deposit(date, deposit.AccountId, deposit.Name, deposit.Amount);
                total -= deposit.Amount;
            }

            state.Deposit(date, AccountId, Name, total);
        }
Exemple #2
0
 public override void ProcessInterest(SimulationState state, DateTime date)
 {
     if (APY > 0)
     {
         decimal amount = (APY / 12m) * Balance;
         state.Deposit(date, this, $"APY({APY:P2})", amount);
     }
 }
Exemple #3
0
        public void Process(SimulationState state, DateTime date)
        {
            if (IsPaidOff)
            {
                return;
            }

            var payment = Payment;

            if (state.IsSnowball && state.SnowballTarget == this)
            {
                payment += state.SnowballAmount;
            }

            if (payment > Balance)
            {
                // if we make this payment; we'll overpay
                payment = Balance;
            }

            state.Deposit(date, this, "Payment", payment);
            state.Withdraw(date, AccountId, Name, payment);
        }
Exemple #4
0
 public void Process(SimulationState state, DateTime date)
 {
     state.Withdraw(date, FromId, Name, Amount);
     state.Deposit(date, ToId, Name, Amount);
 }