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:
parent
bce29aa31a
commit
cc86e5fadd
@ -187,8 +187,11 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
CancellationToken cancel = default;
|
CancellationToken cancel = default;
|
||||||
int userId = User.GetId();
|
int userId = User.GetId();
|
||||||
|
|
||||||
|
#region Create Envelope
|
||||||
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(userId, request.Title, request.Message, request.TFAEnabled, cancel);
|
var envelope = await _envelopeExecutor.CreateEnvelopeAsync(userId, request.Title, request.Message, request.TFAEnabled, cancel);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Add receivers
|
||||||
List<EnvelopeReceiver> sentRecipients = new();
|
List<EnvelopeReceiver> sentRecipients = new();
|
||||||
List<ReceiverGetOrCreateCommand> unsentRecipients = new();
|
List<ReceiverGetOrCreateCommand> unsentRecipients = new();
|
||||||
|
|
||||||
@ -205,6 +208,11 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
|
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
|
||||||
res.UnsentRecipients = unsentRecipients;
|
res.UnsentRecipients = unsentRecipients;
|
||||||
res.SentRecipients = _mapper.Map<IEnumerable<ReceiverReadDto>>(sentRecipients);
|
res.SentRecipients = _mapper.Map<IEnumerable<ReceiverReadDto>>(sentRecipients);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Add document
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
return Ok(res);
|
return Ok(res);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,6 +84,7 @@ public static class DIExtensions
|
|||||||
|
|
||||||
services.AddScoped<IEnvelopeExecutor, EnvelopeExecutor>();
|
services.AddScoped<IEnvelopeExecutor, EnvelopeExecutor>();
|
||||||
services.AddScoped<IEnvelopeReceiverExecutor, EnvelopeReceiverExecutor>();
|
services.AddScoped<IEnvelopeReceiverExecutor, EnvelopeReceiverExecutor>();
|
||||||
|
services.AddScoped<IDocumentExecutor, DocumentExecutor>();
|
||||||
|
|
||||||
if (sqlExecutorConfiguration is not null || sqlExecutorConfigureOptions is not null)
|
if (sqlExecutorConfiguration is not null || sqlExecutorConfigureOptions is not null)
|
||||||
services.AddSQLExecutor(sqlExecutorConfiguration, sqlExecutorConfigureOptions);
|
services.AddSQLExecutor(sqlExecutorConfiguration, sqlExecutorConfigureOptions);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user