using FluentValidation;
using MiningService.API.Application.Commands;

namespace MiningService.API.Application.Validations;

/// <summary>
/// EN: Validator for UpdateStreakConfigCommand.
/// VI: Validator cho UpdateStreakConfigCommand.
/// </summary>
public class UpdateStreakConfigCommandValidator : AbstractValidator<UpdateStreakConfigCommand>
{
    public UpdateStreakConfigCommandValidator()
    {
        RuleFor(x => x.GracePeriodDays)
            .InclusiveBetween(0, 7).WithMessage("Grace period must be 0-7 days / Thời gian gia hạn phải từ 0-7 ngày")
            .When(x => x.GracePeriodDays.HasValue);
    }
}
