Update Data Model Expedition & Set
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 26m4s
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 26m4s
This commit is contained in:
parent
c0d98e2ec8
commit
626f57aab3
66
Models/Models/PhLsmExpeditionDetail.cs
Normal file
66
Models/Models/PhLsmExpeditionDetail.cs
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Models.Models;
|
||||||
|
|
||||||
|
public partial class PhLsmExpeditionDetail
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador interno del ítem de expedición
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Referencia a la cabecera de expedición (PhLSM_ExpeditionHeaders)
|
||||||
|
/// </summary>
|
||||||
|
public int ExpeditionId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Producto médico a despachar
|
||||||
|
/// </summary>
|
||||||
|
public int ProductId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cantidad solicitada del producto
|
||||||
|
/// </summary>
|
||||||
|
public decimal Quantity { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ubicación específica desde donde se despacha este ítem
|
||||||
|
/// </summary>
|
||||||
|
public int LocationId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Número de lote (si aplica trazabilidad)
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de vencimiento del producto (si aplica trazabilidad)
|
||||||
|
/// </summary>
|
||||||
|
public DateOnly? Expiration { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Descripción libre del ítem (uso interno o impresión)
|
||||||
|
/// </summary>
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Precio estimado unitario del producto (sin efecto contable)
|
||||||
|
/// </summary>
|
||||||
|
public decimal? EstimatedUnitprice { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Moneda del precio estimado (ej: ARS, USD)
|
||||||
|
/// </summary>
|
||||||
|
public string? EstimatedCurrency { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tipo de cambio aplicado al precio estimado
|
||||||
|
/// </summary>
|
||||||
|
public decimal? EstimatedExchangerate { get; set; }
|
||||||
|
|
||||||
|
public virtual PhLsmExpeditionHeader Expedition { get; set; } = null!;
|
||||||
|
|
||||||
|
public virtual PhLsmProduct Product { get; set; } = null!;
|
||||||
|
}
|
||||||
84
Models/Models/PhLsmExpeditionHeader.cs
Normal file
84
Models/Models/PhLsmExpeditionHeader.cs
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Models.Models;
|
||||||
|
|
||||||
|
public partial class PhLsmExpeditionHeader
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador interno de la expedición
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Referencia al ticket quirúrgico (si aplica)
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TicketId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Número de expedición (formato EX-00000001)
|
||||||
|
/// </summary>
|
||||||
|
public string Expeditionnumber { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ubicación (depósito) desde donde se despacha
|
||||||
|
/// </summary>
|
||||||
|
public int LocationId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de emisión de la expedición
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Issuedate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Estado de la expedición (1=Borrador, 2=Confirmada, etc.)
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Nombre del destinatario visible en la impresión
|
||||||
|
/// </summary>
|
||||||
|
public string? RecipientName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Número o referencia externa asociada
|
||||||
|
/// </summary>
|
||||||
|
public string? ReferenceNumber { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tipo de origen externo (ej: surgery, demo, préstamo)
|
||||||
|
/// </summary>
|
||||||
|
public string? OriginType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID externo relacionado a otro módulo (ej: ticket, orden)
|
||||||
|
/// </summary>
|
||||||
|
public string? ExternalReference { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Observaciones generales de la expedición
|
||||||
|
/// </summary>
|
||||||
|
public string? Observations { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Información adicional en formato JSON (ej: paciente, médico, etc.)
|
||||||
|
/// </summary>
|
||||||
|
public string? ExtrainfoJson { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cantidad de veces que se imprimió la nota de expedición
|
||||||
|
/// </summary>
|
||||||
|
public int Printcount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de creación del registro
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Createdat { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de última modificación del registro
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? Modifiedat { get; set; }
|
||||||
|
|
||||||
|
public virtual ICollection<PhLsmExpeditionDetail> PhLsmExpeditionDetails { get; set; } = new List<PhLsmExpeditionDetail>();
|
||||||
|
}
|
||||||
@ -57,6 +57,10 @@ public partial class PhLsmProduct
|
|||||||
|
|
||||||
public virtual PhLsmProductDivision? Division { get; set; }
|
public virtual PhLsmProductDivision? Division { get; set; }
|
||||||
|
|
||||||
|
public virtual ICollection<PhLsmExpeditionDetail> PhLsmExpeditionDetails { get; set; } = new List<PhLsmExpeditionDetail>();
|
||||||
|
|
||||||
|
public virtual ICollection<PhLsmProductSetItem> PhLsmProductSetItems { get; set; } = new List<PhLsmProductSetItem>();
|
||||||
|
|
||||||
public virtual ICollection<PhLsmStockEntry> PhLsmStockEntries { get; set; } = new List<PhLsmStockEntry>();
|
public virtual ICollection<PhLsmStockEntry> PhLsmStockEntries { get; set; } = new List<PhLsmStockEntry>();
|
||||||
|
|
||||||
public virtual ICollection<PhLsmStockItem> PhLsmStockItems { get; set; } = new List<PhLsmStockItem>();
|
public virtual ICollection<PhLsmStockItem> PhLsmStockItems { get; set; } = new List<PhLsmStockItem>();
|
||||||
|
|||||||
44
Models/Models/PhLsmProductSet.cs
Normal file
44
Models/Models/PhLsmProductSet.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Models.Models;
|
||||||
|
|
||||||
|
public partial class PhLsmProductSet
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador único del set de productos
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Código del set (ej: CMF1.2, TRAUMA2.0)
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Nombre comercial o técnico del set
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Descripción extendida del set de productos
|
||||||
|
/// </summary>
|
||||||
|
public string? Descripcion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indica si el set requiere un proceso adicional (ej: esterilización)
|
||||||
|
/// </summary>
|
||||||
|
public bool PlusProcess { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de creación del registro
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Createdat { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de última modificación del registro
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? Modifiedat { get; set; }
|
||||||
|
|
||||||
|
public virtual ICollection<PhLsmProductSetItem> PhLsmProductSetItems { get; set; } = new List<PhLsmProductSetItem>();
|
||||||
|
}
|
||||||
36
Models/Models/PhLsmProductSetItem.cs
Normal file
36
Models/Models/PhLsmProductSetItem.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Models.Models;
|
||||||
|
|
||||||
|
public partial class PhLsmProductSetItem
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador único del ítem dentro del set
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID del set al que pertenece este ítem
|
||||||
|
/// </summary>
|
||||||
|
public int ProductsetId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Producto incluido en el set
|
||||||
|
/// </summary>
|
||||||
|
public int ProductId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cantidad estándar del producto en el set
|
||||||
|
/// </summary>
|
||||||
|
public decimal DefaultQuantity { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indica si este ítem es obligatorio en la composición del set
|
||||||
|
/// </summary>
|
||||||
|
public bool Mandatory { get; set; }
|
||||||
|
|
||||||
|
public virtual PhLsmProduct Product { get; set; } = null!;
|
||||||
|
|
||||||
|
public virtual PhLsmProductSet Productset { get; set; } = null!;
|
||||||
|
}
|
||||||
@ -3,9 +3,6 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace Models.Models;
|
namespace Models.Models;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Registro individual de ingreso de stock con valor y trazabilidad
|
|
||||||
/// </summary>
|
|
||||||
public partial class PhLsmStockEntry
|
public partial class PhLsmStockEntry
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -14,49 +11,69 @@ public partial class PhLsmStockEntry
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Referencia al producto ingresado
|
/// Producto ingresado al stock
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ProductId { get; set; }
|
public int ProductId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cantidad ingresada en la unidad correspondiente del producto
|
/// Cantidad ingresada del producto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Quantity { get; set; }
|
public decimal Quantity { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Precio unitario del producto en la moneda indicada
|
/// Precio unitario usado para valorizar el ingreso
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Unitprice { get; set; }
|
public decimal Unitprice { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moneda del ingreso (ej: ars, usd, eur)
|
/// Moneda utilizada en la valorización (ARS, USD, EUR)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Currency { get; set; } = null!;
|
public string Currency { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tipo de cambio aplicado respecto a ARS
|
/// Tasa de conversión de la moneda a ARS
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Exchangerate { get; set; }
|
public decimal Exchangerate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fecha y hora del ingreso físico al stock
|
/// Fecha del ingreso de stock
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime Entrydate { get; set; }
|
public DateTime Entrydate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Referencia externa: número de remito, factura o documento de ingreso
|
/// Referencia visible del movimiento (ej: factura, orden de compra)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Reference { get; set; }
|
public string? Reference { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tipo de origen del ingreso (ej: compra, devolución, ajuste)
|
/// Tipo de origen del ingreso (purchase, return, manual, etc.)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Sourcetype { get; set; }
|
public string? Sourcetype { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Identificador interno del documento de origen (opcional)
|
/// ID de la entidad que generó el ingreso (ej: orden de compra)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? SourceId { get; set; }
|
public int? SourceId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ubicación física donde se depositó el producto
|
||||||
|
/// </summary>
|
||||||
|
public int LocationId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lote del producto ingresado (si aplica trazabilidad)
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de vencimiento del producto ingresado (si aplica)
|
||||||
|
/// </summary>
|
||||||
|
public DateOnly? Expiration { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de creación del registro
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Createdat { get; set; }
|
||||||
|
|
||||||
public virtual PhLsmProduct Product { get; set; } = null!;
|
public virtual PhLsmProduct Product { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,12 @@ public partial class PhLsmStockItem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cantidad actual disponible en esta unidad de stock
|
/// Cantidad actual disponible en esta unidad de stock
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Quantity { get; set; }
|
public decimal Quantity { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cantidad comprometida o reservada para expediciones futuras
|
||||||
|
/// </summary>
|
||||||
|
public decimal ReservedQuantity { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Código de lote (si aplica)
|
/// Código de lote (si aplica)
|
||||||
@ -45,6 +50,16 @@ public partial class PhLsmStockItem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de creación del registro
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Createdat { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de última modificación del registro
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? Modifiedat { get; set; }
|
||||||
|
|
||||||
public virtual PhLsmStockLocation Location { get; set; } = null!;
|
public virtual PhLsmStockLocation Location { get; set; } = null!;
|
||||||
|
|
||||||
public virtual PhLsmProduct Product { get; set; } = null!;
|
public virtual PhLsmProduct Product { get; set; } = null!;
|
||||||
|
|||||||
@ -18,22 +18,22 @@ public partial class PhLsmStockOut
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cantidad retirada del producto
|
/// Cantidad retirada del producto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Quantity { get; set; }
|
public decimal Quantity { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Precio unitario usado para valorizar el egreso
|
/// Precio unitario usado para valorizar el egreso
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Unitprice { get; set; }
|
public decimal Unitprice { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moneda utilizada en la valorización (ars, usd, eur)
|
/// Moneda utilizada en la valorización (ARS, USD, EUR)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Currency { get; set; } = null!;
|
public string Currency { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tasa de conversión de la moneda a ARS
|
/// Tasa de conversión de la moneda a ARS
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Exchangerate { get; set; }
|
public decimal Exchangerate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fecha del egreso de stock
|
/// Fecha del egreso de stock
|
||||||
@ -55,5 +55,30 @@ public partial class PhLsmStockOut
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int? SourceId { get; set; }
|
public int? SourceId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador del caso quirúrgico asociado al egreso
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TicketId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ubicación física desde donde se retiró el producto
|
||||||
|
/// </summary>
|
||||||
|
public int? LocationId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lote del producto egresado (si aplica trazabilidad)
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de vencimiento del producto egresado (si aplica)
|
||||||
|
/// </summary>
|
||||||
|
public DateOnly? Expiration { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha de creación del registro
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Createdat { get; set; }
|
||||||
|
|
||||||
public virtual PhLsmProduct Product { get; set; } = null!;
|
public virtual PhLsmProduct Product { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,10 +15,18 @@ public partial class PhronCareOperationsHubContext : DbContext
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual DbSet<PhLsmExpeditionDetail> PhLsmExpeditionDetails { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<PhLsmExpeditionHeader> PhLsmExpeditionHeaders { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<PhLsmProduct> PhLsmProducts { get; set; }
|
public virtual DbSet<PhLsmProduct> PhLsmProducts { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<PhLsmProductDivision> PhLsmProductDivisions { get; set; }
|
public virtual DbSet<PhLsmProductDivision> PhLsmProductDivisions { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<PhLsmProductSet> PhLsmProductSets { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<PhLsmProductSetItem> PhLsmProductSetItems { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<PhLsmStockEntry> PhLsmStockEntries { get; set; }
|
public virtual DbSet<PhLsmStockEntry> PhLsmStockEntries { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<PhLsmStockItem> PhLsmStockItems { get; set; }
|
public virtual DbSet<PhLsmStockItem> PhLsmStockItems { get; set; }
|
||||||
@ -88,20 +96,143 @@ public partial class PhronCareOperationsHubContext : DbContext
|
|||||||
public virtual DbSet<PhSQuoteTaxis> PhSQuoteTaxes { get; set; }
|
public virtual DbSet<PhSQuoteTaxis> PhSQuoteTaxes { get; set; }
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
#region VERSION DOCKER
|
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
|
||||||
{
|
=> optionsBuilder.UseSqlServer("data source=srv01.saludlab.com.ar,39458;initial catalog=phronCare_OperationsHub;User ID=sa;Password=HS|s[~xxQzTo/n>9jO;encrypt=False;trustServerCertificate=True;MultipleActiveResultSets=True");
|
||||||
if (!optionsBuilder.IsConfigured)
|
|
||||||
{
|
|
||||||
// Dejarlo vacío para usar la configuración externa desde Program.cs o Startup.cs
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
//=> optionsBuilder.UseSqlServer("data source=srv01.saludlab.com.ar,39458;initial catalog=phronCare_OperationsHub;User ID=sa;Password=HS|s[~xxQzTo/n>9jO;encrypt=False;trustServerCertificate=True;MultipleActiveResultSets=True");
|
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
modelBuilder.UseCollation("Modern_Spanish_CI_AS");
|
modelBuilder.UseCollation("Modern_Spanish_CI_AS");
|
||||||
|
|
||||||
|
modelBuilder.Entity<PhLsmExpeditionDetail>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PK__PhLSM_Ex__3213E83F030D2D60");
|
||||||
|
|
||||||
|
entity.ToTable("PhLSM_ExpeditionDetails");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id)
|
||||||
|
.HasComment("Identificador interno del ítem de expedición")
|
||||||
|
.HasColumnName("id");
|
||||||
|
entity.Property(e => e.Batch)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasComment("Número de lote (si aplica trazabilidad)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("batch");
|
||||||
|
entity.Property(e => e.Description)
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.HasComment("Descripción libre del ítem (uso interno o impresión)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("description");
|
||||||
|
entity.Property(e => e.EstimatedCurrency)
|
||||||
|
.HasMaxLength(3)
|
||||||
|
.HasComment("Moneda del precio estimado (ej: ARS, USD)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("estimated_currency");
|
||||||
|
entity.Property(e => e.EstimatedExchangerate)
|
||||||
|
.HasComment("Tipo de cambio aplicado al precio estimado")
|
||||||
|
.HasColumnType("decimal(10, 4)")
|
||||||
|
.HasColumnName("estimated_exchangerate");
|
||||||
|
entity.Property(e => e.EstimatedUnitprice)
|
||||||
|
.HasComment("Precio estimado unitario del producto (sin efecto contable)")
|
||||||
|
.HasColumnType("decimal(18, 4)")
|
||||||
|
.HasColumnName("estimated_unitprice");
|
||||||
|
entity.Property(e => e.ExpeditionId)
|
||||||
|
.HasComment("Referencia a la cabecera de expedición (PhLSM_ExpeditionHeaders)")
|
||||||
|
.HasColumnName("expedition_id");
|
||||||
|
entity.Property(e => e.Expiration)
|
||||||
|
.HasComment("Fecha de vencimiento del producto (si aplica trazabilidad)")
|
||||||
|
.HasColumnName("expiration");
|
||||||
|
entity.Property(e => e.LocationId)
|
||||||
|
.HasComment("Ubicación específica desde donde se despacha este ítem")
|
||||||
|
.HasColumnName("location_id");
|
||||||
|
entity.Property(e => e.ProductId)
|
||||||
|
.HasComment("Producto médico a despachar")
|
||||||
|
.HasColumnName("product_id");
|
||||||
|
entity.Property(e => e.Quantity)
|
||||||
|
.HasComment("Cantidad solicitada del producto")
|
||||||
|
.HasColumnType("decimal(18, 4)")
|
||||||
|
.HasColumnName("quantity");
|
||||||
|
|
||||||
|
entity.HasOne(d => d.Expedition).WithMany(p => p.PhLsmExpeditionDetails)
|
||||||
|
.HasForeignKey(d => d.ExpeditionId)
|
||||||
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
|
.HasConstraintName("FK_PhLSM_ExpeditionDetails_PhLSM_ExpeditionHeaders");
|
||||||
|
|
||||||
|
entity.HasOne(d => d.Product).WithMany(p => p.PhLsmExpeditionDetails)
|
||||||
|
.HasForeignKey(d => d.ProductId)
|
||||||
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
|
.HasConstraintName("FK_PhLSM_ExpeditionDetails_PhLSM_Product");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<PhLsmExpeditionHeader>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PK__PhLSM_Ex__3213E83FBD69DF6E");
|
||||||
|
|
||||||
|
entity.ToTable("PhLSM_ExpeditionHeaders");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id)
|
||||||
|
.HasComment("Identificador interno de la expedición")
|
||||||
|
.HasColumnName("id");
|
||||||
|
entity.Property(e => e.Createdat)
|
||||||
|
.HasDefaultValueSql("(getdate())")
|
||||||
|
.HasComment("Fecha de creación del registro")
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("createdat");
|
||||||
|
entity.Property(e => e.Expeditionnumber)
|
||||||
|
.HasMaxLength(20)
|
||||||
|
.HasComment("Número de expedición (formato EX-00000001)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("expeditionnumber");
|
||||||
|
entity.Property(e => e.ExternalReference)
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasComment("ID externo relacionado a otro módulo (ej: ticket, orden)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("external_reference");
|
||||||
|
entity.Property(e => e.ExtrainfoJson)
|
||||||
|
.HasComment("Información adicional en formato JSON (ej: paciente, médico, etc.)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("extrainfo_json");
|
||||||
|
entity.Property(e => e.Issuedate)
|
||||||
|
.HasDefaultValueSql("(getdate())")
|
||||||
|
.HasComment("Fecha de emisión de la expedición")
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("issuedate");
|
||||||
|
entity.Property(e => e.LocationId)
|
||||||
|
.HasComment("Ubicación (depósito) desde donde se despacha")
|
||||||
|
.HasColumnName("location_id");
|
||||||
|
entity.Property(e => e.Modifiedat)
|
||||||
|
.HasComment("Fecha de última modificación del registro")
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("modifiedat");
|
||||||
|
entity.Property(e => e.Observations)
|
||||||
|
.HasComment("Observaciones generales de la expedición")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("observations");
|
||||||
|
entity.Property(e => e.OriginType)
|
||||||
|
.HasMaxLength(20)
|
||||||
|
.HasComment("Tipo de origen externo (ej: surgery, demo, préstamo)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("origin_type");
|
||||||
|
entity.Property(e => e.Printcount)
|
||||||
|
.HasComment("Cantidad de veces que se imprimió la nota de expedición")
|
||||||
|
.HasColumnName("printcount");
|
||||||
|
entity.Property(e => e.RecipientName)
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasComment("Nombre del destinatario visible en la impresión")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("recipient_name");
|
||||||
|
entity.Property(e => e.ReferenceNumber)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasComment("Número o referencia externa asociada")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("reference_number");
|
||||||
|
entity.Property(e => e.Status)
|
||||||
|
.HasComment("Estado de la expedición (1=Borrador, 2=Confirmada, etc.)")
|
||||||
|
.HasColumnName("status");
|
||||||
|
entity.Property(e => e.TicketId)
|
||||||
|
.HasComment("Referencia al ticket quirúrgico (si aplica)")
|
||||||
|
.HasColumnName("ticket_id");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<PhLsmProduct>(entity =>
|
modelBuilder.Entity<PhLsmProduct>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.Id).HasName("PK__PhLSM_Pr__3213E83F874510C5");
|
entity.HasKey(e => e.Id).HasName("PK__PhLSM_Pr__3213E83F874510C5");
|
||||||
@ -179,70 +310,174 @@ public partial class PhronCareOperationsHubContext : DbContext
|
|||||||
.HasColumnName("name");
|
.HasColumnName("name");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<PhLsmProductSet>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PK__PhLSM_Pr__3213E83F047D4048");
|
||||||
|
|
||||||
|
entity.ToTable("PhLSM_ProductSet");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id)
|
||||||
|
.HasComment("Identificador único del set de productos")
|
||||||
|
.HasColumnName("id");
|
||||||
|
entity.Property(e => e.Code)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasComment("Código del set (ej: CMF1.2, TRAUMA2.0)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("code");
|
||||||
|
entity.Property(e => e.Createdat)
|
||||||
|
.HasDefaultValueSql("(getdate())")
|
||||||
|
.HasComment("Fecha de creación del registro")
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("createdat");
|
||||||
|
entity.Property(e => e.Descripcion)
|
||||||
|
.HasMaxLength(255)
|
||||||
|
.HasComment("Descripción extendida del set de productos")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("descripcion");
|
||||||
|
entity.Property(e => e.Modifiedat)
|
||||||
|
.HasComment("Fecha de última modificación del registro")
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("modifiedat");
|
||||||
|
entity.Property(e => e.Name)
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasComment("Nombre comercial o técnico del set")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("name");
|
||||||
|
entity.Property(e => e.PlusProcess)
|
||||||
|
.HasComment("Indica si el set requiere un proceso adicional (ej: esterilización)")
|
||||||
|
.HasColumnName("plus_process");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<PhLsmProductSetItem>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PK__PhLSM_Pr__3213E83F681F74CE");
|
||||||
|
|
||||||
|
entity.ToTable("PhLSM_ProductSetItem");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id)
|
||||||
|
.HasComment("Identificador único del ítem dentro del set")
|
||||||
|
.HasColumnName("id");
|
||||||
|
entity.Property(e => e.DefaultQuantity)
|
||||||
|
.HasComment("Cantidad estándar del producto en el set")
|
||||||
|
.HasColumnType("decimal(18, 4)")
|
||||||
|
.HasColumnName("default_quantity");
|
||||||
|
entity.Property(e => e.Mandatory)
|
||||||
|
.HasDefaultValue(true)
|
||||||
|
.HasComment("Indica si este ítem es obligatorio en la composición del set")
|
||||||
|
.HasColumnName("mandatory");
|
||||||
|
entity.Property(e => e.ProductId)
|
||||||
|
.HasComment("Producto incluido en el set")
|
||||||
|
.HasColumnName("product_id");
|
||||||
|
entity.Property(e => e.ProductsetId)
|
||||||
|
.HasComment("ID del set al que pertenece este ítem")
|
||||||
|
.HasColumnName("productset_id");
|
||||||
|
|
||||||
|
entity.HasOne(d => d.Product).WithMany(p => p.PhLsmProductSetItems)
|
||||||
|
.HasForeignKey(d => d.ProductId)
|
||||||
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
|
.HasConstraintName("FK_ProductSetItem_Product");
|
||||||
|
|
||||||
|
entity.HasOne(d => d.Productset).WithMany(p => p.PhLsmProductSetItems)
|
||||||
|
.HasForeignKey(d => d.ProductsetId)
|
||||||
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
|
.HasConstraintName("FK_ProductSetItem_Set");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<PhLsmStockEntry>(entity =>
|
modelBuilder.Entity<PhLsmStockEntry>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.Id).HasName("PK__PhLSM_St__3213E83FCFAF3A63");
|
entity.HasKey(e => e.Id).HasName("PK__PhLSM_St__3213E83F7F20E170");
|
||||||
|
|
||||||
entity.ToTable("PhLSM_StockEntry", tb => tb.HasComment("Registro individual de ingreso de stock con valor y trazabilidad"));
|
entity.ToTable("PhLSM_StockEntry");
|
||||||
|
|
||||||
entity.Property(e => e.Id)
|
entity.Property(e => e.Id)
|
||||||
.HasComment("Identificador único del ingreso de stock")
|
.HasComment("Identificador único del ingreso de stock")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
entity.Property(e => e.Batch)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasComment("Lote del producto ingresado (si aplica trazabilidad)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("batch");
|
||||||
|
entity.Property(e => e.Createdat)
|
||||||
|
.HasDefaultValueSql("(getdate())")
|
||||||
|
.HasComment("Fecha de creación del registro")
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("createdat");
|
||||||
entity.Property(e => e.Currency)
|
entity.Property(e => e.Currency)
|
||||||
.HasMaxLength(3)
|
.HasMaxLength(3)
|
||||||
.HasComment("Moneda del ingreso (ej: ars, usd, eur)")
|
.HasComment("Moneda utilizada en la valorización (ARS, USD, EUR)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
.HasColumnName("currency");
|
.HasColumnName("currency");
|
||||||
entity.Property(e => e.Entrydate)
|
entity.Property(e => e.Entrydate)
|
||||||
.HasComment("Fecha y hora del ingreso físico al stock")
|
.HasComment("Fecha del ingreso de stock")
|
||||||
.HasColumnType("datetime")
|
.HasColumnType("datetime")
|
||||||
.HasColumnName("entrydate");
|
.HasColumnName("entrydate");
|
||||||
entity.Property(e => e.Exchangerate)
|
entity.Property(e => e.Exchangerate)
|
||||||
.HasDefaultValue(1.0)
|
.HasDefaultValue(1m)
|
||||||
.HasComment("Tipo de cambio aplicado respecto a ARS")
|
.HasComment("Tasa de conversión de la moneda a ARS")
|
||||||
|
.HasColumnType("decimal(10, 4)")
|
||||||
.HasColumnName("exchangerate");
|
.HasColumnName("exchangerate");
|
||||||
|
entity.Property(e => e.Expiration)
|
||||||
|
.HasComment("Fecha de vencimiento del producto ingresado (si aplica)")
|
||||||
|
.HasColumnName("expiration");
|
||||||
|
entity.Property(e => e.LocationId)
|
||||||
|
.HasComment("Ubicación física donde se depositó el producto")
|
||||||
|
.HasColumnName("location_id");
|
||||||
entity.Property(e => e.ProductId)
|
entity.Property(e => e.ProductId)
|
||||||
.HasComment("Referencia al producto ingresado")
|
.HasComment("Producto ingresado al stock")
|
||||||
.HasColumnName("product_id");
|
.HasColumnName("product_id");
|
||||||
entity.Property(e => e.Quantity)
|
entity.Property(e => e.Quantity)
|
||||||
.HasComment("Cantidad ingresada en la unidad correspondiente del producto")
|
.HasComment("Cantidad ingresada del producto")
|
||||||
|
.HasColumnType("decimal(18, 4)")
|
||||||
.HasColumnName("quantity");
|
.HasColumnName("quantity");
|
||||||
entity.Property(e => e.Reference)
|
entity.Property(e => e.Reference)
|
||||||
.HasMaxLength(100)
|
.HasMaxLength(100)
|
||||||
.HasComment("Referencia externa: número de remito, factura o documento de ingreso")
|
.HasComment("Referencia visible del movimiento (ej: factura, orden de compra)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
.HasColumnName("reference");
|
.HasColumnName("reference");
|
||||||
entity.Property(e => e.SourceId)
|
entity.Property(e => e.SourceId)
|
||||||
.HasComment("Identificador interno del documento de origen (opcional)")
|
.HasComment("ID de la entidad que generó el ingreso (ej: orden de compra)")
|
||||||
.HasColumnName("source_id");
|
.HasColumnName("source_id");
|
||||||
entity.Property(e => e.Sourcetype)
|
entity.Property(e => e.Sourcetype)
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.HasComment("Tipo de origen del ingreso (ej: compra, devolución, ajuste)")
|
.HasComment("Tipo de origen del ingreso (purchase, return, manual, etc.)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
.HasColumnName("sourcetype");
|
.HasColumnName("sourcetype");
|
||||||
entity.Property(e => e.Unitprice)
|
entity.Property(e => e.Unitprice)
|
||||||
.HasComment("Precio unitario del producto en la moneda indicada")
|
.HasComment("Precio unitario usado para valorizar el ingreso")
|
||||||
|
.HasColumnType("decimal(18, 4)")
|
||||||
.HasColumnName("unitprice");
|
.HasColumnName("unitprice");
|
||||||
|
|
||||||
entity.HasOne(d => d.Product).WithMany(p => p.PhLsmStockEntries)
|
entity.HasOne(d => d.Product).WithMany(p => p.PhLsmStockEntries)
|
||||||
.HasForeignKey(d => d.ProductId)
|
.HasForeignKey(d => d.ProductId)
|
||||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
.HasConstraintName("FK__PhLSM_Sto__produ__40257DE4");
|
.HasConstraintName("FK_PhLSM_StockEntry_PhLSM_Product");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<PhLsmStockItem>(entity =>
|
modelBuilder.Entity<PhLsmStockItem>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.Id).HasName("PK__PhLSM_St__3213E83F7C7F442D");
|
entity.HasKey(e => e.Id).HasName("PK__PhLSM_St__3213E83FB413CCCD");
|
||||||
|
|
||||||
entity.ToTable("PhLSM_StockItem");
|
entity.ToTable("PhLSM_StockItem");
|
||||||
|
|
||||||
|
entity.HasIndex(e => new { e.ProductId, e.LocationId, e.Batch, e.Expiration }, "IX_PhLSM_StockItem_UniqueTraceability").IsUnique();
|
||||||
|
|
||||||
entity.Property(e => e.Id)
|
entity.Property(e => e.Id)
|
||||||
.HasComment("Identificador único del ítem de stock físico")
|
.HasComment("Identificador único del ítem de stock físico")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
entity.Property(e => e.Batch)
|
entity.Property(e => e.Batch)
|
||||||
.HasMaxLength(100)
|
.HasMaxLength(100)
|
||||||
.HasComment("Código de lote (si aplica)")
|
.HasComment("Código de lote (si aplica)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
.HasColumnName("batch");
|
.HasColumnName("batch");
|
||||||
|
entity.Property(e => e.Createdat)
|
||||||
|
.HasDefaultValueSql("(getdate())")
|
||||||
|
.HasComment("Fecha de creación del registro")
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("createdat");
|
||||||
entity.Property(e => e.Description)
|
entity.Property(e => e.Description)
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(255)
|
||||||
.HasComment("Comentario libre u observación sobre este ítem de stock")
|
.HasComment("Comentario libre u observación sobre este ítem de stock")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
.HasColumnName("description");
|
.HasColumnName("description");
|
||||||
entity.Property(e => e.Expiration)
|
entity.Property(e => e.Expiration)
|
||||||
.HasComment("Fecha de vencimiento (si aplica)")
|
.HasComment("Fecha de vencimiento (si aplica)")
|
||||||
@ -250,12 +485,21 @@ public partial class PhronCareOperationsHubContext : DbContext
|
|||||||
entity.Property(e => e.LocationId)
|
entity.Property(e => e.LocationId)
|
||||||
.HasComment("Ubicación física del stock (depósito, valija, etc.)")
|
.HasComment("Ubicación física del stock (depósito, valija, etc.)")
|
||||||
.HasColumnName("location_id");
|
.HasColumnName("location_id");
|
||||||
|
entity.Property(e => e.Modifiedat)
|
||||||
|
.HasComment("Fecha de última modificación del registro")
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("modifiedat");
|
||||||
entity.Property(e => e.ProductId)
|
entity.Property(e => e.ProductId)
|
||||||
.HasComment("Producto vinculado al ítem de stock")
|
.HasComment("Producto vinculado al ítem de stock")
|
||||||
.HasColumnName("product_id");
|
.HasColumnName("product_id");
|
||||||
entity.Property(e => e.Quantity)
|
entity.Property(e => e.Quantity)
|
||||||
.HasComment("Cantidad actual disponible en esta unidad de stock")
|
.HasComment("Cantidad actual disponible en esta unidad de stock")
|
||||||
|
.HasColumnType("decimal(18, 4)")
|
||||||
.HasColumnName("quantity");
|
.HasColumnName("quantity");
|
||||||
|
entity.Property(e => e.ReservedQuantity)
|
||||||
|
.HasComment("Cantidad comprometida o reservada para expediciones futuras")
|
||||||
|
.HasColumnType("decimal(18, 4)")
|
||||||
|
.HasColumnName("reserved_quantity");
|
||||||
entity.Property(e => e.Status)
|
entity.Property(e => e.Status)
|
||||||
.HasComment("Estado del ítem (1=Disponible, 2=Reservado, 3=Vencido, etc.)")
|
.HasComment("Estado del ítem (1=Disponible, 2=Reservado, 3=Vencido, etc.)")
|
||||||
.HasColumnName("status");
|
.HasColumnName("status");
|
||||||
@ -263,12 +507,12 @@ public partial class PhronCareOperationsHubContext : DbContext
|
|||||||
entity.HasOne(d => d.Location).WithMany(p => p.PhLsmStockItems)
|
entity.HasOne(d => d.Location).WithMany(p => p.PhLsmStockItems)
|
||||||
.HasForeignKey(d => d.LocationId)
|
.HasForeignKey(d => d.LocationId)
|
||||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
.HasConstraintName("FK__PhLSM_Sto__locat__3C54ED00");
|
.HasConstraintName("FK_PhLSM_StockItem_PhLSM_StockLocation");
|
||||||
|
|
||||||
entity.HasOne(d => d.Product).WithMany(p => p.PhLsmStockItems)
|
entity.HasOne(d => d.Product).WithMany(p => p.PhLsmStockItems)
|
||||||
.HasForeignKey(d => d.ProductId)
|
.HasForeignKey(d => d.ProductId)
|
||||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
.HasConstraintName("FK__PhLSM_Sto__produ__3B60C8C7");
|
.HasConstraintName("FK_PhLSM_StockItem_PhLSM_Product");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<PhLsmStockLocation>(entity =>
|
modelBuilder.Entity<PhLsmStockLocation>(entity =>
|
||||||
@ -292,21 +536,39 @@ public partial class PhronCareOperationsHubContext : DbContext
|
|||||||
|
|
||||||
modelBuilder.Entity<PhLsmStockOut>(entity =>
|
modelBuilder.Entity<PhLsmStockOut>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.Id).HasName("PK__PhLSM_St__3213E83F96B2D858");
|
entity.HasKey(e => e.Id).HasName("PK__PhLSM_St__3213E83F1399BE0F");
|
||||||
|
|
||||||
entity.ToTable("PhLSM_StockOut");
|
entity.ToTable("PhLSM_StockOut");
|
||||||
|
|
||||||
entity.Property(e => e.Id)
|
entity.Property(e => e.Id)
|
||||||
.HasComment("Identificador único del egreso de stock")
|
.HasComment("Identificador único del egreso de stock")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
entity.Property(e => e.Batch)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasComment("Lote del producto egresado (si aplica trazabilidad)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
|
.HasColumnName("batch");
|
||||||
|
entity.Property(e => e.Createdat)
|
||||||
|
.HasDefaultValueSql("(getdate())")
|
||||||
|
.HasComment("Fecha de creación del registro")
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("createdat");
|
||||||
entity.Property(e => e.Currency)
|
entity.Property(e => e.Currency)
|
||||||
.HasMaxLength(3)
|
.HasMaxLength(3)
|
||||||
.HasComment("Moneda utilizada en la valorización (ars, usd, eur)")
|
.HasComment("Moneda utilizada en la valorización (ARS, USD, EUR)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
.HasColumnName("currency");
|
.HasColumnName("currency");
|
||||||
entity.Property(e => e.Exchangerate)
|
entity.Property(e => e.Exchangerate)
|
||||||
.HasDefaultValue(1.0)
|
.HasDefaultValue(1m)
|
||||||
.HasComment("Tasa de conversión de la moneda a ARS")
|
.HasComment("Tasa de conversión de la moneda a ARS")
|
||||||
|
.HasColumnType("decimal(10, 4)")
|
||||||
.HasColumnName("exchangerate");
|
.HasColumnName("exchangerate");
|
||||||
|
entity.Property(e => e.Expiration)
|
||||||
|
.HasComment("Fecha de vencimiento del producto egresado (si aplica)")
|
||||||
|
.HasColumnName("expiration");
|
||||||
|
entity.Property(e => e.LocationId)
|
||||||
|
.HasComment("Ubicación física desde donde se retiró el producto")
|
||||||
|
.HasColumnName("location_id");
|
||||||
entity.Property(e => e.Outdate)
|
entity.Property(e => e.Outdate)
|
||||||
.HasComment("Fecha del egreso de stock")
|
.HasComment("Fecha del egreso de stock")
|
||||||
.HasColumnType("datetime")
|
.HasColumnType("datetime")
|
||||||
@ -316,10 +578,12 @@ public partial class PhronCareOperationsHubContext : DbContext
|
|||||||
.HasColumnName("product_id");
|
.HasColumnName("product_id");
|
||||||
entity.Property(e => e.Quantity)
|
entity.Property(e => e.Quantity)
|
||||||
.HasComment("Cantidad retirada del producto")
|
.HasComment("Cantidad retirada del producto")
|
||||||
|
.HasColumnType("decimal(18, 4)")
|
||||||
.HasColumnName("quantity");
|
.HasColumnName("quantity");
|
||||||
entity.Property(e => e.Reference)
|
entity.Property(e => e.Reference)
|
||||||
.HasMaxLength(100)
|
.HasMaxLength(100)
|
||||||
.HasComment("Referencia visible del movimiento (NE, devolución, cirugía)")
|
.HasComment("Referencia visible del movimiento (NE, devolución, cirugía)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
.HasColumnName("reference");
|
.HasColumnName("reference");
|
||||||
entity.Property(e => e.SourceId)
|
entity.Property(e => e.SourceId)
|
||||||
.HasComment("ID de la entidad que generó el egreso (ej: nota de expedición)")
|
.HasComment("ID de la entidad que generó el egreso (ej: nota de expedición)")
|
||||||
@ -327,15 +591,20 @@ public partial class PhronCareOperationsHubContext : DbContext
|
|||||||
entity.Property(e => e.Sourcetype)
|
entity.Property(e => e.Sourcetype)
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.HasComment("Tipo de origen del egreso (surgery, expiration, manual, etc.)")
|
.HasComment("Tipo de origen del egreso (surgery, expiration, manual, etc.)")
|
||||||
|
.UseCollation("Latin1_General_CI_AS")
|
||||||
.HasColumnName("sourcetype");
|
.HasColumnName("sourcetype");
|
||||||
|
entity.Property(e => e.TicketId)
|
||||||
|
.HasComment("Identificador del caso quirúrgico asociado al egreso")
|
||||||
|
.HasColumnName("ticket_id");
|
||||||
entity.Property(e => e.Unitprice)
|
entity.Property(e => e.Unitprice)
|
||||||
.HasComment("Precio unitario usado para valorizar el egreso")
|
.HasComment("Precio unitario usado para valorizar el egreso")
|
||||||
|
.HasColumnType("decimal(18, 4)")
|
||||||
.HasColumnName("unitprice");
|
.HasColumnName("unitprice");
|
||||||
|
|
||||||
entity.HasOne(d => d.Product).WithMany(p => p.PhLsmStockOuts)
|
entity.HasOne(d => d.Product).WithMany(p => p.PhLsmStockOuts)
|
||||||
.HasForeignKey(d => d.ProductId)
|
.HasForeignKey(d => d.ProductId)
|
||||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
.HasConstraintName("FK__PhLSM_Sto__produ__43F60EC8");
|
.HasConstraintName("FK_PhLSM_StockOut_PhLSM_Product");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<PhLsmUnitOfMeasure>(entity =>
|
modelBuilder.Entity<PhLsmUnitOfMeasure>(entity =>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user