| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace FAU.Entidades; |
| | | 5 | | |
| | | 6 | | [Table("periodos_liquidacion")] |
| | | 7 | | public class Periodo |
| | | 8 | | { |
| | | 9 | | public const string EstadoAbierta = "ABIERTA"; |
| | | 10 | | public const string EstadoListaCalculo = "LISTA_CALCULO"; |
| | | 11 | | public const string EstadoEnCalculo = "EN_CALCULO"; |
| | | 12 | | public const string EstadoCalculada = "CALCULADA"; |
| | | 13 | | public const string EstadoCerrada = "CERRADA"; |
| | | 14 | | |
| | 0 | 15 | | public static readonly IReadOnlyList<string> EstadosActivos = |
| | 0 | 16 | | new[] { EstadoAbierta, EstadoListaCalculo, EstadoEnCalculo }; |
| | | 17 | | |
| | | 18 | | [Key] |
| | | 19 | | [Column("id")] |
| | 395 | 20 | | public long Id { get; set; } |
| | | 21 | | |
| | | 22 | | [Required] |
| | | 23 | | [Column("anio")] |
| | 499 | 24 | | public short Anio { get; set; } |
| | | 25 | | |
| | | 26 | | [Required] |
| | | 27 | | [Column("mes")] |
| | 467 | 28 | | public short Mes { get; set; } |
| | | 29 | | |
| | | 30 | | [Required] |
| | | 31 | | [MaxLength(20)] |
| | | 32 | | [Column("estado")] |
| | 723 | 33 | | public string Estado { get; set; } = "ABIERTA"; |
| | | 34 | | |
| | | 35 | | [Required] |
| | | 36 | | [Column("snapshot_id")] |
| | 200 | 37 | | public long SnapshotId { get; set; } |
| | | 38 | | |
| | | 39 | | [Required] |
| | | 40 | | [Column("fecha_apertura")] |
| | 421 | 41 | | public DateTime FechaApertura { get; set; } = DateTime.Now; |
| | | 42 | | |
| | | 43 | | [Required] |
| | | 44 | | [Column("usuario_apertura")] |
| | 211 | 45 | | public long UsuarioApertura { get; set; } |
| | | 46 | | |
| | | 47 | | [Required] |
| | | 48 | | [MaxLength(64)] |
| | | 49 | | [Column("hash_snapshot")] |
| | 546 | 50 | | public string HashSnapshot { get; set; } = string.Empty; |
| | | 51 | | |
| | | 52 | | [Required] |
| | | 53 | | [Column("activo")] |
| | 440 | 54 | | public bool Activo { get; set; } = true; |
| | | 55 | | |
| | | 56 | | [Column("fecha_cierre_insumos")] |
| | 16 | 57 | | public DateTime? FechaCierreInsumos { get; set; } |
| | | 58 | | |
| | | 59 | | [Column("usuario_cierre_insumos")] |
| | 8 | 60 | | public long? UsuarioCierreInsumosId { get; set; } |
| | | 61 | | |
| | | 62 | | [Column("fecha_calculo")] |
| | 9 | 63 | | public DateTime? FechaCalculo { get; set; } |
| | | 64 | | |
| | | 65 | | [Column("usuario_calculo")] |
| | 1 | 66 | | public long? UsuarioCalculoId { get; set; } |
| | | 67 | | |
| | | 68 | | [Column("fecha_cierre")] |
| | 10 | 69 | | public DateTime? FechaCierre { get; set; } |
| | | 70 | | |
| | | 71 | | [Column("usuario_cierre")] |
| | 4 | 72 | | public long? UsuarioCierreId { get; set; } |
| | | 73 | | |
| | | 74 | | [NotMapped] |
| | 25 | 75 | | public string? UsuarioAperturaUsername { get; set; } |
| | | 76 | | |
| | | 77 | | [ForeignKey("SnapshotId")] |
| | 0 | 78 | | public virtual SnapshotInsumos Snapshot { get; set; } = null!; |
| | | 79 | | |
| | | 80 | | [ForeignKey("UsuarioCierreInsumosId")] |
| | 6 | 81 | | public virtual Usuario? UsuarioCierreInsumos { get; set; } |
| | | 82 | | |
| | | 83 | | [ForeignKey("UsuarioCalculoId")] |
| | 6 | 84 | | public virtual Usuario? UsuarioCalculo { get; set; } |
| | | 85 | | |
| | | 86 | | [ForeignKey("UsuarioCierreId")] |
| | 6 | 87 | | public virtual Usuario? UsuarioCierre { get; set; } |
| | | 88 | | } |