//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using TakeoutSaaS.Infrastructure.App.Persistence;
#nullable disable
namespace TakeoutSaaS.Infrastructure.Migrations
{
[DbContext(typeof(TakeoutAppDbContext))]
partial class TakeoutAppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("MassTransit.EntityFrameworkCoreIntegration.InboxState", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Consumed")
.HasColumnType("timestamp with time zone");
b.Property("ConsumerId")
.HasColumnType("uuid");
b.Property("Delivered")
.HasColumnType("timestamp with time zone");
b.Property("ExpirationTime")
.HasColumnType("timestamp with time zone");
b.Property("LastSequenceNumber")
.HasColumnType("bigint");
b.Property("LockId")
.HasColumnType("uuid");
b.Property("MessageId")
.HasColumnType("uuid");
b.Property("ReceiveCount")
.HasColumnType("integer");
b.Property("Received")
.HasColumnType("timestamp with time zone");
b.Property("RowVersion")
.IsConcurrencyToken()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("bytea");
b.HasKey("Id");
b.HasIndex("Delivered");
b.ToTable("InboxState");
});
modelBuilder.Entity("MassTransit.EntityFrameworkCoreIntegration.OutboxMessage", b =>
{
b.Property("SequenceNumber")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("SequenceNumber"));
b.Property("Body")
.IsRequired()
.HasColumnType("text");
b.Property("ContentType")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("ConversationId")
.HasColumnType("uuid");
b.Property("CorrelationId")
.HasColumnType("uuid");
b.Property("DestinationAddress")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("EnqueueTime")
.HasColumnType("timestamp with time zone");
b.Property("ExpirationTime")
.HasColumnType("timestamp with time zone");
b.Property("FaultAddress")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("Headers")
.HasColumnType("text");
b.Property("InboxConsumerId")
.HasColumnType("uuid");
b.Property("InboxMessageId")
.HasColumnType("uuid");
b.Property("InitiatorId")
.HasColumnType("uuid");
b.Property("MessageId")
.HasColumnType("uuid");
b.Property("MessageType")
.IsRequired()
.HasColumnType("text");
b.Property("OutboxId")
.HasColumnType("uuid");
b.Property("Properties")
.HasColumnType("text");
b.Property("RequestId")
.HasColumnType("uuid");
b.Property("ResponseAddress")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("SentTime")
.HasColumnType("timestamp with time zone");
b.Property("SourceAddress")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("SequenceNumber");
b.HasIndex("EnqueueTime");
b.HasIndex("ExpirationTime");
b.HasIndex("OutboxId", "SequenceNumber")
.IsUnique();
b.HasIndex("InboxMessageId", "InboxConsumerId", "SequenceNumber")
.IsUnique();
b.ToTable("OutboxMessage");
});
modelBuilder.Entity("MassTransit.EntityFrameworkCoreIntegration.OutboxState", b =>
{
b.Property("OutboxId")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("Created")
.HasColumnType("timestamp with time zone");
b.Property("Delivered")
.HasColumnType("timestamp with time zone");
b.Property("LastSequenceNumber")
.HasColumnType("bigint");
b.Property("LockId")
.HasColumnType("uuid");
b.Property("RowVersion")
.IsConcurrencyToken()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("bytea");
b.HasKey("OutboxId");
b.HasIndex("Created");
b.ToTable("OutboxState");
});
modelBuilder.Entity("TakeoutSaaS.Domain.Analytics.Entities.MetricAlertRule", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ConditionJson")
.IsRequired()
.HasColumnType("text")
.HasComment("触发条件 JSON。");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("Enabled")
.HasColumnType("boolean")
.HasComment("是否启用。");
b.Property("MetricDefinitionId")
.HasColumnType("bigint")
.HasComment("关联指标。");
b.Property("NotificationChannels")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("通知渠道。");
b.Property("Severity")
.HasColumnType("integer")
.HasComment("告警级别。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.HasIndex("TenantId", "MetricDefinitionId", "Severity");
b.ToTable("metric_alert_rules", null, t =>
{
t.HasComment("指标告警规则。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Analytics.Entities.MetricDefinition", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Code")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("指标编码。");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DefaultAggregation")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("默认聚合方式。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("Description")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("说明。");
b.Property("DimensionsJson")
.HasColumnType("text")
.HasComment("维度描述 JSON。");
b.Property("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("指标名称。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.HasIndex("TenantId", "Code")
.IsUnique();
b.ToTable("metric_definitions", null, t =>
{
t.HasComment("指标定义,描述可观测的数据点。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Analytics.Entities.MetricSnapshot", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("DimensionKey")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("维度键(JSON)。");
b.Property("MetricDefinitionId")
.HasColumnType("bigint")
.HasComment("指标定义 ID。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property("Value")
.HasPrecision(18, 4)
.HasColumnType("numeric(18,4)")
.HasComment("数值。");
b.Property("WindowEnd")
.HasColumnType("timestamp with time zone")
.HasComment("统计时间窗口结束。");
b.Property("WindowStart")
.HasColumnType("timestamp with time zone")
.HasComment("统计时间窗口开始。");
b.HasKey("Id");
b.HasIndex("TenantId", "MetricDefinitionId", "DimensionKey", "WindowStart", "WindowEnd")
.IsUnique();
b.ToTable("metric_snapshots", null, t =>
{
t.HasComment("指标快照,用于大盘展示。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.Coupon", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Code")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("券码或序列号。");
b.Property("CouponTemplateId")
.HasColumnType("bigint")
.HasComment("模板标识。");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("ExpireAt")
.HasColumnType("timestamp with time zone")
.HasComment("到期时间。");
b.Property("IssuedAt")
.HasColumnType("timestamp with time zone")
.HasComment("发放时间。");
b.Property("OrderId")
.HasColumnType("bigint")
.HasComment("订单 ID(已使用时记录)。");
b.Property("Status")
.HasColumnType("integer")
.HasComment("状态。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property("UsedAt")
.HasColumnType("timestamp with time zone")
.HasComment("使用时间。");
b.Property("UserId")
.HasColumnType("bigint")
.HasComment("归属用户。");
b.HasKey("Id");
b.HasIndex("TenantId", "Code")
.IsUnique();
b.ToTable("coupons", null, t =>
{
t.HasComment("用户领取的券。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.CouponTemplate", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AllowStack")
.HasColumnType("boolean")
.HasComment("是否允许叠加其他优惠。");
b.Property("ChannelsJson")
.HasColumnType("text")
.HasComment("发放渠道(JSON)。");
b.Property("ClaimedQuantity")
.HasColumnType("integer")
.HasComment("已领取数量。");
b.Property("CouponType")
.HasColumnType("integer")
.HasComment("券类型。");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("Description")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("备注。");
b.Property("DiscountCap")
.HasColumnType("numeric")
.HasComment("折扣上限(针对折扣券)。");
b.Property("MinimumSpend")
.HasColumnType("numeric")
.HasComment("最低消费门槛。");
b.Property("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("模板名称。");
b.Property("PerUserLimit")
.HasColumnType("integer")
.HasComment("每位用户可领取上限。");
b.Property("ProductScopeJson")
.HasColumnType("text")
.HasComment("适用品类或商品范围(JSON)。");
b.Property("RelativeValidDays")
.HasColumnType("integer")
.HasComment("有效天数(相对发放时间)。");
b.Property("Status")
.HasColumnType("integer")
.HasComment("状态。");
b.Property("StoreScopeJson")
.HasColumnType("text")
.HasComment("适用门店 ID 集合(JSON)。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("TotalQuantity")
.HasColumnType("integer")
.HasComment("总发放数量上限。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property("ValidFrom")
.HasColumnType("timestamp with time zone")
.HasComment("可用开始时间。");
b.Property("ValidTo")
.HasColumnType("timestamp with time zone")
.HasComment("可用结束时间。");
b.Property("Value")
.HasColumnType("numeric")
.HasComment("面值或折扣额度。");
b.HasKey("Id");
b.ToTable("coupon_templates", null, t =>
{
t.HasComment("优惠券模板。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.NewCustomerCouponRule", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CouponType")
.HasColumnType("integer")
.HasComment("券类型。");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("MinimumSpend")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("使用门槛。");
b.Property("Scene")
.HasColumnType("integer")
.HasComment("券规则场景。");
b.Property("SortOrder")
.HasColumnType("integer")
.HasComment("排序值(同场景内递增)。");
b.Property("StoreId")
.HasColumnType("bigint")
.HasComment("门店 ID。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property("ValidDays")
.HasColumnType("integer")
.HasComment("有效期天数。");
b.Property("Value")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("面值或折扣值。");
b.HasKey("Id");
b.HasIndex("TenantId", "StoreId", "Scene", "SortOrder");
b.ToTable("new_customer_coupon_rules", null, t =>
{
t.HasComment("新客有礼券规则。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.NewCustomerGiftSetting", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("DirectMinimumSpend")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("首单直减门槛金额。");
b.Property("DirectReduceAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("首单直减金额。");
b.Property("GiftEnabled")
.HasColumnType("boolean")
.HasComment("是否开启新客礼包。");
b.Property("GiftType")
.HasColumnType("integer")
.HasComment("礼包类型。");
b.Property("InviteEnabled")
.HasColumnType("boolean")
.HasComment("是否开启老带新分享。");
b.Property("ShareChannelsJson")
.IsRequired()
.HasColumnType("text")
.HasComment("分享渠道(JSON)。");
b.Property("StoreId")
.HasColumnType("bigint")
.HasComment("门店 ID。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.HasIndex("TenantId", "StoreId")
.IsUnique();
b.ToTable("new_customer_gift_settings", null, t =>
{
t.HasComment("新客有礼门店配置。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.NewCustomerGrowthRecord", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("CustomerKey")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("顾客业务唯一键。");
b.Property("CustomerName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("顾客展示名。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("FirstOrderAt")
.HasColumnType("timestamp with time zone")
.HasComment("首单时间。");
b.Property("GiftClaimedAt")
.HasColumnType("timestamp with time zone")
.HasComment("礼包领取时间。");
b.Property("RegisteredAt")
.HasColumnType("timestamp with time zone")
.HasComment("注册时间。");
b.Property("SourceChannel")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("渠道来源。");
b.Property("StoreId")
.HasColumnType("bigint")
.HasComment("门店 ID。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.HasIndex("TenantId", "StoreId", "CustomerKey")
.IsUnique();
b.HasIndex("TenantId", "StoreId", "RegisteredAt");
b.ToTable("new_customer_growth_records", null, t =>
{
t.HasComment("新客成长记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.NewCustomerInviteRecord", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("InviteTime")
.HasColumnType("timestamp with time zone")
.HasComment("邀请时间。");
b.Property("InviteeName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("被邀请人展示名。");
b.Property("InviterName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("邀请人展示名。");
b.Property("OrderStatus")
.HasColumnType("integer")
.HasComment("订单状态。");
b.Property("RewardIssuedAt")
.HasColumnType("timestamp with time zone")
.HasComment("奖励发放时间。");
b.Property("RewardStatus")
.HasColumnType("integer")
.HasComment("奖励状态。");
b.Property("SourceChannel")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("邀请来源渠道。");
b.Property("StoreId")
.HasColumnType("bigint")
.HasComment("门店 ID。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.HasIndex("TenantId", "StoreId", "InviteTime");
b.ToTable("new_customer_invite_records", null, t =>
{
t.HasComment("新客邀请记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.PromotionCampaign", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AudienceDescription")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("目标人群描述。");
b.Property("BannerUrl")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("营销素材(如 banner)。");
b.Property("Budget")
.HasColumnType("numeric")
.HasComment("预算金额。");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("EndAt")
.HasColumnType("timestamp with time zone")
.HasComment("结束时间。");
b.Property("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("活动名称。");
b.Property("PromotionType")
.HasColumnType("integer")
.HasComment("活动类型。");
b.Property("RulesJson")
.IsRequired()
.HasColumnType("text")
.HasComment("活动规则 JSON。");
b.Property("StartAt")
.HasColumnType("timestamp with time zone")
.HasComment("开始时间。");
b.Property("Status")
.HasColumnType("integer")
.HasComment("活动状态。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.ToTable("promotion_campaigns", null, t =>
{
t.HasComment("营销活动配置。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.PunchCardInstance", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("ExpiresAt")
.HasColumnType("timestamp with time zone")
.HasComment("过期时间(UTC,可空)。");
b.Property("InstanceNo")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("实例编号(业务唯一)。");
b.Property("MemberName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("会员名称。");
b.Property("MemberPhoneMasked")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("会员手机号(脱敏)。");
b.Property("PaidAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("实付金额。");
b.Property("PunchCardTemplateId")
.HasColumnType("bigint")
.HasComment("次卡模板 ID。");
b.Property("PurchasedAt")
.HasColumnType("timestamp with time zone")
.HasComment("购买时间(UTC)。");
b.Property("RemainingTimes")
.HasColumnType("integer")
.HasComment("剩余次数。");
b.Property("Status")
.HasColumnType("integer")
.HasComment("实例状态。");
b.Property("StoreId")
.HasColumnType("bigint")
.HasComment("门店 ID。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("TotalTimes")
.HasColumnType("integer")
.HasComment("总次数。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.HasKey("Id");
b.HasIndex("TenantId", "StoreId", "InstanceNo")
.IsUnique();
b.HasIndex("TenantId", "StoreId", "PunchCardTemplateId");
b.HasIndex("TenantId", "StoreId", "Status", "ExpiresAt");
b.ToTable("punch_card_instances", null, t =>
{
t.HasComment("次卡实例(顾客购买后生成)。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.PunchCardTemplate", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AllowTransfer")
.HasColumnType("boolean")
.HasComment("是否允许转赠。");
b.Property("CoverImageUrl")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("封面图片地址。");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间(UTC)。");
b.Property("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property("DailyLimit")
.HasColumnType("integer")
.HasComment("每日限用次数。");
b.Property("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间(UTC),未删除时为 null。");
b.Property("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property("Description")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("次卡描述。");
b.Property("ExpireStrategy")
.HasColumnType("integer")
.HasComment("过期策略。");
b.Property("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("次卡名称。");
b.Property("NotifyChannelsJson")
.IsRequired()
.HasColumnType("text")
.HasComment("购买通知渠道 JSON。");
b.Property("OriginalPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("原价。");
b.Property("PerOrderLimit")
.HasColumnType("integer")
.HasComment("每单限用次数。");
b.Property("PerUserPurchaseLimit")
.HasColumnType("integer")
.HasComment("每人限购张数。");
b.Property("SalePrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("售价。");
b.Property("ScopeCategoryIdsJson")
.IsRequired()
.HasColumnType("text")
.HasComment("指定分类 ID JSON。");
b.Property("ScopeProductIdsJson")
.IsRequired()
.HasColumnType("text")
.HasComment("指定商品 ID JSON。");
b.Property("ScopeTagIdsJson")
.IsRequired()
.HasColumnType("text")
.HasComment("指定标签 ID JSON。");
b.Property("ScopeType")
.HasColumnType("integer")
.HasComment("适用范围类型。");
b.Property("Status")
.HasColumnType("integer")
.HasComment("次卡状态。");
b.Property("StoreId")
.HasColumnType("bigint")
.HasComment("门店 ID。");
b.Property("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property("TotalTimes")
.HasColumnType("integer")
.HasComment("总次数。");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
b.Property