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.
32 lines
848 B
C#
32 lines
848 B
C#
using DigitalData.Core.Abstractions;
|
|
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace EnvelopeGenerator.Application.DTOs.Receiver;
|
|
|
|
[ApiExplorerSettings(IgnoreApi = true)]
|
|
public class ReceiverReadDto : IUnique<int>
|
|
{
|
|
public int Id { get; set; }
|
|
|
|
public string EmailAddress { get; set; }
|
|
|
|
public string Signature { get; set; }
|
|
|
|
public DateTime AddedWhen { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; set; }
|
|
|
|
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
|
|
|
public string? TotpSecretkey { get; set; } = null;
|
|
|
|
public DateTime? TfaRegDeadline { get; set; }
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return Id.GetHashCode();
|
|
}
|
|
} |