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

namespace foundation_system.Models;

[Table("asistencia")]
public class Asistencia
{
    [Key]
    [Column("id")]
    public long Id { get; set; }
    
    [Column("nino_id")]
    public long NinoId { get; set; }
    
    [Column("fecha")]
    public DateOnly Fecha { get; set; } = DateOnly.FromDateTime(DateTime.Now);
    
    [Column("estado")]
    [Required]
    [StringLength(20)]
    public string Estado { get; set; } = "PRESENTE";
    
    [Column("hora_entrada")]
    public TimeOnly? HoraEntrada { get; set; }
    
    [Column("hora_salida")]
    public TimeOnly? HoraSalida { get; set; }
    
    [Column("notas")]
    public string? Notas { get; set; }
    
    [Column("creado_en")]
    public DateTime CreadoEn { get; set; } = DateTime.UtcNow;
    
    // Navigation properties
    [ForeignKey("NinoId")]
    public Nino Nino { get; set; } = null!;
}
