예제 #1
0
        public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet)
        {
            var transaction = new WalletTransferTransaction(amount, this, wallet);

            transaction.Initiate();
            return(transaction);
        }
예제 #2
0
 internal WithdrawalTransaction(Decimal amount, AbstractWallet sourceWallet)
     : base
     (
         amount,
         new ReduceBalanceCommand(sourceWallet, amount)
     )
 {
 }
예제 #3
0
 public CommissionHoldTransaction(Decimal amount, AbstractWallet sourceWallet)
     : base
     (
         amount,
         new ReduceBalanceCommand(sourceWallet, amount)
     )
 {
 }
예제 #4
0
        public PercentageAccrualDecorator(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, Decimal annualPercentage) : base(wallet)
        {
            _dayPercentage = annualPercentage / 365 / 100;

            _dateTimeProvider = dateTimeProvider;
            _lastUpdateTime   = _dateTimeProvider.UtcNow;
            _accumulation     = 0;
        }
예제 #5
0
 public IncreaseBalanceCommand(AbstractWallet wallet, Decimal amount)
     : base
     (
         () => wallet.IncreaseBalance(amount),
         () => wallet.ReduceBalance(amount)
     )
 {
 }
예제 #6
0
 public PercentageAccrualTransaction(Decimal amount, AbstractWallet destinationWallet)
     : base
     (
         amount,
         new IncreaseBalanceCommand(destinationWallet, amount)
     )
 {
 }
예제 #7
0
 internal DepositTransaction(Decimal amount, AbstractWallet destinationWallet)
     : base
     (
         amount,
         new IncreaseBalanceCommand(destinationWallet, amount)
     )
 {
 }
예제 #8
0
        internal WalletTransferTransaction(Decimal amount, AbstractWallet sourceWallet, AbstractWallet destinationWallet)
            : base
            (
                amount,
                CommandChain
                .StartWith(new ReduceBalanceCommand(sourceWallet, amount))
                .Then(new IncreaseBalanceCommand(destinationWallet, amount))
            )

        {
        }
예제 #9
0
 protected WalletDecorator(AbstractWallet wallet)
 {
     _wallet = wallet;
 }
예제 #10
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder SetStartBalance(Decimal startBalance)
 {
     _wallet = new Wallet(startBalance);
     return(this);
 }
예제 #11
0
 public ZeroBalanceLimitProxy(AbstractWallet wallet) : base(wallet, 0)
 {
 }
예제 #12
0
 public CommissionHoldDecorator(AbstractWallet wallet, Decimal commission) : base(wallet)
 {
     _commission = commission;
 }
예제 #13
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder SetWithdrawalAmountLimit(Decimal amountLimit)
 {
     _wallet = new WithdrawalAmountLimitProxy(_wallet, amountLimit);
     return(this);
 }
예제 #14
0
 public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet)
 {
     UpdatePercentage();
     return(_wallet.TransferTo(amount, wallet));
 }
예제 #15
0
 public WithdrawalAmountLimitProxy(AbstractWallet wallet, Decimal limit) : base(wallet, limit)
 {
 }
예제 #16
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder SetTransferAmountLimit(Decimal amountLimit)
 {
     _wallet = new TransferAmountLimitProxy(_wallet, amountLimit);
     return(this);
 }
예제 #17
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder SetZeroBalanceLimit()
 {
     _wallet = new ZeroBalanceLimitProxy(_wallet);
     return(this);
 }
예제 #18
0
파일: WalletProxy.cs 프로젝트: s4xack/Oop
 protected WalletProxy(AbstractWallet wallet)
 {
     _wallet = wallet;
 }
예제 #19
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder SetTransferTimeBlock(TimeSpan blockTime)
 {
     _wallet = new TransferTimeBlockProxy(_wallet, _dateTimeProvider, blockTime);
     return(this);
 }
예제 #20
0
 public WithdrawalTimeBlockProxy(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, TimeSpan blockTime) : base(wallet, dateTimeProvider, blockTime)
 {
 }
예제 #21
0
 protected TimeBlockProxy(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, TimeSpan blockTime) : base(wallet)
 {
     _dateTimeProvider = dateTimeProvider;
     _blockTime        = blockTime;
     _creationTime     = _dateTimeProvider.UtcNow;
 }
예제 #22
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder SetCommissionHold(Decimal commissionAmount)
 {
     _wallet = new CommissionHoldDecorator(_wallet, commissionAmount);
     return(this);
 }
예제 #23
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder SetPercentageAccrual(Decimal annualPercentage)
 {
     _wallet = new PercentageAccrualDecorator(_wallet, _dateTimeProvider, annualPercentage);
     return(this);
 }
예제 #24
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder SetWithdrawalTimeBlock(TimeSpan blockTime)
 {
     _wallet = new WithdrawalTimeBlockProxy(_wallet, _dateTimeProvider, blockTime);
     return(this);
 }
예제 #25
0
파일: WalletProxy.cs 프로젝트: s4xack/Oop
 public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet)
 {
     return(_wallet.TransferTo(amount, wallet));
 }
예제 #26
0
 public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet)
 {
     CheckTimeBlock("Unable to transfer!");
     return(base.TransferTo(amount, wallet));
 }
예제 #27
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder(IDateTimeProvider dateTimeProvider)
 {
     _wallet           = new Wallet(0);
     _dateTimeProvider = dateTimeProvider;
 }
예제 #28
0
파일: WalletBuilder.cs 프로젝트: s4xack/Oop
 public WalletBuilder Refresh()
 {
     _wallet = new Wallet(0);
     return(this);
 }
예제 #29
0
 public TransferTimeBlockProxy(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, TimeSpan blockTime) : base(wallet, dateTimeProvider, blockTime)
 {
 }
예제 #30
0
 protected AmountLimitProxy(AbstractWallet wallet, Decimal limit) : base(wallet)
 {
     _limit = limit;
 }