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:
2026-05-28 23:46:31 +02:00
parent 67e6f288eb
commit bfae72529c
2 changed files with 133 additions and 0 deletions

View File

@@ -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();
}
}