public async Task <IActionResult> UploadFileAsync([FromQuery] string start, [FromQuery] string end) { if (string.IsNullOrEmpty(start) || string.IsNullOrEmpty(end)) { throw new Exception("Invalid start or end date"); } var command = new GetTransactionsByDateRangeQuery { Start = start, End = end }; var result = await _mediator.Send(command); return(Ok(result)); }
public async Task <List <TransactionResult> > Handle(GetTransactionsByDateRangeQuery request, CancellationToken cancellationToken) { return(await transactionService.GetAllByDateRange(request.StartDate, request.EndDate)); }