Fixed Lead->Customer Relationship
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-05-15 07:54:35 +02:00
parent 36b3656886
commit 4523ef6151
6 changed files with 951 additions and 106 deletions
@@ -166,74 +166,6 @@ namespace LiteCharms.Features.Shop.Postgres.Migrations
b.ToTable("Customers", (string)null);
});
modelBuilder.Entity("LiteCharms.Features.Shop.Customers.Models.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("Active")
.HasColumnType("boolean");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("City")
.HasColumnType("text");
b.Property<string>("Company")
.HasColumnType("text");
b.Property<string>("Country")
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Discord")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("LastName")
.HasColumnType("text");
b.Property<string>("LinkedIn")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnType("text");
b.Property<string>("PostalCode")
.HasColumnType("text");
b.Property<string>("Region")
.HasColumnType("text");
b.Property<string>("Slack")
.HasColumnType("text");
b.Property<string>("Tax")
.HasColumnType("text");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Website")
.HasColumnType("text");
b.Property<string>("Whatsapp")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Customer");
});
modelBuilder.Entity("LiteCharms.Features.Shop.Leads.Entities.Lead", b =>
{
b.Property<Guid>("Id")
@@ -270,9 +202,6 @@ namespace LiteCharms.Features.Shop.Postgres.Migrations
b.Property<Guid?>("CustomerId")
.HasColumnType("uuid");
b.Property<Guid?>("CustomerId1")
.HasColumnType("uuid");
b.Property<long?>("FeedItemId")
.HasColumnType("bigint");
@@ -295,8 +224,6 @@ namespace LiteCharms.Features.Shop.Postgres.Migrations
b.HasIndex("CustomerId");
b.HasIndex("CustomerId1");
b.ToTable("Leads", (string)null);
});
@@ -615,9 +542,6 @@ namespace LiteCharms.Features.Shop.Postgres.Migrations
b.Property<Guid>("ProductPriceId")
.HasColumnType("uuid");
b.Property<Guid?>("ProductPriceId1")
.HasColumnType("uuid");
b.Property<int>("Quantity")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
@@ -626,9 +550,6 @@ namespace LiteCharms.Features.Shop.Postgres.Migrations
b.Property<Guid>("ShoppingCartId")
.HasColumnType("uuid");
b.Property<Guid?>("ShoppingCartId1")
.HasColumnType("uuid");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -636,12 +557,8 @@ namespace LiteCharms.Features.Shop.Postgres.Migrations
b.HasIndex("ProductPriceId");
b.HasIndex("ProductPriceId1");
b.HasIndex("ShoppingCartId");
b.HasIndex("ShoppingCartId1");
b.ToTable("ShoppingCartItems", (string)null);
});
@@ -692,15 +609,11 @@ namespace LiteCharms.Features.Shop.Postgres.Migrations
modelBuilder.Entity("LiteCharms.Features.Shop.Leads.Entities.Lead", b =>
{
b.HasOne("LiteCharms.Features.Shop.Customers.Models.Customer", "Customer")
.WithMany()
b.HasOne("LiteCharms.Features.Shop.Customers.Entities.Customer", "Customer")
.WithMany("Leads")
.HasForeignKey("CustomerId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("LiteCharms.Features.Shop.Customers.Entities.Customer", null)
.WithMany("Leads")
.HasForeignKey("CustomerId1");
b.Navigation("Customer");
});
@@ -780,26 +693,18 @@ namespace LiteCharms.Features.Shop.Postgres.Migrations
modelBuilder.Entity("LiteCharms.Features.Shop.ShoppingCarts.Entities.ShoppingCartItem", b =>
{
b.HasOne("LiteCharms.Features.Shop.Products.Entities.ProductPrice", null)
b.HasOne("LiteCharms.Features.Shop.Products.Entities.ProductPrice", "ProductPrice")
.WithMany()
.HasForeignKey("ProductPriceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("LiteCharms.Features.Shop.Products.Entities.ProductPrice", "ProductPrice")
.WithMany()
.HasForeignKey("ProductPriceId1");
b.HasOne("LiteCharms.Features.Shop.ShoppingCarts.Entities.ShoppingCart", null)
b.HasOne("LiteCharms.Features.Shop.ShoppingCarts.Entities.ShoppingCart", "ShoppingCart")
.WithMany("ShoppingCartItems")
.HasForeignKey("ShoppingCartId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LiteCharms.Features.Shop.ShoppingCarts.Entities.ShoppingCart", "ShoppingCart")
.WithMany()
.HasForeignKey("ShoppingCartId1");
b.Navigation("ProductPrice");
b.Navigation("ShoppingCart");