Signaturprüfung zur Filterung der Umschlagempfänger hinzugefügt

This commit is contained in:
Developer 02
2024-04-08 16:22:17 +02:00
parent db83eb90ee
commit 2512de0f26
9 changed files with 38 additions and 25 deletions

View File

@@ -31,10 +31,13 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
return await query.ToListAsync();
}
public async Task<Envelope?> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withReceivers = false, bool withHistory = false, bool withDocumentReceiverElement = false)
public async Task<Envelope?> ReadByUuidAsync(string uuid, string? signature = null, bool withDocuments = false, bool withReceivers = false, bool withHistory = false, bool withDocumentReceiverElement = false)
{
var query = _dbSet.Where(e => e.Uuid == uuid);
if (signature is not null)
query = query.Where(e => e.Receivers != null && e.Receivers.Any(er => er.Receiver != null && er.Receiver.Signature == signature));
if (withDocuments)
if (withDocumentReceiverElement)
query = query.Include(e => e.Documents!).ThenInclude(d => d.Elements);
@@ -42,7 +45,7 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
query = query.Include(e => e.Documents);
if (withReceivers)
query = query.Include(e => e.Receivers);
query = query.Include(e => e.Receivers!).ThenInclude(er => er.Receiver);
if (withHistory)
query = query.Include(e => e.History);