Add query for sensitive envelope receiver data
Introduced `ReadEnvelopeReceiverSecretQuery` to fetch sensitive fields (e.g., access code, phone number) for envelope receivers. Added extension methods for dispatching the query via `IMediator` and implemented `ReadEnvelopeReceiverSecretQueryHandler` to process the query using repositories and AutoMapper. Updated `EnvelopeController` with a new HTTP GET endpoint `EnvelopeReceiverWithSecretByMediatr` to expose the query functionality. This endpoint returns sensitive data as `EnvelopeReceiverSecretDto` or a 404 response if no match is found. These changes improve modularity, testability, and separation of concerns by leveraging MediatR and CQRS patterns.
This commit is contained in:
@@ -438,4 +438,10 @@ public class EnvelopeController : ViewControllerBase
|
||||
return this.ViewDocumentNotFound();
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("EnvelopeReceiverWithSecretByMediatr")]
|
||||
public async Task<IActionResult> EnvelopeReceiverWithSecretByMediatr([FromQuery] ReadEnvelopeReceiverSecretQuery q, CancellationToken cancel)
|
||||
{
|
||||
return await _mediator.Send(q, cancel) is EnvelopeReceiverSecretDto dto ? Ok(dto) : NotFound();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user