using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Infrastructure.Validators;
using Grand.Web.Admin.Models.Shipping;

namespace Grand.Web.Admin.Validators.Shipping;

public class DeliveryDateValidator : BaseGrandValidator<DeliveryDateModel>
{
    public DeliveryDateValidator(
        IEnumerable<IValidatorConsumer<DeliveryDateModel>> validators,
        ITranslationService translationService)
        : base(validators)
    {
        RuleFor(x => x.Name).NotEmpty()
            .WithMessage(
                translationService.GetResource("Admin.Configuration.Shipping.DeliveryDates.Fields.Name.Required"));
    }
}