diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs new file mode 100644 index 00000000..9f05f21a --- /dev/null +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQuery.cs @@ -0,0 +1,12 @@ +using MediatR; + +namespace EnvelopeGenerator.Application.Documents.Queries.Read; + +/// +/// Represents a query to read a document based on its unique identifier or associated envelope identifier. +/// +/// The unique identifier of the document. Optional. +/// The identifier of the envelope associated with the document. Optional. +public record ReadDocumentQuery(int? Id = null, int? EnvelopeId = null) : IRequest +{ +} diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs new file mode 100644 index 00000000..af4e1a74 --- /dev/null +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentQueryHandler.cs @@ -0,0 +1,19 @@ +using EnvelopeGenerator.Application.Contracts.Repositories; +using MediatR; + +namespace EnvelopeGenerator.Application.Documents.Queries.Read; + +public class ReadDocumentQueryHandler : IRequestHandler +{ + public IEnvelopeDocumentRepository _repo; + + public ReadDocumentQueryHandler(IEnvelopeDocumentRepository envelopeDocumentRepository) + { + _repo = envelopeDocumentRepository; + } + + public Task Handle(ReadDocumentQuery query, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} diff --git a/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs new file mode 100644 index 00000000..7d9b6ea0 --- /dev/null +++ b/EnvelopeGenerator.Application/Documents/Queries/Read/ReadDocumentResponse.cs @@ -0,0 +1,15 @@ +namespace EnvelopeGenerator.Application.Documents.Queries.Read; + +/// +/// Represents the response for reading a document. +/// +/// The unique identifier of the document. +/// The identifier of the associated envelope. +/// The date and time when the document was added. +/// The binary data of the document, if available. +public record ReadDocumentResponse( + int Guid, + int EnvelopeId, + DateTime AddedWhen, + byte[]? ByteData +); \ No newline at end of file