Split Features to create space for more projects
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-05-24 13:19:09 +02:00
parent 032b9e1818
commit 70c6e0bfbc
95 changed files with 621 additions and 314 deletions
@@ -0,0 +1,33 @@
namespace LiteCharms.Features.TechShop.Quotes.Entities;
public class QuoteConfiguration : IEntityTypeConfiguration<Quote>
{
public void Configure(EntityTypeBuilder<Quote> builder)
{
builder.ToTable("Quotes");
builder.HasKey(f => f.Id);
builder.Property(f => f.CreatedAt).IsRequired().ValueGeneratedOnAdd().HasDefaultValueSql("now()");
builder.Property(f => f.UpdatedAt).IsRequired(false).HasDefaultValueSql(null);
builder.Property(f => f.ExpiredAt).IsRequired(false).HasDefaultValueSql(null);
builder.Property(f => f.CustomerId).IsRequired();
builder.Property(f => f.OrderId);
builder.Property(f => f.ShoppingCartId);
builder.Property(f => f.Status).IsRequired().HasConversion<int>();
builder.Property(f => f.InvoiceUrl).IsRequired(false).HasMaxLength(2048);
builder.Property(f => f.Reason).IsRequired(false);
builder.HasOne(q => q.Customer)
.WithMany(c => c.Quotes)
.HasForeignKey(q => q.CustomerId)
.IsRequired();
builder.HasOne(q => q.Order)
.WithOne(o => o.Quote)
.HasForeignKey<Quote>(q => q.OrderId);
builder.HasOne(q => q.ShoppingCart)
.WithOne(o => o.Quote)
.HasForeignKey<Quote>(q => q.ShoppingCartId);
}
}