using FluentValidation;

namespace CMSMicroservice.Application.CityCQ.Queries.GetAllCitiesByFilter;

public class GetAllCitiesByFilterQueryValidator : AbstractValidator<GetAllCitiesByFilterQuery>
{
    public GetAllCitiesByFilterQueryValidator()
    {
        // Validation rules اگر نیاز باشد
    }
    
    public async Task<bool> Validate(object model, string propertyName)
    {
        var result = await ValidateAsync(
            ValidationContext<GetAllCitiesByFilterQuery>.CreateWithOptions(
                (GetAllCitiesByFilterQuery)model, 
                x => x.IncludeProperties(propertyName)));
        return result.IsValid;
    }
}
