Files
TakeoutSaaS.AdminApi/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/TakeoutAppDbContextModelSnapshot.cs

6991 lines
301 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// <auto-generated />
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.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("TakeoutSaaS.Domain.Analytics.Entities.MetricAlertRule", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("ConditionJson")
.IsRequired()
.HasColumnType("text")
.HasComment("触发条件 JSON。");
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<bool>("Enabled")
.HasColumnType("boolean")
.HasComment("是否启用。");
b.Property<long>("MetricDefinitionId")
.HasColumnType("bigint")
.HasComment("关联指标。");
b.Property<string>("NotificationChannels")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("通知渠道。");
b.Property<int>("Severity")
.HasColumnType("integer")
.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", "MetricDefinitionId", "Severity");
b.ToTable("metric_alert_rules", null, t =>
{
t.HasComment("指标告警规则。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Analytics.Entities.MetricDefinition", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("指标编码。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<string>("DefaultAggregation")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("默认聚合方式。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<string>("Description")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("说明。");
b.Property<string>("DimensionsJson")
.HasColumnType("text")
.HasComment("维度描述 JSON。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.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", "Code")
.IsUnique();
b.ToTable("metric_definitions", null, t =>
{
t.HasComment("指标定义,描述可观测的数据点。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Analytics.Entities.MetricSnapshot", 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<string>("DimensionKey")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("维度键JSON。");
b.Property<long>("MetricDefinitionId")
.HasColumnType("bigint")
.HasComment("指标定义 ID。");
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<decimal>("Value")
.HasPrecision(18, 4)
.HasColumnType("numeric(18,4)")
.HasComment("数值。");
b.Property<DateTime>("WindowEnd")
.HasColumnType("timestamp with time zone")
.HasComment("统计时间窗口结束。");
b.Property<DateTime>("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<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("券码或序列号。");
b.Property<long>("CouponTemplateId")
.HasColumnType("bigint")
.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<DateTime>("ExpireAt")
.HasColumnType("timestamp with time zone")
.HasComment("到期时间。");
b.Property<DateTime>("IssuedAt")
.HasColumnType("timestamp with time zone")
.HasComment("发放时间。");
b.Property<long?>("OrderId")
.HasColumnType("bigint")
.HasComment("订单 ID已使用时记录。");
b.Property<int>("Status")
.HasColumnType("integer")
.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<DateTime?>("UsedAt")
.HasColumnType("timestamp with time zone")
.HasComment("使用时间。");
b.Property<long>("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<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<bool>("AllowStack")
.HasColumnType("boolean")
.HasComment("是否允许叠加其他优惠。");
b.Property<string>("ChannelsJson")
.HasColumnType("text")
.HasComment("发放渠道JSON。");
b.Property<int>("ClaimedQuantity")
.HasColumnType("integer")
.HasComment("已领取数量。");
b.Property<int>("CouponType")
.HasColumnType("integer")
.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<string>("Description")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("备注。");
b.Property<decimal?>("DiscountCap")
.HasColumnType("numeric")
.HasComment("折扣上限(针对折扣券)。");
b.Property<decimal?>("MinimumSpend")
.HasColumnType("numeric")
.HasComment("最低消费门槛。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("模板名称。");
b.Property<string>("ProductScopeJson")
.HasColumnType("text")
.HasComment("适用品类或商品范围JSON。");
b.Property<int?>("RelativeValidDays")
.HasColumnType("integer")
.HasComment("有效天数(相对发放时间)。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("状态。");
b.Property<string>("StoreScopeJson")
.HasColumnType("text")
.HasComment("适用门店 ID 集合JSON。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<int?>("TotalQuantity")
.HasColumnType("integer")
.HasComment("总发放数量上限。");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间UTC从未更新时为 null。");
b.Property<long?>("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property<DateTime?>("ValidFrom")
.HasColumnType("timestamp with time zone")
.HasComment("可用开始时间。");
b.Property<DateTime?>("ValidTo")
.HasColumnType("timestamp with time zone")
.HasComment("可用结束时间。");
b.Property<decimal>("Value")
.HasColumnType("numeric")
.HasComment("面值或折扣额度。");
b.HasKey("Id");
b.ToTable("coupon_templates", null, t =>
{
t.HasComment("优惠券模板。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.PromotionCampaign", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("AudienceDescription")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("目标人群描述。");
b.Property<string>("BannerUrl")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("营销素材(如 banner。");
b.Property<decimal?>("Budget")
.HasColumnType("numeric")
.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<DateTime>("EndAt")
.HasColumnType("timestamp with time zone")
.HasComment("结束时间。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("活动名称。");
b.Property<int>("PromotionType")
.HasColumnType("integer")
.HasComment("活动类型。");
b.Property<string>("RulesJson")
.IsRequired()
.HasColumnType("text")
.HasComment("活动规则 JSON。");
b.Property<DateTime>("StartAt")
.HasColumnType("timestamp with time zone")
.HasComment("开始时间。");
b.Property<int>("Status")
.HasColumnType("integer")
.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.ToTable("promotion_campaigns", null, t =>
{
t.HasComment("营销活动配置。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.CustomerService.Entities.ChatMessage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("ChatSessionId")
.HasColumnType("bigint")
.HasComment("会话标识。");
b.Property<string>("Content")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasComment("消息内容。");
b.Property<string>("ContentType")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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<bool>("IsRead")
.HasColumnType("boolean")
.HasComment("是否已读。");
b.Property<DateTime?>("ReadAt")
.HasColumnType("timestamp with time zone")
.HasComment("读取时间。");
b.Property<int>("SenderType")
.HasColumnType("integer")
.HasComment("发送方类型。");
b.Property<long?>("SenderUserId")
.HasColumnType("bigint")
.HasComment("发送方用户 ID。");
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", "ChatSessionId", "CreatedAt");
b.ToTable("chat_messages", null, t =>
{
t.HasComment("会话消息。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.CustomerService.Entities.ChatSession", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long?>("AgentUserId")
.HasColumnType("bigint")
.HasComment("当前客服员工 ID。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<long>("CustomerUserId")
.HasColumnType("bigint")
.HasComment("顾客用户 ID。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<DateTime?>("EndedAt")
.HasColumnType("timestamp with time zone")
.HasComment("结束时间。");
b.Property<bool>("IsBotActive")
.HasColumnType("boolean")
.HasComment("是否机器人接待中。");
b.Property<string>("SessionCode")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("会话编号。");
b.Property<DateTime>("StartedAt")
.HasColumnType("timestamp with time zone")
.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", "SessionCode")
.IsUnique();
b.ToTable("chat_sessions", null, t =>
{
t.HasComment("客服会话。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.CustomerService.Entities.SupportTicket", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long?>("AssignedAgentId")
.HasColumnType("bigint")
.HasComment("指派的客服。");
b.Property<DateTime?>("ClosedAt")
.HasColumnType("timestamp with time zone")
.HasComment("关闭时间。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<long>("CustomerUserId")
.HasColumnType("bigint")
.HasComment("客户用户 ID。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text")
.HasComment("工单详情。");
b.Property<long?>("OrderId")
.HasColumnType("bigint")
.HasComment("关联订单(如有)。");
b.Property<int>("Priority")
.HasColumnType("integer")
.HasComment("优先级。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("状态。");
b.Property<string>("Subject")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("工单主题。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<string>("TicketNo")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("工单编号。");
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", "TicketNo")
.IsUnique();
b.ToTable("support_tickets", null, t =>
{
t.HasComment("客服工单。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.CustomerService.Entities.TicketComment", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("AttachmentsJson")
.HasColumnType("text")
.HasComment("附件 JSON。");
b.Property<long?>("AuthorUserId")
.HasColumnType("bigint")
.HasComment("评论人 ID。");
b.Property<string>("Content")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.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<bool>("IsInternal")
.HasColumnType("boolean")
.HasComment("是否内部备注。");
b.Property<long>("SupportTicketId")
.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", "SupportTicketId");
b.ToTable("ticket_comments", null, t =>
{
t.HasComment("工单评论/流转记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Deliveries.Entities.DeliveryEvent", 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>("DeliveryOrderId")
.HasColumnType("bigint")
.HasComment("配送单标识。");
b.Property<int>("EventType")
.HasColumnType("integer")
.HasComment("事件类型。");
b.Property<string>("Message")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("事件描述。");
b.Property<DateTime>("OccurredAt")
.HasColumnType("timestamp with time zone")
.HasComment("发生时间。");
b.Property<string>("Payload")
.HasColumnType("text")
.HasComment("原始数据 JSON。");
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", "DeliveryOrderId", "EventType");
b.ToTable("delivery_events", null, t =>
{
t.HasComment("配送状态事件流水。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Deliveries.Entities.DeliveryOrder", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("CourierName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("骑手姓名。");
b.Property<string>("CourierPhone")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.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<DateTime?>("DeliveredAt")
.HasColumnType("timestamp with time zone")
.HasComment("完成时间。");
b.Property<decimal?>("DeliveryFee")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("配送费。");
b.Property<DateTime?>("DispatchedAt")
.HasColumnType("timestamp with time zone")
.HasComment("下发时间。");
b.Property<string>("FailureReason")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("异常原因。");
b.Property<long>("OrderId")
.HasColumnType("bigint")
.HasComment("获取或设置关联订单 ID。");
b.Property<DateTime?>("PickedUpAt")
.HasColumnType("timestamp with time zone")
.HasComment("取餐时间。");
b.Property<int>("Provider")
.HasColumnType("integer")
.HasComment("配送服务商。");
b.Property<string>("ProviderOrderId")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("第三方配送单号。");
b.Property<int>("Status")
.HasColumnType("integer")
.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", "OrderId")
.IsUnique();
b.ToTable("delivery_orders", null, t =>
{
t.HasComment("配送单。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Distribution.Entities.AffiliateOrder", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AffiliatePartnerId")
.HasColumnType("bigint")
.HasComment("推广人标识。");
b.Property<long>("BuyerUserId")
.HasColumnType("bigint")
.HasComment("用户 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>("EstimatedCommission")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("预计佣金。");
b.Property<decimal>("OrderAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("订单金额。");
b.Property<long>("OrderId")
.HasColumnType("bigint")
.HasComment("关联订单。");
b.Property<DateTime?>("SettledAt")
.HasColumnType("timestamp with time zone")
.HasComment("结算完成时间。");
b.Property<int>("Status")
.HasColumnType("integer")
.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", "AffiliatePartnerId", "OrderId")
.IsUnique();
b.ToTable("affiliate_orders", null, t =>
{
t.HasComment("分销订单记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Distribution.Entities.AffiliatePartner", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("ChannelType")
.HasColumnType("integer")
.HasComment("渠道类型。");
b.Property<decimal>("CommissionRate")
.HasColumnType("numeric")
.HasComment("分成比例0-1。");
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<string>("DisplayName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("昵称或渠道名称。");
b.Property<string>("Phone")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("联系电话。");
b.Property<string>("Remarks")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("审核备注。");
b.Property<int>("Status")
.HasColumnType("integer")
.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<long?>("UserId")
.HasColumnType("bigint")
.HasComment("用户 ID如绑定平台账号。");
b.HasKey("Id");
b.HasIndex("TenantId", "DisplayName");
b.ToTable("affiliate_partners", null, t =>
{
t.HasComment("分销/推广合作伙伴。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Distribution.Entities.AffiliatePayout", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AffiliatePartnerId")
.HasColumnType("bigint")
.HasComment("合作伙伴标识。");
b.Property<decimal>("Amount")
.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<DateTime?>("PaidAt")
.HasColumnType("timestamp with time zone")
.HasComment("打款时间。");
b.Property<string>("Period")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("结算周期描述。");
b.Property<string>("Remarks")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("备注。");
b.Property<int>("Status")
.HasColumnType("integer")
.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", "AffiliatePartnerId", "Period")
.IsUnique();
b.ToTable("affiliate_payouts", null, t =>
{
t.HasComment("佣金结算记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CheckInCampaign", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("AllowMakeupCount")
.HasColumnType("integer")
.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<string>("Description")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("活动描述。");
b.Property<DateTime>("EndDate")
.HasColumnType("timestamp with time zone")
.HasComment("结束日期。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("活动名称。");
b.Property<string>("RewardsJson")
.IsRequired()
.HasColumnType("text")
.HasComment("连签奖励 JSON。");
b.Property<DateTime>("StartDate")
.HasColumnType("timestamp with time zone")
.HasComment("开始日期。");
b.Property<int>("Status")
.HasColumnType("integer")
.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", "Name");
b.ToTable("checkin_campaigns", null, t =>
{
t.HasComment("签到活动配置。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CheckInRecord", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("CheckInCampaignId")
.HasColumnType("bigint")
.HasComment("活动标识。");
b.Property<DateTime>("CheckInDate")
.HasColumnType("timestamp with time zone")
.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<bool>("IsMakeup")
.HasColumnType("boolean")
.HasComment("是否补签。");
b.Property<string>("RewardJson")
.IsRequired()
.HasColumnType("text")
.HasComment("获得奖励 JSON。");
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<long>("UserId")
.HasColumnType("bigint")
.HasComment("用户标识。");
b.HasKey("Id");
b.HasIndex("TenantId", "CheckInCampaignId", "UserId", "CheckInDate")
.IsUnique();
b.ToTable("checkin_records", null, t =>
{
t.HasComment("用户签到记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CommunityComment", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AuthorUserId")
.HasColumnType("bigint")
.HasComment("评论人。");
b.Property<string>("Content")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.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<bool>("IsDeleted")
.HasColumnType("boolean")
.HasComment("状态。");
b.Property<long?>("ParentId")
.HasColumnType("bigint")
.HasComment("父级评论 ID。");
b.Property<long>("PostId")
.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", "PostId", "CreatedAt");
b.ToTable("community_comments", null, t =>
{
t.HasComment("社区评论。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CommunityPost", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AuthorUserId")
.HasColumnType("bigint")
.HasComment("作者用户 ID。");
b.Property<int>("CommentCount")
.HasColumnType("integer")
.HasComment("评论数。");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("text")
.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<int>("LikeCount")
.HasColumnType("integer")
.HasComment("点赞数。");
b.Property<string>("MediaJson")
.HasColumnType("text")
.HasComment("媒体资源 JSON。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("状态。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<string>("Title")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("标题。");
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", "AuthorUserId", "CreatedAt");
b.ToTable("community_posts", null, t =>
{
t.HasComment("社区动态。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CommunityReaction", 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>("PostId")
.HasColumnType("bigint")
.HasComment("动态 ID。");
b.Property<DateTime>("ReactedAt")
.HasColumnType("timestamp with time zone")
.HasComment("时间戳。");
b.Property<int>("ReactionType")
.HasColumnType("integer")
.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<long>("UserId")
.HasColumnType("bigint")
.HasComment("用户 ID。");
b.HasKey("Id");
b.HasIndex("TenantId", "PostId", "UserId")
.IsUnique();
b.ToTable("community_reactions", null, t =>
{
t.HasComment("社区互动反馈。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.GroupBuying.Entities.GroupOrder", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime?>("CancelledAt")
.HasColumnType("timestamp with time zone")
.HasComment("取消时间。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<int>("CurrentCount")
.HasColumnType("integer")
.HasComment("当前已参与人数。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<DateTime>("EndAt")
.HasColumnType("timestamp with time zone")
.HasComment("结束时间。");
b.Property<string>("GroupOrderNo")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("拼单编号。");
b.Property<decimal>("GroupPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("拼团价格。");
b.Property<long>("LeaderUserId")
.HasColumnType("bigint")
.HasComment("团长用户 ID。");
b.Property<long>("ProductId")
.HasColumnType("bigint")
.HasComment("关联商品或套餐。");
b.Property<DateTime>("StartAt")
.HasColumnType("timestamp with time zone")
.HasComment("开始时间。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("拼团状态。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("门店标识。");
b.Property<DateTime?>("SucceededAt")
.HasColumnType("timestamp with time zone")
.HasComment("成团时间。");
b.Property<int>("TargetCount")
.HasColumnType("integer")
.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", "GroupOrderNo")
.IsUnique();
b.ToTable("group_orders", null, t =>
{
t.HasComment("拼单活动。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.GroupBuying.Entities.GroupParticipant", 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>("GroupOrderId")
.HasColumnType("bigint")
.HasComment("拼单活动标识。");
b.Property<DateTime>("JoinedAt")
.HasColumnType("timestamp with time zone")
.HasComment("参与时间。");
b.Property<long>("OrderId")
.HasColumnType("bigint")
.HasComment("对应订单标识。");
b.Property<int>("Status")
.HasColumnType("integer")
.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<long>("UserId")
.HasColumnType("bigint")
.HasComment("用户标识。");
b.HasKey("Id");
b.HasIndex("TenantId", "GroupOrderId", "UserId")
.IsUnique();
b.ToTable("group_participants", null, t =>
{
t.HasComment("拼单参与者。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Inventory.Entities.InventoryAdjustment", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("AdjustmentType")
.HasColumnType("integer")
.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<long>("InventoryItemId")
.HasColumnType("bigint")
.HasComment("对应的库存记录标识。");
b.Property<DateTime>("OccurredAt")
.HasColumnType("timestamp with time zone")
.HasComment("发生时间。");
b.Property<long?>("OperatorId")
.HasColumnType("bigint")
.HasComment("操作人标识。");
b.Property<int>("Quantity")
.HasColumnType("integer")
.HasComment("调整数量,正数增加,负数减少。");
b.Property<string>("Reason")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.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", "InventoryItemId", "OccurredAt");
b.ToTable("inventory_adjustments", null, t =>
{
t.HasComment("库存调整记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Inventory.Entities.InventoryBatch", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("BatchNumber")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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<DateTime?>("ExpireDate")
.HasColumnType("timestamp with time zone")
.HasComment("过期日期。");
b.Property<long>("ProductSkuId")
.HasColumnType("bigint")
.HasComment("SKU 标识。");
b.Property<DateTime?>("ProductionDate")
.HasColumnType("timestamp with time zone")
.HasComment("生产日期。");
b.Property<int>("Quantity")
.HasColumnType("integer")
.HasComment("入库数量。");
b.Property<int>("RemainingQuantity")
.HasColumnType("integer")
.HasComment("剩余数量。");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("bytea")
.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", "ProductSkuId", "BatchNumber")
.IsUnique();
b.ToTable("inventory_batches", null, t =>
{
t.HasComment("SKU 批次信息。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Inventory.Entities.InventoryItem", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("BatchConsumeStrategy")
.HasColumnType("integer")
.HasComment("批次扣减策略。");
b.Property<string>("BatchNumber")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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<DateTime?>("ExpireDate")
.HasColumnType("timestamp with time zone")
.HasComment("过期日期。");
b.Property<bool>("IsPresale")
.HasColumnType("boolean")
.HasComment("是否预售商品。");
b.Property<bool>("IsSoldOut")
.HasColumnType("boolean")
.HasComment("是否标记售罄。");
b.Property<string>("Location")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("储位或仓位信息。");
b.Property<int?>("MaxQuantityPerOrder")
.HasColumnType("integer")
.HasComment("单品限购(覆盖商品级 MaxQuantityPerOrder。");
b.Property<int?>("PresaleCapacity")
.HasColumnType("integer")
.HasComment("预售名额(上限)。");
b.Property<DateTime?>("PresaleEndTime")
.HasColumnType("timestamp with time zone")
.HasComment("预售结束时间UTC。");
b.Property<int>("PresaleLocked")
.HasColumnType("integer")
.HasComment("当前预售已锁定数量。");
b.Property<DateTime?>("PresaleStartTime")
.HasColumnType("timestamp with time zone")
.HasComment("预售开始时间UTC。");
b.Property<long>("ProductSkuId")
.HasColumnType("bigint")
.HasComment("SKU 标识。");
b.Property<int>("QuantityOnHand")
.HasColumnType("integer")
.HasComment("可用库存。");
b.Property<int>("QuantityReserved")
.HasColumnType("integer")
.HasComment("已锁定库存(订单占用)。");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("bytea")
.HasComment("并发控制字段。");
b.Property<int?>("SafetyStock")
.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", "ProductSkuId", "BatchNumber");
b.ToTable("inventory_items", null, t =>
{
t.HasComment("SKU 在门店的库存信息。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Inventory.Entities.InventoryLockRecord", 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<DateTime?>("ExpiresAt")
.HasColumnType("timestamp with time zone")
.HasComment("过期时间UTC。");
b.Property<string>("IdempotencyKey")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("幂等键。");
b.Property<bool>("IsPresale")
.HasColumnType("boolean")
.HasComment("是否预售锁定。");
b.Property<long>("ProductSkuId")
.HasColumnType("bigint")
.HasComment("SKU ID。");
b.Property<int>("Quantity")
.HasColumnType("integer")
.HasComment("锁定数量。");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("bytea")
.HasComment("并发控制字段。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("锁定状态。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("门店 ID。");
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", "IdempotencyKey")
.IsUnique();
b.HasIndex("TenantId", "StoreId", "ProductSkuId", "Status");
b.ToTable("inventory_lock_records", null, t =>
{
t.HasComment("库存锁定记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberPointLedger", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("BalanceAfterChange")
.HasColumnType("integer")
.HasComment("变动后余额。");
b.Property<int>("ChangeAmount")
.HasColumnType("integer")
.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<DateTime?>("ExpireAt")
.HasColumnType("timestamp with time zone")
.HasComment("过期时间(如适用)。");
b.Property<long>("MemberId")
.HasColumnType("bigint")
.HasComment("会员标识。");
b.Property<DateTime>("OccurredAt")
.HasColumnType("timestamp with time zone")
.HasComment("发生时间。");
b.Property<int>("Reason")
.HasColumnType("integer")
.HasComment("变动原因。");
b.Property<long?>("SourceId")
.HasColumnType("bigint")
.HasComment("来源 ID订单、活动等。");
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", "MemberId", "OccurredAt");
b.ToTable("member_point_ledgers", null, t =>
{
t.HasComment("积分变动流水。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberProfile", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("AvatarUrl")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("头像。");
b.Property<DateTime?>("BirthDate")
.HasColumnType("timestamp with time zone")
.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<int>("GrowthValue")
.HasColumnType("integer")
.HasComment("成长值/经验值。");
b.Property<DateTime>("JoinedAt")
.HasColumnType("timestamp with time zone")
.HasComment("注册时间。");
b.Property<long?>("MemberTierId")
.HasColumnType("bigint")
.HasComment("当前会员等级 ID。");
b.Property<string>("Mobile")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("手机号。");
b.Property<string>("Nickname")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("昵称。");
b.Property<int>("PointsBalance")
.HasColumnType("integer")
.HasComment("会员积分余额。");
b.Property<int>("Status")
.HasColumnType("integer")
.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<long>("UserId")
.HasColumnType("bigint")
.HasComment("用户标识。");
b.HasKey("Id");
b.HasIndex("TenantId", "Mobile")
.IsUnique();
b.ToTable("member_profiles", null, t =>
{
t.HasComment("会员档案。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberTier", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("BenefitsJson")
.IsRequired()
.HasColumnType("text")
.HasComment("等级权益JSON。");
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<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("等级名称。");
b.Property<int>("RequiredGrowth")
.HasColumnType("integer")
.HasComment("所需成长值。");
b.Property<int>("SortOrder")
.HasColumnType("integer")
.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", "Name")
.IsUnique();
b.ToTable("member_tiers", null, t =>
{
t.HasComment("会员等级定义。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.Merchant", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Address")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("详细地址。");
b.Property<string>("BrandAlias")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("品牌简称或别名。");
b.Property<string>("BrandName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("品牌名称(对外展示)。");
b.Property<string>("BusinessLicenseImageUrl")
.HasColumnType("text")
.HasComment("营业执照扫描件地址。");
b.Property<string>("BusinessLicenseNumber")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("营业执照号。");
b.Property<string>("Category")
.HasColumnType("text")
.HasComment("品牌所属品类,如火锅、咖啡等。");
b.Property<string>("City")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("所在城市。");
b.Property<string>("ContactEmail")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("联系邮箱。");
b.Property<string>("ContactPhone")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.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<string>("District")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("所在区县。");
b.Property<DateTime?>("JoinedAt")
.HasColumnType("timestamp with time zone")
.HasComment("入驻时间。");
b.Property<DateTime?>("LastReviewedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次审核时间。");
b.Property<double?>("Latitude")
.HasColumnType("double precision")
.HasComment("纬度信息。");
b.Property<string>("LegalPerson")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("法人或负责人姓名。");
b.Property<string>("LogoUrl")
.HasColumnType("text")
.HasComment("品牌 Logo。");
b.Property<double?>("Longitude")
.HasColumnType("double precision")
.HasComment("经度信息。");
b.Property<string>("Province")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("所在省份。");
b.Property<string>("ReviewRemarks")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("审核备注或驳回原因。");
b.Property<string>("ServicePhone")
.HasColumnType("text")
.HasComment("客服电话。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("入驻状态。");
b.Property<string>("SupportEmail")
.HasColumnType("text")
.HasComment("客服邮箱。");
b.Property<string>("TaxNumber")
.HasColumnType("text")
.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");
b.ToTable("merchants", null, t =>
{
t.HasComment("商户主体信息,承载入驻和资质审核结果。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.MerchantCategory", 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<int>("DisplayOrder")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(0)
.HasComment("显示顺序,越小越靠前。");
b.Property<bool>("IsActive")
.HasColumnType("boolean")
.HasComment("是否可用。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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", "Name")
.IsUnique();
b.ToTable("merchant_categories", null, t =>
{
t.HasComment("商户可选类目。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.MerchantContract", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("ContractNumber")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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<DateTime>("EndDate")
.HasColumnType("timestamp with time zone")
.HasComment("合同结束时间。");
b.Property<string>("FileUrl")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("合同文件存储地址。");
b.Property<long>("MerchantId")
.HasColumnType("bigint")
.HasComment("所属商户标识。");
b.Property<DateTime?>("SignedAt")
.HasColumnType("timestamp with time zone")
.HasComment("签署时间。");
b.Property<DateTime>("StartDate")
.HasColumnType("timestamp with time zone")
.HasComment("合同开始时间。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("合同状态。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<DateTime?>("TerminatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("终止时间。");
b.Property<string>("TerminationReason")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("终止原因。");
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", "MerchantId", "ContractNumber")
.IsUnique();
b.ToTable("merchant_contracts", null, t =>
{
t.HasComment("商户合同记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.MerchantDocument", 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<string>("DocumentNumber")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("证照编号。");
b.Property<int>("DocumentType")
.HasColumnType("integer")
.HasComment("证照类型。");
b.Property<DateTime?>("ExpiresAt")
.HasColumnType("timestamp with time zone")
.HasComment("到期日期。");
b.Property<string>("FileUrl")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("证照文件链接。");
b.Property<DateTime?>("IssuedAt")
.HasColumnType("timestamp with time zone")
.HasComment("签发日期。");
b.Property<long>("MerchantId")
.HasColumnType("bigint")
.HasComment("所属商户标识。");
b.Property<string>("Remarks")
.HasColumnType("text")
.HasComment("审核备注或驳回原因。");
b.Property<int>("Status")
.HasColumnType("integer")
.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", "MerchantId", "DocumentType");
b.ToTable("merchant_documents", null, t =>
{
t.HasComment("商户提交的资质或证照材料。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.MerchantStaff", 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<string>("Email")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("邮箱地址。");
b.Property<long?>("IdentityUserId")
.HasColumnType("bigint")
.HasComment("登录账号 ID指向统一身份体系。");
b.Property<long>("MerchantId")
.HasColumnType("bigint")
.HasComment("所属商户标识。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("员工姓名。");
b.Property<string>("PermissionsJson")
.HasColumnType("text")
.HasComment("自定义权限JSON。");
b.Property<string>("Phone")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("手机号。");
b.Property<int>("RoleType")
.HasColumnType("integer")
.HasComment("员工角色类型。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("员工状态。");
b.Property<long?>("StoreId")
.HasColumnType("bigint")
.HasComment("可选的关联门店 ID。");
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", "MerchantId", "Phone");
b.ToTable("merchant_staff", null, t =>
{
t.HasComment("商户员工账号,支持门店维度分配。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Navigation.Entities.MapLocation", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.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<string>("Landmark")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("打车/导航落点描述。");
b.Property<double>("Latitude")
.HasColumnType("double precision")
.HasComment("纬度。");
b.Property<double>("Longitude")
.HasColumnType("double precision")
.HasComment("经度。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("名称。");
b.Property<long?>("StoreId")
.HasColumnType("bigint")
.HasComment("关联门店 ID可空表示独立 POI。");
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");
b.ToTable("map_locations", null, t =>
{
t.HasComment("地图 POI 信息,用于门店定位和推荐。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Navigation.Entities.NavigationRequest", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("Channel")
.HasColumnType("integer")
.HasComment("来源通道小程序、H5 等)。");
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<DateTime>("RequestedAt")
.HasColumnType("timestamp with time zone")
.HasComment("请求时间。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("门店 ID。");
b.Property<int>("TargetApp")
.HasColumnType("integer")
.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<long>("UserId")
.HasColumnType("bigint")
.HasComment("用户 ID。");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "StoreId", "RequestedAt");
b.ToTable("navigation_requests", null, t =>
{
t.HasComment("用户发起的导航请求日志。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Ordering.Entities.CartItem", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("AttributesJson")
.HasColumnType("text")
.HasComment("扩展 JSON规格、加料选项等。");
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>("ProductId")
.HasColumnType("bigint")
.HasComment("商品或 SKU 标识。");
b.Property<string>("ProductName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("商品名称快照。");
b.Property<long?>("ProductSkuId")
.HasColumnType("bigint")
.HasComment("SKU 标识。");
b.Property<int>("Quantity")
.HasColumnType("integer")
.HasComment("数量。");
b.Property<string>("Remark")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("自定义备注(口味要求)。");
b.Property<long>("ShoppingCartId")
.HasColumnType("bigint")
.HasComment("所属购物车标识。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("状态。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<decimal>("UnitPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("单价快照。");
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", "ShoppingCartId");
b.ToTable("cart_items", null, t =>
{
t.HasComment("购物车条目。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Ordering.Entities.CartItemAddon", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("CartItemId")
.HasColumnType("bigint")
.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>("ExtraPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("附加价格。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("选项名称。");
b.Property<long?>("OptionId")
.HasColumnType("bigint")
.HasComment("选项 ID可对应 ProductAddonOption。");
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.ToTable("cart_item_addons", null, t =>
{
t.HasComment("购物车条目的加料/附加项。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Ordering.Entities.CheckoutSession", 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<DateTime>("ExpiresAt")
.HasColumnType("timestamp with time zone")
.HasComment("过期时间UTC。");
b.Property<string>("SessionToken")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("会话 Token。");
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.Property<long>("UserId")
.HasColumnType("bigint")
.HasComment("用户标识。");
b.Property<string>("ValidationResultJson")
.IsRequired()
.HasColumnType("text")
.HasComment("校验结果明细 JSON。");
b.HasKey("Id");
b.HasIndex("TenantId", "SessionToken")
.IsUnique();
b.ToTable("checkout_sessions", null, t =>
{
t.HasComment("结账会话,记录校验上下文。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Ordering.Entities.ShoppingCart", 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<string>("DeliveryPreference")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("履约方式(堂食/自提/配送)缓存。");
b.Property<DateTime>("LastModifiedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次修改时间UTC。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("购物车状态,包含正常/锁定。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("门店标识。");
b.Property<string>("TableContext")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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<long>("UserId")
.HasColumnType("bigint")
.HasComment("用户标识。");
b.HasKey("Id");
b.HasIndex("TenantId", "UserId", "StoreId")
.IsUnique();
b.ToTable("shopping_carts", null, t =>
{
t.HasComment("用户购物车,按租户/门店隔离。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.Order", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("CancelReason")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("取消原因。");
b.Property<DateTime?>("CancelledAt")
.HasColumnType("timestamp with time zone")
.HasComment("取消时间。");
b.Property<int>("Channel")
.HasColumnType("integer")
.HasComment("下单渠道。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<string>("CustomerName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("顾客姓名。");
b.Property<string>("CustomerPhone")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("顾客手机号。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<int>("DeliveryType")
.HasColumnType("integer")
.HasComment("履约类型。");
b.Property<decimal>("DiscountAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("优惠金额。");
b.Property<DateTime?>("FinishedAt")
.HasColumnType("timestamp with time zone")
.HasComment("完成时间。");
b.Property<decimal>("ItemsAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("商品总额。");
b.Property<string>("OrderNo")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("订单号。");
b.Property<decimal>("PaidAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("实付金额。");
b.Property<DateTime?>("PaidAt")
.HasColumnType("timestamp with time zone")
.HasComment("支付时间。");
b.Property<decimal>("PayableAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("应付金额。");
b.Property<int>("PaymentStatus")
.HasColumnType("integer")
.HasComment("支付状态。");
b.Property<string>("QueueNumber")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("排队号(如有)。");
b.Property<string>("Remark")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("备注。");
b.Property<long?>("ReservationId")
.HasColumnType("bigint")
.HasComment("预约 ID。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("当前状态。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("门店。");
b.Property<string>("TableNo")
.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", "OrderNo")
.IsUnique();
b.HasIndex("TenantId", "StoreId", "Status");
b.ToTable("orders", null, t =>
{
t.HasComment("交易订单。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.OrderItem", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("AttributesJson")
.HasColumnType("text")
.HasComment("自定义属性 JSON。");
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>("DiscountAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("折扣金额。");
b.Property<long>("OrderId")
.HasColumnType("bigint")
.HasComment("订单 ID。");
b.Property<long>("ProductId")
.HasColumnType("bigint")
.HasComment("商品 ID。");
b.Property<string>("ProductName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("商品名称。");
b.Property<int>("Quantity")
.HasColumnType("integer")
.HasComment("数量。");
b.Property<string>("SkuName")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("SKU/规格描述。");
b.Property<decimal>("SubTotal")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("小计。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<string>("Unit")
.HasMaxLength(16)
.HasColumnType("character varying(16)")
.HasComment("单位。");
b.Property<decimal>("UnitPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("单价。");
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("OrderId");
b.HasIndex("TenantId", "OrderId");
b.ToTable("order_items", null, t =>
{
t.HasComment("订单明细。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.OrderStatusHistory", 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<string>("Notes")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("备注信息。");
b.Property<DateTime>("OccurredAt")
.HasColumnType("timestamp with time zone")
.HasComment("发生时间。");
b.Property<long?>("OperatorId")
.HasColumnType("bigint")
.HasComment("操作人标识(可为空表示系统)。");
b.Property<long>("OrderId")
.HasColumnType("bigint")
.HasComment("订单标识。");
b.Property<int>("Status")
.HasColumnType("integer")
.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", "OrderId", "OccurredAt");
b.ToTable("order_status_histories", null, t =>
{
t.HasComment("订单状态流转记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.RefundRequest", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("Amount")
.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<long>("OrderId")
.HasColumnType("bigint")
.HasComment("关联订单标识。");
b.Property<DateTime?>("ProcessedAt")
.HasColumnType("timestamp with time zone")
.HasComment("审核完成时间。");
b.Property<string>("Reason")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("申请原因。");
b.Property<string>("RefundNo")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("退款单号。");
b.Property<DateTime>("RequestedAt")
.HasColumnType("timestamp with time zone")
.HasComment("用户提交时间。");
b.Property<string>("ReviewNotes")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("审核备注。");
b.Property<int>("Status")
.HasColumnType("integer")
.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", "RefundNo")
.IsUnique();
b.ToTable("refund_requests", null, t =>
{
t.HasComment("售后/退款申请。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Payments.Entities.PaymentRecord", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("Amount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("支付金额。");
b.Property<string>("ChannelTransactionId")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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<int>("Method")
.HasColumnType("integer")
.HasComment("支付方式。");
b.Property<long>("OrderId")
.HasColumnType("bigint")
.HasComment("关联订单。");
b.Property<DateTime?>("PaidAt")
.HasColumnType("timestamp with time zone")
.HasComment("支付完成时间。");
b.Property<string>("Payload")
.HasColumnType("text")
.HasComment("原始回调内容。");
b.Property<string>("Remark")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("错误/备注。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("支付状态。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<string>("TradeNo")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("平台交易号。");
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", "OrderId");
b.ToTable("payment_records", null, t =>
{
t.HasComment("支付流水。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Payments.Entities.PaymentRefundRecord", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("Amount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("退款金额。");
b.Property<string>("ChannelRefundId")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("渠道退款流水号。");
b.Property<DateTime?>("CompletedAt")
.HasColumnType("timestamp with time zone")
.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<long>("OrderId")
.HasColumnType("bigint")
.HasComment("关联订单标识。");
b.Property<string>("Payload")
.HasColumnType("text")
.HasComment("渠道返回的原始数据 JSON。");
b.Property<long>("PaymentRecordId")
.HasColumnType("bigint")
.HasComment("原支付记录标识。");
b.Property<DateTime>("RequestedAt")
.HasColumnType("timestamp with time zone")
.HasComment("退款请求时间。");
b.Property<int>("Status")
.HasColumnType("integer")
.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", "PaymentRecordId");
b.ToTable("payment_refund_records", null, t =>
{
t.HasComment("支付渠道退款流水。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.Product", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("CategoryId")
.HasColumnType("bigint")
.HasComment("所属分类。");
b.Property<string>("CoverImage")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.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<string>("Description")
.HasColumnType("text")
.HasComment("商品描述。");
b.Property<bool>("EnableDelivery")
.HasColumnType("boolean")
.HasComment("支持配送。");
b.Property<bool>("EnableDineIn")
.HasColumnType("boolean")
.HasComment("支持堂食。");
b.Property<bool>("EnablePickup")
.HasColumnType("boolean")
.HasComment("支持自提。");
b.Property<string>("GalleryImages")
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasComment("Gallery 图片逗号分隔。");
b.Property<bool>("IsFeatured")
.HasColumnType("boolean")
.HasComment("是否热门推荐。");
b.Property<int?>("MaxQuantityPerOrder")
.HasColumnType("integer")
.HasComment("最大每单限购。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("商品名称。");
b.Property<decimal?>("OriginalPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("原价。");
b.Property<decimal>("Price")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("现价。");
b.Property<string>("SpuCode")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("商品编码。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("商品状态。");
b.Property<int?>("StockQuantity")
.HasColumnType("integer")
.HasComment("库存数量(可选)。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("所属门店。");
b.Property<string>("Subtitle")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("副标题/卖点。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<string>("Unit")
.HasMaxLength(16)
.HasColumnType("character varying(16)")
.HasComment("售卖单位(份/杯等)。");
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", "SpuCode")
.IsUnique();
b.HasIndex("TenantId", "StoreId");
b.ToTable("products", null, t =>
{
t.HasComment("商品SPU信息。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductAddonGroup", 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<bool>("IsRequired")
.HasColumnType("boolean")
.HasComment("是否必选。");
b.Property<int?>("MaxSelect")
.HasColumnType("integer")
.HasComment("最大选择数量。");
b.Property<int?>("MinSelect")
.HasColumnType("integer")
.HasComment("最小选择数量。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("分组名称。");
b.Property<long>("ProductId")
.HasColumnType("bigint")
.HasComment("所属商品。");
b.Property<int>("SelectionType")
.HasColumnType("integer")
.HasComment("选择类型。");
b.Property<int>("SortOrder")
.HasColumnType("integer")
.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", "ProductId", "Name");
b.ToTable("product_addon_groups", null, t =>
{
t.HasComment("加料/做法分组。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductAddonOption", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AddonGroupId")
.HasColumnType("bigint")
.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?>("ExtraPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("附加价格。");
b.Property<bool>("IsDefault")
.HasColumnType("boolean")
.HasComment("是否默认选项。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("选项名称。");
b.Property<int>("SortOrder")
.HasColumnType("integer")
.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.ToTable("product_addon_options", null, t =>
{
t.HasComment("加料选项。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductAttributeGroup", 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<bool>("IsRequired")
.HasColumnType("boolean")
.HasComment("是否必选。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("分组名称,例如“辣度”“份量”。");
b.Property<long>("ProductId")
.HasColumnType("bigint")
.HasComment("所属商品标识。");
b.Property<int>("SelectionType")
.HasColumnType("integer")
.HasComment("选择类型(单选/多选)。");
b.Property<int>("SortOrder")
.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", "Name");
b.ToTable("product_attribute_groups", null, t =>
{
t.HasComment("商品规格/属性分组。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductAttributeOption", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AttributeGroupId")
.HasColumnType("bigint")
.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?>("ExtraPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("附加价格。");
b.Property<bool>("IsDefault")
.HasColumnType("boolean")
.HasComment("是否默认选中。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("选项名称。");
b.Property<int>("SortOrder")
.HasColumnType("integer")
.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", "AttributeGroupId", "Name")
.IsUnique();
b.ToTable("product_attribute_options", null, t =>
{
t.HasComment("商品规格选项。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductCategory", 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<string>("Description")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("分类描述。");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean")
.HasComment("是否启用。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("分类名称。");
b.Property<int>("SortOrder")
.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");
b.ToTable("product_categories", null, t =>
{
t.HasComment("商品分类。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductMediaAsset", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Caption")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.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<int>("MediaType")
.HasColumnType("integer")
.HasComment("媒体类型。");
b.Property<long>("ProductId")
.HasColumnType("bigint")
.HasComment("商品标识。");
b.Property<int>("SortOrder")
.HasColumnType("integer")
.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<string>("Url")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("媒资链接。");
b.HasKey("Id");
b.ToTable("product_media_assets", null, t =>
{
t.HasComment("商品媒资素材。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductPricingRule", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("ConditionsJson")
.IsRequired()
.HasColumnType("text")
.HasComment("条件描述JSON如会员等级、渠道等。");
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<DateTime?>("EndTime")
.HasColumnType("timestamp with time zone")
.HasComment("生效结束时间。");
b.Property<decimal>("Price")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("特殊价格。");
b.Property<long>("ProductId")
.HasColumnType("bigint")
.HasComment("所属商品。");
b.Property<int>("RuleType")
.HasColumnType("integer")
.HasComment("策略类型。");
b.Property<int>("SortOrder")
.HasColumnType("integer")
.HasComment("排序值。");
b.Property<DateTime?>("StartTime")
.HasColumnType("timestamp with time zone")
.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<string>("WeekdaysJson")
.HasColumnType("text")
.HasComment("生效星期JSON 数组)。");
b.HasKey("Id");
b.HasIndex("TenantId", "ProductId", "RuleType");
b.ToTable("product_pricing_rules", null, t =>
{
t.HasComment("商品价格策略,支持会员价/时段价等。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductSku", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("AttributesJson")
.IsRequired()
.HasColumnType("text")
.HasComment("规格属性 JSON记录选项 ID。");
b.Property<string>("Barcode")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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?>("OriginalPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("原价。");
b.Property<decimal>("Price")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("售价。");
b.Property<long>("ProductId")
.HasColumnType("bigint")
.HasComment("所属商品标识。");
b.Property<string>("SkuCode")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("SKU 编码。");
b.Property<int>("SortOrder")
.HasColumnType("integer")
.HasComment("排序值。");
b.Property<int?>("StockQuantity")
.HasColumnType("integer")
.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<decimal?>("Weight")
.HasPrecision(10, 3)
.HasColumnType("numeric(10,3)")
.HasComment("重量(千克)。");
b.HasKey("Id");
b.HasIndex("TenantId", "SkuCode")
.IsUnique();
b.ToTable("product_skus", null, t =>
{
t.HasComment("商品 SKU记录具体规格组合价格。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Queues.Entities.QueueTicket", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime?>("CalledAt")
.HasColumnType("timestamp with time zone")
.HasComment("叫号时间。");
b.Property<DateTime?>("CancelledAt")
.HasColumnType("timestamp with time zone")
.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<int?>("EstimatedWaitMinutes")
.HasColumnType("integer")
.HasComment("预计等待分钟。");
b.Property<DateTime?>("ExpiredAt")
.HasColumnType("timestamp with time zone")
.HasComment("过号时间。");
b.Property<int>("PartySize")
.HasColumnType("integer")
.HasComment("就餐人数。");
b.Property<string>("Remark")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("备注。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("状态。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("获取或设置所属门店 ID。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<string>("TicketNumber")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("排队编号。");
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");
b.HasIndex("TenantId", "StoreId", "TicketNumber")
.IsUnique();
b.ToTable("queue_tickets", null, t =>
{
t.HasComment("排队叫号。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Reservations.Entities.Reservation", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime?>("CancelledAt")
.HasColumnType("timestamp with time zone")
.HasComment("取消时间。");
b.Property<string>("CheckInCode")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("核销码/到店码。");
b.Property<DateTime?>("CheckedInAt")
.HasColumnType("timestamp with time zone")
.HasComment("实际签到时间。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<string>("CustomerName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("客户姓名。");
b.Property<string>("CustomerPhone")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("联系电话。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<int>("PeopleCount")
.HasColumnType("integer")
.HasComment("用餐人数。");
b.Property<string>("Remark")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("备注。");
b.Property<string>("ReservationNo")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("预约号。");
b.Property<DateTime>("ReservationTime")
.HasColumnType("timestamp with time zone")
.HasComment("预约时间UTC。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("状态。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("门店。");
b.Property<string>("TablePreference")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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", "ReservationNo")
.IsUnique();
b.HasIndex("TenantId", "StoreId");
b.ToTable("reservations", null, t =>
{
t.HasComment("预约/预订记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.Store", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Address")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("详细地址。");
b.Property<string>("Announcement")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("门店公告。");
b.Property<string>("BusinessHours")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("门店营业时段描述(备用字符串)。");
b.Property<string>("City")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("所在城市。");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("门店编码,便于扫码及外部对接。");
b.Property<string>("Country")
.HasColumnType("text")
.HasComment("所在国家或地区。");
b.Property<string>("CoverImageUrl")
.HasColumnType("text")
.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>("DeliveryRadiusKm")
.HasPrecision(6, 2)
.HasColumnType("numeric(6,2)")
.HasComment("默认配送半径(公里)。");
b.Property<string>("Description")
.HasColumnType("text")
.HasComment("门店描述或公告。");
b.Property<string>("District")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("区县信息。");
b.Property<double?>("Latitude")
.HasColumnType("double precision")
.HasComment("纬度。");
b.Property<double?>("Longitude")
.HasColumnType("double precision")
.HasComment("高德/腾讯地图经度。");
b.Property<string>("ManagerName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("门店负责人姓名。");
b.Property<long>("MerchantId")
.HasColumnType("bigint")
.HasComment("所属商户标识。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("门店名称。");
b.Property<string>("Phone")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("联系电话。");
b.Property<string>("Province")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("所在省份。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("门店当前运营状态。");
b.Property<bool>("SupportsDelivery")
.HasColumnType("boolean")
.HasComment("是否支持配送。");
b.Property<bool>("SupportsDineIn")
.HasColumnType("boolean")
.HasComment("是否支持堂食。");
b.Property<bool>("SupportsPickup")
.HasColumnType("boolean")
.HasComment("是否支持自提。");
b.Property<bool>("SupportsQueueing")
.HasColumnType("boolean")
.HasComment("支持排队叫号。");
b.Property<bool>("SupportsReservation")
.HasColumnType("boolean")
.HasComment("支持预约。");
b.Property<string>("Tags")
.HasColumnType("text")
.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", "Code")
.IsUnique();
b.HasIndex("TenantId", "MerchantId");
b.ToTable("stores", null, t =>
{
t.HasComment("门店信息,承载营业配置与能力。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreBusinessHour", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int?>("CapacityLimit")
.HasColumnType("integer")
.HasComment("最大接待容量或单量限制。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<int>("DayOfWeek")
.HasColumnType("integer")
.HasComment("星期几0 表示周日。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<TimeSpan>("EndTime")
.HasColumnType("interval")
.HasComment("结束时间(本地时间)。");
b.Property<int>("HourType")
.HasColumnType("integer")
.HasComment("时段类型(正常营业、休息、预约等)。");
b.Property<string>("Notes")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("备注。");
b.Property<TimeSpan>("StartTime")
.HasColumnType("interval")
.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", "DayOfWeek");
b.ToTable("store_business_hours", null, t =>
{
t.HasComment("门店营业时段配置。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreDeliveryZone", 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?>("DeliveryFee")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("配送费。");
b.Property<int?>("EstimatedMinutes")
.HasColumnType("integer")
.HasComment("预计送达分钟。");
b.Property<decimal?>("MinimumOrderAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("起送价。");
b.Property<string>("PolygonGeoJson")
.IsRequired()
.HasColumnType("text")
.HasComment("GeoJSON 表示的多边形范围。");
b.Property<int>("SortOrder")
.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.Property<string>("ZoneName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("区域名称。");
b.HasKey("Id");
b.HasIndex("TenantId", "StoreId", "ZoneName");
b.ToTable("store_delivery_zones", null, t =>
{
t.HasComment("门店配送范围配置。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreEmployeeShift", 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<TimeSpan>("EndTime")
.HasColumnType("interval")
.HasComment("结束时间。");
b.Property<string>("Notes")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("备注。");
b.Property<int>("RoleType")
.HasColumnType("integer")
.HasComment("排班角色。");
b.Property<DateTime>("ShiftDate")
.HasColumnType("timestamp with time zone")
.HasComment("班次日期。");
b.Property<long>("StaffId")
.HasColumnType("bigint")
.HasComment("员工标识。");
b.Property<TimeSpan>("StartTime")
.HasColumnType("interval")
.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", "ShiftDate", "StaffId")
.IsUnique();
b.ToTable("store_employee_shifts", null, t =>
{
t.HasComment("门店员工排班记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreHoliday", 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>("Date")
.HasColumnType("timestamp with time zone")
.HasComment("日期。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<bool>("IsClosed")
.HasColumnType("boolean")
.HasComment("是否全天闭店。");
b.Property<string>("Reason")
.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", "Date")
.IsUnique();
b.ToTable("store_holidays", null, t =>
{
t.HasComment("门店休息日或特殊营业日。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StorePickupSetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("AllowDaysAhead")
.HasColumnType("integer")
.HasComment("可预约天数(含当天)。");
b.Property<bool>("AllowToday")
.HasColumnType("boolean")
.HasComment("是否允许当天自提。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<int>("DefaultCutoffMinutes")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(30)
.HasComment("默认截单分钟(开始前多少分钟截止)。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<int?>("MaxQuantityPerOrder")
.HasColumnType("integer")
.HasComment("单笔自提最大份数。");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("bytea")
.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")
.IsUnique();
b.ToTable("store_pickup_settings", null, t =>
{
t.HasComment("门店自提配置。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StorePickupSlot", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("Capacity")
.HasColumnType("integer")
.HasComment("容量(份数)。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<int>("CutoffMinutes")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(30)
.HasComment("截单分钟(开始前多少分钟截止)。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<TimeSpan>("EndTime")
.HasColumnType("interval")
.HasComment("当天结束时间UTC。");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean")
.HasComment("是否启用。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("档期名称。");
b.Property<int>("ReservedCount")
.HasColumnType("integer")
.HasComment("已占用数量。");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("bytea")
.HasComment("并发控制字段。");
b.Property<TimeSpan>("StartTime")
.HasColumnType("interval")
.HasComment("当天开始时间UTC。");
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.Property<string>("Weekdays")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("适用星期(逗号分隔 1-7。");
b.HasKey("Id");
b.HasIndex("TenantId", "StoreId", "Name");
b.ToTable("store_pickup_slots", null, t =>
{
t.HasComment("门店自提档期。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreTable", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long?>("AreaId")
.HasColumnType("bigint")
.HasComment("所在区域 ID。");
b.Property<int>("Capacity")
.HasColumnType("integer")
.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<string>("QrCodeUrl")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("桌码二维码地址。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("当前桌台状态。");
b.Property<long>("StoreId")
.HasColumnType("bigint")
.HasComment("门店标识。");
b.Property<string>("TableCode")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("桌码。");
b.Property<string>("Tags")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.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", "TableCode")
.IsUnique();
b.ToTable("store_tables", null, t =>
{
t.HasComment("桌台信息与二维码绑定。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreTableArea", 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<string>("Description")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("区域描述。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("区域名称。");
b.Property<int>("SortOrder")
.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", "Name")
.IsUnique();
b.ToTable("store_table_areas", null, t =>
{
t.HasComment("门店桌台区域配置。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.QuotaPackage", 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<string>("Description")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("描述。");
b.Property<bool>("IsActive")
.HasColumnType("boolean")
.HasComment("是否上架。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("配额包名称。");
b.Property<decimal>("Price")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("价格。");
b.Property<int>("QuotaType")
.HasColumnType("integer")
.HasComment("配额类型。");
b.Property<decimal>("QuotaValue")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("配额数值。");
b.Property<int>("SortOrder")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(0)
.HasComment("排序。");
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("QuotaType", "IsActive", "SortOrder");
b.ToTable("quota_packages", null, t =>
{
t.HasComment("配额包定义(平台提供的可购买配额包)。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.Tenant", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Address")
.HasColumnType("text")
.HasComment("详细地址信息。");
b.Property<string>("City")
.HasColumnType("text")
.HasComment("所在城市。");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("租户短编码,作为跨系统引用的唯一标识。");
b.Property<string>("ContactEmail")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("主联系人邮箱。");
b.Property<string>("ContactName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("主联系人姓名。");
b.Property<string>("ContactPhone")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("主联系人电话。");
b.Property<string>("Country")
.HasColumnType("text")
.HasComment("所在国家/地区。");
b.Property<string>("CoverImageUrl")
.HasColumnType("text")
.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<DateTime?>("EffectiveFrom")
.HasColumnType("timestamp with time zone")
.HasComment("服务生效时间UTC。");
b.Property<DateTime?>("EffectiveTo")
.HasColumnType("timestamp with time zone")
.HasComment("服务到期时间UTC。");
b.Property<string>("Industry")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("所属行业,如餐饮、零售等。");
b.Property<string>("LegalEntityName")
.HasColumnType("text")
.HasComment("法人或公司主体名称。");
b.Property<string>("LogoUrl")
.HasColumnType("text")
.HasComment("LOGO 图片地址。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("租户全称或品牌名称。");
b.Property<long?>("PrimaryOwnerUserId")
.HasColumnType("bigint")
.HasComment("系统内对应的租户所有者账号 ID。");
b.Property<string>("Province")
.HasColumnType("text")
.HasComment("所在省份或州。");
b.Property<string>("Remarks")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("备注信息,用于运营记录特殊说明。");
b.Property<string>("ShortName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("对外展示的简称。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("租户当前状态,涵盖审核、启用、停用等场景。");
b.Property<DateTime?>("SuspendedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次暂停服务时间。");
b.Property<string>("SuspensionReason")
.HasColumnType("text")
.HasComment("暂停或终止的原因说明。");
b.Property<string>("Tags")
.HasColumnType("text")
.HasComment("业务标签集合(逗号分隔)。");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间UTC从未更新时为 null。");
b.Property<long?>("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property<string>("Website")
.HasColumnType("text")
.HasComment("官网或主要宣传链接。");
b.HasKey("Id");
b.HasIndex("Code")
.IsUnique();
b.HasIndex("ContactPhone")
.IsUnique();
b.ToTable("tenants", null, t =>
{
t.HasComment("平台租户信息,描述租户的生命周期与基础资料。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantAnnouncement", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("AnnouncementType")
.HasColumnType("integer")
.HasComment("公告类型。");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("text")
.HasComment("公告正文(可为 Markdown/HTML前端自行渲染。");
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<DateTime>("EffectiveFrom")
.HasColumnType("timestamp with time zone")
.HasComment("生效时间UTC。");
b.Property<DateTime?>("EffectiveTo")
.HasColumnType("timestamp with time zone")
.HasComment("失效时间UTC为空表示长期有效。");
b.Property<int>("PublisherScope")
.HasColumnType("integer")
.HasComment("发布者范围。");
b.Property<long?>("PublisherUserId")
.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()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("bytea")
.HasComment("并发控制字段。");
b.Property<bool>("IsActive")
.HasColumnType("boolean")
.HasComment("是否启用(已弃用,迁移期保留)。");
b.Property<int>("Priority")
.HasColumnType("integer")
.HasComment("展示优先级,数值越大越靠前。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("公告标题。");
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", "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("租户公告。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantAnnouncementRead", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AnnouncementId")
.HasColumnType("bigint")
.HasComment("公告 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<DateTime>("ReadAt")
.HasColumnType("timestamp with time zone")
.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<long?>("UserId")
.HasColumnType("bigint")
.HasComment("已读用户 ID后台账号为空表示租户级已读。");
b.HasKey("Id");
b.HasIndex("TenantId", "AnnouncementId", "UserId")
.IsUnique();
b.ToTable("tenant_announcement_reads", null, t =>
{
t.HasComment("租户公告已读记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantBillingStatement", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("AmountDue")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("应付金额(原始金额)。");
b.Property<decimal>("AmountPaid")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("实付金额。");
b.Property<int>("BillingType")
.HasColumnType("integer")
.HasComment("账单类型(订阅账单/配额包账单/手动账单/续费账单)。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<string>("Currency")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(8)
.HasColumnType("character varying(8)")
.HasDefaultValue("CNY")
.HasComment("货币类型(默认 CNY。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<decimal>("DiscountAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("折扣金额。");
b.Property<DateTime>("DueDate")
.HasColumnType("timestamp with time zone")
.HasComment("到期日。");
b.Property<string>("LineItemsJson")
.HasColumnType("text")
.HasComment("账单明细 JSON记录各项费用。");
b.Property<string>("Notes")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("备注信息(如:人工备注、取消原因等)。");
b.Property<DateTime?>("OverdueNotifiedAt")
.HasColumnType("timestamp with time zone")
.HasComment("逾期通知时间。");
b.Property<DateTime>("PeriodEnd")
.HasColumnType("timestamp with time zone")
.HasComment("账单周期结束时间。");
b.Property<DateTime>("PeriodStart")
.HasColumnType("timestamp with time zone")
.HasComment("账单周期开始时间。");
b.Property<DateTime?>("ReminderSentAt")
.HasColumnType("timestamp with time zone")
.HasComment("提醒发送时间(续费提醒、逾期提醒等)。");
b.Property<string>("StatementNo")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("账单编号,供对账查询。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("当前付款状态。");
b.Property<long?>("SubscriptionId")
.HasColumnType("bigint")
.HasComment("关联的订阅 ID仅当 BillingType 为 Subscription 或 Renewal 时有值)。");
b.Property<decimal>("TaxAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.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("CreatedAt")
.HasDatabaseName("idx_billing_created_at");
b.HasIndex("Status", "DueDate")
.HasDatabaseName("idx_billing_status_duedate")
.HasFilter("\"Status\" IN (0, 2)");
b.HasIndex("TenantId", "StatementNo")
.IsUnique();
b.HasIndex("TenantId", "Status", "DueDate")
.HasDatabaseName("idx_billing_tenant_status_duedate");
b.ToTable("tenant_billing_statements", null, t =>
{
t.HasComment("租户账单,用于呈现周期性收费。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("Channel")
.HasColumnType("integer")
.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<string>("Message")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasComment("通知正文。");
b.Property<string>("MetadataJson")
.HasColumnType("text")
.HasComment("附加元数据 JSON。");
b.Property<DateTime?>("ReadAt")
.HasColumnType("timestamp with time zone")
.HasComment("租户是否已阅读。");
b.Property<DateTime>("SentAt")
.HasColumnType("timestamp with time zone")
.HasComment("推送时间。");
b.Property<int>("Severity")
.HasColumnType("integer")
.HasComment("通知重要级别。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("通知标题。");
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", "Channel", "SentAt");
b.ToTable("tenant_notifications", null, t =>
{
t.HasComment("面向租户的站内通知或消息推送。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantPackage", 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<string>("Description")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("套餐描述,包含适用场景、权益等。");
b.Property<string>("FeaturePoliciesJson")
.HasColumnType("text")
.HasComment("权益明细 JSON记录自定义特性开关。");
b.Property<bool>("IsActive")
.HasColumnType("boolean")
.HasComment("是否仍启用(平台控制)。");
b.Property<bool>("IsAllowNewTenantPurchase")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(true)
.HasComment("是否允许新租户购买/选择(仅影响新购)。");
b.Property<bool>("IsPublicVisible")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(true)
.HasComment("是否对外可见(展示页/套餐列表可见性)。");
b.Property<bool>("IsRecommended")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(false)
.HasComment("是否推荐展示(运营推荐标识)。");
b.Property<int?>("MaxAccountCount")
.HasColumnType("integer")
.HasComment("允许创建的最大账号数。");
b.Property<int?>("MaxDeliveryOrders")
.HasColumnType("integer")
.HasComment("每月可调用的配送单数量上限。");
b.Property<int?>("MaxSmsCredits")
.HasColumnType("integer")
.HasComment("每月短信额度上限。");
b.Property<int?>("MaxStorageGb")
.HasColumnType("integer")
.HasComment("存储容量上限GB。");
b.Property<int?>("MaxStoreCount")
.HasColumnType("integer")
.HasComment("允许的最大门店数。");
b.Property<decimal?>("MonthlyPrice")
.HasColumnType("numeric")
.HasComment("月付价格,单位:人民币元。");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("套餐名称,展示给租户的简称。");
b.Property<int>("PackageType")
.HasColumnType("integer")
.HasComment("套餐分类(试用、标准、旗舰等)。");
b.Property<int>("PublishStatus")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(0)
.HasComment("发布状态0=草稿1=已发布。");
b.Property<int>("SortOrder")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(0)
.HasComment("展示排序,数值越小越靠前。");
b.PrimitiveCollection<string[]>("Tags")
.IsRequired()
.HasColumnType("text[]")
.HasComment("套餐标签(用于展示与对比页)。");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间UTC从未更新时为 null。");
b.Property<long?>("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property<decimal?>("YearlyPrice")
.HasColumnType("numeric")
.HasComment("年付价格,单位:人民币元。");
b.HasKey("Id");
b.HasIndex("IsActive", "SortOrder");
b.HasIndex("PublishStatus", "IsActive", "IsPublicVisible", "IsAllowNewTenantPurchase", "SortOrder");
b.ToTable("tenant_packages", null, t =>
{
t.HasComment("平台提供的租户套餐定义。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantPayment", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("Amount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("支付金额。");
b.Property<long>("BillingStatementId")
.HasColumnType("bigint")
.HasComment("关联的账单 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<int>("Method")
.HasColumnType("integer")
.HasComment("支付方式。");
b.Property<string>("Notes")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("备注信息。");
b.Property<DateTime?>("PaidAt")
.HasColumnType("timestamp with time zone")
.HasComment("支付时间。");
b.Property<string>("ProofUrl")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("支付凭证 URL。");
b.Property<string>("RefundReason")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("退款原因。");
b.Property<DateTime?>("RefundedAt")
.HasColumnType("timestamp with time zone")
.HasComment("退款时间。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("支付状态。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<string>("TransactionNo")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("交易号。");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次更新时间UTC从未更新时为 null。");
b.Property<long?>("UpdatedBy")
.HasColumnType("bigint")
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
b.Property<DateTime?>("VerifiedAt")
.HasColumnType("timestamp with time zone")
.HasComment("审核时间。");
b.Property<long?>("VerifiedBy")
.HasColumnType("bigint")
.HasComment("审核人 ID管理员。");
b.HasKey("Id");
b.HasIndex("TransactionNo")
.HasDatabaseName("idx_payment_transaction_no")
.HasFilter("\"TransactionNo\" IS NOT NULL");
b.HasIndex("BillingStatementId", "PaidAt")
.HasDatabaseName("idx_payment_billing_paidat");
b.HasIndex("TenantId", "BillingStatementId");
b.ToTable("tenant_payments", null, t =>
{
t.HasComment("租户支付记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantQuotaPackagePurchase", 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<DateTime?>("ExpiredAt")
.HasColumnType("timestamp with time zone")
.HasComment("过期时间(可选)。");
b.Property<string>("Notes")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("备注。");
b.Property<decimal>("Price")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.HasComment("购买价格。");
b.Property<DateTime>("PurchasedAt")
.HasColumnType("timestamp with time zone")
.HasComment("购买时间。");
b.Property<long>("QuotaPackageId")
.HasColumnType("bigint")
.HasComment("配额包 ID。");
b.Property<decimal>("QuotaValue")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)")
.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", "QuotaPackageId", "PurchasedAt");
b.ToTable("tenant_quota_package_purchases", null, t =>
{
t.HasComment("租户配额包购买记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantQuotaUsage", 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<DateTime?>("LastResetAt")
.HasColumnType("timestamp with time zone")
.HasComment("最近一次重置时间。");
b.Property<decimal>("LimitValue")
.HasColumnType("numeric")
.HasComment("当前配额上限。");
b.Property<int>("QuotaType")
.HasColumnType("integer")
.HasComment("配额类型,例如门店数、短信条数等。");
b.Property<string>("ResetCycle")
.HasColumnType("text")
.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<decimal>("UsedValue")
.HasColumnType("numeric")
.HasComment("已消耗的数量。");
b.HasKey("Id");
b.HasIndex("TenantId", "QuotaType")
.IsUnique();
b.ToTable("tenant_quota_usages", null, t =>
{
t.HasComment("租户配额使用情况快照。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantQuotaUsageHistory", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal?>("ChangeAmount")
.HasColumnType("numeric")
.HasComment("变更量(可选)。");
b.Property<string>("ChangeReason")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasComment("变更原因(可选)。");
b.Property<int>("ChangeType")
.HasColumnType("integer")
.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>("LimitValue")
.HasColumnType("numeric")
.HasComment("限额值(记录时刻的快照)。");
b.Property<int>("QuotaType")
.HasColumnType("integer")
.HasComment("配额类型。");
b.Property<DateTime>("RecordedAt")
.HasColumnType("timestamp with time zone")
.HasComment("记录时间UTC。");
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<decimal>("UsedValue")
.HasColumnType("numeric")
.HasComment("已使用值(记录时刻的快照)。");
b.HasKey("Id");
b.HasIndex("TenantId", "RecordedAt");
b.HasIndex("TenantId", "QuotaType", "RecordedAt");
b.ToTable("tenant_quota_usage_histories", null, t =>
{
t.HasComment("租户配额使用历史记录(用于追踪配额上下限与使用量的时间序列变化)。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantReviewClaim", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("ClaimedAt")
.HasColumnType("timestamp with time zone")
.HasComment("领取时间UTC。");
b.Property<long>("ClaimedBy")
.HasColumnType("bigint")
.HasComment("领取人用户 ID。");
b.Property<string>("ClaimedByName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.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<DateTime?>("ReleasedAt")
.HasColumnType("timestamp with time zone")
.HasComment("释放时间UTC未释放时为 null。");
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("ClaimedBy");
b.HasIndex("TenantId")
.IsUnique()
.HasFilter("\"ReleasedAt\" IS NULL AND \"DeletedAt\" IS NULL");
b.ToTable("tenant_review_claims", null, t =>
{
t.HasComment("租户入驻审核领取记录(防止多管理员并发审核)。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantSubscription", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<bool>("AutoRenew")
.HasColumnType("boolean")
.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<DateTime>("EffectiveFrom")
.HasColumnType("timestamp with time zone")
.HasComment("订阅生效时间UTC。");
b.Property<DateTime>("EffectiveTo")
.HasColumnType("timestamp with time zone")
.HasComment("订阅到期时间UTC。");
b.Property<DateTime?>("NextBillingDate")
.HasColumnType("timestamp with time zone")
.HasComment("下一个计费时间,配合自动续费使用。");
b.Property<string>("Notes")
.HasColumnType("text")
.HasComment("运营备注信息。");
b.Property<long?>("ScheduledPackageId")
.HasColumnType("bigint")
.HasComment("若已排期升降配,对应的新套餐 ID。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("订阅当前状态。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("所属租户 ID。");
b.Property<long>("TenantPackageId")
.HasColumnType("bigint")
.HasComment("当前订阅关联的套餐标识。");
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", "TenantPackageId");
b.ToTable("tenant_subscriptions", null, t =>
{
t.HasComment("租户套餐订阅记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantSubscriptionHistory", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal?>("Amount")
.HasColumnType("numeric")
.HasComment("相关费用。");
b.Property<int>("ChangeType")
.HasColumnType("integer")
.HasComment("变更类型。");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasComment("创建时间UTC。");
b.Property<long?>("CreatedBy")
.HasColumnType("bigint")
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
b.Property<string>("Currency")
.HasMaxLength(8)
.HasColumnType("character varying(8)")
.HasComment("币种。");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasComment("软删除时间UTC未删除时为 null。");
b.Property<long?>("DeletedBy")
.HasColumnType("bigint")
.HasComment("删除人用户标识(软删除),未删除时为 null。");
b.Property<DateTime>("EffectiveFrom")
.HasColumnType("timestamp with time zone")
.HasComment("生效时间。");
b.Property<DateTime>("EffectiveTo")
.HasColumnType("timestamp with time zone")
.HasComment("到期时间。");
b.Property<long>("FromPackageId")
.HasColumnType("bigint")
.HasComment("原套餐 ID。");
b.Property<string>("Notes")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("备注。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("租户标识。");
b.Property<long>("TenantSubscriptionId")
.HasColumnType("bigint")
.HasComment("对应的订阅 ID。");
b.Property<long>("ToPackageId")
.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", "TenantSubscriptionId");
b.ToTable("tenant_subscription_histories", null, t =>
{
t.HasComment("租户套餐订阅变更记录。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantVerificationProfile", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasComment("实体唯一标识。");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("AdditionalDataJson")
.HasColumnType("text")
.HasComment("附加资料JSON。");
b.Property<string>("BankAccountName")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("开户名。");
b.Property<string>("BankAccountNumber")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("银行账号。");
b.Property<string>("BankName")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasComment("银行名称。");
b.Property<string>("BusinessLicenseNumber")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("营业执照编号。");
b.Property<string>("BusinessLicenseUrl")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.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<string>("LegalPersonIdBackUrl")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("法人身份证反面。");
b.Property<string>("LegalPersonIdFrontUrl")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("法人身份证正面。");
b.Property<string>("LegalPersonIdNumber")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasComment("法人身份证号。");
b.Property<string>("LegalPersonName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("法人姓名。");
b.Property<string>("ReviewRemarks")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasComment("审核备注。");
b.Property<DateTime?>("ReviewedAt")
.HasColumnType("timestamp with time zone")
.HasComment("审核时间。");
b.Property<long?>("ReviewedBy")
.HasColumnType("bigint")
.HasComment("审核人 ID。");
b.Property<string>("ReviewedByName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasComment("审核人姓名。");
b.Property<int>("Status")
.HasColumnType("integer")
.HasComment("实名状态。");
b.Property<DateTime?>("SubmittedAt")
.HasColumnType("timestamp with time zone")
.HasComment("提交时间。");
b.Property<long>("TenantId")
.HasColumnType("bigint")
.HasComment("对应的租户标识。");
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")
.IsUnique();
b.ToTable("tenant_verification_profiles", null, t =>
{
t.HasComment("租户实名认证资料。");
});
});
modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.OrderItem", b =>
{
b.HasOne("TakeoutSaaS.Domain.Orders.Entities.Order", null)
.WithMany()
.HasForeignKey("OrderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}