using System.ComponentModel.DataAnnotations;
using System.Text.Json;

namespace ERPCore.Dtos.Auth;

public sealed class IsAvailableRequest
{
    [Required] public string Identifier { get; set; } = string.Empty;
    public string? Recovery { get; set; }
}

public sealed class IsAvailableResponse
{
    public bool? IsAvailable { get; set; }
    public string? Message { get; set; }
    /// <summary>Passed through as-is when `Recovery` matched existing users — shape isn't in the documented catalog.</summary>
    public JsonElement? ExistingUsers { get; set; }
}

public sealed class SendOtpRequest
{
    [Required] public string Identifier { get; set; } = string.Empty;
    public int NumberOfDigits { get; set; } = 6;
    public bool NewUser { get; set; }
}

public sealed class SendOtpResponse
{
    public string? ReferenceNumber { get; set; }
    public DateTime? ExpiresAt { get; set; }
    public string? RecoveryType { get; set; }
}

public sealed class VerifyAltOtpRequest
{
    [Required] public string ReferenceNumber { get; set; } = string.Empty;
    [Required] public string OtpCode { get; set; } = string.Empty;
    public string? Identifier { get; set; }
    public Guid? UserId { get; set; }
    public bool NewUser { get; set; }
    public string? DeviceName { get; set; }
}
