using FluentValidation;
using AdsBillingService.API.Application.Commands;

namespace AdsBillingService.API.Application.Validations;

/// <summary>
/// EN: Validator for AddFundsCommand.
/// VI: Validator cho AddFundsCommand.
/// </summary>
public class AddFundsCommandValidator : AbstractValidator<AddFundsCommand>
{
    public AddFundsCommandValidator()
    {
        RuleFor(x => x.AccountId)
            .NotEmpty()
            .WithMessage("Account ID is required / Account ID là bắt buộc");

        RuleFor(x => x.Amount)
            .GreaterThan(0)
            .WithMessage("Amount must be greater than 0 / Số tiền phải lớn hơn 0")
            .LessThanOrEqualTo(1_000_000_000)
            .WithMessage("Amount must not exceed 1,000,000,000 / Số tiền không được vượt quá 1,000,000,000");
    }
}
