示例#1
0
            public void Deposit(AccountStatusAwareOperations context, AccountInformation account, Amount amount)
            {
                logger.LogInfo("Request to deposit '{0}' into active account '{1}'.", amount, account);

                decorated.Deposit(context, account, amount);

                logger.LogInfo("Deposit of '{0}' made into active account '{1}'.", amount, account);
            }
            public void ActivateAccount(AccountStatusAwareOperations context, IAccountIdentity account)
            {
                logger.LogInfo("Activating new account: {0}.", account);

                decorated.ActivateAccount(context, account);

                logger.LogInfo("New account activated: {0}.", account);
            }
示例#3
0
            public void StateTransition(AccountStatusAwareOperations status)
            {
                logger.LogTrace("Internal state changed to '{0}'. Invoking state transition method.", decorated.GetType().FullName);

                decorated.StateTransition(status);

                logger.LogTrace("State transition method on '{0}' invoked.", decorated.GetType().Name);
            }
示例#4
0
            public void DeactivateAccount(AccountStatusAwareOperations context, IAccountIdentity account)
            {
                logger.LogInfo("Request to deactivate account '{0}'.", account);

                decorated.DeactivateAccount(context, account);

                logger.LogInfo("Account '{0}' deactivated.", account);
            }
            public Amount RetrieveBalance(AccountStatusAwareOperations context, AccountInformation account)
            {
                logger.LogTrace("Retrieving balance for new inactive account: {0}.", account);

                var result = decorated.RetrieveBalance(context, account);

                logger.LogTrace("Account balance is {0}: {1}.", result, account);

                return(result);
            }
示例#6
0
            public Amount RetrieveBalance(AccountStatusAwareOperations context, AccountInformation account)
            {
                logger.LogTrace("Request to retrieve balance of active account '{0}'.", account);

                var balance = decorated.RetrieveBalance(context, account);

                logger.LogTrace("Balance of active account '{0}' retrieved. Current balance is '{1}'.", account, balance);

                return(balance);
            }
 public abstract void Deposit(AccountStatusAwareOperations context, AccountInformation account, Amount amount);
 public override void DeactivateAccount(AccountStatusAwareOperations context, IAccountIdentity account)
 {
     deactivationMethod.DeactivateAccount(account);
     context.SetState(context.inactiveState);
 }
 public virtual void StateTransition(AccountStatusAwareOperations context)
 {
     DoNothing();
 }
 public virtual void DeactivateAccount(AccountStatusAwareOperations context, IAccountIdentity account)
 {
     DoNothing();
 }
 public void DeactivateAccount(AccountStatusAwareOperations context, IAccountIdentity account)
 {
     logger.LogWarning("Request to deactivate a new account that is not active yet: {0}.", account);
 }
 public abstract Amount RetrieveBalance(AccountStatusAwareOperations context, AccountInformation account);
 public void Deposit(AccountStatusAwareOperations context, AccountInformation account, Amount amount)
 {
     logger.LogWarning("Request to deposit '{0}' into a new inactive account '{1}'.", amount, account);
 }
            public void StateTransition(AccountStatusAwareOperations context)
            {
                logger.LogTrace("Internal state changed to '0'.", decorated.GetType().Name);

                decorated.StateTransition(context);
            }
            public override Amount RetrieveBalance(AccountStatusAwareOperations context, AccountInformation account)
            {
                var result = balanceRetrievalMethod.RetrieveBalance(account);

                return(result);
            }
示例#16
0
 public void ActivateAccount(AccountStatusAwareOperations context, IAccountIdentity account)
 {
     logger.LogWarning("Request to activate account '{0}'. This account is already active. The request will be ignored.", account);
 }
 public override void ActivateAccount(AccountStatusAwareOperations context, IAccountIdentity account)
 {
     reactivateMethod.Reactivate(account);
     context.SetState(context.activeState);
 }
 public override void Deposit(AccountStatusAwareOperations context, AccountInformation account, Amount amount)
 {
     depositMethod.Deposit(account, amount);
 }
 public void DeactivateAccount(AccountStatusAwareOperations context, IAccountIdentity account)
 {
     logger.LogWarning("Attempt to deactivate already inactive account '{0}'.", account);
 }