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:
2026-04-15 13:37:40 +02:00
parent 859ff5902e
commit e5eb0f19e7

View File

@@ -14,13 +14,18 @@ public class RecActionController(IMediator mediator) : ControllerBase
/// Invokes a batch of RecActions for a given profile.
/// </summary>
/// <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>
/// <returns>An HTTP 202 Accepted response indicating the process has been started.</returns>
[HttpPost("invoke/{profileId}")]
[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();
}