Beispiel #1
0
        public List <TransactionOrderDomainEntity> GetListByFromAccount(AccountDomainEntity fromAccount)
        {
            List <int> statusList = new List <int>()
            {
                TransactionStatusEnum.Created.ToInt(),
                       TransactionStatusEnum.Pending.ToInt()
            };

            return(GetListBy(
                       to =>
                       to.FromAccountId == fromAccount.AccountId && statusList.Contains(to.TransactionOrderStatusId)));
        }
Beispiel #2
0
 private TransactionOrderDomainEntity With(
     TransactionTypeDomainEntity transactionType,
     string orderDescription,
     DateTime operationDate,
     AccountDomainEntity fromAccount,
     AccountDomainEntity toAccount,
     decimal amount,
     TransactionStatusDomainEntity transactionOrderStatus)
 {
     TransactionType   = transactionType;
     OrderDesctiption  = orderDescription;
     CreateDate        = DateTime.Now;
     OperationDate     = operationDate;
     FromAccount       = fromAccount;
     ToAccount         = toAccount;
     Amount            = amount;
     TransactionStatus = transactionOrderStatus;
     return(this);
 }
Beispiel #3
0
        public TransactionOrderDomainEntity With(
            TransactionTypeEnum type,
            string orderDescription,
            DateTime operationDate,
            AccountDomainEntity fromAccount,
            AccountDomainEntity toAccount,
            decimal amount,
            TransactionStatusEnum orderStatus)
        {
            if (fromAccount.AccountType.AccountTypeId != toAccount.AccountType.AccountTypeId)
            {
                throw new AccountManagementException.TransactionOrderCouldNotHasDifferentAccountTypes(string.
                                                                                                      Format("FromAccountType: {0} - ToAccountType: {1}", fromAccount.AccountType.AccountTypeName, toAccount.AccountType.AccountTypeName));
            }

            var transactionType   = coreContext.Query <ITransactionTypeRepository>().GetByKey(type.ToString());
            var transactionStatus = coreContext.Query <ITransactionStatusRepository>().GetByKey(orderStatus.ToString());

            return(With(transactionType, orderDescription, operationDate, fromAccount, toAccount, amount, transactionStatus));
        }