// EN: Validator for CancelOrderCommand.
// VI: Validator cho CancelOrderCommand.

using FluentValidation;

namespace OrderService.API.Application.Validations;

/// <summary>
/// EN: Validator for CancelOrderCommand.
/// VI: Validator cho CancelOrderCommand.
/// </summary>
public class CancelOrderCommandValidator : AbstractValidator<Commands.CancelOrderCommand>
{
    public CancelOrderCommandValidator()
    {
        RuleFor(x => x.OrderId)
            .NotEmpty()
            .WithMessage("EN: Order ID is required / VI: Order ID là bắt buộc");

        RuleFor(x => x.ShopId)
            .NotEmpty()
            .WithMessage("EN: Shop ID is required / VI: Shop ID là bắt buộc");

        RuleFor(x => x.Reason)
            .NotEmpty()
            .WithMessage("EN: Cancellation reason is required / VI: Lý do hủy là bắt buộc")
            .MaximumLength(500)
            .WithMessage("EN: Reason must not exceed 500 characters / VI: Lý do không được vượt quá 500 ký tự");
    }
}
