using RealCV.Application.Models;

namespace RealCV.Application.Interfaces;

/// <summary>
/// Service for verifying academic researchers via ORCID
/// </summary>
public interface IAcademicVerifierService
{
    /// <summary>
    /// Verify an academic researcher by ORCID ID
    /// </summary>
    Task<AcademicVerificationResult> VerifyByOrcidAsync(string orcidId);

    /// <summary>
    /// Search for researchers and verify by name
    /// </summary>
    Task<AcademicVerificationResult> VerifyByNameAsync(
        string name,
        string? affiliation = null);

    /// <summary>
    /// Search ORCID for researchers
    /// </summary>
    Task<List<OrcidSearchResult>> SearchResearchersAsync(
        string name,
        string? affiliation = null);

    /// <summary>
    /// Verify claimed publications
    /// </summary>
    Task<List<PublicationVerificationResult>> VerifyPublicationsAsync(
        string orcidId,
        List<string> claimedPublications);
}

public sealed record OrcidSearchResult
{
    public required string OrcidId { get; init; }
    public required string Name { get; init; }
    public string? OrcidUrl { get; init; }
    public List<string>? Affiliations { get; init; }
    public int? PublicationCount { get; init; }
}

public sealed record PublicationVerificationResult
{
    public required string ClaimedTitle { get; init; }
    public required bool IsVerified { get; init; }
    public string? MatchedTitle { get; init; }
    public string? Doi { get; init; }
    public int? Year { get; init; }
    public string? Notes { get; init; }
}
