diff --git a/samples/VirtoCommerce.OrdersModule2.Web/VirtoCommerce.OrdersModule2.Web.csproj b/samples/VirtoCommerce.OrdersModule2.Web/VirtoCommerce.OrdersModule2.Web.csproj
index a2c5cfa20..60990e549 100644
--- a/samples/VirtoCommerce.OrdersModule2.Web/VirtoCommerce.OrdersModule2.Web.csproj
+++ b/samples/VirtoCommerce.OrdersModule2.Web/VirtoCommerce.OrdersModule2.Web.csproj
@@ -9,7 +9,7 @@
all
runtime; build; native; analyzers; buildtransitive
-
+
diff --git a/src/VirtoCommerce.OrdersModule.Core/Model/ConfigurationItem.cs b/src/VirtoCommerce.OrdersModule.Core/Model/ConfigurationItem.cs
index b75927a53..4dad8b6cd 100644
--- a/src/VirtoCommerce.OrdersModule.Core/Model/ConfigurationItem.cs
+++ b/src/VirtoCommerce.OrdersModule.Core/Model/ConfigurationItem.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Linq;
using VirtoCommerce.Platform.Core.Common;
@@ -6,16 +7,26 @@
namespace VirtoCommerce.OrdersModule.Core.Model;
[SwaggerSchemaId("OrderConfigurationItem")]
-public class ConfigurationItem : AuditableEntity
+public class ConfigurationItem : AuditableEntity, ICloneable
{
+ public string LineItemId { get; set; }
+
public string ProductId { get; set; }
+ public string SectionId { get; set; }
+
public string Name { get; set; }
public string Sku { get; set; }
public int Quantity { get; set; }
+ public decimal Price { get; set; }
+
+ public decimal SalePrice { get; set; }
+
+ public virtual decimal ExtendedPrice => SalePrice * Quantity;
+
public string ImageUrl { get; set; }
public string CatalogId { get; set; }
@@ -26,9 +37,11 @@ public class ConfigurationItem : AuditableEntity
public string CustomText { get; set; }
+ public string ProductSnapshot { get; set; }
+
public IList Files { get; set; }
- public object Clone()
+ public virtual object Clone()
{
var result = (ConfigurationItem)MemberwiseClone();
diff --git a/src/VirtoCommerce.OrdersModule.Core/Model/LineItem.cs b/src/VirtoCommerce.OrdersModule.Core/Model/LineItem.cs
index 3c65c4b82..71da43cfc 100644
--- a/src/VirtoCommerce.OrdersModule.Core/Model/LineItem.cs
+++ b/src/VirtoCommerce.OrdersModule.Core/Model/LineItem.cs
@@ -59,7 +59,7 @@ public class LineItem : AuditableEntity, IHasOuterId, IHasTaxDetalization, ISupp
public decimal DiscountTotalWithTax { get; set; }
- //Any extra Fee
+ //Any extra Fee
public virtual decimal Fee { get; set; }
public virtual decimal FeeWithTax { get; set; }
@@ -109,6 +109,8 @@ public class LineItem : AuditableEntity, IHasOuterId, IHasTaxDetalization, ISupp
public bool IsConfigured { get; set; }
+ public string ProductSnapshot { get; set; }
+
#region IHaveDimension Members
public string WeightUnit { get; set; }
@@ -191,22 +193,27 @@ public virtual object Clone()
if (DynamicProperties != null)
{
- result.DynamicProperties = new List(DynamicProperties.Select(x => x.Clone() as DynamicObjectProperty));
+ result.DynamicProperties = DynamicProperties.Select(x => x.CloneTyped()).ToList();
}
if (Discounts != null)
{
- result.Discounts = new List(Discounts.Select(x => x.Clone() as Discount));
+ result.Discounts = Discounts.Select(x => x.CloneTyped()).ToList();
}
if (TaxDetails != null)
{
- result.TaxDetails = new List(TaxDetails.Select(x => x.Clone() as TaxDetail));
+ result.TaxDetails = TaxDetails.Select(x => x.CloneTyped()).ToList();
}
if (FeeDetails != null)
{
- result.FeeDetails = new List(FeeDetails.Select(x => x.Clone() as FeeDetail));
+ result.FeeDetails = FeeDetails.Select(x => x.CloneTyped()).ToList();
+ }
+
+ if (ConfigurationItems != null)
+ {
+ result.ConfigurationItems = ConfigurationItems.Select(x => x.CloneTyped()).ToList();
}
return result;
diff --git a/src/VirtoCommerce.OrdersModule.Core/ModuleConstants.cs b/src/VirtoCommerce.OrdersModule.Core/ModuleConstants.cs
index 6040b0a21..8ba54a351 100644
--- a/src/VirtoCommerce.OrdersModule.Core/ModuleConstants.cs
+++ b/src/VirtoCommerce.OrdersModule.Core/ModuleConstants.cs
@@ -278,6 +278,14 @@ public static class General
IsPublic = true,
};
+ public static SettingDescriptor ProductSnapshotEnabled { get; } = new SettingDescriptor
+ {
+ Name = "Order.ProductSnapshot.Enable",
+ GroupName = "Orders|Products",
+ ValueType = SettingValueType.Boolean,
+ DefaultValue = false,
+ };
+
public static SettingDescriptor MaxOrderDocumentCount { get; } = new SettingDescriptor
{
Name = "Order.MaxOrderDocumentCount",
@@ -327,6 +335,7 @@ public static IEnumerable AllSettings
yield return PurchasedProductIndexation;
yield return EventBasedPurchasedProductIndexation;
yield return PurchasedProductStoreFilter;
+ yield return ProductSnapshotEnabled;
yield return MaxOrderDocumentCount;
yield return DashboardStatisticsEnabled;
yield return DashboardStatisticsRangeMonths;
diff --git a/src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj b/src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj
index 7aad5096a..930cb3a8e 100644
--- a/src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj
+++ b/src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj
@@ -15,12 +15,12 @@
-
+
-
+
diff --git a/src/VirtoCommerce.OrdersModule.Data.MySql/ConfigurationItemEntityConfiguration.cs b/src/VirtoCommerce.OrdersModule.Data.MySql/ConfigurationItemEntityConfiguration.cs
new file mode 100644
index 000000000..ff088db57
--- /dev/null
+++ b/src/VirtoCommerce.OrdersModule.Data.MySql/ConfigurationItemEntityConfiguration.cs
@@ -0,0 +1,15 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+using VirtoCommerce.OrdersModule.Data.Model;
+
+namespace VirtoCommerce.OrdersModule.Data.MySql
+{
+ public class ConfigurationItemEntityConfiguration : IEntityTypeConfiguration
+ {
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.Property(x => x.Price).HasColumnType("decimal").HasPrecision(18, 4);
+ builder.Property(x => x.SalePrice).HasColumnType("decimal").HasPrecision(18, 4);
+ }
+ }
+}
diff --git a/src/VirtoCommerce.OrdersModule.Data.MySql/Migrations/20251209111643_AddOrderConfigurationItemPrice.Designer.cs b/src/VirtoCommerce.OrdersModule.Data.MySql/Migrations/20251209111643_AddOrderConfigurationItemPrice.Designer.cs
new file mode 100644
index 000000000..8de1476de
--- /dev/null
+++ b/src/VirtoCommerce.OrdersModule.Data.MySql/Migrations/20251209111643_AddOrderConfigurationItemPrice.Designer.cs
@@ -0,0 +1,2255 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using VirtoCommerce.OrdersModule.Data.Repositories;
+
+#nullable disable
+
+namespace VirtoCommerce.OrdersModule.Data.MySql.Migrations
+{
+ [DbContext(typeof(OrderDbContext))]
+ [Migration("20251209111643_AddOrderConfigurationItemPrice")]
+ partial class AddOrderConfigurationItemPrice
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.AddressEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("AddressType")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("City")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CountryCode")
+ .HasMaxLength(3)
+ .HasColumnType("varchar(3)");
+
+ b.Property("CountryName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CustomerOrderId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("Description")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("FirstName")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("LastName")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Line1")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("Line2")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("MiddleName")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Name")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("Organization")
+ .HasMaxLength(512)
+ .HasColumnType("varchar(512)");
+
+ b.Property("OuterId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("PaymentInId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("Phone")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("PostalCode")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("RegionId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("RegionName")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ShipmentId")
+ .HasColumnType("varchar(128)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerOrderId");
+
+ b.HasIndex("PaymentInId");
+
+ b.HasIndex("ShipmentId");
+
+ b.ToTable("OrderAddress", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.CaptureEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Amount")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("CancelReason")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("CancelledDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CancelledState")
+ .HasMaxLength(32)
+ .HasColumnType("varchar(32)");
+
+ b.Property("CloseTransaction")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("Comment")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Currency")
+ .IsRequired()
+ .HasMaxLength(3)
+ .HasColumnType("varchar(3)");
+
+ b.Property("CustomerOrderId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("IsApproved")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsCancelled")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ModifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Number")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("OuterId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ParentOperationId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("PaymentId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("Status")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Sum")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("TransactionId")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("VendorId")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerOrderId");
+
+ b.HasIndex("PaymentId");
+
+ b.HasIndex("TransactionId", "CustomerOrderId")
+ .IsUnique();
+
+ b.ToTable("OrderCapture", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.CaptureItemEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CaptureId")
+ .IsRequired()
+ .HasColumnType("varchar(128)");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LineItemId")
+ .IsRequired()
+ .HasColumnType("varchar(128)");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ModifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("OuterId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CaptureId");
+
+ b.HasIndex("LineItemId");
+
+ b.ToTable("OrderCaptureItem", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.ConfigurationItemEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CatalogId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CategoryId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CustomText")
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)");
+
+ b.Property("ImageUrl")
+ .HasMaxLength(1028)
+ .HasColumnType("varchar(1028)");
+
+ b.Property("LineItemId")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ModifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Name")
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("Price")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("ProductId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ProductSnapshot")
+ .HasColumnType("longtext");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.Property("SalePrice")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("SectionId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Sku")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LineItemId");
+
+ b.ToTable("OrderConfigurationItem", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.ConfigurationItemFileEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ConfigurationItemId")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ContentType")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ModifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Name")
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("Size")
+ .HasColumnType("bigint");
+
+ b.Property("Url")
+ .IsRequired()
+ .HasMaxLength(2083)
+ .HasColumnType("varchar(2083)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ConfigurationItemId");
+
+ b.ToTable("OrderConfigurationItemFile", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.CustomerOrderEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CancelReason")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("CancelledDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CancelledState")
+ .HasMaxLength(32)
+ .HasColumnType("varchar(32)");
+
+ b.Property("ChannelId")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Comment")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Currency")
+ .IsRequired()
+ .HasMaxLength(3)
+ .HasColumnType("varchar(3)");
+
+ b.Property("CustomerId")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CustomerName")
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)");
+
+ b.Property("DiscountAmount")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("DiscountTotal")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("DiscountTotalWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("EmployeeId")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("EmployeeName")
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)");
+
+ b.Property("Fee")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("FeeTotal")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("FeeTotalWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("FeeWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("HandlingTotal")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("HandlingTotalWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("IsAnonymous")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsApproved")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsCancelled")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsPrototype")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LanguageCode")
+ .HasMaxLength(16)
+ .HasColumnType("varchar(16)");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ModifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Number")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("OrganizationId")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("OrganizationName")
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)");
+
+ b.Property("OuterId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ParentOperationId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("PaymentTotal")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("PaymentTotalWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("PurchaseOrderNumber")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("RowVersion")
+ .IsConcurrencyToken()
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("timestamp(6)");
+
+ b.Property("ShippingTotal")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("ShippingTotalWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("ShoppingCartId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Status")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("StoreId")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("StoreName")
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)");
+
+ b.Property("SubTotal")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("SubTotalWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("SubscriptionId")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("SubscriptionNumber")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Sum")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("TaxPercentRate")
+ .HasColumnType("decimal(18,4)");
+
+ b.Property("TaxTotal")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("Total")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OuterId");
+
+ b.ToTable("CustomerOrder", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.DiscountEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CouponCode")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CouponInvalidDescription")
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("Currency")
+ .IsRequired()
+ .HasMaxLength(3)
+ .HasColumnType("varchar(3)");
+
+ b.Property("CustomerOrderId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("DiscountAmount")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("DiscountAmountWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("LineItemId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("PaymentInId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("PromotionDescription")
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("PromotionId")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("PromotionName")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ShipmentId")
+ .HasColumnType("varchar(128)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerOrderId");
+
+ b.HasIndex("LineItemId");
+
+ b.HasIndex("PaymentInId");
+
+ b.HasIndex("ShipmentId");
+
+ b.ToTable("OrderDiscount", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.FeeDetailEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Amount")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("Currency")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CustomerOrderId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("Description")
+ .HasColumnType("longtext");
+
+ b.Property("FeeId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("LineItemId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("PaymentInId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("ShipmentId")
+ .HasColumnType("varchar(128)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerOrderId");
+
+ b.HasIndex("LineItemId");
+
+ b.HasIndex("PaymentInId");
+
+ b.HasIndex("ShipmentId");
+
+ b.ToTable("OrderFeeDetail", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.LineItemEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("CancelReason")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("CancelledDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CatalogId")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CategoryId")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Comment")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Currency")
+ .IsRequired()
+ .HasMaxLength(3)
+ .HasColumnType("varchar(3)");
+
+ b.Property("CustomerOrderId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("DiscountAmount")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("DiscountAmountWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("Fee")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("FeeWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("FulfillmentCenterId")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("FulfillmentCenterName")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("FulfillmentLocationCode")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Height")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal(18,4)");
+
+ b.Property("ImageUrl")
+ .HasMaxLength(1028)
+ .HasColumnType("varchar(1028)");
+
+ b.Property("IsCancelled")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsConfigured")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsDiscountAmountRounded")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsGift")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsReccuring")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("Length")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal(18,4)");
+
+ b.Property("MeasureUnit")
+ .HasMaxLength(32)
+ .HasColumnType("varchar(32)");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ModifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("OuterId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Price")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("PriceId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("PriceWithTax")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("ProductId")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ProductOuterId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ProductSnapshot")
+ .HasColumnType("longtext");
+
+ b.Property("ProductType")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.Property("ShippingMethodCode")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Sku")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Status")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("TaxPercentRate")
+ .HasColumnType("decimal(18,4)");
+
+ b.Property("TaxTotal")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("TaxType")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("VendorId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Weight")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal(18,4)");
+
+ b.Property("WeightUnit")
+ .HasMaxLength(32)
+ .HasColumnType("varchar(32)");
+
+ b.Property("Width")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal(18,4)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerOrderId");
+
+ b.ToTable("OrderLineItem", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.OrderDynamicPropertyObjectValueEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("BooleanValue")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("CaptureId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CustomerOrderId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("DateTimeValue")
+ .HasColumnType("datetime(6)");
+
+ b.Property("DecimalValue")
+ .HasColumnType("decimal(18,5)");
+
+ b.Property("DictionaryItemId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("IntegerValue")
+ .HasColumnType("int");
+
+ b.Property("LineItemId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("Locale")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("LongTextValue")
+ .HasColumnType("longtext");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ModifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ObjectId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ObjectType")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("PaymentInId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("PropertyId")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("PropertyName")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("RefundId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("ShipmentId")
+ .HasColumnType("varchar(128)");
+
+ b.Property("ShortTextValue")
+ .HasMaxLength(512)
+ .HasColumnType("varchar(512)");
+
+ b.Property("ValueType")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CaptureId");
+
+ b.HasIndex("CustomerOrderId");
+
+ b.HasIndex("LineItemId");
+
+ b.HasIndex("PaymentInId");
+
+ b.HasIndex("RefundId");
+
+ b.HasIndex("ShipmentId");
+
+ b.HasIndex("ObjectType", "CustomerOrderId")
+ .HasDatabaseName("IX_OrderDynamicProperty_ObjectType_CustomerOrderId");
+
+ b.HasIndex("ObjectType", "LineItemId")
+ .HasDatabaseName("IX_OrderDynamicProperty_ObjectType_LineItemId");
+
+ b.HasIndex("ObjectType", "ObjectId")
+ .HasDatabaseName("IX_OrderDynamicProperty_ObjectType_ObjectId");
+
+ b.HasIndex("ObjectType", "PaymentInId")
+ .HasDatabaseName("IX_OrderDynamicProperty_ObjectType_PaymentInId");
+
+ b.HasIndex("ObjectType", "RefundId")
+ .HasDatabaseName("IX_OrderDynamicProperty_ObjectType_RefundId");
+
+ b.HasIndex("ObjectType", "ShipmentId")
+ .HasDatabaseName("IX_OrderDynamicProperty_ObjectType_ShipmentId");
+
+ b.ToTable("OrderDynamicPropertyObjectValue", (string)null);
+ });
+
+ modelBuilder.Entity("VirtoCommerce.OrdersModule.Data.Model.PaymentGatewayTransactionEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("Amount")
+ .HasPrecision(18, 4)
+ .HasColumnType("decimal");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Currency")
+ .HasMaxLength(3)
+ .HasColumnType("varchar(3)");
+
+ b.Property("GatewayIpAddress")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("IsProcessed")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ModifiedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Note")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("PaymentInId")
+ .IsRequired()
+ .HasColumnType("varchar(128)");
+
+ b.Property("ProcessAttemptCount")
+ .HasColumnType("int");
+
+ b.Property("ProcessError")
+ .HasMaxLength(2048)
+ .HasColumnType("varchar(2048)");
+
+ b.Property("ProcessedDate")
+ .HasColumnType("datetime(6)");
+
+ b.Property("RequestData")
+ .HasColumnType("longtext");
+
+ b.Property