#nullable enable
namespace Baya.Application.Contracts.Common;

/// <summary>
/// Seam for verifying a partner center's licensing — the MoH establishment permit (پروانه تأسیس) and the
/// eNamad trust seal (نماد اعتماد الکترونیکی) — against its authoritative source. There is <b>no public B2B
/// API</b> for these today, so the default implementation returns
/// <see cref="LicenseVerificationStatus.NeedsManualReview"/>: <c>VerifyPartnerCenter</c> records the human
/// admin decision. When a real eNamad / MoH registry endpoint becomes available a real implementation replaces
/// this registration and starts returning <see cref="LicenseVerificationStatus.Valid"/>/<see cref="LicenseVerificationStatus.Invalid"/>
/// — <c>VerifyPartnerCenter</c> is unchanged.
/// </summary>
public interface ILicenseVerificationService
{
    Task<LicenseVerdict> VerifyEstablishmentPermitAsync(string permitNo, CancellationToken cancellationToken = default);

    Task<LicenseVerdict> VerifyENamadAsync(string enamadCode, CancellationToken cancellationToken = default);
}

/// <summary>Whether a license can be verified automatically or needs a manual admin decision.</summary>
public enum LicenseVerificationStatus
{
    NeedsManualReview,
    Valid,
    Invalid
}

/// <summary>Outcome of an <see cref="ILicenseVerificationService"/> check.</summary>
/// <param name="Status">Manual today; automated once a registry/API is available.</param>
/// <param name="Reason">Human-readable reason for the verdict (esp. for manual/invalid).</param>
public readonly record struct LicenseVerdict(LicenseVerificationStatus Status, string Reason);
