diff --git a/src/ReC.Application/OutResults/Commands/DeleteOutResCommand.cs b/src/ReC.Application/OutResults/Commands/DeleteOutResCommand.cs index 14f0911..c92552a 100644 --- a/src/ReC.Application/OutResults/Commands/DeleteOutResCommand.cs +++ b/src/ReC.Application/OutResults/Commands/DeleteOutResCommand.cs @@ -4,15 +4,41 @@ using ReC.Domain.Entities; namespace ReC.Application.OutResults.Commands; +/// +/// Represents the command to delete output results based on specified criteria. +/// +/// +/// Deletion can be performed by providing either an or a . +/// At least one of these properties must be set for the operation to proceed. +/// public record DeleteOutResCommand : IRequest { + /// + /// Gets the unique identifier for the action whose output results should be deleted. + /// public long? ActionId { get; init; } + /// + /// Gets the unique identifier for the profile whose associated action's output results should be deleted. + /// public long? ProfileId { get; init; } } +/// +/// Handles the execution of the . +/// public class DeleteOutResCommandHandler(IRepository repo) : IRequestHandler { + /// + /// Processes the delete command by removing matching entities from the repository. + /// + /// The command containing the deletion criteria. + /// A cancellation token that can be used to cancel the work. + /// A task that represents the asynchronous delete operation. + /// + /// The handler deletes records where OutRes.ActionId matches + /// or where the associated Action.ProfileId matches . + /// public Task Handle(DeleteOutResCommand request, CancellationToken cancel) { return repo.DeleteAsync(x => x.ActionId == request.ActionId || x.Action!.ProfileId == request.ProfileId, cancel);