using FluentValidation;
using Meezi.API.Models.Expenses;

namespace Meezi.API.Validators;

public class CreateExpenseRequestValidator : AbstractValidator<CreateExpenseRequest>
{
    public CreateExpenseRequestValidator()
    {
        RuleFor(x => x.BranchId).NotEmpty();
        RuleFor(x => x.Amount).GreaterThan(0);
        RuleFor(x => x.Note).MaximumLength(500).When(x => x.Note is not null);
        RuleFor(x => x.ReceiptImageUrl).MaximumLength(500).When(x => x.ReceiptImageUrl is not null);
    }
}
