using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace foundation_system.Models;

[Table("ninos")]
public class Nino
{
    [Key]
    [Column("id")]
    public long Id { get; set; }
    
    [Column("persona_id")]
    public long PersonaId { get; set; }
    
    [Column("fecha_inscripcion")]
    public DateOnly FechaInscripcion { get; set; } = DateOnly.FromDateTime(DateTime.Now);
    
    [Column("codigo_inscripcion")]
    [Required]
    [StringLength(20)]
    public string CodigoInscripcion { get; set; } = string.Empty;
    
    [Column("estado")]
    [StringLength(20)]
    public string Estado { get; set; } = "ACTIVO";
    
    [Column("nivel_grado")]
    [StringLength(20)]
    public string? NivelGrado { get; set; }
    
    [Column("alergias")]
    public string? Alergias { get; set; }
    
    [Column("contacto_emergencia_nombre")]
    [StringLength(100)]
    public string? ContactoEmergenciaNombre { get; set; }
    
    [Column("contacto_emergencia_telefono")]
    [StringLength(20)]
    public string? ContactoEmergenciaTelefono { get; set; }
    
    [Column("activo")]
    public bool Activo { get; set; } = true;
    
    [Column("creado_en")]
    public DateTime CreadoEn { get; set; } = DateTime.UtcNow;
    
    [Column("actualizado_en")]
    public DateTime ActualizadoEn { get; set; } = DateTime.UtcNow;
    
    // Navigation properties
    [ForeignKey("PersonaId")]
    public Persona Persona { get; set; } = null!;
}
