Example #1
0
        public async Task <ApiResponse <int> > CreateExpenseClaim(ExpenseClaimDetailViewModel expenseClaimDetailViewModel)
        {
            try
            {
                CreateExpenseClaimCommand createExpenseClaimCommand = _mapper.Map <CreateExpenseClaimCommand>(expenseClaimDetailViewModel);
                var response = await _client.AddExpenseClaimAsync(createExpenseClaimCommand);

                return(new ApiResponse <int>()
                {
                    Data = response.ExpenseClaim.ExpenseClaimId, Success = true
                });
            }
            catch (ApiException ex)
            {
                return(ConvertApiExceptions <int>(ex));
            }
        }
Example #2
0
 public async Task <IActionResult> Post(CreateExpenseClaimCommand command)
 {
     return(Ok(await _mediator.Send(command)));
 }
Example #3
0
        public async Task <ActionResult <CreateExpenseClaimCommandResponse> > Create([FromBody] CreateExpenseClaimCommand createExpenseClaimCommand)
        {
            var createExpenseClaimCommandResponse = await _mediator.Send(createExpenseClaimCommand);

            return(Ok(createExpenseClaimCommandResponse));
        }
Example #4
0
 public async Task <ActionResult <ExpenseClaimResponseDto> > Post(CreateExpenseClaimCommand command)
 {
     return(await Mediator.Send(command));
 }