feat(platform): add CRM SMS and payment settings

This commit is contained in:
2026-07-29 15:41:27 +08:00
parent 6db200a2fc
commit ead7bdc2e2
25 changed files with 23250 additions and 140 deletions

View File

@@ -158,3 +158,40 @@ internal sealed class PlatformBillingDunningNotificationEventConfiguration : IEn
.OnDelete(DeleteBehavior.Cascade);
}
}
internal sealed class PlatformPaymentAppConfiguration : IEntityTypeConfiguration<PlatformPaymentApp>
{
public void Configure(EntityTypeBuilder<PlatformPaymentApp> builder)
{
builder.ConfigureEntity("platform_payment_apps");
builder.ConfigureTimestamps();
builder.Property(entity => entity.AppCode).HasMaxLength(100);
builder.Property(entity => entity.AppName).HasMaxLength(200);
builder.Property(entity => entity.Status).HasSnakeCaseEnum();
builder.Property(entity => entity.SettlementMode).HasMaxLength(100);
builder.Property(entity => entity.Description).HasMaxLength(500);
builder.Property(entity => entity.Metadata).IsJson("{}");
builder.HasIndex(entity => entity.AppCode).IsUnique();
builder.HasIndex(entity => new { entity.Status, entity.AppCode });
}
}
internal sealed class PlatformPaymentChannelConfiguration : IEntityTypeConfiguration<PlatformPaymentChannel>
{
public void Configure(EntityTypeBuilder<PlatformPaymentChannel> builder)
{
builder.ConfigureEntity("platform_payment_channels");
builder.ConfigureTimestamps();
builder.Property(entity => entity.Provider).HasMaxLength(80);
builder.Property(entity => entity.Mode).HasMaxLength(100);
builder.Property(entity => entity.Status).HasSnakeCaseEnum();
builder.Property(entity => entity.DisplayName).HasMaxLength(200);
builder.Property(entity => entity.SecretRef).HasMaxLength(300);
builder.Property(entity => entity.CallbackPath).HasMaxLength(500);
builder.Property(entity => entity.ConfigPublic).IsJson("{}");
builder.Property(entity => entity.Metadata).IsJson("{}");
builder.HasIndex(entity => new { entity.AppId, entity.Provider }).IsUnique();
builder.HasIndex(entity => new { entity.Status, entity.Priority, entity.Provider });
builder.HasOne<PlatformPaymentApp>().WithMany().HasForeignKey(entity => entity.AppId).OnDelete(DeleteBehavior.Cascade);
}
}