Merged incoming changes
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class CustomerConfiguration : IEntityTypeConfiguration<Customer>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Customer> builder)
|
||||
{
|
||||
builder.ToTable(nameof(Customer));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).ValueGeneratedOnAdd();
|
||||
builder.Property(f => f.UpdatedAt).IsRequired(false).ValueGeneratedOnUpdate();
|
||||
builder.Property(f => f.Company);
|
||||
builder.Property(f => f.Name).IsRequired();
|
||||
builder.Property(f => f.LastName).IsRequired();
|
||||
builder.Property(f => f.Email).IsRequired();
|
||||
builder.Property(f => f.Tax);
|
||||
builder.Property(f => f.Discord);
|
||||
builder.Property(f => f.Slack);
|
||||
builder.Property(f => f.LinkedIn);
|
||||
builder.Property(f => f.Whatsapp);
|
||||
builder.Property(f => f.Website);
|
||||
builder.Property(f => f.Phone);
|
||||
builder.Property(f => f.Address);
|
||||
builder.Property(f => f.City);
|
||||
builder.Property(f => f.Region);
|
||||
builder.Property(f => f.Country);
|
||||
builder.Property(f => f.PostalCode);
|
||||
builder.Property(f => f.Active).HasDefaultValue(true);
|
||||
|
||||
builder.HasMany(f => f.Leads)
|
||||
.WithOne(f => f.Customer)
|
||||
.HasForeignKey(f => f.CustomerId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class LeadConfiguration : IEntityTypeConfiguration<Lead>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Lead> builder)
|
||||
{
|
||||
builder.ToTable(nameof(Lead));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).ValueGeneratedOnAdd();
|
||||
builder.Property(f => f.UpdatedAt).IsRequired(false).ValueGeneratedOnUpdate();
|
||||
builder.Property(f => f.CustomerId).IsRequired(false);
|
||||
builder.Property(f => f.Source);
|
||||
builder.Property(f => f.ClickId);
|
||||
builder.Property(f => f.WebClickId);
|
||||
builder.Property(f => f.AppClickId);
|
||||
builder.Property(f => f.CampaignId);
|
||||
builder.Property(f => f.AdGroupId);
|
||||
builder.Property(f => f.AdName);
|
||||
builder.Property(f => f.TargetId);
|
||||
builder.Property(f => f.FeedItemId);
|
||||
builder.Property(f => f.ClickLocation);
|
||||
builder.Property(f => f.Status).IsRequired();
|
||||
builder.Property(f => f.AttributionHash).IsRequired(true);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class NotificationConfiguration : IEntityTypeConfiguration<Notification>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Notification> builder)
|
||||
{
|
||||
builder.ToTable(nameof(Notification));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).IsRequired().ValueGeneratedOnAdd();
|
||||
builder.Property(f => f.Direction).IsRequired();
|
||||
builder.Property(f => f.Author).IsRequired();
|
||||
builder.Property(f => f.Title).IsRequired();
|
||||
builder.Property(f => f.Description).IsRequired();
|
||||
builder.Property(f => f.Platform).IsRequired();
|
||||
builder.Property(f => f.PlatformAddress).IsRequired();
|
||||
builder.Property(f => f.CorrelationId).IsRequired();
|
||||
builder.Property(f => f.CorrelationIdType).IsRequired();
|
||||
builder.Property(f => f.IsInternal).HasDefaultValue(true);
|
||||
builder.Property(f => f.Processed).HasDefaultValue(false);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class OrderConfiguration : IEntityTypeConfiguration<Order>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Order> builder)
|
||||
{
|
||||
builder.ToTable(nameof(Order));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).ValueGeneratedOnAdd();
|
||||
builder.Property(f => f.UpdatedAt).IsRequired(false).ValueGeneratedOnUpdate();
|
||||
builder.Property(f => f.CustomerId).IsRequired();
|
||||
builder.Property(f => f.QuoteId).IsRequired(false);
|
||||
builder.Property(f => f.RefundId).IsRequired(false);
|
||||
builder.Property(f => f.ShoppingCartId).IsRequired();
|
||||
builder.Property(f => f.Status).HasConversion<int>().IsRequired();
|
||||
builder.Property(f => f.Notes).HasColumnType("jsonb").IsRequired(false);
|
||||
|
||||
builder.HasOne(f => f.Quote)
|
||||
.WithOne(f => f.Order)
|
||||
.HasForeignKey<Order>(f => f.QuoteId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
builder.HasOne(f => f.Customer)
|
||||
.WithMany(f => f.Orders)
|
||||
.HasForeignKey(f => f.CustomerId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class OrderRefundConfiguration : IEntityTypeConfiguration<OrderRefund>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<OrderRefund> builder)
|
||||
{
|
||||
builder.ToTable(nameof(OrderRefund));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).ValueGeneratedOnAdd();
|
||||
builder.Property(f => f.OrderId).IsRequired();
|
||||
builder.Property(f => f.Reason).IsRequired();
|
||||
builder.Property(f => f.Amount).IsRequired().HasPrecision(18, 2);
|
||||
|
||||
builder.HasOne(f => f.Order)
|
||||
.WithOne(o => o.Refund)
|
||||
.HasForeignKey<OrderRefund>(o => o.OrderId);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class ProductConfiguration : IEntityTypeConfiguration<Product>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Product> builder)
|
||||
{
|
||||
builder.ToTable(nameof(Product));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.Name).IsRequired();
|
||||
builder.Property(f => f.Description).IsRequired();
|
||||
builder.Property(f => f.Active).HasDefaultValue(true);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class ProductPriceConfiguration : IEntityTypeConfiguration<ProductPrice>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ProductPrice> builder)
|
||||
{
|
||||
builder.ToTable(nameof(ProductPrice));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).ValueGeneratedOnAdd();
|
||||
builder.Property(f => f.UpdatedAt).IsRequired(false).ValueGeneratedOnUpdate();
|
||||
builder.Property(f => f.ProductId).IsRequired();
|
||||
builder.Property(f => f.Price).IsRequired().HasPrecision(18, 2);
|
||||
builder.Property(f => f.Discount).HasPrecision(18, 2);
|
||||
builder.Property(f => f.Active);
|
||||
|
||||
builder.HasOne(f => f.Product)
|
||||
.WithMany(p => p.ProductPrices)
|
||||
.HasForeignKey(f => f.ProductId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class QuoteConfiguration : IEntityTypeConfiguration<Quote>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Quote> builder)
|
||||
{
|
||||
builder.ToTable(nameof(Quote));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).IsRequired().ValueGeneratedOnAdd();
|
||||
builder.Property(f => f.UpdatedAt).IsRequired().ValueGeneratedOnAddOrUpdate();
|
||||
builder.Property(f => f.ExpiredAt).IsRequired(false);
|
||||
builder.Property(f => f.CustomerId).IsRequired();
|
||||
builder.Property(f => f.Status).IsRequired();
|
||||
builder.Property(f => f.ShoppingCartId).IsRequired();
|
||||
builder.Property(f => f.Reason).IsRequired(false);
|
||||
|
||||
builder.HasOne(f => f.Customer)
|
||||
.WithMany()
|
||||
.HasForeignKey(f => f.CustomerId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class ShoppingCartConfiguration : IEntityTypeConfiguration<ShoppingCart>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ShoppingCart> builder)
|
||||
{
|
||||
builder.ToTable(nameof(ShoppingCart));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).IsRequired().ValueGeneratedOnAdd();
|
||||
builder.Property(f => f.UpdatedAt).IsRequired().ValueGeneratedOnAddOrUpdate();
|
||||
builder.Property(f => f.CustomerId).IsRequired(false);
|
||||
builder.Property(f => f.OrderId).IsRequired(false);
|
||||
builder.Property(f => f.QuoteId).IsRequired(false);
|
||||
|
||||
builder.HasOne(f => f.Customer)
|
||||
.WithMany(c => c.ShoppingCarts)
|
||||
.HasForeignKey(f => f.CustomerId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
|
||||
builder.HasOne(f => f.Order)
|
||||
.WithOne(o => o.ShoppingCart)
|
||||
.HasForeignKey<Order>(o => o.ShoppingCartId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
|
||||
builder.HasOne(f => f.Quote)
|
||||
.WithOne(o => o.ShoppingCart)
|
||||
.HasForeignKey<Quote>(o => o.ShoppingCartId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
namespace LiteCharms.Entities.Configuration;
|
||||
|
||||
public class ShoppingCartItemConfiguration : IEntityTypeConfiguration<ShoppingCartItem>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ShoppingCartItem> builder)
|
||||
{
|
||||
builder.ToTable(nameof(ShoppingCartItem));
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).IsRequired().ValueGeneratedOnAdd();
|
||||
builder.Property(f => f.UpdatedAt).IsRequired().ValueGeneratedOnAddOrUpdate();
|
||||
builder.Property(f => f.Quantity).IsRequired().HasDefaultValue(1);
|
||||
builder.Property(f => f.ProductPriceId).IsRequired();
|
||||
|
||||
builder.HasOne(f => f.ProductPrice)
|
||||
.WithMany()
|
||||
.HasForeignKey(f => f.ProductPriceId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
|
||||
builder.HasOne(f => f.ShoppingCart)
|
||||
.WithMany(f => f.ShoppingCartItems)
|
||||
.HasForeignKey(f => f.ShoppingCartId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using LiteCharms.Entities.Configuration;
|
||||
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
[EntityTypeConfiguration<CustomerConfiguration, Customer>]
|
||||
public class Customer : Models.Customer
|
||||
{
|
||||
public virtual ICollection<Lead>? Leads { get; set; }
|
||||
|
||||
public virtual ICollection<Order>? Orders { get; set; }
|
||||
|
||||
public virtual ICollection<Quote>? Quotes { get; set; }
|
||||
|
||||
public virtual ICollection<ShoppingCart>? ShoppingCarts { get; set; }
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using LiteCharms.Entities.Configuration;
|
||||
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
[EntityTypeConfiguration<LeadConfiguration, Lead>]
|
||||
public class Lead : Models.Lead
|
||||
{
|
||||
public virtual Customer? Customer { get; set; }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
using LiteCharms.Entities.Configuration;
|
||||
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
[EntityTypeConfiguration<NotificationConfiguration, Notification>]
|
||||
public class Notification : Models.Notification;
|
||||
@@ -1,15 +0,0 @@
|
||||
using LiteCharms.Entities.Configuration;
|
||||
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
[EntityTypeConfiguration<OrderConfiguration, Order>]
|
||||
public class Order : Models.Order
|
||||
{
|
||||
public virtual OrderRefund? Refund { get; set; }
|
||||
|
||||
public virtual Customer? Customer { get; set; }
|
||||
|
||||
public virtual Quote? Quote { get; set; }
|
||||
|
||||
public virtual ShoppingCart? ShoppingCart { get; set; }
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using LiteCharms.Entities.Configuration;
|
||||
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
[EntityTypeConfiguration<OrderRefundConfiguration, OrderRefund>]
|
||||
public class OrderRefund : Models.OrderRefund
|
||||
{
|
||||
public virtual Order? Order { get; set; }
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using LiteCharms.Entities.Configuration;
|
||||
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
[EntityTypeConfiguration<ProductConfiguration, Product>]
|
||||
public class Product : Models.Product
|
||||
{
|
||||
public virtual ICollection<ProductPrice>? ProductPrices { get; set; }
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using LiteCharms.Entities.Configuration;
|
||||
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
[EntityTypeConfiguration<ProductPriceConfiguration, ProductPrice>]
|
||||
public class ProductPrice : Models.ProductPrice
|
||||
{
|
||||
public virtual Product? Product { get; set; }
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using LiteCharms.Entities.Configuration;
|
||||
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
[EntityTypeConfiguration<QuoteConfiguration, Quote>]
|
||||
public class Quote : Models.Quote
|
||||
{
|
||||
public virtual Customer? Customer { get; set; }
|
||||
|
||||
public virtual ShoppingCart? ShoppingCart { get; set; }
|
||||
|
||||
public virtual Order? Order { get; set; }
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using LiteCharms.Entities.Configuration;
|
||||
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
[EntityTypeConfiguration<ShoppingCartConfiguration, ShoppingCart>]
|
||||
public class ShoppingCart : Models.ShoppingCart
|
||||
{
|
||||
public virtual Customer? Customer { get; set; }
|
||||
|
||||
public virtual Order? Order { get; set; }
|
||||
|
||||
public virtual Quote? Quote { get; set; }
|
||||
|
||||
public virtual ICollection<ShoppingCartItem>? ShoppingCartItems { get; set; }
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace LiteCharms.Entities;
|
||||
|
||||
public class ShoppingCartItem : Models.ShoppingCartItem
|
||||
{
|
||||
public virtual ShoppingCart? ShoppingCart { get; set; }
|
||||
|
||||
public virtual ProductPrice? ProductPrice { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user