public static void ChangeOrSetAmountTo(PaymentTransactionState state, Money money) { if (money._amount > 1000) { throw new DailyAmountExceedException(state.Id.ToString()); } state.ApplyEvent(new Events.V1.TransactionAmountChangedDomainEvent(money._amount.Value)); }
public static void AssignDetail(PaymentTransactionState state, string description) => state.ApplyEvent(new Events.V1.TransactionDetailAssignedToTransactionDomainEvent(state.Id.ToString(), description));
public static void SetMoney(PaymentTransactionState state, decimal amount) => state.ApplyEvent(new Events.V1.TransactionAmountChangedDomainEvent(amount));
public static void PaymentStatusFailed(PaymentTransactionState state) => state.ApplyEvent(new Events.V1.TransactionStatusChangedDomainEvent(PaymenTransactionStatus.FailStatus.Id));