| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace FAU.Entidades; |
| | | 5 | | |
| | | 6 | | [Table("personas")] |
| | | 7 | | public class Persona |
| | | 8 | | { |
| | | 9 | | [Key] |
| | | 10 | | [Column("id")] |
| | 203 | 11 | | public long Id { get; set; } |
| | | 12 | | |
| | | 13 | | [Required] |
| | | 14 | | [MaxLength(12)] |
| | | 15 | | [Column("cedula")] |
| | 246 | 16 | | public string Cedula { get; set; } = string.Empty; |
| | | 17 | | |
| | | 18 | | [Required] |
| | | 19 | | [MaxLength(100)] |
| | | 20 | | [Column("primer_nombre")] |
| | 320 | 21 | | public string PrimerNombre { get; set; } = string.Empty; |
| | | 22 | | |
| | | 23 | | [MaxLength(100)] |
| | | 24 | | [Column("segundo_nombre")] |
| | 29 | 25 | | public string? SegundoNombre { get; set; } |
| | | 26 | | |
| | | 27 | | [Required] |
| | | 28 | | [MaxLength(100)] |
| | | 29 | | [Column("primer_apellido")] |
| | 319 | 30 | | public string PrimerApellido { get; set; } = string.Empty; |
| | | 31 | | |
| | | 32 | | [MaxLength(100)] |
| | | 33 | | [Column("segundo_apellido")] |
| | 29 | 34 | | public string? SegundoApellido { get; set; } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Propiedad de conveniencia para obtener el nombre completo |
| | | 38 | | /// </summary> |
| | | 39 | | [NotMapped] |
| | | 40 | | public string NombreCompleto => |
| | 20 | 41 | | $"{PrimerNombre} {(string.IsNullOrWhiteSpace(SegundoNombre) ? "" : SegundoNombre + " ")}{PrimerApellido}{(string |
| | | 42 | | |
| | | 43 | | [Column("fecha_nacimiento")] |
| | 9 | 44 | | public DateTime? FechaNacimiento { get; set; } |
| | | 45 | | |
| | | 46 | | [MaxLength(150)] |
| | | 47 | | [Column("email")] |
| | 35 | 48 | | public string? Email { get; set; } |
| | | 49 | | |
| | | 50 | | [MaxLength(30)] |
| | | 51 | | [Column("telefono")] |
| | 13 | 52 | | public string? Telefono { get; set; } |
| | | 53 | | |
| | | 54 | | [MaxLength(200)] |
| | | 55 | | [Column("direccion")] |
| | 5 | 56 | | public string? Direccion { get; set; } |
| | | 57 | | |
| | | 58 | | [MaxLength(10)] |
| | | 59 | | [Column("codigo_postal")] |
| | 5 | 60 | | public string? CodigoPostal { get; set; } |
| | | 61 | | |
| | | 62 | | [MaxLength(100)] |
| | | 63 | | [Column("departamento")] |
| | 5 | 64 | | public string? Departamento { get; set; } |
| | | 65 | | |
| | | 66 | | [MaxLength(100)] |
| | | 67 | | [Column("localidad")] |
| | 5 | 68 | | public string? Localidad { get; set; } |
| | | 69 | | |
| | | 70 | | [Column("fecha_actualizacion")] |
| | 150 | 71 | | public DateTime FechaActualizacion { get; set; } = DateTime.UtcNow; |
| | | 72 | | |
| | | 73 | | // Navegación |
| | 148 | 74 | | public virtual ICollection<Usuario> Usuarios { get; set; } = new List<Usuario>(); |
| | 148 | 75 | | public virtual ICollection<CuentaBancaria> CuentasBancarias { get; set; } = new List<CuentaBancaria>(); |
| | 148 | 76 | | public virtual ICollection<RelacionLaboral> RelacionesLaborales { get; set; } = new List<RelacionLaboral>(); |
| | | 77 | | } |
| | | 78 | | |