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

namespace TakeoutSaaS.Application.App.Stores.Validators;

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