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

namespace TakeoutSaaS.Application.App.Stores.Validators;

/// <summary>
/// 创建排班命令验证器。
/// </summary>
public sealed class CreateStoreEmployeeShiftCommandValidator : AbstractValidator<CreateStoreEmployeeShiftCommand>
{
    /// <summary>
    /// 初始化验证规则。
    /// </summary>
    public CreateStoreEmployeeShiftCommandValidator()
    {
        RuleFor(x => x.StoreId).GreaterThan(0);
        RuleFor(x => x.StaffId).GreaterThan(0);
        RuleFor(x => x.ShiftDate).NotEmpty();
        RuleFor(x => x.StartTime).LessThan(x => x.EndTime).WithMessage("结束时间必须晚于开始时间");
        RuleFor(x => x.Notes).MaximumLength(256);
    }
}
