From cb103dcb6961e500159c759872d195dc83e705e0 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 11 Jun 2026 23:04:05 +0200 Subject: [PATCH] Restrict UserId visibility and update query includes The `UserId` property in `ReadEnvelopeQuery` was changed from `public` to `internal` to improve encapsulation. A new `Authorize` method was added to set the `UserId` property using the `with` expression. In `ReadEnvelopeQueryHandler`, the LINQ query was updated to replace the inclusion of `Documents` with `EnvelopeReceivers` and their associated `Receiver`, reflecting a shift in the data being eagerly loaded to support updated functionality. --- .../Envelopes/Queries/ReadEnvelopeQuery.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EnvelopeGenerator.Application/Envelopes/Queries/ReadEnvelopeQuery.cs b/EnvelopeGenerator.Application/Envelopes/Queries/ReadEnvelopeQuery.cs index 0f68e78c..0719279e 100644 --- a/EnvelopeGenerator.Application/Envelopes/Queries/ReadEnvelopeQuery.cs +++ b/EnvelopeGenerator.Application/Envelopes/Queries/ReadEnvelopeQuery.cs @@ -22,7 +22,7 @@ public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest /// Optionaler Benutzerfilter; wenn gesetzt, werden nur Umschläge des Benutzers geladen. /// - public int? UserId { get; init; } + internal int? UserId { get; init; } /// /// Setzt den Benutzerkontext für die Abfrage. @@ -133,7 +133,7 @@ public class ReadEnvelopeQueryHandler : IRequestHandler e.Documents) + .Include(e => e.EnvelopeReceivers).ThenInclude(er => er.Receiver) .ToListAsync(cancel); return _mapper.Map>(envelopes);