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); }
public override void ProcessInterest(SimulationState state, DateTime date) { if (APY > 0) { decimal amount = (APY / 12m) * Balance; state.Deposit(date, this, $"APY({APY:P2})", amount); } }
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); }
public void Process(SimulationState state, DateTime date) { state.Withdraw(date, FromId, Name, Amount); state.Deposit(date, ToId, Name, Amount); }