using FluentValidation;
using PromotionService.API.Application.Commands;

namespace PromotionService.API.Application.Validations;

/// <summary>
/// EN: Validator for RevokeVoucherCommand.
/// VI: Validator cho RevokeVoucherCommand.
/// </summary>
public class RevokeVoucherCommandValidator : AbstractValidator<RevokeVoucherCommand>
{
    public RevokeVoucherCommandValidator()
    {
        RuleFor(x => x.VoucherId)
            .NotEmpty().WithMessage("Voucher ID is required / ID voucher là bắt buộc");

        RuleFor(x => x.Reason)
            .NotEmpty().WithMessage("Reason is required / Lý do là bắt buộc")
            .MaximumLength(500).WithMessage("Reason max 500 chars / Lý do tối đa 500 ký tự");
    }
}
