This commit implements a complete rebranding of the project: - Updated all namespaces from `DocumentOperator` to `DocumentService`. - Renamed file paths, embedded resources, and test data references. - Updated configuration keys, logging paths, and Redis instance names. - Revised documentation to reflect the new project name. - Modified project and solution files to align with the new structure. - Updated class names, DTOs, commands, queries, and handlers. - Adjusted middleware, controllers, and API endpoints. - Updated Swagger metadata and API titles to `DocumentService API`. - Refactored test namespaces, resource paths, and embedded resources. - Updated build and deployment configurations for the new name. - Replaced all references to `DocumentOperator` in comments and literals. These changes ensure consistency across the codebase and documentation.
38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using AutoMapper;
|
|
using DocumentService.Application.Common.DTOs;
|
|
using DocumentService.Application.Common.Interfaces;
|
|
using MediatR;
|
|
|
|
namespace DocumentService.Application.ValidatePdfA.Queries;
|
|
|
|
/// <summary>
|
|
/// Query for PDF/A validation (Stream-based)
|
|
/// </summary>
|
|
public record ValidatePdfAQuery : IRequest<PdfAValidationResult>
|
|
{
|
|
/// <summary>
|
|
/// PDF as stream (caller is responsible for disposal)
|
|
/// </summary>
|
|
public required Stream PdfStream { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Handler for ValidatePdfAQuery
|
|
/// Orchestrates PDF/A validation using IPdfProcessor and AutoMapper
|
|
/// </summary>
|
|
public class ValidatePdfAQueryHandler(IPdfProcessor PdfProcessor, IMapper Mapper)
|
|
: IRequestHandler<ValidatePdfAQuery, PdfAValidationResult>
|
|
{
|
|
/// <summary>
|
|
/// Validates PDF/A and returns metadata with conformance level
|
|
/// </summary>
|
|
public async Task<PdfAValidationResult> Handle(ValidatePdfAQuery request, CancellationToken cancellationToken)
|
|
{
|
|
// Call DevExpress service directly with stream (exceptions propagate naturally)
|
|
var metadata = await PdfProcessor.ValidatePdfAAsync(request.PdfStream);
|
|
|
|
// Map DTO to response DTO using AutoMapper
|
|
return Mapper.Map<PdfAValidationResult>(metadata);
|
|
}
|
|
}
|