Added Customer, Contact and Address with Service

Labeled all service to enable assembly scanning
This commit is contained in:
Khwezi Mngoma
2026-05-26 00:27:11 +02:00
parent 4a85d01d1a
commit 7136e4fc70
20 changed files with 749 additions and 9 deletions
@@ -0,0 +1,20 @@
namespace LiteCharms.Features.MidrandBooks.Customers.Entities;
public class CustomerConfiguration : IEntityTypeConfiguration<Customer>
{
public void Configure(EntityTypeBuilder<Customer> builder)
{
builder.ToTable("Customers");
builder.HasKey(c => c.Id);
builder.Property(c => c.CreatedAt).IsRequired().ValueGeneratedOnAdd().HasDefaultValueSql("now()");
builder.Property(c => c.UpdatedAt).HasDefaultValueSql("now()");
builder.Property(c => c.Company).IsRequired(false);
builder.Property(c => c.VatNumber).IsRequired(false);
builder.Property(c => c.Email).IsRequired();
builder.Property(c => c.Phone).IsRequired();
builder.Property(c => c.Website).IsRequired();
builder.Property(c => c.SocialMedia).IsRequired(false).HasColumnType("jsonb");
builder.Property(c => c.Enabled).HasDefaultValue(true);
}
}