| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace FAU.Entidades; |
| | | 5 | | |
| | | 6 | | [Table("usuarios")] |
| | | 7 | | public class Usuario |
| | | 8 | | { |
| | | 9 | | [Key] |
| | | 10 | | [Column("id")] |
| | 141 | 11 | | public long Id { get; set; } |
| | | 12 | | |
| | | 13 | | [Required] |
| | | 14 | | [MaxLength(60)] |
| | | 15 | | [Column("username")] |
| | 252 | 16 | | public string Username { get; set; } = string.Empty; |
| | | 17 | | |
| | | 18 | | [Required] |
| | | 19 | | [MaxLength(255)] |
| | | 20 | | [Column("password_hash")] |
| | 147 | 21 | | public string PasswordHash { get; set; } = string.Empty; |
| | | 22 | | |
| | | 23 | | [Required] |
| | | 24 | | [MaxLength(20)] |
| | | 25 | | [Column("estado")] |
| | 240 | 26 | | public string Estado { get; set; } = "activo"; |
| | | 27 | | |
| | | 28 | | [Column("intentos_fallidos")] |
| | 37 | 29 | | public short IntentosFallidos { get; set; } = 0; |
| | | 30 | | |
| | | 31 | | [Column("bloqueado_hasta")] |
| | 10 | 32 | | public DateTime? BloqueadoHasta { get; set; } |
| | | 33 | | |
| | | 34 | | [Column("persona_id")] |
| | 22 | 35 | | public long? PersonaId { get; set; } |
| | | 36 | | |
| | | 37 | | [Column("fecha_actualizacion")] |
| | 139 | 38 | | public DateTime FechaActualizacion { get; set; } = DateTime.UtcNow; |
| | | 39 | | |
| | | 40 | | // Navegación |
| | | 41 | | [ForeignKey("PersonaId")] |
| | 135 | 42 | | public virtual Persona? Persona { get; set; } |
| | | 43 | | |
| | 227 | 44 | | public virtual ICollection<Rol> Roles { get; set; } = new List<Rol>(); |
| | 107 | 45 | | public virtual ICollection<BitacoraAuditoria> BitacorasAuditoria { get; set; } = new List<BitacoraAuditoria>(); |
| | | 46 | | } |
| | | 47 | | |