From 220d02819c9d6a414568d13a50a6e2c5e3d0dd42 Mon Sep 17 00:00:00 2001 From: javiermengual Date: Tue, 30 Dec 2025 13:19:02 +0100 Subject: [PATCH] enchance: mejoro los types de openapi para el frontend --- DoliMiddlewareApi/Controllers/InvoicesController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DoliMiddlewareApi/Controllers/InvoicesController.cs b/DoliMiddlewareApi/Controllers/InvoicesController.cs index acc9e85..c5d4924 100644 --- a/DoliMiddlewareApi/Controllers/InvoicesController.cs +++ b/DoliMiddlewareApi/Controllers/InvoicesController.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using DoliMiddlewareApi.Dtos; using DoliMiddlewareApi.Services; using Microsoft.AspNetCore.Mvc; @@ -16,7 +17,8 @@ public class InvoicesController : ControllerBase } [HttpGet] - public async Task GetInvoices( + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task>> GetInvoices( [FromQuery] int limit = 50, [FromQuery] [Range(1, int.MaxValue)] int page = 1, [FromQuery] string? status = null) @@ -26,7 +28,9 @@ public class InvoicesController : ControllerBase } [HttpGet("{id:int}")] - public async Task GetInvoice(int id) + [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> GetInvoice(int id) { var invoice = await _dolibarrClient.GetInvoiceAsync(id); return Ok(invoice);