diff --git a/EnvelopeGenerator.Application/Common/Dto/DocumentDetailsDto.cs b/EnvelopeGenerator.Application/Common/Dto/DocumentDetailsDto.cs new file mode 100644 index 00000000..5e3a6fd4 --- /dev/null +++ b/EnvelopeGenerator.Application/Common/Dto/DocumentDetailsDto.cs @@ -0,0 +1,27 @@ +namespace EnvelopeGenerator.Application.Common.Dto; + +/// +/// Data Transfer Object representing document metadata and elements without binary payload. +/// +public record DocumentDetailsDto +{ + /// + /// Gets or sets the unique identifier of the document. + /// + public int Id { get; init; } + + /// + /// Gets or sets the envelope ID to which the document belongs. + /// + public int EnvelopeId { get; init; } + + /// + /// Gets or sets the date and time when the document was added. + /// + public DateTime AddedWhen { get; init; } + + /// + /// Gets or sets the collection of elements associated with the document for receiver interactions, if any. + /// + public IEnumerable? Elements { get; init; } +} diff --git a/EnvelopeGenerator.Application/Common/Dto/DocumentDto.cs b/EnvelopeGenerator.Application/Common/Dto/DocumentDto.cs index 34403d8f..e8bb7c02 100644 --- a/EnvelopeGenerator.Application/Common/Dto/DocumentDto.cs +++ b/EnvelopeGenerator.Application/Common/Dto/DocumentDto.cs @@ -3,30 +3,25 @@ /// /// Data Transfer Object representing a document within an envelope, including optional binary data and form elements. /// -public class DocumentDto +public record DocumentDto : DocumentDetailsDto { /// - /// Gets or sets the unique identifier of the document. + /// /// - public int Id { get; set; } + public DocumentDto() { } /// - /// Gets or sets the envelope ID to which the document belongs. + /// /// - public int EnvelopeId { get; set; } - - /// - /// Gets or sets the date and time when the document was added. - /// - public DateTime AddedWhen { get; set; } + /// + /// + public DocumentDto(byte[] byteData, DocumentDetailsDto details) : base(details) + { + ByteData = byteData; + } /// /// Gets or sets the binary data of the document, if available. /// - public byte[]? ByteData { get; set; } - - /// - /// Gets or sets the collection of elements associated with the document for receiver interactions, if any. - /// - public IEnumerable? Elements { get; set; } -} \ No newline at end of file + public byte[]? ByteData { get; init; } +}