using FluentValidation;

namespace Baya.Application.Features.Identity.Commands.AddNurseBankAccount;

public sealed class AddNurseBankAccountCommandValidator : AbstractValidator<AddNurseBankAccountCommand>
{
    public AddNurseBankAccountCommandValidator()
    {
        RuleFor(x => x.BankName).NotEmpty().MaximumLength(100);
        RuleFor(x => x.AccountHolderName).NotEmpty().MaximumLength(200);
        RuleFor(x => x.Iban)
            .NotEmpty()
            .Must(Sheba.IsValid)
            .WithMessage("A valid Iranian IBAN (شبا) is required: IR followed by 24 digits.");
    }
}
