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

namespace TakeoutSaaS.Application.App.Stores.Validators;

/// <summary>
/// 更新自提档期验证器。
/// </summary>
public sealed class UpdateStorePickupSlotCommandValidator : AbstractValidator<UpdateStorePickupSlotCommand>
{
    /// <summary>
    /// 初始化规则。
    /// </summary>
    public UpdateStorePickupSlotCommandValidator()
    {
        RuleFor(x => x.SlotId).GreaterThan(0);
        RuleFor(x => x.StoreId).GreaterThan(0);
        RuleFor(x => x.Name).NotEmpty().MaximumLength(64);
        RuleFor(x => x.Capacity).GreaterThan(0);
        RuleFor(x => x.Weekdays).NotEmpty().MaximumLength(32);
        RuleFor(x => x.CutoffMinutes).GreaterThanOrEqualTo(0);
        RuleFor(x => x.EndTime).GreaterThan(x => x.StartTime);
    }
}
