namespace RealCV.Application.Models;

/// <summary>
/// Result of verifying an academic researcher via ORCID
/// </summary>
public sealed record AcademicVerificationResult
{
    public required string ClaimedName { get; init; }
    public required bool IsVerified { get; init; }

    // ORCID profile
    public string? OrcidId { get; init; }
    public string? MatchedName { get; init; }
    public string? OrcidUrl { get; init; }

    // Academic affiliations
    public List<AcademicAffiliation> Affiliations { get; init; } = [];

    // Publications
    public int TotalPublications { get; init; }
    public List<Publication> RecentPublications { get; init; } = [];

    // Education from ORCID
    public List<AcademicEducation> Education { get; init; } = [];

    public string? VerificationNotes { get; init; }
    public List<AcademicVerificationFlag> Flags { get; init; } = [];
}

public sealed record AcademicAffiliation
{
    public required string Organization { get; init; }
    public string? Department { get; init; }
    public string? Role { get; init; }
    public DateOnly? StartDate { get; init; }
    public DateOnly? EndDate { get; init; }
}

public sealed record Publication
{
    public required string Title { get; init; }
    public string? Journal { get; init; }
    public int? Year { get; init; }
    public string? Doi { get; init; }
    public string? Type { get; init; }
}

public sealed record AcademicEducation
{
    public required string Institution { get; init; }
    public string? Degree { get; init; }
    public string? Subject { get; init; }
    public int? Year { get; init; }
}

public sealed record AcademicVerificationFlag
{
    public required string Type { get; init; }
    public required string Severity { get; init; }
    public required string Message { get; init; }
    public int ScoreImpact { get; init; }
}
