using FluentValidation;
using Meezi.API.Models.Public;

namespace Meezi.API.Validators;

public class CreateCafeReviewRequestValidator : AbstractValidator<CreateCafeReviewRequest>
{
    public CreateCafeReviewRequestValidator()
    {
        RuleFor(x => x.AuthorName).NotEmpty().MaximumLength(200);
        RuleFor(x => x.Rating).InclusiveBetween(1, 5);
        RuleFor(x => x.AuthorPhone).Matches(@"^09\d{9}$").When(x => !string.IsNullOrEmpty(x.AuthorPhone));
        RuleFor(x => x.Comment).MaximumLength(2000);
    }
}

public class ReplyCafeReviewRequestValidator : AbstractValidator<ReplyCafeReviewRequest>
{
    public ReplyCafeReviewRequestValidator()
    {
        RuleFor(x => x.Reply).NotEmpty().MaximumLength(2000);
    }
}
