public async Task <IActionResult> MarkDispute([FromBody] MarkInvoiceDisputeRequest model) { try { await _invoiceService.MarkDisputeAsync(model.InvoiceId, model.Reason, model.EmployeeId); return(Ok()); } catch (InvoiceNotFoundException ex) { _log.WarningWithDetails(ex.Message, model); return(NotFound(ErrorResponse.Create(ex.Message))); } catch (EmployeeNotFoundException ex) { _log.WarningWithDetails(ex.Message, model); return(NotFound(ErrorResponse.Create(ex.Message))); } catch (InvalidOperationException ex) { _log.ErrorWithDetails(ex, model); return(BadRequest(ErrorResponse.Create(ex.Message))); } }
public Task MarkDisputeAsync(MarkInvoiceDisputeRequest model) { return(_runner.RunAsync(() => _invoicesApi.MarkDisputeAsync(model))); }