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

using FluentValidation;
using OrderService.API.Application.Commands.Reports;

namespace OrderService.API.Application.Validations;

/// <summary>
/// EN: Validator for CloseDayCommand.
/// VI: Validator cho CloseDayCommand.
/// </summary>
public class CloseDayCommandValidator : AbstractValidator<CloseDayCommand>
{
    public CloseDayCommandValidator()
    {
        RuleFor(x => x.ShopId)
            .NotEmpty()
            .WithMessage("EN: Shop ID is required / VI: Shop ID la bat buoc");

        RuleFor(x => x.CloseDate)
            .NotEmpty()
            .WithMessage("EN: Close date is required / VI: Ngay dong la bat buoc")
            .LessThanOrEqualTo(DateTime.UtcNow.Date.AddDays(1))
            .WithMessage("EN: Close date cannot be in the future / VI: Ngay dong khong the trong tuong lai");
    }
}
