Refactor DTOs for improved structure and documentation

Transitioned from records to classes for flexibility, added XML documentation for clarity, and updated property definitions to use standard getters and setters. Introduced the `required` keyword for essential properties, removed unnecessary constructors, and enhanced property descriptions for better readability. Additionally, overridden `GetHashCode` in `ReceiverReadDto` for proper collection behavior.
This commit is contained in:
Developer 02
2025-05-13 11:05:43 +02:00
parent cc11d70a27
commit 7e66cd4dae
12 changed files with 473 additions and 145 deletions

View File

@@ -4,53 +4,52 @@ using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Domain.Entities;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
namespace EnvelopeGenerator.Application.DTOs;
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeDto : IUnique<int>
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeDto() : IUnique<int>
{
public int Id { get; set; }
public int Id { get; set; }
public int UserId { get; set; }
public int UserId { get; set; }
public int Status { get; set; }
public int Status { get; set; }
public string StatusName { get; set; }
public string StatusName { get; set; }
public string Uuid { get; set; }
public string Uuid { get; set; }
[TemplatePlaceholder("[MESSAGE]")]
public string Message { get; set; }
[TemplatePlaceholder("[MESSAGE]")]
public string Message { get; set; }
public DateTime AddedWhen { get; set; }
public DateTime AddedWhen { get; set; }
public DateTime? ChangedWhen { get; set; }
public DateTime? ChangedWhen { get; set; }
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
public string Title { get; set; }
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
public string Title { get; set; }
public int? ContractType { get; set; }
public int? ContractType { get; set; }
public string Language { get; set; }
public string Language { get; set; }
public int? EnvelopeTypeId { get; set; }
public int? EnvelopeTypeId { get; set; }
public int? CertificationType { get; set; }
public int? CertificationType { get; set; }
public bool? UseAccessCode { get; set; }
public bool? UseAccessCode { get; set; }
public bool TFAEnabled { get; init; }
public bool TFAEnabled { get; init; }
public UserReadDto? User { get; set; }
public UserReadDto? User { get; set; }
public EnvelopeType? EnvelopeType { get; set; }
public EnvelopeType? EnvelopeType { get; set; }
public string? EnvelopeTypeTitle { get; set; }
public string? EnvelopeTypeTitle { get; set; }
public bool IsAlreadySent { get; set; }
public bool IsAlreadySent { get; set; }
public byte[]? DocResult { get; init; }
public byte[]? DocResult { get; init; }
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
}
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
}