using MediatR;
using Modules.Library.Application.Gateways;

namespace Modules.Library.Application.Commands.Dictionaries.Genre;

public class DeleteGenreCommand : IRequest<Unit>
{
    public Guid Id { get; set; } = default!;
}

public class DeleteGenreCommandHandler(IGenreGateway genreGateway) : IRequestHandler<DeleteGenreCommand, Unit>
{
    public async Task<Unit> Handle(DeleteGenreCommand request, CancellationToken cancellationToken)
    {
        await genreGateway.Delete(request.Id);
        return Unit.Value;
    }
}