Files
components/LiteCharms.Entities/Configuration/QuoteConfiguration.cs
T
Khwezi Mngoma 83f51c6a23 Added notifications
Added shopping cart and items
Added quotes
Refactored relatinoships
Migrated changes
Refactored cqrs commands and queries
Refactored mappings
2026-05-05 23:59:31 +02:00

24 lines
886 B
C#

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);
}
}