#nullable enable
using Baya.Application.Contracts.Common;
using Baya.Domain.Entities.Verification;

namespace Baya.Infrastructure.CrossCutting.Seams;

/// <summary>
/// Default <see cref="ICredentialVerifier"/> — and the mock. MoH پروانه صلاحیت حرفه‌ای and INO membership
/// have <b>no public B2B API</b>, so verification is a manual admin review of the uploaded document against
/// the official portal: every call returns <see cref="CredentialVerificationStatus.RequiresManualReview"/>
/// with <c>verification_method = manual</c>. When an <c>api</c>/<c>portal</c> source becomes available, a
/// real implementation replaces this registration and starts returning
/// <see cref="CredentialVerificationStatus.Verified"/>/<see cref="CredentialVerificationStatus.Failed"/>
/// with the matching method — callers are unchanged.
/// </summary>
public sealed class MockCredentialVerifier : ICredentialVerifier
{
    public Task<CredentialVerificationResult> VerifyAsync(string credentialType, string? credentialNumber, CancellationToken cancellationToken = default)
        => Task.FromResult(new CredentialVerificationResult(
            CredentialVerificationStatus.RequiresManualReview,
            VerificationMethods.Manual,
            ExternalResponseJson: null));
}
