Exemplo n.º 1
0
        public List <TransactionPerTypeAns> GetAnsAmtType([FromBody] RAnsTransactionReqFormDto bodyDto)
        {
            var allTransactions = bodyDto.CustomerID != null?
                                  _repo.GetFromCustomerID((int)bodyDto.CustomerID).ToList() : _repo.GetAll().ToList();

            TransactionAnalyzer transactionAnalyzer = new TransactionAnalyzer(allTransactions);
            var result = (List <TransactionPerTypeAns>)transactionAnalyzer.GenerateResults(bodyDto.FromDate, bodyDto.ToDate, "amountPerType");

            return(result);
        }
Exemplo n.º 2
0
        public List <TransactionDto> GetSpecific([FromBody] RAnsTransactionReqFormDto bodyDto)
        {
            var allTransactions = bodyDto.CustomerID != null?
                                  _repo.GetFromCustomerID((int)bodyDto.CustomerID).ToList() : _repo.GetAll().ToList();

            var tranAnalyzer     = new TransactionAnalyzer(allTransactions);
            var specTransactions = tranAnalyzer.GetTransactionsBetween(bodyDto.FromDate, bodyDto.ToDate).ToList();

            var result = new List <TransactionDto>();

            foreach (var tran in specTransactions)
            {
                TransactionDto tranDto = new TransactionDto(tran);
                result.Add(tranDto);
            }

            return(result);
        }