Upgrade de DbContext y Patch Customers
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 4m17s
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 4m17s
This commit is contained in:
parent
f4d6bd9e28
commit
9940189a93
@ -7,7 +7,7 @@
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\maski\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.1</NuGetToolVersion>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.2</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\maski\.nuget\packages\" />
|
||||
|
||||
20
Models/Models/PhOhArcadocumentType.cs
Normal file
20
Models/Models/PhOhArcadocumentType.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Models.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Catálogo oficial de tipos de comprobantes AFIP.
|
||||
/// </summary>
|
||||
public partial class PhOhArcadocumentType
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Code { get; set; } = null!;
|
||||
|
||||
public string Description { get; set; } = null!;
|
||||
|
||||
public string? Letter { get; set; }
|
||||
|
||||
public bool Isactive { get; set; }
|
||||
}
|
||||
@ -14,6 +14,4 @@ public partial class PhSBusinessUnit
|
||||
public string? Manager { get; set; }
|
||||
|
||||
public virtual ICollection<PhSProduct> PhSProducts { get; set; } = new List<PhSProduct>();
|
||||
|
||||
public virtual ICollection<PhSQuoteHeader> PhSQuoteHeaders { get; set; } = new List<PhSQuoteHeader>();
|
||||
}
|
||||
|
||||
@ -31,7 +31,5 @@ public partial class PhSCustomer
|
||||
|
||||
public virtual ICollection<PhSPatient> PhSPatients { get; set; } = new List<PhSPatient>();
|
||||
|
||||
public virtual ICollection<PhSQuoteHeader> PhSQuoteHeaders { get; set; } = new List<PhSQuoteHeader>();
|
||||
|
||||
public virtual PhOhTaxCondition? TaxCondition { get; set; }
|
||||
}
|
||||
|
||||
47
Models/Models/PhSFormSeries.cs
Normal file
47
Models/Models/PhSFormSeries.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Models.Models;
|
||||
|
||||
/// <summary>
|
||||
/// FormSeries: talonarios/series por tipo de formulario, letra y punto de venta.
|
||||
/// </summary>
|
||||
public partial class PhSFormSeries
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// FK a tipo de formulario (PhS_FormTypes).
|
||||
/// </summary>
|
||||
public int FormtypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punto de venta asignado.
|
||||
/// </summary>
|
||||
public short Pointofsale { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Letra de serie (A,B,C...).
|
||||
/// </summary>
|
||||
public string Letter { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Marca esta serie como predeterminada.
|
||||
/// </summary>
|
||||
public bool Isdefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indica si está habilitada.
|
||||
/// </summary>
|
||||
public bool Isactive { get; set; }
|
||||
|
||||
public DateTime Createdat { get; set; }
|
||||
|
||||
public DateTime? Modifiedat { get; set; }
|
||||
|
||||
public string NumberingSource { get; set; } = null!;
|
||||
|
||||
public virtual PhSFormType Formtype { get; set; } = null!;
|
||||
|
||||
public virtual PhSFormSeriesNextNumber? PhSFormSeriesNextNumber { get; set; }
|
||||
}
|
||||
24
Models/Models/PhSFormSeriesNextNumber.cs
Normal file
24
Models/Models/PhSFormSeriesNextNumber.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Models.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Mantiene el siguiente número correlativo para cada FormSeries.
|
||||
/// </summary>
|
||||
public partial class PhSFormSeriesNextNumber
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// FK a PhS_FormSeries.
|
||||
/// </summary>
|
||||
public int FormseriesId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Próximo número correlativo.
|
||||
/// </summary>
|
||||
public int Nextnumber { get; set; }
|
||||
|
||||
public virtual PhSFormSeries Formseries { get; set; } = null!;
|
||||
}
|
||||
18
Models/Models/PhSFormType.cs
Normal file
18
Models/Models/PhSFormType.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Models.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Tipos genéricos de formularios del sistema (presupuesto, factura, recibo, etc.)
|
||||
/// </summary>
|
||||
public partial class PhSFormType
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Code { get; set; } = null!;
|
||||
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<PhSFormSeries> PhSFormSeries { get; set; } = new List<PhSFormSeries>();
|
||||
}
|
||||
@ -26,6 +26,4 @@ public partial class PhSProduct
|
||||
public virtual PhSBusinessUnit? Businessunits { get; set; }
|
||||
|
||||
public virtual PhSProductCategory? Category { get; set; }
|
||||
|
||||
public virtual ICollection<PhSQuoteDetail> PhSQuoteDetails { get; set; } = new List<PhSQuoteDetail>();
|
||||
}
|
||||
|
||||
@ -3,15 +3,60 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Models.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Tabla de detalles de presupuestos
|
||||
/// </summary>
|
||||
public partial class PhSQuoteDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// ID interno
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
public int? QuoteheadersId { get; set; }
|
||||
/// <summary>
|
||||
/// FK a encabezado de presupuesto
|
||||
/// </summary>
|
||||
public int QuoteheaderId { get; set; }
|
||||
|
||||
public int? ProductsId { get; set; }
|
||||
/// <summary>
|
||||
/// ID del producto original
|
||||
/// </summary>
|
||||
public int ProductId { get; set; }
|
||||
|
||||
public virtual PhSProduct? Products { get; set; }
|
||||
/// <summary>
|
||||
/// Descripción modificable del producto (puede diferir del original)
|
||||
/// </summary>
|
||||
public string? ProductDescription { get; set; }
|
||||
|
||||
public virtual PhSQuoteHeader? Quoteheaders { get; set; }
|
||||
/// <summary>
|
||||
/// Cantidad
|
||||
/// </summary>
|
||||
public int Quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Precio unitario original
|
||||
/// </summary>
|
||||
public decimal Unitprice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ¿Aprobado? (0=No, 1=Si)
|
||||
/// </summary>
|
||||
public bool Approved { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Importe aprobado final
|
||||
/// </summary>
|
||||
public decimal? Approvedamount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fecha de creación del registro
|
||||
/// </summary>
|
||||
public DateTime Createdat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fecha de última modificación
|
||||
/// </summary>
|
||||
public DateTime? Modifiedat { get; set; }
|
||||
|
||||
public virtual PhSQuoteHeader Quoteheader { get; set; } = null!;
|
||||
}
|
||||
|
||||
@ -3,19 +3,87 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Models.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Tabla de cabeceras de presupuestos
|
||||
/// </summary>
|
||||
public partial class PhSQuoteHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// ID interno
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
public string? TicketId { get; set; }
|
||||
/// <summary>
|
||||
/// Relación con Tickets
|
||||
/// </summary>
|
||||
public Guid TicketId { get; set; }
|
||||
|
||||
public int? BusinessunitsId { get; set; }
|
||||
/// <summary>
|
||||
/// Cliente asociado
|
||||
/// </summary>
|
||||
public int CustomerId { get; set; }
|
||||
|
||||
public int? CustomersId { get; set; }
|
||||
/// <summary>
|
||||
/// Unidad de negocio
|
||||
/// </summary>
|
||||
public int BusinessunitId { get; set; }
|
||||
|
||||
public virtual PhSBusinessUnit? Businessunits { get; set; }
|
||||
/// <summary>
|
||||
/// Estado: E (Emitido), A (Aprobado), AC (Aprobado para cirugia), etc.
|
||||
/// </summary>
|
||||
public string Status { get; set; } = null!;
|
||||
|
||||
public virtual PhSCustomer? Customers { get; set; }
|
||||
/// <summary>
|
||||
/// Fecha de emisión
|
||||
/// </summary>
|
||||
public DateTime Issuedate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fecha de aprobación
|
||||
/// </summary>
|
||||
public DateOnly? Approvaldate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fecha tentativa (de cirugía por ej.)
|
||||
/// </summary>
|
||||
public DateTime? Estimateddate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Importe estimado total
|
||||
/// </summary>
|
||||
public decimal? Estimatedamount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Importe aprobado
|
||||
/// </summary>
|
||||
public decimal? Approvedamount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Número visible del presupuesto
|
||||
/// </summary>
|
||||
public string Quotenumber { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Cantidad de impresiones
|
||||
/// </summary>
|
||||
public int Printcount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Observaciones internas
|
||||
/// </summary>
|
||||
public string? Observations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fecha de creación
|
||||
/// </summary>
|
||||
public DateTime Createdat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fecha de modificación
|
||||
/// </summary>
|
||||
public DateTime? Modifiedat { get; set; }
|
||||
|
||||
public virtual ICollection<PhSQuoteDetail> PhSQuoteDetails { get; set; } = new List<PhSQuoteDetail>();
|
||||
|
||||
public virtual ICollection<PhSQuoteRole> PhSQuoteRoles { get; set; } = new List<PhSQuoteRole>();
|
||||
}
|
||||
|
||||
37
Models/Models/PhSQuoteRole.cs
Normal file
37
Models/Models/PhSQuoteRole.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Models.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Tabla de roles asociados a presupuestos
|
||||
/// </summary>
|
||||
public partial class PhSQuoteRole
|
||||
{
|
||||
/// <summary>
|
||||
/// ID interno
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// FK a encabezado de presupuesto (PhS_QuoteHeaders)
|
||||
/// </summary>
|
||||
public int QuoteheaderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Tipo de entidad asociada (Ej: PhS_Professionals, PhS_Institutions, PhS_Patients)
|
||||
/// </summary>
|
||||
public string Entitytype { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// ID de la entidad asociada
|
||||
/// </summary>
|
||||
public int EntityId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rol que cumple la entidad en el presupuesto (Ej: Medico, Hospital, Paciente)
|
||||
/// </summary>
|
||||
public string Role { get; set; } = null!;
|
||||
|
||||
public virtual PhSQuoteHeader Quoteheader { get; set; } = null!;
|
||||
}
|
||||
@ -15,6 +15,8 @@ public partial class PhronCareOperationsHubContext : DbContext
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<PhOhArcadocumentType> PhOhArcadocumentTypes { get; set; }
|
||||
|
||||
public virtual DbSet<PhOhTaxCondition> PhOhTaxConditions { get; set; }
|
||||
|
||||
public virtual DbSet<PhOhTicket> PhOhTickets { get; set; }
|
||||
@ -31,6 +33,12 @@ public partial class PhronCareOperationsHubContext : DbContext
|
||||
|
||||
public virtual DbSet<PhSDocumentType> PhSDocumentTypes { get; set; }
|
||||
|
||||
public virtual DbSet<PhSFormSeries> PhSFormSeries { get; set; }
|
||||
|
||||
public virtual DbSet<PhSFormSeriesNextNumber> PhSFormSeriesNextNumbers { get; set; }
|
||||
|
||||
public virtual DbSet<PhSFormType> PhSFormTypes { get; set; }
|
||||
|
||||
public virtual DbSet<PhSInstitution> PhSInstitutions { get; set; }
|
||||
|
||||
public virtual DbSet<PhSPatient> PhSPatients { get; set; }
|
||||
@ -47,6 +55,8 @@ public partial class PhronCareOperationsHubContext : DbContext
|
||||
|
||||
public virtual DbSet<PhSQuoteHeader> PhSQuoteHeaders { get; set; }
|
||||
|
||||
public virtual DbSet<PhSQuoteRole> PhSQuoteRoles { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
#region VERSION DOCKER
|
||||
{
|
||||
@ -56,12 +66,39 @@ public partial class PhronCareOperationsHubContext : DbContext
|
||||
}
|
||||
}
|
||||
#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");
|
||||
//=> 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)
|
||||
{
|
||||
modelBuilder.UseCollation("Modern_Spanish_CI_AS");
|
||||
|
||||
modelBuilder.Entity<PhOhArcadocumentType>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PK__PhOH_ARC__3213E83FF8940395");
|
||||
|
||||
entity.ToTable("PhOH_ARCADocumentTypes", tb => tb.HasComment("Catálogo oficial de tipos de comprobantes AFIP."));
|
||||
|
||||
entity.Property(e => e.Id)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("id");
|
||||
entity.Property(e => e.Code)
|
||||
.HasMaxLength(3)
|
||||
.IsUnicode(false)
|
||||
.IsFixedLength()
|
||||
.HasColumnName("code");
|
||||
entity.Property(e => e.Description)
|
||||
.HasMaxLength(255)
|
||||
.HasColumnName("description");
|
||||
entity.Property(e => e.Isactive)
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("isactive");
|
||||
entity.Property(e => e.Letter)
|
||||
.HasMaxLength(1)
|
||||
.IsUnicode(false)
|
||||
.IsFixedLength()
|
||||
.HasColumnName("letter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<PhOhTaxCondition>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PK__PhOH_Tax__3213E83F26F7EAEF");
|
||||
@ -267,6 +304,91 @@ public partial class PhronCareOperationsHubContext : DbContext
|
||||
.HasColumnName("name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<PhSFormSeries>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PK__PhS_Form__3213E83F7D86A419");
|
||||
|
||||
entity.ToTable("PhS_FormSeries", tb => tb.HasComment("FormSeries: talonarios/series por tipo de formulario, letra y punto de venta."));
|
||||
|
||||
entity.HasIndex(e => e.FormtypeId, "IX_PhS_FormSeries_FormType");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
entity.Property(e => e.Createdat)
|
||||
.HasDefaultValueSql("(getdate())")
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("createdat");
|
||||
entity.Property(e => e.FormtypeId)
|
||||
.HasComment("FK a tipo de formulario (PhS_FormTypes).")
|
||||
.HasColumnName("formtype_id");
|
||||
entity.Property(e => e.Isactive)
|
||||
.HasDefaultValue(true)
|
||||
.HasComment("Indica si está habilitada.")
|
||||
.HasColumnName("isactive");
|
||||
entity.Property(e => e.Isdefault)
|
||||
.HasComment("Marca esta serie como predeterminada.")
|
||||
.HasColumnName("isdefault");
|
||||
entity.Property(e => e.Letter)
|
||||
.HasMaxLength(1)
|
||||
.IsUnicode(false)
|
||||
.IsFixedLength()
|
||||
.HasComment("Letra de serie (A,B,C...).")
|
||||
.HasColumnName("letter");
|
||||
entity.Property(e => e.Modifiedat)
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("modifiedat");
|
||||
entity.Property(e => e.NumberingSource)
|
||||
.HasMaxLength(20)
|
||||
.IsUnicode(false)
|
||||
.HasDefaultValue("INTERNAL")
|
||||
.HasColumnName("numbering_source");
|
||||
entity.Property(e => e.Pointofsale)
|
||||
.HasComment("Punto de venta asignado.")
|
||||
.HasColumnName("pointofsale");
|
||||
|
||||
entity.HasOne(d => d.Formtype).WithMany(p => p.PhSFormSeries)
|
||||
.HasForeignKey(d => d.FormtypeId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("FK_PhS_FormSeries_FormTypes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<PhSFormSeriesNextNumber>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PK__PhS_Form__3213E83F60B7AAE4");
|
||||
|
||||
entity.ToTable("PhS_FormSeriesNextNumber", tb => tb.HasComment("Mantiene el siguiente número correlativo para cada FormSeries."));
|
||||
|
||||
entity.HasIndex(e => e.FormseriesId, "IX_PhS_NextNumber_FormSeriesId").IsUnique();
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
entity.Property(e => e.FormseriesId)
|
||||
.HasComment("FK a PhS_FormSeries.")
|
||||
.HasColumnName("formseries_id");
|
||||
entity.Property(e => e.Nextnumber)
|
||||
.HasComment("Próximo número correlativo.")
|
||||
.HasColumnName("nextnumber");
|
||||
|
||||
entity.HasOne(d => d.Formseries).WithOne(p => p.PhSFormSeriesNextNumber)
|
||||
.HasForeignKey<PhSFormSeriesNextNumber>(d => d.FormseriesId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("FK_PhS_NextNumber_FormSeries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<PhSFormType>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PK__PhS_Form__3213E83FF7278F22");
|
||||
|
||||
entity.ToTable("PhS_FormTypes", tb => tb.HasComment("Tipos genéricos de formularios del sistema (presupuesto, factura, recibo, etc.)"));
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
entity.Property(e => e.Code)
|
||||
.HasMaxLength(20)
|
||||
.IsUnicode(false)
|
||||
.HasColumnName("code");
|
||||
entity.Property(e => e.Name)
|
||||
.HasMaxLength(100)
|
||||
.HasColumnName("name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<PhSInstitution>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PK__PhS_Inst__3213E83F7645655B");
|
||||
@ -488,39 +610,156 @@ public partial class PhronCareOperationsHubContext : DbContext
|
||||
|
||||
modelBuilder.Entity<PhSQuoteDetail>(entity =>
|
||||
{
|
||||
entity.ToTable("PhS_QuoteDetails");
|
||||
entity.HasKey(e => e.Id).HasName("PK__PhS_Quot__3213E83F94207114");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
entity.Property(e => e.ProductsId).HasColumnName("products_id");
|
||||
entity.Property(e => e.QuoteheadersId).HasColumnName("quoteheaders_id");
|
||||
entity.ToTable("PhS_QuoteDetails", tb => tb.HasComment("Tabla de detalles de presupuestos"));
|
||||
|
||||
entity.HasOne(d => d.Products).WithMany(p => p.PhSQuoteDetails)
|
||||
.HasForeignKey(d => d.ProductsId)
|
||||
.HasConstraintName("FK_PhS_QuoteDetails_PhS_Products");
|
||||
entity.Property(e => e.Id)
|
||||
.HasComment("ID interno")
|
||||
.HasColumnName("id");
|
||||
entity.Property(e => e.Approved)
|
||||
.HasComment("¿Aprobado? (0=No, 1=Si)")
|
||||
.HasColumnName("approved");
|
||||
entity.Property(e => e.Approvedamount)
|
||||
.HasComment("Importe aprobado final")
|
||||
.HasColumnType("decimal(18, 2)")
|
||||
.HasColumnName("approvedamount");
|
||||
entity.Property(e => e.Createdat)
|
||||
.HasDefaultValueSql("(getdate())")
|
||||
.HasComment("Fecha de creación del registro")
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("createdat");
|
||||
entity.Property(e => e.Modifiedat)
|
||||
.HasComment("Fecha de última modificación")
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("modifiedat");
|
||||
entity.Property(e => e.ProductDescription)
|
||||
.HasComment("Descripción modificable del producto (puede diferir del original)")
|
||||
.HasColumnName("product_description");
|
||||
entity.Property(e => e.ProductId)
|
||||
.HasComment("ID del producto original")
|
||||
.HasColumnName("product_id");
|
||||
entity.Property(e => e.Quantity)
|
||||
.HasDefaultValue(1)
|
||||
.HasComment("Cantidad")
|
||||
.HasColumnName("quantity");
|
||||
entity.Property(e => e.QuoteheaderId)
|
||||
.HasComment("FK a encabezado de presupuesto")
|
||||
.HasColumnName("quoteheader_id");
|
||||
entity.Property(e => e.Unitprice)
|
||||
.HasComment("Precio unitario original")
|
||||
.HasColumnType("decimal(18, 2)")
|
||||
.HasColumnName("unitprice");
|
||||
|
||||
entity.HasOne(d => d.Quoteheaders).WithMany(p => p.PhSQuoteDetails)
|
||||
.HasForeignKey(d => d.QuoteheadersId)
|
||||
.HasConstraintName("FK_PhS_QuoteDetails_PhS_QuoteHeaders");
|
||||
entity.HasOne(d => d.Quoteheader).WithMany(p => p.PhSQuoteDetails)
|
||||
.HasForeignKey(d => d.QuoteheaderId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("FK_QuoteDetails_Header");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<PhSQuoteHeader>(entity =>
|
||||
{
|
||||
entity.ToTable("PhS_QuoteHeaders");
|
||||
entity.HasKey(e => e.Id).HasName("PK__PhS_Quot__3213E83FA0B43134");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
entity.Property(e => e.BusinessunitsId).HasColumnName("businessunits_id");
|
||||
entity.Property(e => e.CustomersId).HasColumnName("customers_id");
|
||||
entity.ToTable("PhS_QuoteHeaders", tb => tb.HasComment("Tabla de cabeceras de presupuestos"));
|
||||
|
||||
entity.Property(e => e.Id)
|
||||
.HasComment("ID interno")
|
||||
.HasColumnName("id");
|
||||
entity.Property(e => e.Approvaldate)
|
||||
.HasComment("Fecha de aprobación")
|
||||
.HasColumnName("approvaldate");
|
||||
entity.Property(e => e.Approvedamount)
|
||||
.HasComment("Importe aprobado")
|
||||
.HasColumnType("decimal(18, 2)")
|
||||
.HasColumnName("approvedamount");
|
||||
entity.Property(e => e.BusinessunitId)
|
||||
.HasComment("Unidad de negocio")
|
||||
.HasColumnName("businessunit_id");
|
||||
entity.Property(e => e.Createdat)
|
||||
.HasDefaultValueSql("(getdate())")
|
||||
.HasComment("Fecha de creación")
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("createdat");
|
||||
entity.Property(e => e.CustomerId)
|
||||
.HasComment("Cliente asociado")
|
||||
.HasColumnName("customer_id");
|
||||
entity.Property(e => e.Estimatedamount)
|
||||
.HasComment("Importe estimado total")
|
||||
.HasColumnType("decimal(18, 2)")
|
||||
.HasColumnName("estimatedamount");
|
||||
entity.Property(e => e.Estimateddate)
|
||||
.HasComment("Fecha tentativa (de cirugía por ej.)")
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("estimateddate");
|
||||
entity.Property(e => e.Issuedate)
|
||||
.HasDefaultValueSql("(getdate())")
|
||||
.HasComment("Fecha de emisión")
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("issuedate");
|
||||
entity.Property(e => e.Modifiedat)
|
||||
.HasComment("Fecha de modificación")
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("modifiedat");
|
||||
entity.Property(e => e.Observations)
|
||||
.HasComment("Observaciones internas")
|
||||
.HasColumnName("observations");
|
||||
entity.Property(e => e.Printcount)
|
||||
.HasComment("Cantidad de impresiones")
|
||||
.HasColumnName("printcount");
|
||||
entity.Property(e => e.Quotenumber)
|
||||
.HasMaxLength(20)
|
||||
.IsUnicode(false)
|
||||
.HasComment("Número visible del presupuesto")
|
||||
.HasColumnName("quotenumber");
|
||||
entity.Property(e => e.Status)
|
||||
.HasMaxLength(2)
|
||||
.IsUnicode(false)
|
||||
.HasDefaultValue("E")
|
||||
.IsFixedLength()
|
||||
.HasComment("Estado: E (Emitido), A (Aprobado), AC (Aprobado para cirugia), etc.")
|
||||
.HasColumnName("status");
|
||||
entity.Property(e => e.TicketId)
|
||||
.HasMaxLength(50)
|
||||
.HasComment("Relación con Tickets")
|
||||
.HasColumnName("ticket_id");
|
||||
});
|
||||
|
||||
entity.HasOne(d => d.Businessunits).WithMany(p => p.PhSQuoteHeaders)
|
||||
.HasForeignKey(d => d.BusinessunitsId)
|
||||
.HasConstraintName("FK_PhS_QuoteHeaders_PhS_BusinessUnits");
|
||||
modelBuilder.Entity<PhSQuoteRole>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PK__PhS_Quot__3213E83F7BBCA6FF");
|
||||
|
||||
entity.HasOne(d => d.Customers).WithMany(p => p.PhSQuoteHeaders)
|
||||
.HasForeignKey(d => d.CustomersId)
|
||||
.HasConstraintName("FK_PhS_QuoteHeaders_PhS_Customers");
|
||||
entity.ToTable("PhS_QuoteRoles", tb => tb.HasComment("Tabla de roles asociados a presupuestos"));
|
||||
|
||||
entity.HasIndex(e => new { e.Entitytype, e.EntityId }, "IX_QuoteRoles_Entity");
|
||||
|
||||
entity.HasIndex(e => e.QuoteheaderId, "IX_QuoteRoles_HeaderId");
|
||||
|
||||
entity.HasIndex(e => e.Role, "IX_QuoteRoles_Role");
|
||||
|
||||
entity.Property(e => e.Id)
|
||||
.HasComment("ID interno")
|
||||
.HasColumnName("id");
|
||||
entity.Property(e => e.EntityId)
|
||||
.HasComment("ID de la entidad asociada")
|
||||
.HasColumnName("entity_id");
|
||||
entity.Property(e => e.Entitytype)
|
||||
.HasMaxLength(50)
|
||||
.IsUnicode(false)
|
||||
.HasComment("Tipo de entidad asociada (Ej: PhS_Professionals, PhS_Institutions, PhS_Patients)")
|
||||
.HasColumnName("entitytype");
|
||||
entity.Property(e => e.QuoteheaderId)
|
||||
.HasComment("FK a encabezado de presupuesto (PhS_QuoteHeaders)")
|
||||
.HasColumnName("quoteheader_id");
|
||||
entity.Property(e => e.Role)
|
||||
.HasMaxLength(50)
|
||||
.IsUnicode(false)
|
||||
.HasComment("Rol que cumple la entidad en el presupuesto (Ej: Medico, Hospital, Paciente)")
|
||||
.HasColumnName("role");
|
||||
|
||||
entity.HasOne(d => d.Quoteheader).WithMany(p => p.PhSQuoteRoles)
|
||||
.HasForeignKey(d => d.QuoteheaderId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("FK_QuoteRoles_Header");
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
|
||||
@ -38,7 +38,6 @@ namespace Models.Repositories
|
||||
.Include(c => c.Accounttypes)
|
||||
.Include(c => c.PhSCustomerAddresses)
|
||||
.Include(c => c.PhSCustomerDocuments)
|
||||
.Include(c => c.PhSQuoteHeaders)
|
||||
.FirstOrDefaultAsync(c => c.Id == id);
|
||||
|
||||
return customer != null ? EntityMapper.MapEntity<PhSCustomer, ECustomer>(customer) : null;
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\maski\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.1</NuGetToolVersion>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.2</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\maski\.nuget\packages\" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user