public void StateTransition(LoyaltyPointAccount status)
            {
                log.Trace("Internal state changed to '{0}'. Invoking state transition method.", decorated.GetType().FullName);

                decorated.StateTransition(status);

                log.Trace("State transition method on '{0}' invoked.", decorated.GetType().Name);
            }
            public void DeactivateAccount(LoyaltyPointAccount account)
            {
                log.Info("Request to deactivate account '{0}'.", account);

                decorated.DeactivateAccount(account);

                log.Info("Account '{0}' deactivated.", account);
            }
            public void ActivateAccount(LoyaltyPointAccount account)
            {
                log.Info("Activating new account: {0}.", account);

                decorated.ActivateAccount(account);

                log.Info("New account activated: {0}.", account);
            }
            public void Deposit(LoyaltyPointAccount account, Amount amount)
            {
                log.Info("Request to deposit '{0}' into active account '{1}'.", amount, account);

                decorated.Deposit(account, amount);

                log.Info("Deposit of '{0}' made into active account '{1}'. New balance is '{2}'", amount, account, account.CurrentPoints);
            }
            public Amount RetrieveBalance(LoyaltyPointAccount account)
            {
                log.Trace("Request to retrieve balance of active account '{0}'.", account);

                var balance = decorated.RetrieveBalance(account);

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

                return(balance);
            }
            public Amount RetrieveBalance(LoyaltyPointAccount account)
            {
                log.Trace("Retrieving balance for new inactive account: {0}.", account);

                var result = decorated.RetrieveBalance(account);

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

                return(result);
            }
 public override void ActivateAccount(LoyaltyPointAccount account)
 {
     reactivateMethod.Reactivate(account.identity);
     account.SetState(account.activeState);
 }
            public void StateTransition(LoyaltyPointAccount account)
            {
                log.Trace("Internal state changed to '{0}'.", decorated.GetType().Name);

                decorated.StateTransition(account);
            }
            public void Deposit(LoyaltyPointAccount account, Amount amount)
            {
                log.Info("Request to deposit '{0}' into new inactive account '{1}'.", amount, account);

                decorated.Deposit(account, amount);
            }
Esempio n. 10
0
 public virtual void StateTransition(LoyaltyPointAccount account)
 {
     DoNothing();
 }
            public void DeactivateAccount(LoyaltyPointAccount account)
            {
                log.Warning("Request to deactivate a new account that is not active yet: {0}.", account);

                decorated.DeactivateAccount(account);
            }
Esempio n. 12
0
 public abstract Amount RetrieveBalance(LoyaltyPointAccount account);
Esempio n. 13
0
 public virtual void DeactivateAccount(LoyaltyPointAccount account)
 {
     DoNothing();
 }
            public override Amount RetrieveBalance(LoyaltyPointAccount account)
            {
                var result = balanceRetrievalMethod.RetrieveBalance(account.identity, account.primaryCurrency);

                return(result);
            }
Esempio n. 15
0
 public abstract void Deposit(LoyaltyPointAccount account, Amount amount);
            public void ActivateAccount(LoyaltyPointAccount account)
            {
                log.Warning("Request to activate account '{0}'. This account is already active. The request will be ignored.", account);

                decorated.ActivateAccount(account);
            }
Esempio n. 17
0
            public void Deposit(LoyaltyPointAccount account, Amount amount)
            {
                log.Warning("Request to make deposit of '{0}' into inactive account '{1}'.", amount, account);

                decorated.Deposit(account, amount);
            }
Esempio n. 18
0
            public void DeactivateAccount(LoyaltyPointAccount account)
            {
                log.Warning("Attempt to deactivate already inactive account '{0}'.", account);

                decorated.DeactivateAccount(account);
            }
 public override void Deposit(LoyaltyPointAccount account, Amount amount)
 {
     depositMethod.Deposit(account.identity, amount);
 }
Esempio n. 20
0
 public override void DeactivateAccount(LoyaltyPointAccount account)
 {
     deactivationMethod.DeactivateAccount(account.identity);
     account.SetState(account.inactiveState);
 }