diff --git a/Domain/Entities/EBusinessUnit.cs b/Domain/Entities/EBusinessUnit.cs new file mode 100644 index 0000000..5a71a76 --- /dev/null +++ b/Domain/Entities/EBusinessUnit.cs @@ -0,0 +1,15 @@ +namespace Domain.Entities +{ + public class EBusinessUnit + { + public int Id { get; set; } + + public string? Code { get; set; } + + public string? Description { get; set; } + + public string? Manager { get; set; } + + } + +} diff --git a/Domain/Entities/EProduct.cs b/Domain/Entities/EProduct.cs new file mode 100644 index 0000000..0a71a1b --- /dev/null +++ b/Domain/Entities/EProduct.cs @@ -0,0 +1,28 @@ +namespace Domain.Entities +{ + public class EProduct + { + public int Id { get; set; } + + public int? BusinessunitsId { get; set; } + + public string? Name { get; set; } + + public string Description { get; set; } = null!; + + public int? Categoryid { get; set; } + + public string? Origin { get; set; } + + public decimal Baseprice { get; set; } + + public string Currency { get; set; } = null!; + + public bool Isactive { get; set; } + + public virtual EBusinessUnit? Businessunits { get; set; } + + public virtual EProductCategory? Category { get; set; } + } + +} diff --git a/Domain/Entities/EProductCategory.cs b/Domain/Entities/EProductCategory.cs new file mode 100644 index 0000000..79b9a4b --- /dev/null +++ b/Domain/Entities/EProductCategory.cs @@ -0,0 +1,14 @@ +namespace Domain.Entities +{ + public class EProductCategory + { + public int Id { get; set; } + + public string Name { get; set; } = null!; + + public string? Description { get; set; } + + public bool Isactive { get; set; } + + } +} diff --git a/Domain/obj/Domain.csproj.nuget.g.props b/Domain/obj/Domain.csproj.nuget.g.props index 8b4eb7e..3efed38 100644 --- a/Domain/obj/Domain.csproj.nuget.g.props +++ b/Domain/obj/Domain.csproj.nuget.g.props @@ -7,7 +7,7 @@ $(UserProfile)\.nuget\packages\ C:\Users\maski\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages PackageReference - 6.13.2 + 6.13.1 diff --git a/Models/Models/PhOhTaxCondition.cs b/Models/Models/PhOhTaxCondition.cs index 3a3a328..a5674e6 100644 --- a/Models/Models/PhOhTaxCondition.cs +++ b/Models/Models/PhOhTaxCondition.cs @@ -10,4 +10,6 @@ public partial class PhOhTaxCondition public string Description { get; set; } = null!; public string CmpClase { get; set; } = null!; + + public virtual ICollection PhSCustomers { get; set; } = new List(); } diff --git a/Models/Models/PhSBusinessUnit.cs b/Models/Models/PhSBusinessUnit.cs index 942ba4b..64f5e0f 100644 --- a/Models/Models/PhSBusinessUnit.cs +++ b/Models/Models/PhSBusinessUnit.cs @@ -7,7 +7,7 @@ public partial class PhSBusinessUnit { public int Id { get; set; } - public string? Name { get; set; } + public string? Code { get; set; } public string? Description { get; set; } diff --git a/Models/Models/PhSCustomer.cs b/Models/Models/PhSCustomer.cs index 503ad27..7cd12cc 100644 --- a/Models/Models/PhSCustomer.cs +++ b/Models/Models/PhSCustomer.cs @@ -30,4 +30,6 @@ public partial class PhSCustomer public virtual ICollection PhSCustomerDocuments { get; set; } = new List(); public virtual ICollection PhSQuoteHeaders { get; set; } = new List(); + + public virtual PhOhTaxCondition? TaxCondition { get; set; } } diff --git a/Models/Models/PhSProduct.cs b/Models/Models/PhSProduct.cs index 9d795c0..68dd941 100644 --- a/Models/Models/PhSProduct.cs +++ b/Models/Models/PhSProduct.cs @@ -9,7 +9,23 @@ public partial class PhSProduct public int? BusinessunitsId { get; set; } + public string? Name { get; set; } + + public string Description { get; set; } = null!; + + public int? Categoryid { get; set; } + + public string? Origin { get; set; } + + public decimal Baseprice { get; set; } + + public string Currency { get; set; } = null!; + + public bool Isactive { get; set; } + public virtual PhSBusinessUnit? Businessunits { get; set; } + public virtual PhSProductCategory? Category { get; set; } + public virtual ICollection PhSQuoteDetails { get; set; } = new List(); } diff --git a/Models/Models/PhSProductCategory.cs b/Models/Models/PhSProductCategory.cs new file mode 100644 index 0000000..c767a05 --- /dev/null +++ b/Models/Models/PhSProductCategory.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +namespace Models.Models; + +public partial class PhSProductCategory +{ + public int Id { get; set; } + + public string Name { get; set; } = null!; + + public string? Description { get; set; } + + public bool Isactive { get; set; } + + public virtual ICollection PhSProducts { get; set; } = new List(); +} diff --git a/Models/Models/PhronCareOperationsHubContext.cs b/Models/Models/PhronCareOperationsHubContext.cs index 0db422a..b1ebb35 100644 --- a/Models/Models/PhronCareOperationsHubContext.cs +++ b/Models/Models/PhronCareOperationsHubContext.cs @@ -33,6 +33,8 @@ public partial class PhronCareOperationsHubContext : DbContext public virtual DbSet PhSProducts { get; set; } + public virtual DbSet PhSProductCategories { get; set; } + public virtual DbSet PhSQuoteDetails { get; set; } public virtual DbSet PhSQuoteHeaders { get; set; } @@ -46,7 +48,7 @@ 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) { @@ -113,15 +115,15 @@ public partial class PhronCareOperationsHubContext : DbContext entity.ToTable("PhS_BusinessUnits"); entity.Property(e => e.Id).HasColumnName("id"); + entity.Property(e => e.Code) + .HasMaxLength(10) + .HasColumnName("code"); entity.Property(e => e.Description) .HasMaxLength(100) .HasColumnName("description"); entity.Property(e => e.Manager) .HasMaxLength(50) .HasColumnName("manager"); - entity.Property(e => e.Name) - .HasMaxLength(50) - .HasColumnName("name"); }); modelBuilder.Entity(entity => @@ -150,6 +152,10 @@ public partial class PhronCareOperationsHubContext : DbContext entity.HasOne(d => d.Accounttypes).WithMany(p => p.PhSCustomers) .HasForeignKey(d => d.AccounttypesId) .HasConstraintName("FK_PhS_Customers_PhS_AccountTypes"); + + entity.HasOne(d => d.TaxCondition).WithMany(p => p.PhSCustomers) + .HasForeignKey(d => d.TaxConditionId) + .HasConstraintName("FK_PhS_Customers_PhOH_Tax_Conditions"); }); modelBuilder.Entity(entity => @@ -258,11 +264,54 @@ public partial class PhronCareOperationsHubContext : DbContext entity.ToTable("PhS_Products"); entity.Property(e => e.Id).HasColumnName("id"); + entity.Property(e => e.Baseprice) + .HasColumnType("decimal(18, 2)") + .HasColumnName("baseprice"); entity.Property(e => e.BusinessunitsId).HasColumnName("businessunits_id"); + entity.Property(e => e.Categoryid).HasColumnName("categoryid"); + entity.Property(e => e.Currency) + .HasMaxLength(3) + .IsUnicode(false) + .HasDefaultValue("ARS") + .HasColumnName("currency"); + entity.Property(e => e.Description).HasColumnName("description"); + entity.Property(e => e.Isactive) + .HasDefaultValue(true) + .HasColumnName("isactive"); + entity.Property(e => e.Name) + .HasMaxLength(100) + .IsFixedLength() + .HasColumnName("name"); + entity.Property(e => e.Origin) + .HasMaxLength(12) + .IsUnicode(false) + .HasColumnName("origin"); entity.HasOne(d => d.Businessunits).WithMany(p => p.PhSProducts) .HasForeignKey(d => d.BusinessunitsId) .HasConstraintName("FK_PhS_Products_PhS_BusinessUnits"); + + entity.HasOne(d => d.Category).WithMany(p => p.PhSProducts) + .HasForeignKey(d => d.Categoryid) + .HasConstraintName("FK_PhS_Products_Categories"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Id).HasName("PK__PhS_Prod__3214EC070BF59892"); + + entity.ToTable("PhS_ProductCategories"); + + entity.Property(e => e.Id).HasColumnName("id"); + entity.Property(e => e.Description) + .HasMaxLength(250) + .HasColumnName("description"); + entity.Property(e => e.Isactive) + .HasDefaultValue(true) + .HasColumnName("isactive"); + entity.Property(e => e.Name) + .HasMaxLength(100) + .HasColumnName("name"); }); modelBuilder.Entity(entity => diff --git a/Models/obj/Models.csproj.nuget.g.props b/Models/obj/Models.csproj.nuget.g.props index 57bd42c..d21a6b0 100644 --- a/Models/obj/Models.csproj.nuget.g.props +++ b/Models/obj/Models.csproj.nuget.g.props @@ -7,7 +7,7 @@ $(UserProfile)\.nuget\packages\ C:\Users\maski\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages PackageReference - 6.13.2 + 6.13.1