Feature-Update: Erweiterung der Envelope- und DocumentReceiverElement-Abfragen

Die Methoden `ReadAllWithAsync` und `ReadByUuidAsync` in `EnvelopeRepository` wurden erweitert, um optional DocumentReceiverElemente und Signaturdetails einzubeziehen.
This commit is contained in:
Developer 02
2024-04-05 16:54:29 +02:00
parent cbb03d77ba
commit ab713a23ac
15 changed files with 121 additions and 41 deletions

View File

@@ -7,8 +7,8 @@ namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeService : IBasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>
{
Task<IServiceResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false);
Task<IServiceResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false, bool documentReceiverElement = false);
Task<IServiceResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withReceivers = false, bool withHistory = false);
Task<IServiceResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withReceivers = false, bool withHistory = false, bool withDocumentReceiverElement = false);
}
}

View File

@@ -10,6 +10,6 @@ namespace EnvelopeGenerator.Application.DTOs
string Filepath,
DateTime AddedWhen,
string FilenameOriginal,
ICollection<DocumentReceiverElement>? Elements
IEnumerable<DocumentReceiverElement>? Elements
);
}

View File

@@ -32,7 +32,7 @@ namespace EnvelopeGenerator.Application.DTOs
bool IsAlreadySent,
string? StatusTranslated,
string? ContractTypeTranslated,
ICollection<EnvelopeDocument>? Documents,
ICollection<EnvelopeReceiver>? Receivers,
ICollection<EnvelopeHistory>? History);
IEnumerable<EnvelopeDocumentDto>? Documents,
IEnumerable<EnvelopeReceiverDto>? Receivers,
IEnumerable<EnvelopeHistoryDto>? History);
}

View File

@@ -16,16 +16,16 @@ namespace EnvelopeGenerator.Application.Services
{
}
public async Task<IServiceResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false)
public async Task<IServiceResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false, bool documentReceiverElement = false)
{
var envelopes = await _repository.ReadAllWithAsync(documents: documents, receivers: receivers, history: history);
var envelopes = await _repository.ReadAllWithAsync(documents: documents, receivers: receivers, history: history, documentReceiverElement: documentReceiverElement);
var readDto = _mapper.MapOrThrow<IEnumerable<EnvelopeDto>>(envelopes);
return Successful(readDto);
}
public async Task<IServiceResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withReceivers = false, bool withHistory = false)
public async Task<IServiceResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withReceivers = false, bool withHistory = false, bool withDocumentReceiverElement = false)
{
var envelope = await _repository.ReadByUuidAsync(uuid: uuid, withDocuments: withDocuments, withReceivers: withReceivers, withHistory: withHistory);
var envelope = await _repository.ReadByUuidAsync(uuid: uuid, withDocuments: withDocuments, withReceivers: withReceivers, withHistory: withHistory, withDocumentReceiverElement: withDocumentReceiverElement);
if (envelope is null)
return Failed<EnvelopeDto>();