private PrePaidAccount(PrePaidAccountId id, Money amountAvailable, Money debtLimit, Money debt) { Id = id; _amountAvailable = amountAvailable; _debtLimit = debtLimit; _debt = debt; }
public async Task NewAccountWasCreatedForCurrency(Currency currency) { var account = PrePaidAccount.New(currency); await _repository.Save(account); _id = account.Id; }
public async Task AmountAvailableWas(decimal value, Currency currency) { var account = PrePaidAccount.New(currency); account.Recharge(Money.Of(value, currency)); await _repository.Save(account); _id = account.Id; }
public static PrePaidAccount Restore(Snapshot snapshot) => new PrePaidAccount( PrePaidAccountId.Of(snapshot.Id), snapshot.AmountAvailable, snapshot.DebtLimit, snapshot.Debt);
public static PrePaidAccount New(Currency currency) => new PrePaidAccount( PrePaidAccountId.New(), Money.Of(0, currency), Money.Of(0, currency), Money.Of(0, currency));