示例#1
0
 private PrePaidAccount(PrePaidAccountId id, Money amountAvailable, Money debtLimit, Money debt)
 {
     Id = id;
     _amountAvailable = amountAvailable;
     _debtLimit       = debtLimit;
     _debt            = debt;
 }
示例#2
0
            public async Task NewAccountWasCreatedForCurrency(Currency currency)
            {
                var account = PrePaidAccount.New(currency);
                await _repository.Save(account);

                _id = account.Id;
            }
示例#3
0
            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;
            }
示例#4
0
 public static PrePaidAccount Restore(Snapshot snapshot) => new PrePaidAccount(
     PrePaidAccountId.Of(snapshot.Id),
     snapshot.AmountAvailable,
     snapshot.DebtLimit,
     snapshot.Debt);
示例#5
0
 public static PrePaidAccount New(Currency currency) => new PrePaidAccount(
     PrePaidAccountId.New(),
     Money.Of(0, currency),
     Money.Of(0, currency),
     Money.Of(0, currency));