Refactor DTOs and namespaces for maintainability

Consolidated DTOs under `DocumentService.Application.Common.DTOs.Requests`
to centralize and align them with the application layer. Introduced
`PdfBase64RequestBase` to encapsulate shared properties, reducing
redundancy across request DTOs. Updated controllers, clients, and tests
to use the new DTO structure. Removed redundant DTOs and cleaned up
unused namespaces and comments. Improved documentation and ensured
consistent naming conventions across the codebase.
This commit is contained in:
2026-08-31 01:19:52 +02:00
parent af0fca198a
commit 2c98558131
30 changed files with 97 additions and 440 deletions

View File

@@ -3,7 +3,7 @@ using System.Net.Http.Headers;
using System.Reflection;
using System.Text;
using System.Text.Json;
using DocumentService.API.Controllers;
using DocumentService.Application.Common.DTOs.Requests;
using DocumentService.Domain.Models.ValueObjects;
using FluentAssertions;
using Microsoft.AspNetCore.Mvc.Testing;
@@ -243,7 +243,7 @@ public class PdfOperationsControllerTests : IClassFixture<WebApplicationFactory<
// Arrange
string base64Pdf = LoadTestPdfAsBase64("valid.pdf");
var request = new AddAnnotationBase64Command
var request = new AddAnnotationBase64Request
{
Base64Pdf = base64Pdf,
AnnotationType = AnnotationType.FreeText,
@@ -275,7 +275,7 @@ public class PdfOperationsControllerTests : IClassFixture<WebApplicationFactory<
// Arrange
string base64Pdf = LoadTestPdfAsBase64("valid.pdf");
var request = new AddAnnotationBase64Command
var request = new AddAnnotationBase64Request
{
Base64Pdf = base64Pdf,
AnnotationType = AnnotationType.StickyNote,
@@ -335,7 +335,7 @@ public class PdfOperationsControllerTests : IClassFixture<WebApplicationFactory<
// Arrange
string base64Pdf = LoadTestPdfAsBase64("valid.pdf");
var request = new AddAnnotationBase64Command
var request = new AddAnnotationBase64Request
{
Base64Pdf = base64Pdf,
AnnotationType = AnnotationType.Square,
@@ -363,7 +363,7 @@ public class PdfOperationsControllerTests : IClassFixture<WebApplicationFactory<
public async Task AnnotateFromBase64_InvalidBase64_Returns400()
{
// Arrange
var request = new AddAnnotationBase64Command
var request = new AddAnnotationBase64Request
{
Base64Pdf = "INVALID_BASE64!!!",
AnnotationType = AnnotationType.Circle,
@@ -390,7 +390,7 @@ public class PdfOperationsControllerTests : IClassFixture<WebApplicationFactory<
// Arrange
string base64Pdf = LoadTestPdfAsBase64("valid.pdf");
var request = new AddAnnotationBase64Command
var request = new AddAnnotationBase64Request
{
Base64Pdf = base64Pdf,
AnnotationType = AnnotationType.FreeText,
@@ -418,7 +418,7 @@ public class PdfOperationsControllerTests : IClassFixture<WebApplicationFactory<
// Arrange
string base64Pdf = LoadTestPdfAsBase64("valid.pdf");
var request = new AddAnnotationBase64Command
var request = new AddAnnotationBase64Request
{
Base64Pdf = base64Pdf,
AnnotationType = AnnotationType.FreeText,
@@ -446,7 +446,7 @@ public class PdfOperationsControllerTests : IClassFixture<WebApplicationFactory<
// Arrange
string base64Pdf = LoadTestPdfAsBase64("valid.pdf");
var request = new AddAnnotationBase64Command
var request = new AddAnnotationBase64Request
{
Base64Pdf = base64Pdf,
AnnotationType = AnnotationType.TextMarkup,
@@ -474,7 +474,7 @@ public class PdfOperationsControllerTests : IClassFixture<WebApplicationFactory<
// Arrange
string base64Pdf = LoadTestPdfAsBase64("valid.pdf");
var request = new AddAnnotationBase64Command
var request = new AddAnnotationBase64Request
{
Base64Pdf = base64Pdf,
AnnotationType = AnnotationType.Circle,