2026-02-01 06:12:09 -06:00
|
|
|
|
2026-02-01 04:27:06 -06:00
|
|
|
namespace FiscalOS.API.Login;
|
|
|
|
|
|
2026-02-01 06:12:09 -06:00
|
|
|
public record LoginRequest : IValidatableObject
|
|
|
|
|
{
|
|
|
|
|
public string Username { get; init; } = string.Empty;
|
|
|
|
|
public string Password { get; init; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrWhiteSpace(Username))
|
|
|
|
|
{
|
|
|
|
|
yield return new("The Username field is required.", [nameof(Username)]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(Password))
|
|
|
|
|
{
|
|
|
|
|
yield return new("The Password field is required.", [nameof(Password)]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|