#nullable enable
using Baya.Domain.Common;

namespace Baya.Domain.Entities.Verification;

/// <summary>
/// The structured, queryable credential registry — the actual license/membership numbers, authority,
/// holder-name-as-printed and issue/expiry dates behind the opaque uploads. Powers the public trust badge
/// (types held, never numbers), renewal/expiry alerts and cross-checking. <see cref="CredentialNumber"/> is
/// encrypted PII (through <c>IFieldEncryptor</c>); <see cref="HolderNameSnapshot"/> is cross-checked against
/// the nurse's verified identity name before the credential is recorded — never trust an uploaded file alone.
/// </summary>
public class NurseCredential : BaseEntity<long>
{
    public long NurseId { get; set; }

    /// <summary>One of <see cref="CredentialTypes"/>.</summary>
    public string CredentialType { get; set; } = string.Empty;

    /// <summary>Encrypted at rest — never serialized on the wire.</summary>
    public string CredentialNumber { get; set; } = string.Empty;

    /// <summary>Name as printed on the credential, snapshotted for the identity cross-check.</summary>
    public string HolderNameSnapshot { get; set; } = string.Empty;

    public string IssuingAuthority { get; set; } = string.Empty;

    public DateOnly? IssuedAt { get; set; }

    /// <summary>Drives renewal alerts and the expiry scanner re-gate.</summary>
    public DateOnly? ExpiresAt { get; set; }

    /// <summary>Portal URL / method used to verify (audit defensibility).</summary>
    public string? VerificationSource { get; set; }

    /// <summary>One of <see cref="VerificationMethods"/> (<c>manual</c> today for MoH/INO/criminal).</summary>
    public string VerificationMethod { get; set; } = VerificationMethods.Manual;

    public int? VerifiedByAdminId { get; set; }

    public DateTimeOffset? DeletedAt { get; set; }
}
