public Task Handle(PayCreatedEvent @event) { _facturaServices.Update(new Factura { Amount = @event.Monto, IdInvoice = @event.FacturaID, State = @event.Estado }); return(Task.CompletedTask); }
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()); }