Refactor batch invocation to use RecActionViews

Replaced all batch RecAction logic with RecActionViews equivalents. Updated controller methods to call InvokeBatchRecActionView instead of InvokeBatchRecAction. Removed InvokeBatchRecActionsCommand and its handler, and added InvokeBatchRecActionViewsCommand with similar logic for RecActionViews. This shifts batch processing from RecActions to RecActionViews across the codebase.
This commit is contained in:
2025-12-12 15:00:26 +01:00
parent 92e7d44d3b
commit f53603083a
2 changed files with 8 additions and 8 deletions

View File

@@ -4,17 +4,17 @@ using ReC.Domain.Constants;
namespace ReC.Application.RecActionViews.Commands;
public record InvokeBatchRecActionsCommand : ReadRecActionQueryBase, IRequest;
public record InvokeBatchRecActionViewsCommand : ReadRecActionQueryBase, IRequest;
public static class InvokeBatchRecActionsCommandExtensions
public static class InvokeBatchRecActionViewsCommandExtensions
{
public static Task InvokeBatchRecAction(this ISender sender, long profileId, CancellationToken cancel = default)
=> sender.Send(new InvokeBatchRecActionsCommand { ProfileId = profileId }, cancel);
public static Task InvokeBatchRecActionView(this ISender sender, long profileId, CancellationToken cancel = default)
=> sender.Send(new InvokeBatchRecActionViewsCommand { ProfileId = profileId }, cancel);
}
public class InvokeRecActionsCommandHandler(ISender sender) : IRequestHandler<InvokeBatchRecActionsCommand>
public class InvokeRecActionViewsCommandHandler(ISender sender) : IRequestHandler<InvokeBatchRecActionViewsCommand>
{
public async Task Handle(InvokeBatchRecActionsCommand request, CancellationToken cancel)
public async Task Handle(InvokeBatchRecActionViewsCommand request, CancellationToken cancel)
{
var actions = await sender.Send(request.ToReadQuery(q => q.Invoked = false), cancel);