namespace GerbilManagerWebAPI.Genetics
{
    /// <summary>
    /// Result of an inbreeding-coefficient (Inzuchtkoeffizient) calculation for an
    /// individual or a hypothetical pairing.
    /// </summary>
    /// <param name="Coefficient">Wright's inbreeding coefficient F, in the range 0..1.</param>
    /// <param name="Percent">The coefficient expressed as a percentage (F * 100).</param>
    /// <param name="GenerationsAvailable">
    /// The deepest generation of known ancestry above the individual (parents = 1,
    /// grandparents = 2, …). 0 when no parents are recorded.
    /// </param>
    /// <param name="CommonAncestors">
    /// The ancestors common to both parents, each with its additive contribution to F,
    /// ordered by contribution descending. Empty when there is no inbreeding.
    /// </param>
    public record InbreedingResult(
        double Coefficient,
        double Percent,
        int GenerationsAvailable,
        IReadOnlyList<CommonAncestorContribution> CommonAncestors);

    /// <summary>A single common ancestor and how much it contributes to F.</summary>
    public record CommonAncestorContribution(Guid Id, string Name, double Contribution);
}
