Пример #1
0
 public Task Handle(PayCreatedEvent @event)
 {
     _facturaServices.Update(new Factura {
         Amount = @event.Monto, IdInvoice = @event.FacturaID, State = @event.Estado
     });
     return(Task.CompletedTask);
 }
Пример #2
0
        public IActionResult Update([FromBody] FacturaUpdateDTO facturaUpdateDTO)
        {
            Factura factura = _facturaServices.Get(facturaUpdateDTO.FacturaID);

            if (factura == null)
            {
                return(NotFound());
            }

            factura.State = facturaUpdateDTO.Estado;

            if (!_facturaServices.Update(factura))
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, $"Hubo un problema al intentar actualizar la factura { factura.IdInvoice }"));
            }

            return(Ok());
        }