This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
namespace LiteCharms.Features.TechShop.Leads.Entities;
|
||||
|
||||
public class LeadConfiguration : IEntityTypeConfiguration<Lead>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Lead> builder)
|
||||
{
|
||||
builder.ToTable("Leads");
|
||||
|
||||
builder.HasKey(f => f.Id);
|
||||
builder.Property(f => f.CreatedAt).ValueGeneratedOnAdd().HasDefaultValueSql("now()");
|
||||
builder.Property(f => f.UpdatedAt).IsRequired(false).HasDefaultValueSql(null);
|
||||
builder.Property(f => f.CustomerId);
|
||||
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);
|
||||
|
||||
builder.HasOne(f => f.Customer)
|
||||
.WithMany(f => f.Leads)
|
||||
.HasForeignKey(f => f.CustomerId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user