Retructured solution

This commit is contained in:
Khwezi Mngoma
2026-05-13 20:06:24 +02:00
parent 26075cd9a7
commit a42c51d7b2
231 changed files with 1618 additions and 1408 deletions
@@ -0,0 +1,18 @@
using LiteCharms.Features.Shop.Leads.Entities;
using LiteCharms.Features.Shop.Orders.Entities;
using LiteCharms.Features.Shop.Quotes.Entities;
using LiteCharms.Features.Shop.ShoppingCarts.Entities;
namespace LiteCharms.Features.Shop.Customers.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; }
}
@@ -0,0 +1,30 @@
namespace LiteCharms.Features.Shop.Customers.Entities;
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().HasDefaultValueSql("now()");
builder.Property(f => f.UpdatedAt).IsRequired(false);
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);
}
}