using Baya.Application.Models.Common;
using Baya.Application.Models.Jwt;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;

namespace Baya.Application.Features.Users.Queries.TokenRequest;

public record PasswordUserTokenRequestQuery
(string UserName,string Password)
:IValidatableModel<PasswordUserTokenRequestQuery>,IRequest<OperationResult<AccessToken>>
{
    public IValidator<PasswordUserTokenRequestQuery> ValidateApplicationModel(ApplicationBaseValidationModelProvider<PasswordUserTokenRequestQuery> validator)
    {
        validator.RuleFor(c => c.UserName)
            .NotEmpty();

        validator.RuleFor(c => c.Password)
            .NotEmpty();

        return validator;
    }
}