Ejemplo n.º 1
0
        public BankAccountDTO Deposit(BankAccountLiquidizeSRO deliquidize)
        {
            var account = _repository.GetByGuid(deliquidize.GuidAccount);

            if (account == null)
            {
                return(null);
            }

            account.Worth += deliquidize.Value;
            _repository.SaveChanges();
            return(_dtoMapper.Map(account));
        }
Ejemplo n.º 2
0
        //WILL NEVER BE IN ANY STANDALONE-APP instead it should be transactionally coupled to the physical money-transaction
        public BankAccountDTO Withdraw(BankAccountLiquidizeSRO liquidize)
        {
            var account = _repository.GetByGuid(liquidize.GuidAccount);

            if (account == null
                | account.Worth < liquidize.Value)
            {
                return(null);
            }

            account.Worth -= liquidize.Value;
            //_transactionLogic.Transfer?
            //          .TransferFromInternalLiquid() for
            //concrete injection of BankTransactionLogic?
            //create my own (new BankTransactionLogic() )?
            _repository.SaveChanges();
            return(_dtoMapper.Map(account));
        }