Exemplo n.º 1
0
        public async ValueTask <ActionResult <List <LeadOutputModel> > > SearchLead(SearchParametersInputModel searchparameters)
        {
            DataWrapper <List <LeadDto> > dataWrapper = await _repo.SearchLeads(_mapper.Map <LeadSearchParameters>(searchparameters));

            return(MakeResponse(dataWrapper, _mapper.Map <List <LeadOutputModel> >));
        }
Exemplo n.º 2
0
        public async ValueTask <ActionResult <List <TransactionOutputModel> > > SearchTransactionsByParameters([FromBody] SearchParametersInputModel searchModel)
        {
            if (string.IsNullOrEmpty(searchModel.FromDate))
            {
                searchModel.FromDate = null;
            }
            if (string.IsNullOrEmpty(searchModel.TillDate))
            {
                searchModel.TillDate = null;
            }
            if (searchModel.Type == (byte)TransactionType.Withdraw)
            {
                searchModel.AmountBegin *= -1;
            }
            if (searchModel.Type == (byte)TransactionType.Withdraw)
            {
                searchModel.AmountEnd *= -1;
            }
            var dataWrapper = await _transactionService.SearchTransactions(_mapper.Map <TransactionSearchParameters>(searchModel));

            return(MakeResponse(dataWrapper, _mapper.Map <List <TransactionOutputModel> >));
        }