using FluentValidation;

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

public sealed class UpsertCustomerProfileCommandValidator : AbstractValidator<UpsertCustomerProfileCommand>
{
    public UpsertCustomerProfileCommandValidator()
    {
        RuleFor(x => x.DefaultEmergencyContactName).NotEmpty().MaximumLength(200);
        RuleFor(x => x.DefaultEmergencyContactPhone)
            .NotEmpty()
            .Must(IranianPhone.IsValid)
            .WithMessage("A valid Iranian mobile number is required (09xxxxxxxxx).");
    }
}
