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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user