feat:商户管理

This commit is contained in:
2025-12-29 16:40:27 +08:00
parent 57f4c2d394
commit dd91c1010a
62 changed files with 10536 additions and 165 deletions

View File

@@ -17,7 +17,7 @@ namespace TakeoutSaaS.Infrastructure.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.0")
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@@ -2373,6 +2373,14 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("character varying(256)")
.HasComment("详细地址。");
b.Property<DateTime?>("ApprovedAt")
.HasColumnType("timestamp with time zone")
.HasComment("审核通过时间。");
b.Property<long?>("ApprovedBy")
.HasColumnType("bigint")
.HasComment("审核通过人。");
b.Property<string>("BrandAlias")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
@@ -2402,6 +2410,23 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("character varying(64)")
.HasComment("所在城市。");
b.Property<DateTime?>("ClaimExpiresAt")
.HasColumnType("timestamp with time zone")
.HasComment("领取过期时间。");
b.Property<DateTime?>("ClaimedAt")
.HasColumnType("timestamp with time zone")
.HasComment("领取时间。");
b.Property<long?>("ClaimedBy")
.HasColumnType("bigint")
.HasComment("当前领取人。");
b.Property<string>("ClaimedByName")
.HasMaxLength(100)
.HasColumnType("character varying(100)")
.HasComment("当前领取人姓名。");
b.Property<string>("ContactEmail")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
@@ -2434,6 +2459,21 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("character varying(64)")
.HasComment("所在区县。");
b.Property<DateTime?>("FrozenAt")
.HasColumnType("timestamp with time zone")
.HasComment("冻结时间。");
b.Property<string>("FrozenReason")
.HasMaxLength(500)
.HasColumnType("character varying(500)")
.HasComment("冻结原因。");
b.Property<bool>("IsFrozen")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(false)
.HasComment("是否冻结业务。");
b.Property<DateTime?>("JoinedAt")
.HasColumnType("timestamp with time zone")
.HasComment("入驻时间。");
@@ -2442,6 +2482,10 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("timestamp with time zone")
.HasComment("最近一次审核时间。");
b.Property<long?>("LastReviewedBy")
.HasColumnType("bigint")
.HasComment("最近一次审核人。");
b.Property<double?>("Latitude")
.HasColumnType("double precision")
.HasComment("纬度信息。");
@@ -2459,6 +2503,10 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("double precision")
.HasComment("经度信息。");
b.Property<int?>("OperatingMode")
.HasColumnType("integer")
.HasComment("经营模式(同一主体/不同主体)。");
b.Property<string>("Province")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
@@ -2469,6 +2517,13 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("character varying(512)")
.HasComment("审核备注或驳回原因。");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("bytea")
.HasComment("并发控制版本。");
b.Property<string>("ServicePhone")
.HasColumnType("text")
.HasComment("客服电话。");
@@ -2499,8 +2554,12 @@ namespace TakeoutSaaS.Infrastructure.Migrations
b.HasKey("Id");
b.HasIndex("ClaimedBy");
b.HasIndex("TenantId");
b.HasIndex("TenantId", "Status");
b.ToTable("merchants", null, t =>
{
t.HasComment("商户主体信息,承载入驻和资质审核结果。");
@@ -4784,6 +4843,16 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("character varying(256)")
.HasComment("门店营业时段描述(备用字符串)。");
b.Property<string>("BusinessLicenseImageUrl")
.HasMaxLength(500)
.HasColumnType("character varying(500)")
.HasComment("门店营业执照图片地址(主体不一致模式使用)。");
b.Property<string>("BusinessLicenseNumber")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasComment("门店营业执照号(主体不一致模式使用)。");
b.Property<string>("City")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
@@ -4837,6 +4906,11 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("double precision")
.HasComment("纬度。");
b.Property<string>("LegalRepresentative")
.HasMaxLength(100)
.HasColumnType("character varying(100)")
.HasComment("门店法人(主体不一致模式使用)。");
b.Property<double?>("Longitude")
.HasColumnType("double precision")
.HasComment("高德/腾讯地图经度。");
@@ -4866,6 +4940,11 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("character varying(64)")
.HasComment("所在省份。");
b.Property<string>("RegisteredAddress")
.HasMaxLength(500)
.HasColumnType("character varying(500)")
.HasComment("门店注册地址(主体不一致模式使用)。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("门店当前运营状态。");
@@ -4908,6 +4987,10 @@ namespace TakeoutSaaS.Infrastructure.Migrations
b.HasKey("Id");
b.HasIndex("MerchantId", "BusinessLicenseNumber")
.IsUnique()
.HasFilter("\"BusinessLicenseNumber\" IS NOT NULL AND \"Status\" <> 3");
b.HasIndex("TenantId", "Code")
.IsUnique();
@@ -5704,6 +5787,10 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("character varying(128)")
.HasComment("租户全称或品牌名称。");
b.Property<int?>("OperatingMode")
.HasColumnType("integer")
.HasComment("经营模式(同一主体/不同主体)。");
b.Property<long?>("PrimaryOwnerUserId")
.HasColumnType("bigint")
.HasComment("系统内对应的租户所有者账号 ID。");
@@ -5806,6 +5893,18 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("timestamp with time zone")
.HasComment("失效时间UTC为空表示长期有效。");
b.Property<bool>("IsActive")
.HasColumnType("boolean")
.HasComment("是否启用(已弃用,迁移期保留)。");
b.Property<int>("Priority")
.HasColumnType("integer")
.HasComment("展示优先级,数值越大越靠前。");
b.Property<DateTime?>("PublishedAt")
.HasColumnType("timestamp with time zone")
.HasComment("实际发布时间UTC。");
b.Property<int>("PublisherScope")
.HasColumnType("integer")
.HasComment("发布者范围。");
@@ -5814,32 +5913,10 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("bigint")
.HasComment("发布者用户 ID平台或租户后台账号。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("公告状态。");
b.Property<DateTime?>("PublishedAt")
.HasColumnType("timestamp with time zone")
.HasComment("实际发布时间UTC。");
b.Property<DateTime?>("RevokedAt")
.HasColumnType("timestamp with time zone")
.HasComment("撤销时间UTC。");
b.Property<DateTime?>("ScheduledPublishAt")
.HasColumnType("timestamp with time zone")
.HasComment("预定发布时间UTC。");
b.Property<string>("TargetType")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("目标受众类型。");
b.Property<string>("TargetParameters")
.HasColumnType("text")
.HasComment("目标受众参数JSON。");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
@@ -5847,13 +5924,23 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("bytea")
.HasComment("并发控制字段。");
b.Property<bool>("IsActive")
.HasColumnType("boolean")
.HasComment("是否启用(已弃用,迁移期保留)。");
b.Property<DateTime?>("ScheduledPublishAt")
.HasColumnType("timestamp with time zone")
.HasComment("预定发布时间UTC)。");
b.Property<int>("Priority")
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("展示优先级,数值越大越靠前。");
.HasComment("公告状态。");
b.Property<string>("TargetParameters")
.HasColumnType("text")
.HasComment("目标受众参数JSON。");
b.Property<string>("TargetType")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("目标受众类型。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
@@ -5875,15 +5962,15 @@ namespace TakeoutSaaS.Infrastructure.Migrations
b.HasKey("Id");
b.HasIndex("Status", "EffectiveFrom")
.HasFilter("\"TenantId\" = 0");
b.HasIndex("TenantId", "AnnouncementType", "IsActive");
b.HasIndex("TenantId", "EffectiveFrom", "EffectiveTo");
b.HasIndex("TenantId", "Status", "EffectiveFrom");
b.HasIndex("Status", "EffectiveFrom")
.HasFilter("\"TenantId\" = 0");
b.ToTable("tenant_announcements", null, t =>
{
t.HasComment("租户公告。");