using Baya.Domain.Entities.Bnpl;
using FluentValidation;

namespace Baya.Application.Features.Bnpl.Commands.InitiateBnplOrder;

public sealed class InitiateBnplOrderCommandValidator : AbstractValidator<InitiateBnplOrderCommand>
{
    public InitiateBnplOrderCommandValidator()
    {
        RuleFor(x => x.BookingRequestId).GreaterThan(0);
        RuleFor(x => x.ProviderCode)
            .NotEmpty()
            .Must(BnplProviderCodes.IsKnown)
            .WithMessage("provider_code must be one of snapppay, digipay, tara, torobpay.");
    }
}
