diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs
index f03c869b..143f4b10 100644
--- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs
+++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs
@@ -13,6 +13,8 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos
public Guid ProductSkuId { get; set; }
+ public Guid? ProductDetailId { get; set; }
+
public DateTime ProductModificationTime { get; set; }
public DateTime? ProductDetailModificationTime { get; set; }
diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs
index 906fb5c2..fe4c5926 100644
--- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs
+++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs
@@ -126,6 +126,7 @@ namespace EasyAbp.EShop.Orders.Orders
id: _guidGenerator.Create(),
productId: product.Id,
productSkuId: productSku.Id,
+ productDetailId: productDetailId,
productModificationTime: product.LastModificationTime ?? product.CreationTime,
productDetailModificationTime: productDetail?.LastModificationTime ?? productDetail?.CreationTime,
productGroupName: product.ProductGroupName,
diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs
index 86326187..feadc7e2 100644
--- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs
+++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs
@@ -9,6 +9,8 @@ namespace EasyAbp.EShop.Orders.Orders
Guid ProductSkuId { get; }
+ Guid? ProductDetailId { get; }
+
DateTime ProductModificationTime { get; }
DateTime? ProductDetailModificationTime { get; }
diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs
index d7a87f45..7698bc53 100644
--- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs
+++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs
@@ -12,6 +12,8 @@ namespace EasyAbp.EShop.Orders.Orders
public Guid ProductSkuId { get; set; }
+ public Guid? ProductDetailId { get; set; }
+
public DateTime ProductModificationTime { get; set; }
public DateTime? ProductDetailModificationTime { get; set; }
diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs
index 2378a988..dfcfbe8f 100644
--- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs
+++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs
@@ -13,6 +13,8 @@ namespace EasyAbp.EShop.Orders.Orders
public virtual Guid ProductSkuId { get; protected set; }
+ public virtual Guid? ProductDetailId { get; protected set; }
+
public virtual DateTime ProductModificationTime { get; protected set; }
public virtual DateTime? ProductDetailModificationTime { get; protected set; }
@@ -68,6 +70,7 @@ namespace EasyAbp.EShop.Orders.Orders
Guid id,
Guid productId,
Guid productSkuId,
+ Guid? productDetailId,
DateTime productModificationTime,
DateTime? productDetailModificationTime,
[NotNull] string productGroupName,
@@ -86,6 +89,7 @@ namespace EasyAbp.EShop.Orders.Orders
{
ProductId = productId;
ProductSkuId = productSkuId;
+ ProductDetailId = productDetailId;
ProductModificationTime = productModificationTime;
ProductDetailModificationTime = productDetailModificationTime;
ProductGroupName = productGroupName;
diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs
index f69a4998..63670c45 100644
--- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs
+++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs
@@ -110,6 +110,12 @@ namespace EasyAbp.EShop.Orders.Orders
ProductId = OrderTestData.Product1Id,
ProductSkuId = OrderTestData.ProductSku1Id,
Quantity = 10
+ },
+ new CreateOrderLineDto
+ {
+ ProductId = OrderTestData.Product1Id,
+ ProductSkuId = OrderTestData.ProductSku2Id,
+ Quantity = 1
}
}
};
@@ -124,47 +130,6 @@ namespace EasyAbp.EShop.Orders.Orders
var response = await _orderAppService.GetAsync(createResponse.Id);
// Assert
- response.ShouldNotBeNull();
- response.Currency.ShouldBe("CNY");
- response.CanceledTime.ShouldBeNull();
- response.CancellationReason.ShouldBeNullOrEmpty();
- response.CompletionTime.ShouldBeNull();
- response.CustomerRemark.ShouldBe("customer remark");
- response.OrderNumber.ShouldNotBeNull();
- response.OrderStatus.ShouldBe(OrderStatus.Pending);
- response.PaidTime.ShouldBeNull();
- response.PaymentId.ShouldBeNull();
- response.RefundAmount.ShouldBe(0m);
- response.StaffRemark.ShouldBeNullOrEmpty();
- response.StoreId.ShouldBe(OrderTestData.Store1Id);
- response.TotalDiscount.ShouldBe(0m);
- response.TotalPrice.ShouldBe(10m);
- response.ActualTotalPrice.ShouldBe(10m);
- response.CustomerUserId.ShouldBe(Guid.Parse("2e701e62-0953-4dd3-910b-dc6cc93ccb0d"));
- response.ProductTotalPrice.ShouldBe(10m);
- response.ReducedInventoryAfterPaymentTime.ShouldBeNull();
- response.ReducedInventoryAfterPlacingTime.ShouldNotBeNull();
- response.OrderLines.Count.ShouldBe(1);
-
- var responseOrderLine = response.OrderLines.First();
- responseOrderLine.ProductId.ShouldBe(OrderTestData.Product1Id);
- responseOrderLine.ProductSkuId.ShouldBe(OrderTestData.ProductSku1Id);
- responseOrderLine.ProductDisplayName.ShouldBe("Hello pencil");
- responseOrderLine.ProductUniqueName.ShouldBe("Pencil");
- responseOrderLine.ProductGroupName.ShouldBe("Default");
- responseOrderLine.ProductGroupDisplayName.ShouldBe("Default");
- responseOrderLine.SkuName.ShouldBe("My SKU");
- responseOrderLine.UnitPrice.ShouldBe(1m);
- responseOrderLine.TotalPrice.ShouldBe(10m);
- responseOrderLine.TotalDiscount.ShouldBe(0m);
- responseOrderLine.ActualTotalPrice.ShouldBe(10m);
- responseOrderLine.Currency.ShouldBe("CNY");
- responseOrderLine.Quantity.ShouldBe(10);
- responseOrderLine.ProductModificationTime.ShouldBe(OrderTestData.ProductLastModificationTime);
- responseOrderLine.ProductDetailModificationTime.ShouldBe(OrderTestData.ProductDetailLastModificationTime);
- responseOrderLine.RefundAmount.ShouldBe(0m);
- responseOrderLine.RefundedQuantity.ShouldBe(0);
-
UsingDbContext(context =>
{
context.Orders.Count().ShouldBe(1);
@@ -183,31 +148,36 @@ namespace EasyAbp.EShop.Orders.Orders
order.StaffRemark.ShouldBeNullOrEmpty();
order.StoreId.ShouldBe(OrderTestData.Store1Id);
order.TotalDiscount.ShouldBe(0m);
- order.TotalPrice.ShouldBe(10m);
- order.ActualTotalPrice.ShouldBe(10m);
+ order.TotalPrice.ShouldBe(12m);
+ order.ActualTotalPrice.ShouldBe(12m);
order.CustomerUserId.ShouldBe(Guid.Parse("2e701e62-0953-4dd3-910b-dc6cc93ccb0d"));
- order.ProductTotalPrice.ShouldBe(10m);
+ order.ProductTotalPrice.ShouldBe(12m);
order.ReducedInventoryAfterPaymentTime.ShouldBeNull();
order.ReducedInventoryAfterPlacingTime.ShouldNotBeNull();
- order.OrderLines.Count.ShouldBe(1);
-
- var orderLine = order.OrderLines.First();
- orderLine.ProductId.ShouldBe(OrderTestData.Product1Id);
- orderLine.ProductSkuId.ShouldBe(OrderTestData.ProductSku1Id);
- orderLine.ProductDisplayName.ShouldBe("Hello pencil");
- orderLine.ProductUniqueName.ShouldBe("Pencil");
- orderLine.ProductGroupName.ShouldBe("Default");
- orderLine.ProductGroupDisplayName.ShouldBe("Default");
- orderLine.SkuName.ShouldBe("My SKU");
- orderLine.UnitPrice.ShouldBe(1m);
- orderLine.TotalPrice.ShouldBe(10m);
- orderLine.TotalDiscount.ShouldBe(0m);
- orderLine.ActualTotalPrice.ShouldBe(10m);
- orderLine.Currency.ShouldBe("CNY");
- orderLine.Quantity.ShouldBe(10);
- orderLine.ProductModificationTime.ShouldBe(OrderTestData.ProductLastModificationTime);
- orderLine.RefundAmount.ShouldBe(0m);
- orderLine.RefundedQuantity.ShouldBe(0);
+ order.OrderLines.Count.ShouldBe(2);
+
+ var orderLine1 = response.OrderLines.Single(x => x.ProductSkuId == OrderTestData.ProductSku1Id);
+ orderLine1.ProductId.ShouldBe(OrderTestData.Product1Id);
+ orderLine1.ProductSkuId.ShouldBe(OrderTestData.ProductSku1Id);
+ orderLine1.ProductDetailId.ShouldBe(OrderTestData.ProductDetail1Id);
+ orderLine1.ProductDisplayName.ShouldBe("Hello pencil");
+ orderLine1.ProductUniqueName.ShouldBe("Pencil");
+ orderLine1.ProductGroupName.ShouldBe("Default");
+ orderLine1.ProductGroupDisplayName.ShouldBe("Default");
+ orderLine1.SkuName.ShouldBe("My SKU");
+ orderLine1.UnitPrice.ShouldBe(1m);
+ orderLine1.TotalPrice.ShouldBe(10m);
+ orderLine1.TotalDiscount.ShouldBe(0m);
+ orderLine1.ActualTotalPrice.ShouldBe(10m);
+ orderLine1.Currency.ShouldBe("CNY");
+ orderLine1.Quantity.ShouldBe(10);
+ orderLine1.ProductModificationTime.ShouldBe(OrderTestData.ProductLastModificationTime);
+ orderLine1.ProductDetailModificationTime.ShouldBe(OrderTestData.ProductDetailLastModificationTime);
+ orderLine1.RefundAmount.ShouldBe(0m);
+ orderLine1.RefundedQuantity.ShouldBe(0);
+
+ var orderLine2 = response.OrderLines.Single(x => x.ProductSkuId == OrderTestData.ProductSku2Id);
+ orderLine2.ProductDetailId.ShouldBe(OrderTestData.ProductDetail2Id);
});
}
diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220411204916_AddedProductDetailIdToOrderLine.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220411204916_AddedProductDetailIdToOrderLine.Designer.cs
new file mode 100644
index 00000000..91b8403a
--- /dev/null
+++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220411204916_AddedProductDetailIdToOrderLine.Designer.cs
@@ -0,0 +1,5134 @@
+//
+using System;
+using EShopSample.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.Abp.EntityFrameworkCore;
+
+#nullable disable
+
+namespace EShopSample.Migrations
+{
+ [DbContext(typeof(EShopSampleDbContext))]
+ [Migration("20220411204916_AddedProductDetailIdToOrderLine")]
+ partial class AddedProductDetailIdToOrderLine
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
+ .HasAnnotation("ProductVersion", "6.0.3")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
+
+ modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ActualTotalPrice")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("CanceledTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CancellationReason")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CompletionTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("Currency")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CustomerRemark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CustomerUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("OrderNumber")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("OrderStatus")
+ .HasColumnType("int");
+
+ b.Property("PaidTime")
+ .HasColumnType("datetime2");
+
+ b.Property("PaymentExpiration")
+ .HasColumnType("datetime2");
+
+ b.Property("PaymentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductTotalPrice")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("ReducedInventoryAfterPaymentTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ReducedInventoryAfterPlacingTime")
+ .HasColumnType("datetime2");
+
+ b.Property("RefundAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("StaffRemark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("StoreId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("TenantId");
+
+ b.Property("TotalDiscount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("TotalPrice")
+ .HasColumnType("decimal(20,8)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrderNumber")
+ .IsUnique()
+ .HasFilter("[OrderNumber] IS NOT NULL");
+
+ b.ToTable("EasyAbpEShopOrdersOrders", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderExtraFee", b =>
+ {
+ b.Property("OrderId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Key")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Fee")
+ .HasColumnType("decimal(20,8)");
+
+ b.HasKey("OrderId", "Name", "Key");
+
+ b.ToTable("EasyAbpEShopOrdersOrderExtraFees", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ActualTotalPrice")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("Currency")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MediaResources")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductDetailId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductDetailModificationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ProductDisplayName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProductGroupDisplayName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProductGroupName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProductId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductModificationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ProductSkuId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductUniqueName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.Property("RefundAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("RefundedQuantity")
+ .HasColumnType("int");
+
+ b.Property("SkuDescription")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SkuName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TotalDiscount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("TotalPrice")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("UnitPrice")
+ .HasColumnType("decimal(20,8)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrderId");
+
+ b.ToTable("EasyAbpEShopOrdersOrderLines", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ActualPaymentAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("CanceledTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CompletionTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("Currency")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExternalTradingCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("OriginalPaymentAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("PayeeAccount")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PaymentDiscount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("PaymentMethod")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PendingRefundAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("RefundAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("TenantId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("TenantId");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.ToTable("EasyAbpEShopPaymentsPayments", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ActualPaymentAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("ItemKey")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ItemType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("OriginalPaymentAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("PaymentDiscount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("PaymentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PendingRefundAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("RefundAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("StoreId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PaymentId");
+
+ b.ToTable("EasyAbpEShopPaymentsPaymentItems", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CanceledTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CompletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("Currency")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CustomerRemark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DisplayReason")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExternalTradingCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PaymentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RefundAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("RefundPaymentMethod")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("StaffRemark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TenantId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("TenantId");
+
+ b.HasKey("Id");
+
+ b.ToTable("EasyAbpEShopPaymentsRefunds", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("CustomerRemark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("OrderId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PaymentItemId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RefundAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("RefundId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("StaffRemark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("StoreId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RefundId");
+
+ b.ToTable("EasyAbpEShopPaymentsRefundItems", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OrderLineId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RefundAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("RefundItemId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RefundedQuantity")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RefundItemId");
+
+ b.ToTable("EasyAbpEShopPaymentsRefundItemOrderLines", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.BasketItems.BasketItem", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BasketName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("Currency")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("Inventory")
+ .HasColumnType("int");
+
+ b.Property("IsInvalid")
+ .HasColumnType("bit");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MediaResources")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProductDisplayName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProductId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductSkuId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductUniqueName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.Property("SkuDescription")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SkuName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("StoreId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("TenantId");
+
+ b.Property("TotalDiscount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("TotalPrice")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("UnitPrice")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("EasyAbpEShopPluginsBasketsBasketItems", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.ProductUpdates.ProductUpdate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("ProductSkuId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("TenantId");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ProductSkuId");
+
+ b.ToTable("EasyAbpEShopPluginsBasketsProductUpdates", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.Coupons.Coupon", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CouponTemplateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("Currency")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DiscountedAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("ExpirationTime")
+ .HasColumnType("datetime2");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("OrderId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("TenantId");
+
+ b.Property("UsedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.ToTable("EasyAbpEShopPluginsCouponsCoupons", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ConditionAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("CouponType")
+ .HasColumnType("int");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("Currency")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Description")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DiscountAmount")
+ .HasColumnType("decimal(20,8)");
+
+ b.Property("DisplayName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsUnscoped")
+ .HasColumnType("bit");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("StoreId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TenantId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("TenantId");
+
+ b.Property("UniqueName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UsableBeginTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UsableDuration")
+ .HasColumnType("time");
+
+ b.Property("UsableEndTime")
+ .HasColumnType("datetime2");
+
+ b.HasKey("Id");
+
+ b.ToTable("EasyAbpEShopPluginsCouponsCouponTemplates", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplateScope", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CouponTemplateId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("ProductGroupName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProductId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductSkuId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("StoreId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CouponTemplateId");
+
+ b.ToTable("EasyAbpEShopPluginsCouponsCouponTemplateScopes", (string)null);
+ });
+
+ modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Code")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Description")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DisplayName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsHidden")
+ .HasColumnType("bit");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Level")
+ .HasColumnType("int");
+
+ b.Property