Refactor Envelope classes to use Sender instead of User

Updated the `EnvelopeHistoryQuery` to determine `ReferenceType` based on the presence of a `Sender` instead of a `User`.

In the `EnvelopeQuery`, replaced the `User` parameter with `Sender`, and updated related properties to reflect this change. This refactor shifts the focus from a user-centric model to a sender-centric model for envelope queries.
This commit is contained in:
Developer 02 2025-04-10 18:49:01 +02:00
parent 6969f5f93e
commit 2f8d5f1fc8
2 changed files with 6 additions and 6 deletions

View File

@ -22,7 +22,7 @@ public record EnvelopeHistoryQuery<TEnvelopeQuery, TReceiverQuery>(int EnvelopeI
/// Ist keiner von beiden definiert, wird der Referenztyp als System betrachtet.
/// </summary>
public ReferenceType ReferenceType =>
Envelope?.User is not null
Envelope?.Sender is not null
? ReferenceType.Receiver
: Receiver is not null
? ReferenceType.Receiver

View File

@ -6,27 +6,27 @@ namespace EnvelopeGenerator.Application.Envelopes;
/// Repräsentiert eine Abfrage für Umschläge.
/// </summary>
/// <param name="Id">Die eindeutige Kennung des Umschlags.</param>
/// <param name="User">Absender des Schreibens</param>
/// <param name="Sender">Absender des Schreibens</param>
/// <param name="Status">Der Status des Umschlags.</param>
/// <param name="Uuid">Die universell eindeutige Kennung des Umschlags.</param>
public record EnvelopeQuery(
int? Id = null,
UserQuery? User = null,
UserQuery? Sender = null,
int? Status = null,
string? Uuid = null) : IRequest
{
/// <summary>
/// Die eindeutige Kennung des Benutzers.
/// </summary>
public int? UserId => User?.Id;
public int? SenderId => Sender?.Id;
/// <summary>
/// Der Benutzername des Absenders.
/// </summary>
public string? Username => User?.Username;
public string? SenderUsername => Sender?.Username;
/// <summary>
/// Die E-Mail-Adresse des Benutzers.
/// </summary>
public string? UserEmail => User?.Username;
public string? SenderEmail => Sender?.Username;
};