Update Model, Tables Products in API
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 4m56s

This commit is contained in:
Leandro Hernan Rojas 2025-04-16 09:30:00 -03:00
parent 7c7dc287df
commit e41dc8747d
11 changed files with 150 additions and 7 deletions

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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.2</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\maski\.nuget\packages\" />

View File

@ -10,4 +10,6 @@ public partial class PhOhTaxCondition
public string Description { get; set; } = null!;
public string CmpClase { get; set; } = null!;
public virtual ICollection<PhSCustomer> PhSCustomers { get; set; } = new List<PhSCustomer>();
}

View File

@ -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; }

View File

@ -30,4 +30,6 @@ public partial class PhSCustomer
public virtual ICollection<PhSCustomerDocument> PhSCustomerDocuments { get; set; } = new List<PhSCustomerDocument>();
public virtual ICollection<PhSQuoteHeader> PhSQuoteHeaders { get; set; } = new List<PhSQuoteHeader>();
public virtual PhOhTaxCondition? TaxCondition { get; set; }
}

View File

@ -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<PhSQuoteDetail> PhSQuoteDetails { get; set; } = new List<PhSQuoteDetail>();
}

View File

@ -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<PhSProduct> PhSProducts { get; set; } = new List<PhSProduct>();
}

View File

@ -33,6 +33,8 @@ public partial class PhronCareOperationsHubContext : DbContext
public virtual DbSet<PhSProduct> PhSProducts { get; set; }
public virtual DbSet<PhSProductCategory> PhSProductCategories { get; set; }
public virtual DbSet<PhSQuoteDetail> PhSQuoteDetails { get; set; }
public virtual DbSet<PhSQuoteHeader> 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<PhSCustomer>(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<PhSCustomerAddress>(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<PhSProductCategory>(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<PhSQuoteDetail>(entity =>

View File

@ -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.2</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\maski\.nuget\packages\" />