feat: 套餐发布状态与可见/可购开关
This commit is contained in:
@@ -19,6 +19,7 @@ using TakeoutSaaS.Domain.Queues.Entities;
|
||||
using TakeoutSaaS.Domain.Reservations.Entities;
|
||||
using TakeoutSaaS.Domain.Stores.Entities;
|
||||
using TakeoutSaaS.Domain.Tenants.Entities;
|
||||
using TakeoutSaaS.Domain.Tenants.Enums;
|
||||
using TakeoutSaaS.Infrastructure.Common.Persistence;
|
||||
using TakeoutSaaS.Shared.Abstractions.Ids;
|
||||
using TakeoutSaaS.Shared.Abstractions.Security;
|
||||
@@ -676,8 +677,12 @@ public sealed class TakeoutAppDbContext(
|
||||
builder.Property(x => x.Name).HasMaxLength(128).IsRequired();
|
||||
builder.Property(x => x.Description).HasMaxLength(512);
|
||||
builder.Property(x => x.FeaturePoliciesJson).HasColumnType("text");
|
||||
builder.Property(x => x.PublishStatus).HasConversion<int>().HasDefaultValue(TenantPackagePublishStatus.Published).HasComment("发布状态:0=草稿,1=已发布。");
|
||||
builder.Property(x => x.IsPublicVisible).HasDefaultValue(true).HasComment("是否对外可见(展示页/套餐列表可见性)。");
|
||||
builder.Property(x => x.IsAllowNewTenantPurchase).HasDefaultValue(true).HasComment("是否允许新租户购买/选择(仅影响新购)。");
|
||||
builder.Property(x => x.SortOrder).HasDefaultValue(0).HasComment("展示排序,数值越小越靠前。");
|
||||
builder.HasIndex(x => new { x.IsActive, x.SortOrder });
|
||||
builder.HasIndex(x => new { x.PublishStatus, x.IsActive, x.IsPublicVisible, x.IsAllowNewTenantPurchase, x.SortOrder });
|
||||
}
|
||||
|
||||
private static void ConfigureTenantSubscription(EntityTypeBuilder<TenantSubscription> builder)
|
||||
|
||||
Reference in New Issue
Block a user