Refactor envelope and user query structures

- Introduced a new `UserQuery` record to encapsulate user-related information, replacing individual fields in `EnvelopeQuery`.
- Added a `ReferenceType` property in `EnvelopeHistoryQuery` to enhance reference handling logic.
- Modified `EnvelopeQuery` to use the new `UserQuery` structure, simplifying the data model.
- Updated `HistoryController` with a new constructor and restructured the `GetReferenceTypes` method.
- Introduced `ReadEnvelopeHistoryQuery` to allow for more specific envelope history queries.
- Overall improvements enhance code structure, clarity, and querying capabilities.
This commit is contained in:
Developer 02
2025-04-10 16:35:40 +02:00
parent 9f186afdff
commit 2cb5d0c0d5
5 changed files with 106 additions and 65 deletions

View File

@@ -1,5 +1,6 @@
using EnvelopeGenerator.Application.Envelopes;
using EnvelopeGenerator.Application.Receivers;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.EnvelopeHistories;
@@ -13,4 +14,10 @@ public record EnvelopeHistoryQuery<TEnvelopeQuery, TReceiverQuery>(int EnvelopeI
where TEnvelopeQuery : EnvelopeQuery
where TReceiverQuery : ReceiverQuery
{
public ReferenceType ReferenceType =>
Envelope?.User is not null
? ReferenceType.Receiver
: Receiver is not null
? ReferenceType.Receiver
: ReferenceType.System;
}