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

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

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

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