feat: implement tenant member stored card module
All checks were successful
Build and Deploy TenantApi + SkuWorker / build-and-deploy (push) Successful in 2m24s

This commit is contained in:
2026-03-04 09:14:57 +08:00
parent d96ca4971a
commit 2970134200
35 changed files with 12805 additions and 1 deletions

View File

@@ -2976,6 +2976,67 @@ namespace TakeoutSaaS.Infrastructure.Migrations
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberDaySetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<decimal>("ExtraDiscountRate")
.HasPrecision(5, 2)
.HasColumnType("numeric(5,2)")
.HasComment("会员日额外折扣(如 9 表示 9 折)。");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean")
.HasComment("是否启用会员日。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间UTC从未更新时为 null。");
b.Property<long?>("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property<int>("Weekday")
.HasColumnType("integer")
.HasComment("周几1-7对应周一到周日。");
b.HasKey("Id");
b.HasIndex("TenantId")
.IsUnique();
b.ToTable("member_day_settings", null, t =>
{
t.HasComment("会员日配置。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberPointLedger", b =>
{
b.Property<long>("Id")
@@ -3116,6 +3177,21 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("integer")
.HasComment("会员状态。");
b.Property<decimal>("StoredBalance")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("储值余额。");
b.Property<decimal>("StoredGiftBalance")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("储值赠金余额。");
b.Property<decimal>("StoredRechargeBalance")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("储值实充余额。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
@@ -3134,6 +3210,8 @@ namespace TakeoutSaaS.Infrastructure.Migrations
b.HasKey("Id");
b.HasIndex("TenantId", "MemberTierId");
b.HasIndex("TenantId", "Mobile")
.IsUnique();
@@ -3143,6 +3221,252 @@ namespace TakeoutSaaS.Infrastructure.Migrations
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberProfileTag", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<long>("MemberProfileId")
.HasColumnType("bigint")
.HasComment("会员标识。");
b.Property<string>("TagName")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("标签名。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间UTC从未更新时为 null。");
b.Property<long?>("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.HasIndex("TenantId", "MemberProfileId");
b.HasIndex("TenantId", "MemberProfileId", "TagName")
.IsUnique();
b.ToTable("member_profile_tags", null, t =>
{
t.HasComment("会员标签。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberStoredCardPlan", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<decimal>("GiftAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("赠送金额。");
b.Property<decimal>("RechargeAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("充值金额。");
b.Property<int>("SortOrder")
.HasColumnType("integer")
.HasComment("排序值(越小越靠前)。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("启用状态。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("门店标识。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间UTC从未更新时为 null。");
b.Property<long?>("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.HasIndex("TenantId", "StoreId", "SortOrder");
b.HasIndex("TenantId", "StoreId", "Status");
b.HasIndex("TenantId", "StoreId", "RechargeAmount", "GiftAmount")
.IsUnique();
b.ToTable("member_stored_card_plans", null, t =>
{
t.HasComment("会员储值卡充值方案。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberStoredCardRechargeRecord", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("ArrivedAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("到账金额(充值+赠送)。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<decimal>("GiftAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("赠送金额。");
b.Property<long>("MemberId")
.HasColumnType("bigint")
.HasComment("会员标识。");
b.Property<string>("MemberMobileMasked")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("会员手机号快照(脱敏)。");
b.Property<string>("MemberName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("会员名称快照。");
b.Property<int>("PaymentMethod")
.HasColumnType("integer")
.HasComment("支付方式。");
b.Property<long?>("PlanId")
.HasColumnType("bigint")
.HasComment("充值方案标识(可空,表示非方案充值)。");
b.Property<decimal>("RechargeAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("充值金额。");
b.Property<DateTime>("RechargedAt")
.HasColumnType("timestamp with time zone")
.HasComment("充值时间UTC。");
b.Property<string>("RecordNo")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("充值单号。");
b.Property<string>("Remark")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("备注。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("门店标识。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间UTC从未更新时为 null。");
b.Property<long?>("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.HasIndex("TenantId", "StoreId", "RechargedAt");
b.HasIndex("TenantId", "StoreId", "RecordNo")
.IsUnique();
b.HasIndex("TenantId", "StoreId", "MemberId", "RechargedAt");
b.HasIndex("TenantId", "StoreId", "PlanId", "RechargedAt");
b.ToTable("member_stored_card_recharge_records", null, t =>
{
t.HasComment("会员储值卡充值记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberTier", b =>
{
b.Property<long>("Id")
@@ -3157,6 +3481,12 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("text")
.HasComment("等级权益JSON。");
b.Property<string>("ColorHex")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)")
.HasComment("主题色。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
@@ -3173,6 +3503,20 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<int>("DowngradeWindowDays")
.HasColumnType("integer")
.HasComment("降级观察窗口天数。");
b.Property<string>("IconKey")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("图标键。");
b.Property<bool>("IsDefault")
.HasColumnType("boolean")
.HasComment("是否默认等级。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
@@ -3199,11 +3543,28 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property<decimal?>("UpgradeAmountThreshold")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("升级累计消费门槛。");
b.Property<int?>("UpgradeOrderCountThreshold")
.HasColumnType("integer")
.HasComment("升级消费次数门槛。");
b.Property<string>("UpgradeRuleType")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)")
.HasComment("升级规则类型none/amount/count/both。");
b.HasKey("Id");
b.HasIndex("TenantId", "Name")
.IsUnique();
b.HasIndex("TenantId", "SortOrder");
b.ToTable("member_tiers", null, t =>
{
t.HasComment("会员等级定义。");