public async Task <IActionResult> UpdateAsync([FromBody] UpdateInvoiceModel model)
        {
            try
            {
                model.ValidateDueDate();

                var invoice = Mapper.Map <Invoice>(model);

                await _invoiceService.UpdateDraftAsync(invoice);

                return(NoContent());
            }
            catch (InvoiceDueDateException ex)
            {
                _log.WarningWithDetails(ex.Message, model.Sanitize());

                return(BadRequest(ErrorResponse.Create(ex.Message)));
            }
            catch (InvoiceNotFoundException ex)
            {
                _log.WarningWithDetails(ex.Message, model.Sanitize());

                return(NotFound(ErrorResponse.Create("Invoice with such Id and MerchantId not found")));
            }
            catch (InvalidOperationException ex)
            {
                _log.WarningWithDetails(ex.Message, model.Sanitize());

                return(BadRequest(ErrorResponse.Create(ex.Message)));
            }
        }