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

namespace TakeoutSaaS.Application.App.Stores.Validators;

/// <summary>
/// 创建自提档期验证器。
/// </summary>
public sealed class CreateStorePickupSlotCommandValidator : AbstractValidator<CreateStorePickupSlotCommand>
{
    /// <summary>
    /// 初始化规则。
    /// </summary>
    public CreateStorePickupSlotCommandValidator()
    {
        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);
    }
}
