using FluentValidation;
using Indotalent.Shared.Consts;

namespace Indotalent.Features.Multitenant.TenantUser.Cqrs;

public class UpdateTenantUserValidator : AbstractValidator<UpdateTenantUserRequest>
{
    public UpdateTenantUserValidator()
    {
        RuleFor(x => x.Id)
            .NotEmpty().WithMessage("ID is required for update");

        RuleFor(x => x.Summary)
            .NotEmpty().WithMessage("Summary is required")
            .MaximumLength(GlobalConsts.StringLengthShort);

        RuleFor(x => x.TenantId)
            .NotEmpty().WithMessage("Tenant is required");

        RuleFor(x => x.UserId)
            .NotEmpty().WithMessage("User is required");
    }
}