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:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,6 @@ namespace EnvelopeGenerator.Application.DTOs
|
||||
string Filepath,
|
||||
DateTime AddedWhen,
|
||||
string FilenameOriginal,
|
||||
ICollection<DocumentReceiverElement>? Elements
|
||||
IEnumerable<DocumentReceiverElement>? Elements
|
||||
);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user