From 757f56b9f8ee74cec37c91ff0effb31c81a1cea0 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 11 Aug 2026 10:29:44 +0200 Subject: [PATCH] refactor: Move request DTOs to DocumentService.Client.Models namespace --- .../Controllers/PdfAttachmentController.cs | 1 + .../Controllers/PdfConversionController.cs | 31 +------------------ .../Controllers/PdfValidationController.cs | 25 +-------------- .../Controllers/ZugferdController.cs | 25 +-------------- 4 files changed, 4 insertions(+), 78 deletions(-) diff --git a/DocumentOperator.API/Controllers/PdfAttachmentController.cs b/DocumentOperator.API/Controllers/PdfAttachmentController.cs index ad20e36..10c3efb 100644 --- a/DocumentOperator.API/Controllers/PdfAttachmentController.cs +++ b/DocumentOperator.API/Controllers/PdfAttachmentController.cs @@ -2,6 +2,7 @@ using DocumentService.Application.AddAttachments; using DocumentService.Application.CheckPdfAttachments.Queries; using DocumentService.Application.Common.DTOs; using DocumentService.Application.ExtractPdfAttachments; +using DocumentService.Client.Models.Requests; using DocumentService.Domain.Common.Exceptions; using MediatR; using Microsoft.AspNetCore.Http; diff --git a/DocumentOperator.API/Controllers/PdfConversionController.cs b/DocumentOperator.API/Controllers/PdfConversionController.cs index e394c37..9bf7228 100644 --- a/DocumentOperator.API/Controllers/PdfConversionController.cs +++ b/DocumentOperator.API/Controllers/PdfConversionController.cs @@ -1,5 +1,6 @@ using DocumentService.Application.ConvertFromPdfA; using DocumentService.Application.ConvertToPdfA; +using DocumentService.Client.Models.Requests; using DocumentService.Domain.Common.Exceptions; using MediatR; using Microsoft.AspNetCore.Http; @@ -179,33 +180,3 @@ public class PdfConversionController(IMediator mediator) : ControllerBase return File(resultPdf, "application/pdf", "converted-pdf.pdf"); } } - -/// -/// Request DTO for converting PDF to PDF/A -/// -public record ConvertToPdfARequest -{ - /// - /// PDF document encoded as Base64 string - /// - /// JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c... - public required string Base64Pdf { get; init; } - - /// - /// Target PDF/A level (default: "PDF/A-3b") - /// - /// PDF/A-3b - public string? PdfALevel { get; init; } -} - -/// -/// Request DTO for converting PDF/A to PDF -/// -public record ConvertFromPdfARequest -{ - /// - /// PDF/A document encoded as Base64 string - /// - /// JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c... - public required string Base64Pdf { get; init; } -} diff --git a/DocumentOperator.API/Controllers/PdfValidationController.cs b/DocumentOperator.API/Controllers/PdfValidationController.cs index e54feea..7d587d4 100644 --- a/DocumentOperator.API/Controllers/PdfValidationController.cs +++ b/DocumentOperator.API/Controllers/PdfValidationController.cs @@ -1,6 +1,7 @@ using DocumentService.Application.Common.DTOs; using DocumentService.Application.ValidatePdf.Queries; using DocumentService.Application.ValidatePdfA.Queries; +using DocumentService.Client.Models.Requests; using DocumentService.Domain.Common.Exceptions; using MediatR; using Microsoft.AspNetCore.Mvc; @@ -167,27 +168,3 @@ public class PdfValidationController(IMediator Mediator) : ControllerBase return Ok(result); } } - -/// -/// Request DTO for Base64-encoded PDF validation -/// -public record ValidatePdfBase64Request -{ - /// - /// PDF document encoded as Base64 string - /// - /// JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c... - public string Base64Pdf { get; init; } = string.Empty; -} - -/// -/// Request DTO for Base64-encoded PDF/A validation -/// -public record ValidatePdfABase64Request -{ - /// - /// PDF document encoded as Base64 string - /// - /// JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c... - public string Base64Pdf { get; init; } = string.Empty; -} diff --git a/DocumentOperator.API/Controllers/ZugferdController.cs b/DocumentOperator.API/Controllers/ZugferdController.cs index f44e908..3967f51 100644 --- a/DocumentOperator.API/Controllers/ZugferdController.cs +++ b/DocumentOperator.API/Controllers/ZugferdController.cs @@ -1,6 +1,7 @@ using DocumentService.Application.Common.DTOs; using DocumentService.Application.ExtractZugferd; using DocumentService.Application.HasZugferd.Queries; +using DocumentService.Client.Models.Requests; using DocumentService.Domain.Common.Exceptions; using MediatR; using Microsoft.AspNetCore.Http; @@ -176,27 +177,3 @@ public class ZugferdController(IMediator mediator) : ControllerBase return Ok(result); } } - -/// -/// Request DTO for Base64-encoded PDF ZUGFeRD check -/// -public record HasZugferdRequest -{ - /// - /// PDF document encoded as Base64 string - /// - /// JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c... - public string Base64Pdf { get; init; } = string.Empty; -} - -/// -/// Request DTO for Base64-encoded PDF ZUGFeRD extraction -/// -public record ExtractZugferdRequest -{ - /// - /// PDF document encoded as Base64 string - /// - /// JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c... - public required string Base64Pdf { get; init; } -}