using FluentValidation.AspNetCore;
using FluentValidation;

namespace WorkFlowCheck.Web.Validators
{
    public static class FluentValidationConfig
    {
        public static IServiceCollection AddFluentValidationSetup(this IServiceCollection services)
        {
            services.AddFluentValidationAutoValidation();
            services.AddFluentValidationClientsideAdapters(); // ha valaha szeretnél client-side-t is

            // Itt regisztrálod a validátorokat – automatikusan az adott assembly-ből
            services.AddValidatorsFromAssembly(typeof(FluentValidationConfig).Assembly);

            return services;
        }
    }
}
