//
using System;
using Fengling.Backend.Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Fengling.Backend.Infrastructure.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.0");
modelBuilder.Entity("Fengling.Backend.Domain.AggregatesModel.GiftAggregate.Gift", b =>
{
b.Property("Id")
.HasColumnType("TEXT")
.HasComment("礼品ID");
b.Property("AvailableStock")
.HasColumnType("INTEGER")
.HasComment("可用库存");
b.Property("CreatedAt")
.HasColumnType("TEXT")
.HasComment("创建时间");
b.Property("Deleted")
.HasColumnType("INTEGER");
b.Property("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasComment("描述");
b.Property("ImageUrl")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasComment("图片URL");
b.Property("IsOnShelf")
.HasColumnType("INTEGER")
.HasComment("是否上架");
b.Property("LimitPerMember")
.HasColumnType("INTEGER")
.HasComment("每人限兑数量");
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasComment("礼品名称");
b.Property("RequiredPoints")
.HasColumnType("INTEGER")
.HasComment("所需积分");
b.Property("RowVersion")
.IsConcurrencyToken()
.HasColumnType("INTEGER");
b.Property("SortOrder")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property("TotalStock")
.HasColumnType("INTEGER")
.HasComment("总库存");
b.Property("Type")
.HasColumnType("INTEGER")
.HasComment("礼品类型(1:实物,2:虚拟,3:自有产品)");
b.Property("UpdatedAt")
.HasColumnType("TEXT")
.HasComment("更新时间");
b.HasKey("Id");
b.HasIndex("IsOnShelf")
.HasDatabaseName("IX_Gifts_IsOnShelf");
b.HasIndex("SortOrder")
.HasDatabaseName("IX_Gifts_SortOrder");
b.HasIndex("Type")
.HasDatabaseName("IX_Gifts_Type");
b.ToTable("Gifts", (string)null);
});
modelBuilder.Entity("Fengling.Backend.Domain.AggregatesModel.MarketingCodeAggregate.MarketingCode", b =>
{
b.Property("Id")
.HasColumnType("TEXT")
.HasComment("营销码ID");
b.Property("BatchNo")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasComment("批次号");
b.Property("Code")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasComment("营销码");
b.Property("CreatedAt")
.HasColumnType("TEXT")
.HasComment("创建时间");
b.Property("Deleted")
.HasColumnType("INTEGER");
b.Property("ExpiryDate")
.HasColumnType("TEXT")
.HasComment("过期时间");
b.Property("IsUsed")
.HasColumnType("INTEGER")
.HasComment("是否已使用");
b.Property("RowVersion")
.IsConcurrencyToken()
.HasColumnType("INTEGER");
b.Property("UsedAt")
.HasColumnType("TEXT")
.HasComment("使用时间");
b.Property("UsedByMemberId")
.HasColumnType("TEXT")
.HasComment("使用者会员ID");
b.HasKey("Id");
b.HasIndex("BatchNo")
.HasDatabaseName("IX_MarketingCodes_BatchNo");
b.HasIndex("Code")
.IsUnique()
.HasDatabaseName("IX_MarketingCodes_Code");
b.HasIndex("IsUsed")
.HasDatabaseName("IX_MarketingCodes_IsUsed");
b.ToTable("MarketingCodes", (string)null);
});
modelBuilder.Entity("Fengling.Backend.Domain.AggregatesModel.MemberAggregate.Member", b =>
{
b.Property("Id")
.HasColumnType("TEXT")
.HasComment("会员ID");
b.Property("AvailablePoints")
.HasColumnType("INTEGER")
.HasComment("可用积分");
b.Property("Deleted")
.HasColumnType("INTEGER");
b.Property("Nickname")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasComment("昵称");
b.Property("Password")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasComment("密码(已加密)");
b.Property("Phone")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("TEXT")
.HasComment("手机号");
b.Property("RegisteredAt")
.HasColumnType("TEXT")
.HasComment("注册时间");
b.Property("RowVersion")
.IsConcurrencyToken()
.HasColumnType("INTEGER");
b.Property("Status")
.HasColumnType("INTEGER")
.HasComment("状态(1:正常,2:禁用)");
b.Property("TotalPoints")
.HasColumnType("INTEGER")
.HasComment("累计总积分");
b.HasKey("Id");
b.HasIndex("Phone")
.IsUnique()
.HasDatabaseName("IX_Members_Phone");
b.HasIndex("Status")
.HasDatabaseName("IX_Members_Status");
b.ToTable("Members", (string)null);
});
modelBuilder.Entity("Fengling.Backend.Domain.AggregatesModel.PointsRuleAggregate.PointsRule", b =>
{
b.Property("Id")
.HasColumnType("TEXT")
.HasComment("积分规则ID");
b.Property("BonusMultiplier")
.HasColumnType("TEXT")
.HasComment("奖励倍数");
b.Property("CategoryId")
.HasColumnType("TEXT")
.HasComment("品类ID");
b.Property("CreatedAt")
.HasColumnType("TEXT")
.HasComment("创建时间");
b.Property("Deleted")
.HasColumnType("INTEGER");
b.Property("EndDate")
.HasColumnType("TEXT")
.HasComment("生效结束时间");
b.Property("IsActive")
.HasColumnType("INTEGER")
.HasComment("是否激活");
b.Property("MemberLevelCode")
.HasMaxLength(20)
.HasColumnType("TEXT")
.HasComment("会员等级编码");
b.Property("PointsValue")
.HasColumnType("INTEGER")
.HasComment("积分值");
b.Property("ProductId")
.HasColumnType("TEXT")
.HasComment("产品ID");
b.Property("RowVersion")
.IsConcurrencyToken()
.HasColumnType("INTEGER");
b.Property("RuleName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasComment("规则名称");
b.Property("RuleType")
.HasColumnType("INTEGER")
.HasComment("规则类型(1:产品,2:时间,3:会员等级)");
b.Property("StartDate")
.HasColumnType("TEXT")
.HasComment("生效开始时间");
b.HasKey("Id");
b.HasIndex("IsActive")
.HasDatabaseName("IX_PointsRules_IsActive");
b.HasIndex("MemberLevelCode")
.HasDatabaseName("IX_PointsRules_MemberLevelCode");
b.HasIndex("ProductId")
.HasDatabaseName("IX_PointsRules_ProductId");
b.HasIndex("StartDate", "EndDate")
.HasDatabaseName("IX_PointsRules_DateRange");
b.ToTable("PointsRules", (string)null);
});
modelBuilder.Entity("Fengling.Backend.Domain.AggregatesModel.PointsTransactionAggregate.PointsTransaction", b =>
{
b.Property("Id")
.HasColumnType("TEXT")
.HasComment("积分流水ID");
b.Property("Amount")
.HasColumnType("INTEGER")
.HasComment("积分数量");
b.Property("CreatedAt")
.HasColumnType("TEXT")
.HasComment("创建时间");
b.Property("Deleted")
.HasColumnType("INTEGER");
b.Property("ExpiryDate")
.HasColumnType("TEXT")
.HasComment("过期时间");
b.Property("MemberId")
.HasColumnType("TEXT")
.HasComment("会员ID");
b.Property("Reason")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT")
.HasComment("原因描述");
b.Property("RelatedId")
.HasColumnType("TEXT")
.HasComment("关联ID");
b.Property("RowVersion")
.IsConcurrencyToken()
.HasColumnType("INTEGER");
b.Property("Source")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasComment("来源");
b.Property("Type")
.HasColumnType("INTEGER")
.HasComment("交易类型(1:获得,2:消费,3:过期,4:退还)");
b.HasKey("Id");
b.HasIndex("CreatedAt")
.HasDatabaseName("IX_PointsTransactions_CreatedAt");
b.HasIndex("MemberId")
.HasDatabaseName("IX_PointsTransactions_MemberId");
b.HasIndex("RelatedId")
.IsUnique()
.HasDatabaseName("IX_PointsTransactions_RelatedId");
b.HasIndex("Type")
.HasDatabaseName("IX_PointsTransactions_Type");
b.ToTable("PointsTransactions", (string)null);
});
modelBuilder.Entity("Fengling.Backend.Domain.AggregatesModel.RedemptionOrderAggregate.RedemptionOrder", b =>
{
b.Property("Id")
.HasColumnType("TEXT")
.HasComment("兑换订单ID");
b.Property("CancelReason")
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasComment("取消原因");
b.Property("ConsumedPoints")
.HasColumnType("INTEGER")
.HasComment("消耗积分");
b.Property("CreatedAt")
.HasColumnType("TEXT")
.HasComment("创建时间");
b.Property("Deleted")
.HasColumnType("INTEGER");
b.Property("GiftId")
.HasColumnType("TEXT")
.HasComment("礼品ID");
b.Property("GiftName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasComment("礼品名称");
b.Property("GiftType")
.HasColumnType("INTEGER")
.HasComment("礼品类型");
b.Property("MemberId")
.HasColumnType("TEXT")
.HasComment("会员ID");
b.Property("OrderNo")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasComment("订单号");
b.Property("Quantity")
.HasColumnType("INTEGER")
.HasComment("数量");
b.Property("RowVersion")
.IsConcurrencyToken()
.HasColumnType("INTEGER");
b.Property("Status")
.HasColumnType("INTEGER")
.HasComment("订单状态(1:待处理,2:已发货,3:已送达,4:已完成,5:已取消)");
b.Property("TrackingNo")
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasComment("物流单号");
b.Property("UpdatedAt")
.HasColumnType("TEXT")
.HasComment("更新时间");
b.HasKey("Id");
b.HasIndex("CreatedAt")
.HasDatabaseName("IX_RedemptionOrders_CreatedAt");
b.HasIndex("MemberId")
.HasDatabaseName("IX_RedemptionOrders_MemberId");
b.HasIndex("OrderNo")
.IsUnique()
.HasDatabaseName("IX_RedemptionOrders_OrderNo");
b.HasIndex("Status")
.HasDatabaseName("IX_RedemptionOrders_Status");
b.ToTable("RedemptionOrders", (string)null);
});
modelBuilder.Entity("Fengling.Backend.Domain.AggregatesModel.MarketingCodeAggregate.MarketingCode", b =>
{
b.OwnsOne("Fengling.Backend.Domain.AggregatesModel.MarketingCodeAggregate.ProductInfo", "ProductInfo", b1 =>
{
b1.Property("MarketingCodeId")
.HasColumnType("TEXT");
b1.Property("CategoryId")
.HasColumnType("TEXT")
.HasColumnName("CategoryId")
.HasComment("品类ID");
b1.Property("CategoryName")
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasColumnName("CategoryName")
.HasComment("品类名称");
b1.Property("ProductId")
.HasColumnType("TEXT")
.HasColumnName("ProductId")
.HasComment("产品ID");
b1.Property("ProductName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasColumnName("ProductName")
.HasComment("产品名称");
b1.HasKey("MarketingCodeId");
b1.ToTable("MarketingCodes");
b1.WithOwner()
.HasForeignKey("MarketingCodeId");
});
b.Navigation("ProductInfo")
.IsRequired();
});
modelBuilder.Entity("Fengling.Backend.Domain.AggregatesModel.MemberAggregate.Member", b =>
{
b.OwnsOne("Fengling.Backend.Domain.AggregatesModel.MemberAggregate.MemberLevel", "Level", b1 =>
{
b1.Property("MemberId")
.HasColumnType("TEXT");
b1.Property("BonusRate")
.HasColumnType("TEXT")
.HasColumnName("BonusRate")
.HasComment("积分奖励倍率");
b1.Property("LevelCode")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("TEXT")
.HasColumnName("LevelCode")
.HasComment("等级编码");
b1.Property("LevelName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasColumnName("LevelName")
.HasComment("等级名称");
b1.Property("RequiredPoints")
.HasColumnType("INTEGER")
.HasColumnName("RequiredPoints")
.HasComment("所需积分");
b1.HasKey("MemberId");
b1.ToTable("Members");
b1.WithOwner()
.HasForeignKey("MemberId");
});
b.Navigation("Level")
.IsRequired();
});
modelBuilder.Entity("Fengling.Backend.Domain.AggregatesModel.RedemptionOrderAggregate.RedemptionOrder", b =>
{
b.OwnsOne("Fengling.Backend.Domain.AggregatesModel.RedemptionOrderAggregate.Address", "ShippingAddress", b1 =>
{
b1.Property("RedemptionOrderId")
.HasColumnType("TEXT");
b1.Property("City")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasColumnName("City")
.HasComment("市");
b1.Property("DetailAddress")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT")
.HasColumnName("DetailAddress")
.HasComment("详细地址");
b1.Property("District")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasColumnName("District")
.HasComment("区/县");
b1.Property("Phone")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("TEXT")
.HasColumnName("ReceiverPhone")
.HasComment("联系电话");
b1.Property("Province")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasColumnName("Province")
.HasComment("省");
b1.Property("ReceiverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasColumnName("ReceiverName")
.HasComment("收货人姓名");
b1.HasKey("RedemptionOrderId");
b1.ToTable("RedemptionOrders");
b1.WithOwner()
.HasForeignKey("RedemptionOrderId");
});
b.Navigation("ShippingAddress");
});
#pragma warning restore 612, 618
}
}
}