From e58b6c0679d1b17453402b70528a814376f68386 Mon Sep 17 00:00:00 2001 From: JavMB Date: Thu, 14 May 2026 20:48:35 +0200 Subject: [PATCH] Add auth and response docs to DocumentController endpoints --- DoliMiddlewareApi/Controllers/DocumentController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DoliMiddlewareApi/Controllers/DocumentController.cs b/DoliMiddlewareApi/Controllers/DocumentController.cs index 575fced..567993b 100644 --- a/DoliMiddlewareApi/Controllers/DocumentController.cs +++ b/DoliMiddlewareApi/Controllers/DocumentController.cs @@ -1,4 +1,5 @@ using DoliMiddlewareApi.Services; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -6,10 +7,14 @@ namespace DoliMiddlewareApi.Controllers { [Route("api/[controller]")] [ApiController] + [Authorize] public class DocumentController(DocumentService documentService) : ControllerBase { [HttpGet("invoice/{invoiceRef}/pdf")] + [ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task GetInvoicePdf(string invoiceRef) { var (content, filename) = await documentService.BuildInvoicePdfAsync(invoiceRef);