using System.ComponentModel.DataAnnotations;

namespace GerbilManagerWebAPI.Models
{
    /// <summary>A litter (Wurf). Parents are gerbils; juveniles are Gerbils linked via Gerbil.LitterId.</summary>
    public class Litter
    {
        [Key]
        public Guid Id { get; set; }
        public required string Name { get; set; }
        public DateOnly Date { get; set; }

        /// <summary>Total born count (was "Strength").</summary>
        public int? TotalBorn { get; set; }

        public Guid? FatherId { get; set; }
        public Gerbil? Father { get; set; }
        public Guid? MotherId { get; set; }
        public Gerbil? Mother { get; set; }

        /// <summary>Computed ~35 days after Date by default; editable.</summary>
        public DateOnly? ExpectedGoHomeDate { get; set; }
        public string? Notes { get; set; }

        /// <summary>Zuchtnummer der Verpaarung (Wurfchronik col H) — pairing-level code;
        /// litters sharing it are the same Zuchtpaar. Set by the FEAT-8 import.</summary>
        public string? PairingCode { get; set; }

        /// <summary>DB-5: stable import source id (extract.py litter Id). Unique (filtered,
        /// nulls allowed for manually-entered litters). Primary idempotency key for re-imports;
        /// Name+Date is the fallback for litters created before this column existed.</summary>
        public string? ExternalRef { get; set; }

        /// <summary>FEAT-NAMEGEN: Wurfbuchstabe (A, B, C … AA, AB …) — alle Welpen dieses
        /// Wurfs erhalten Namen mit diesem Anfangsbuchstaben (gängige Zuchtkonvention).</summary>
        public string? LitterLetter { get; set; }
    }
}
