Organize EnvelopeReceiverController and add DocumentExecutor

Updated `EnvelopeReceiverController` with new regions for
creating envelopes and managing recipients, improving code
readability. Added service registration for `IDocumentExecutor`
in `DependencyExtensions.cs` to enhance document management.
This commit is contained in:
Developer 02
2025-05-07 01:32:21 +02:00
parent bce29aa31a
commit cc86e5fadd
2 changed files with 9 additions and 0 deletions

View File

@@ -187,8 +187,11 @@ public class EnvelopeReceiverController : ControllerBase
CancellationToken cancel = default;
int userId = User.GetId();
#region Create Envelope
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(userId, request.Title, request.Message, request.TFAEnabled, cancel);
#endregion
#region Add receivers
List<EnvelopeReceiver> sentRecipients = new();
List<ReceiverGetOrCreateCommand> unsentRecipients = new();
@@ -205,6 +208,11 @@ public class EnvelopeReceiverController : ControllerBase
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
res.UnsentRecipients = unsentRecipients;
res.SentRecipients = _mapper.Map<IEnumerable<ReceiverReadDto>>(sentRecipients);
#endregion
#region Add document
#endregion
return Ok(res);
}