Add optional references to RecAction invoke endpoint
The Invoke action in RecActionController now accepts an optional InvokeReferencesDto from the request body. This enables clients to provide reference values that are passed through to all result records. The method signature, XML documentation, and command dispatch have been updated to support this enhancement.
This commit is contained in:
@@ -14,13 +14,18 @@ public class RecActionController(IMediator mediator) : ControllerBase
|
|||||||
/// Invokes a batch of RecActions for a given profile.
|
/// Invokes a batch of RecActions for a given profile.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="profileId">The identifier of the profile whose RecActions should be invoked.</param>
|
/// <param name="profileId">The identifier of the profile whose RecActions should be invoked.</param>
|
||||||
|
/// <param name="references">Optional reference values that are passed through to all result records.</param>
|
||||||
/// <param name="cancel">A token to cancel the operation.</param>
|
/// <param name="cancel">A token to cancel the operation.</param>
|
||||||
/// <returns>An HTTP 202 Accepted response indicating the process has been started.</returns>
|
/// <returns>An HTTP 202 Accepted response indicating the process has been started.</returns>
|
||||||
[HttpPost("invoke/{profileId}")]
|
[HttpPost("invoke/{profileId}")]
|
||||||
[ProducesResponseType(StatusCodes.Status202Accepted)]
|
[ProducesResponseType(StatusCodes.Status202Accepted)]
|
||||||
public async Task<IActionResult> Invoke([FromRoute] long profileId, CancellationToken cancel)
|
public async Task<IActionResult> Invoke([FromRoute] long profileId, [FromBody] InvokeReferencesDto? references = null, CancellationToken cancel = default)
|
||||||
{
|
{
|
||||||
await mediator.Send(new InvokeBatchRecActionViewsCommand { ProfileId = profileId }, cancel);
|
await mediator.Send(new InvokeBatchRecActionViewsCommand
|
||||||
|
{
|
||||||
|
ProfileId = profileId,
|
||||||
|
References = references
|
||||||
|
}, cancel);
|
||||||
return Accepted();
|
return Accepted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user