using FluentValidation;
using TakeoutSaaS.Application.App.Stores.Commands;

namespace TakeoutSaaS.Application.App.Stores.Validators;

/// <summary>
/// 更新节假日命令验证器。
/// </summary>
public sealed class UpdateStoreHolidayCommandValidator : AbstractValidator<UpdateStoreHolidayCommand>
{
    /// <summary>
    /// 初始化验证规则。
    /// </summary>
    public UpdateStoreHolidayCommandValidator()
    {
        RuleFor(x => x.HolidayId).GreaterThan(0);
        RuleFor(x => x.StoreId).GreaterThan(0);
        RuleFor(x => x.Date).NotEmpty();
        RuleFor(x => x.Reason).MaximumLength(256);
    }
}
