using FluentValidation;
using Meezi.API.Models.Kitchen;

namespace Meezi.API.Validators;

public class CreateKitchenStationRequestValidator : AbstractValidator<CreateKitchenStationRequest>
{
    public CreateKitchenStationRequestValidator()
    {
        RuleFor(x => x.Name).NotEmpty().MaximumLength(100);
        RuleFor(x => x.PrinterPort).InclusiveBetween(1, 65535);
    }
}

public class UpdateKitchenStationRequestValidator : AbstractValidator<UpdateKitchenStationRequest>
{
    public UpdateKitchenStationRequestValidator()
    {
        RuleFor(x => x.Name).MaximumLength(100).When(x => x.Name is not null);
        RuleFor(x => x.PrinterPort).InclusiveBetween(1, 65535).When(x => x.PrinterPort.HasValue);
    }
}
