using System.ComponentModel.DataAnnotations;

namespace GerbilManagerWebAPI.Models
{
    /// <summary>
    /// A person/cattery a gerbil came from (Herkunft) or was given to (Abnehmer).
    /// Was "Breeder"; the role is relational (see Gerbil.OriginContactId / ReceiverContactId).
    /// </summary>
    public class Contact
    {
        [Key]
        public Guid Id { get; set; }
        public required string Name { get; set; }
        public string? Email { get; set; }
        public string? Phone { get; set; }
        public string? Address { get; set; }
        public string? Notes { get; set; }

        public bool IsBreeder { get; set; }
        public bool IsReceiver { get; set; }

        /// <summary>
        /// Namens-Anhängsel dieser Zucht (wie ein „Nachname"), z. B.
        /// „von den Wüstenwinden“. Für Tiere fremder Züchter pflegbar.
        /// </summary>
        public string? NameSuffix { get; set; }

        /// <summary>Data-provenance / traceability for the import: a JSON object describing
        /// WHICH source information produced this contact (sourceFiles, mergedRecordCount,
        /// notes). Written by the Python merge_and_resolve step and surfaced read-only
        /// ("Datenherkunft"). Null = manually-added contact / no import data.</summary>
        public string? Provenance { get; set; }

        /// <summary>true = manually created in the UI; false = produced by an import path. The ingest
        /// re-import wipe deletes ONLY IsManual=false contacts, so a manually-added contact (e.g. the
        /// Herkunft/Abnehmer of a manual animal) is never wiped. All import paths leave this false.</summary>
        public bool IsManual { get; set; }
    }
}
