From f9b13af4ae256bf75b79a007d5282167f3387b24 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sat, 17 Feb 2024 17:45:50 +0100 Subject: [PATCH] #1052. Highlighting the names of products when they are low in quantity on the Stock Management page in the Admin. --- .../Data/CatalogCustomModelBuilder.cs | 3 +- .../wwwroot/admin/stock/stock-form.html | 4 +- .../wwwroot/admin/stock/stock-form.js | 10 +- ...0217163906_AddedCatalogSetting.Designer.cs | 4748 +++++++++++++++++ .../20240217163906_AddedCatalogSetting.cs | 28 + .../Migrations/SimplDbContextModelSnapshot.cs | 7 + 6 files changed, 4796 insertions(+), 4 deletions(-) create mode 100644 src/SimplCommerce.WebHost/Migrations/20240217163906_AddedCatalogSetting.Designer.cs create mode 100644 src/SimplCommerce.WebHost/Migrations/20240217163906_AddedCatalogSetting.cs diff --git a/src/Modules/SimplCommerce.Module.Catalog/Data/CatalogCustomModelBuilder.cs b/src/Modules/SimplCommerce.Module.Catalog/Data/CatalogCustomModelBuilder.cs index f5920f6f15..567de4a802 100644 --- a/src/Modules/SimplCommerce.Module.Catalog/Data/CatalogCustomModelBuilder.cs +++ b/src/Modules/SimplCommerce.Module.Catalog/Data/CatalogCustomModelBuilder.cs @@ -37,7 +37,8 @@ public void Build(ModelBuilder modelBuilder) modelBuilder.Entity().HasData( new AppSetting("Catalog.ProductPageSize") { Module = "Catalog", IsVisibleInCommonSettingPage = true, Value = "10" }, - new AppSetting("Catalog.IsProductPriceIncludeTax") { Module = "Catalog", IsVisibleInCommonSettingPage = true, Value = "true" } + new AppSetting("Catalog.IsProductPriceIncludeTax") { Module = "Catalog", IsVisibleInCommonSettingPage = true, Value = "true" }, + new AppSetting("Catalog.MinimumProductQuantityForHighlighting") { Module = "Catalog", IsVisibleInCommonSettingPage = true, Value = "5" } ); modelBuilder.Entity().HasData( diff --git a/src/Modules/SimplCommerce.Module.Inventory/wwwroot/admin/stock/stock-form.html b/src/Modules/SimplCommerce.Module.Inventory/wwwroot/admin/stock/stock-form.html index 6b4db26aac..3430c8f48c 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/wwwroot/admin/stock/stock-form.html +++ b/src/Modules/SimplCommerce.Module.Inventory/wwwroot/admin/stock/stock-form.html @@ -47,7 +47,9 @@

{{::vm.translate.get('Stock management for warehouse')}} {{ vm.selec - + {{item.productName}} {{item.productSku}} {{item.quantity}} diff --git a/src/Modules/SimplCommerce.Module.Inventory/wwwroot/admin/stock/stock-form.js b/src/Modules/SimplCommerce.Module.Inventory/wwwroot/admin/stock/stock-form.js index 574aeada08..6a615d337f 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/wwwroot/admin/stock/stock-form.js +++ b/src/Modules/SimplCommerce.Module.Inventory/wwwroot/admin/stock/stock-form.js @@ -2,9 +2,9 @@ (function () { angular .module('simplAdmin.inventory') - .controller('StockFormCtrl', ['stockService', 'translateService', StockFormCtrl]); + .controller('StockFormCtrl', ['configurationService','stockService', 'translateService', StockFormCtrl]); - function StockFormCtrl(stockService, translateService) { + function StockFormCtrl(configurationService, stockService, translateService) { var vm = this; vm.tableStateRef = {}; vm.translate = translateService; @@ -42,5 +42,11 @@ vm.selectedWarehouse = vm.warehouses[0]; } }); + + configurationService.getSettings().then(function (result) { + const minimumQuantityForHighlighting = result.data.find(o => o.key === "Catalog.MinimumProductQuantityForHighlighting"); + + vm.minimumQuantityForHighlighting = minimumQuantityForHighlighting ? minimumQuantityForHighlighting.value : 0; + }); } })(); diff --git a/src/SimplCommerce.WebHost/Migrations/20240217163906_AddedCatalogSetting.Designer.cs b/src/SimplCommerce.WebHost/Migrations/20240217163906_AddedCatalogSetting.Designer.cs new file mode 100644 index 0000000000..fbffb93628 --- /dev/null +++ b/src/SimplCommerce.WebHost/Migrations/20240217163906_AddedCatalogSetting.Designer.cs @@ -0,0 +1,4748 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SimplCommerce.Module.Core.Data; + +#nullable disable + +namespace SimplCommerce.WebHost.Migrations +{ + [DbContext(typeof(SimplDbContext))] + [Migration("20240217163906_AddedCatalogSetting")] + partial class AddedCatalogSetting + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_RoleClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserLogin", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("Core_UserToken", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Localization_Culture", (string)null); + + b.HasData( + new + { + Id = "en-US", + Name = "English (US)" + }); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityType") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ProperyName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_LocalizedContentProperty", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_Resource", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ActivityTypeId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ActivityTypeId"); + + b.ToTable("ActivityLog_Activity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.ActivityType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("ActivityLog_ActivityType", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "EntityView" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Brand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_Brand", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IncludeInMenu") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Category", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BrandId") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("Gtin") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("HasOptions") + .HasColumnType("bit"); + + b.Property("IsAllowToOrder") + .HasColumnType("bit"); + + b.Property("IsCallForPricing") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFeatured") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsVisibleIndividually") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("NormalizedName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("OldPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PublishedOn") + .HasColumnType("datetimeoffset"); + + b.Property("RatingAverage") + .HasColumnType("float"); + + b.Property("ReviewsCount") + .HasColumnType("int"); + + b.Property("ShortDescription") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Sku") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("SpecialPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("datetimeoffset"); + + b.Property("SpecialPriceStart") + .HasColumnType("datetimeoffset"); + + b.Property("Specification") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQuantity") + .HasColumnType("int"); + + b.Property("StockTrackingIsEnabled") + .HasColumnType("bit"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BrandId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("TaxClassId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Product", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.ToTable("Catalog_ProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductAttributeGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AttributeId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("AttributeId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductAttributeValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsFeaturedProduct") + .HasColumnType("bit"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("LinkType") + .HasColumnType("int"); + + b.Property("LinkedProductId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("LinkedProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductLink", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductMedia", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductOption", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Color" + }, + new + { + Id = 2L, + Name = "Size" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("int"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionCombination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DisplayType") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("int"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OldPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SpecialPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("datetimeoffset"); + + b.Property("SpecialPriceStart") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductPriceHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductTemplate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.Property("ProductTemplateId") + .HasColumnType("bigint"); + + b.Property("ProductAttributeId") + .HasColumnType("bigint"); + + b.HasKey("ProductTemplateId", "ProductAttributeId"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("Catalog_ProductTemplateProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.Checkout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("IsProductPriceIncludeTax") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ShippingAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("ShippingData") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("TaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.ToTable("Checkouts_Checkout", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.CheckoutItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CheckoutId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CheckoutId"); + + b.HasIndex("ProductId"); + + b.ToTable("Checkouts_CheckoutItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsSystem") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Cms_Menu", (string)null); + + b.HasData( + new + { + Id = 1L, + IsPublished = true, + IsSystem = true, + Name = "Customer Services" + }, + new + { + Id = 2L, + IsPublished = true, + IsSystem = true, + Name = "Information" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomLink") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("MenuId") + .HasColumnType("bigint"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("EntityId"); + + b.HasIndex("MenuId"); + + b.HasIndex("ParentId"); + + b.ToTable("Cms_MenuItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Body") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("PublishedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.ToTable("Cms_Page", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CommentText") + .HasColumnType("nvarchar(max)"); + + b.Property("CommenterName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UserId"); + + b.ToTable("Comments_Comment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ContactAreaId") + .HasColumnType("bigint"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EmailAddress") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("FullName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PhoneNumber") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ContactAreaId"); + + b.ToTable("Contacts_Contact", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.ContactArea", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Contacts_ContactArea", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CountryId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_Address", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressLine1 = "364 Cong Hoa", + ContactName = "Thien Nguyen", + CountryId = "VN", + StateOrProvinceId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.AppSetting", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("IsVisibleInCommonSettingPage") + .HasColumnType("bit"); + + b.Property("Module") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_AppSetting", (string)null); + + b.HasData( + new + { + Id = "Catalog.ProductPageSize", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "10" + }, + new + { + Id = "Catalog.IsProductPriceIncludeTax", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "Catalog.MinimumProductQuantityForHighlighting", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "5" + }, + new + { + Id = "Catalog.IsCommentsRequireApproval", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "GoogleAppKey", + IsVisibleInCommonSettingPage = false, + Module = "Contact", + Value = "" + }, + new + { + Id = "Global.AssetVersion", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "1.0" + }, + new + { + Id = "Global.AssetBundling", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "false" + }, + new + { + Id = "Theme", + IsVisibleInCommonSettingPage = false, + Module = "Core", + Value = "Generic" + }, + new + { + Id = "Global.DefaultCultureUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.DefaultCultureAdminUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyCulture", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyDecimalPlace", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "2" + }, + new + { + Id = "SmtpServer", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "smtp.gmail.com" + }, + new + { + Id = "SmtpPort", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "587" + }, + new + { + Id = "SmtpUsername", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "SmtpPassword", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "Localization.LocalizedConentEnable", + IsVisibleInCommonSettingPage = true, + Module = "Localization", + Value = "true" + }, + new + { + Id = "News.PageSize", + IsVisibleInCommonSettingPage = true, + Module = "News", + Value = "10" + }, + new + { + Id = "Tax.DefaultTaxClassId", + IsVisibleInCommonSettingPage = true, + Module = "Tax", + Value = "1" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("Code3") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsBillingEnabled") + .HasColumnType("bit"); + + b.Property("IsCityEnabled") + .HasColumnType("bit"); + + b.Property("IsDistrictEnabled") + .HasColumnType("bit"); + + b.Property("IsShippingEnabled") + .HasColumnType("bit"); + + b.Property("IsZipCodeEnabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Country", (string)null); + + b.HasData( + new + { + Id = "VN", + Code3 = "VNM", + IsBillingEnabled = true, + IsCityEnabled = false, + IsDistrictEnabled = true, + IsShippingEnabled = true, + IsZipCodeEnabled = false, + Name = "Việt Nam" + }, + new + { + Id = "US", + Code3 = "USA", + IsBillingEnabled = true, + IsCityEnabled = true, + IsDistrictEnabled = false, + IsShippingEnabled = true, + IsZipCodeEnabled = true, + Name = "United States" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Core_CustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Core_CustomerGroupUser", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Location") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_District", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Quận 1", + StateOrProvinceId = 1L, + Type = "Quận" + }, + new + { + Id = 2L, + Name = "Quận 2", + StateOrProvinceId = 1L, + Type = "Quận" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("Core_Entity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.EntityType", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AreaName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsMenuable") + .HasColumnType("bit"); + + b.Property("RoutingAction") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("RoutingController") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_EntityType", (string)null); + + b.HasData( + new + { + Id = "Category", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "CategoryDetail", + RoutingController = "Category" + }, + new + { + Id = "Brand", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "BrandDetail", + RoutingController = "Brand" + }, + new + { + Id = "Product", + AreaName = "Catalog", + IsMenuable = false, + RoutingAction = "ProductDetail", + RoutingController = "Product" + }, + new + { + Id = "Page", + AreaName = "Cms", + IsMenuable = true, + RoutingAction = "PageDetail", + RoutingController = "Page" + }, + new + { + Id = "Vendor", + AreaName = "Core", + IsMenuable = false, + RoutingAction = "VendorDetail", + RoutingController = "Vendor" + }, + new + { + Id = "NewsCategory", + AreaName = "News", + IsMenuable = true, + RoutingAction = "NewsCategoryDetail", + RoutingController = "NewsCategory" + }, + new + { + Id = "NewsItem", + AreaName = "News", + IsMenuable = false, + RoutingAction = "NewsItemDetail", + RoutingController = "NewsItem" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("FileName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("FileSize") + .HasColumnType("int"); + + b.Property("MediaType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Core_Media", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("Core_Role", (string)null); + + b.HasData( + new + { + Id = 1L, + ConcurrencyStamp = "4776a1b2-dbe4-4056-82ec-8bed211d1454", + Name = "admin", + NormalizedName = "ADMIN" + }, + new + { + Id = 2L, + ConcurrencyStamp = "00d172be-03a0-4856-8b12-26d63fcf4374", + Name = "customer", + NormalizedName = "CUSTOMER" + }, + new + { + Id = 3L, + ConcurrencyStamp = "d4754388-8355-4018-b728-218018836817", + Name = "guest", + NormalizedName = "GUEST" + }, + new + { + Id = 4L, + ConcurrencyStamp = "71f10604-8c4d-4a7d-ac4a-ffefb11cefeb", + Name = "vendor", + NormalizedName = "VENDOR" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Code") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.ToTable("Core_StateOrProvince", (string)null); + + b.HasData( + new + { + Id = 1L, + CountryId = "VN", + Name = "Hồ Chí Minh", + Type = "Thành Phố" + }, + new + { + Id = 2L, + Code = "WA", + CountryId = "US", + Name = "Washington" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Culture") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DefaultBillingAddressId") + .HasColumnType("bigint"); + + b.Property("DefaultShippingAddressId") + .HasColumnType("bigint"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("ExtensionData") + .HasColumnType("nvarchar(max)"); + + b.Property("FullName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("RefreshTokenHash") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserGuid") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("DefaultBillingAddressId"); + + b.HasIndex("DefaultShippingAddressId"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.HasIndex("VendorId"); + + b.ToTable("Core_User", (string)null); + + b.HasData( + new + { + Id = 2L, + AccessFailedCount = 0, + ConcurrencyStamp = "101cd6ae-a8ef-4a37-97fd-04ac2dd630e4", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "system@simplcommerce.com", + EmailConfirmed = false, + FullName = "System User", + IsDeleted = true, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "SYSTEM@SIMPLCOMMERCE.COM", + NormalizedUserName = "SYSTEM@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "a9565acb-cee6-425f-9833-419a793f5fba", + TwoFactorEnabled = false, + UserGuid = new Guid("5f72f83b-7436-4221-869c-1b69b2e23aae"), + UserName = "system@simplcommerce.com" + }, + new + { + Id = 10L, + AccessFailedCount = 0, + ConcurrencyStamp = "c83afcbc-312c-4589-bad7-8686bd4754c0", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "admin@simplcommerce.com", + EmailConfirmed = false, + FullName = "Shop Admin", + IsDeleted = false, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "ADMIN@SIMPLCOMMERCE.COM", + NormalizedUserName = "ADMIN@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "d6847450-47f0-4c7a-9fed-0c66234bf61f", + TwoFactorEnabled = false, + UserGuid = new Guid("ed8210c3-24b0-4823-a744-80078cf12eb4"), + UserName = "admin@simplcommerce.com" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("AddressType") + .HasColumnType("int"); + + b.Property("LastUsedOn") + .HasColumnType("datetimeoffset"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_UserRole", (string)null); + + b.HasData( + new + { + UserId = 10L, + RoleId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Vendor", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Widget", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("CreateUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EditUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ViewComponentName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Widget", (string)null); + + b.HasData( + new + { + Id = "CategoryWidget", + CreateUrl = "widget-category-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 160, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-category-edit", + IsPublished = false, + Name = "Category Widget", + ViewComponentName = "CategoryWidget" + }, + new + { + Id = "ProductWidget", + CreateUrl = "widget-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-product-edit", + IsPublished = false, + Name = "Product Widget", + ViewComponentName = "ProductWidget" + }, + new + { + Id = "SimpleProductWidget", + CreateUrl = "widget-simple-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-simple-product-edit", + IsPublished = false, + Name = "Simple Product Widget", + ViewComponentName = "SimpleProductWidget" + }, + new + { + Id = "HtmlWidget", + CreateUrl = "widget-html-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-html-edit", + IsPublished = false, + Name = "Html Widget", + ViewComponentName = "HtmlWidget" + }, + new + { + Id = "CarouselWidget", + CreateUrl = "widget-carousel-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-carousel-edit", + IsPublished = false, + Name = "Carousel Widget", + ViewComponentName = "CarouselWidget" + }, + new + { + Id = "SpaceBarWidget", + CreateUrl = "widget-spacebar-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-spacebar-edit", + IsPublished = false, + Name = "SpaceBar Widget", + ViewComponentName = "SpaceBarWidget" + }, + new + { + Id = "RecentlyViewedWidget", + CreateUrl = "widget-recently-viewed-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-recently-viewed-edit", + IsPublished = false, + Name = "Recently Viewed Widget", + ViewComponentName = "RecentlyViewedWidget" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Data") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("HtmlData") + .HasColumnType("nvarchar(max)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("PublishEnd") + .HasColumnType("datetimeoffset"); + + b.Property("PublishStart") + .HasColumnType("datetimeoffset"); + + b.Property("WidgetId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("WidgetZoneId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("WidgetId"); + + b.HasIndex("WidgetZoneId"); + + b.ToTable("Core_WidgetInstance", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetZone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_WidgetZone", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Home Featured" + }, + new + { + Id = 2L, + Name = "Home Main Content" + }, + new + { + Id = 3L, + Name = "Home After Main Content" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("ReservedQuantity") + .HasColumnType("int"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_Stock", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AdjustedQuantity") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_StockHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("VendorId"); + + b.ToTable("Inventory_Warehouse", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressId = 1L, + Name = "Default warehouse" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("News_NewsCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("FullContent") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("PublishedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ShortContent") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("News_NewsItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("NewsItemId") + .HasColumnType("bigint"); + + b.HasKey("CategoryId", "NewsItemId"); + + b.HasIndex("NewsItemId"); + + b.ToTable("News_NewsItemCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BillingAddressId") + .HasColumnType("bigint"); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("IsMasterOrder") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("OrderTotal") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("PaymentFeeAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ShippingAddressId") + .HasColumnType("bigint"); + + b.Property("ShippingFeeAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("SubTotal") + .HasColumnType("decimal(18,2)"); + + b.Property("SubTotalWithDiscount") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BillingAddressId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ParentId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Orders_Order", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Orders_OrderAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("NewStatus") + .HasColumnType("int"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("OldStatus") + .HasColumnType("int"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("OrderSnapshot") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.ToTable("Orders_OrderHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("ProductPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("TaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxPercent") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("ProductId"); + + b.ToTable("Orders_OrderItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("decimal(18,2)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("FailureMessage") + .HasColumnType("nvarchar(max)"); + + b.Property("GatewayTransactionId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("PaymentFee") + .HasColumnType("decimal(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("Payments_Payment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.PaymentProvider", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AdditionalSettings") + .HasColumnType("nvarchar(max)"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("LandingViewComponentName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Payments_PaymentProvider", (string)null); + + b.HasData( + new + { + Id = "Braintree", + AdditionalSettings = "{\"PublicKey\": \"6j4d7qspt5n48kx4\", \"PrivateKey\" : \"bd1c26e53a6d811243fcc3eb268113e1\", \"MerchantId\" : \"ncsh7wwqvzs3cx9q\", \"IsProduction\" : \"false\"}", + ConfigureUrl = "payments-braintree-config", + IsEnabled = true, + LandingViewComponentName = "BraintreeLanding", + Name = "Braintree" + }, + new + { + Id = "CoD", + ConfigureUrl = "payments-cod-config", + IsEnabled = true, + LandingViewComponentName = "CoDLanding", + Name = "Cash On Delivery" + }, + new + { + Id = "PaypalExpress", + AdditionalSettings = "{ \"IsSandbox\":true, \"ClientId\":\"\", \"ClientSecret\":\"\" }", + ConfigureUrl = "payments-paypalExpress-config", + IsEnabled = true, + LandingViewComponentName = "PaypalExpressLanding", + Name = "Paypal Express" + }, + new + { + Id = "Stripe", + AdditionalSettings = "{\"PublicKey\": \"pk_test_6pRNASCoBOKtIshFeQd4XMUh\", \"PrivateKey\" : \"sk_test_BQokikJOvBiI2HlWgH4olfQ2\"}", + ConfigureUrl = "payments-stripe-config", + IsEnabled = true, + LandingViewComponentName = "StripeLanding", + Name = "Stripe" + }, + new + { + Id = "MomoPayment", + AdditionalSettings = "{\"IsSandbox\":true,\"PartnerCode\":\"MOMOIQA420180417\",\"AccessKey\":\"SvDmj2cOTYZmQQ3H\",\"SecretKey\":\"PPuDXq1KowPT1ftR8DvlQTHhC03aul17\",\"PaymentFee\":0.0}", + ConfigureUrl = "payments-momo-config", + IsEnabled = true, + LandingViewComponentName = "MomoLanding", + Name = "Momo Payment" + }, + new + { + Id = "NganLuong", + AdditionalSettings = "{\"IsSandbox\":true, \"MerchantId\": 47249, \"MerchantPassword\": \"e530745693dbde678f9da98a7c821a07\", \"ReceiverEmail\": \"nlqthien@gmail.com\"}", + ConfigureUrl = "payments-nganluong-config", + IsEnabled = true, + LandingViewComponentName = "NganLuongLanding", + Name = "Ngan Luong Payment" + }, + new + { + Id = "Cashfree", + AdditionalSettings = "{ \"IsSandbox\":true, \"AppId\":\"358035b02486f36ca27904540853\", \"SecretKey\":\"26f48dcd6a27f89f59f28e65849e587916dd57b9\" }", + ConfigureUrl = "payments-cashfree-config", + IsEnabled = true, + LandingViewComponentName = "CashfreeLanding", + Name = "Cashfree Payment Gateway" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("DiscountStep") + .HasColumnType("int"); + + b.Property("EndOn") + .HasColumnType("datetimeoffset"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsCouponRequired") + .HasColumnType("bit"); + + b.Property("MaxDiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StartOn") + .HasColumnType("datetimeoffset"); + + b.Property("UsageLimitPerCoupon") + .HasColumnType("int"); + + b.Property("UsageLimitPerCustomer") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CartRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CategoryId"); + + b.HasIndex("CategoryId"); + + b.ToTable("Pricing_CartRuleCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CartRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "ProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Pricing_CartRuleProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CouponId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.HasIndex("CouponId"); + + b.HasIndex("UserId"); + + b.ToTable("Pricing_CartRuleUsage", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("EndOn") + .HasColumnType("datetimeoffset"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("MaxDiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StartOn") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CatalogRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.Property("CatalogRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CatalogRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CatalogRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.ToTable("Pricing_Coupon", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("UserId"); + + b.ToTable("ProductComparison_ComparingProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductRecentlyViewed.Models.RecentlyViewedProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("LatestViewedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("ProductRecentlyViewed_RecentlyViewedProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ReplierName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ReviewId"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Reply", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Rating") + .HasColumnType("int"); + + b.Property("ReviewerName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Review", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Search.Models.Query", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("QueryText") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("ResultsCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Search_Query", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("TrackingNumber") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Shipments_Shipment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("OrderItemId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("ShipmentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("ShipmentId"); + + b.ToTable("Shipments_ShipmentItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipping.Models.ShippingProvider", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AdditionalSettings") + .HasColumnType("nvarchar(max)"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("OnlyCountryIdsString") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("OnlyStateOrProvinceIdsString") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ShippingPriceServiceTypeName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ToAllShippingEnabledCountries") + .HasColumnType("bit"); + + b.Property("ToAllShippingEnabledStatesOrProvinces") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("Shipping_ShippingProvider", (string)null); + + b.HasData( + new + { + Id = "FreeShip", + AdditionalSettings = "{MinimumOrderAmount : 1}", + ConfigureUrl = "", + IsEnabled = true, + Name = "Free Ship", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingFree.Services.FreeShippingServiceProvider,SimplCommerce.Module.ShippingFree", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }, + new + { + Id = "TableRate", + ConfigureUrl = "shipping-table-rate-config", + IsEnabled = true, + Name = "Table Rate", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingTableRate.Services.TableRateShippingServiceProvider,SimplCommerce.Module.ShippingTableRate", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("MinOrderSubtotal") + .HasColumnType("decimal(18,2)"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("ShippingTableRate_PriceAndDestination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("ProductId"); + + b.ToTable("ShoppingCart_CartItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxClass", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Tax_TaxClass", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Standard VAT" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("StateOrProvinceId"); + + b.HasIndex("TaxClassId"); + + b.ToTable("Tax_TaxRate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("SharingCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("WishList_WishList", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("WishListId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WishListId"); + + b.ToTable("WishList_WishListItem", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany("Resources") + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.HasOne("SimplCommerce.Module.ActivityLog.Models.ActivityType", "ActivityType") + .WithMany() + .HasForeignKey("ActivityTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ActivityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Brand", "Brand") + .WithMany() + .HasForeignKey("BrandId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Brand"); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("TaxClass"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", "Group") + .WithMany("Attributes") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "Attribute") + .WithMany() + .HasForeignKey("AttributeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("AttributeValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Attribute"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Categories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "LinkedProduct") + .WithMany("LinkedProductLinks") + .HasForeignKey("LinkedProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("ProductLinks") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("LinkedProduct"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Media", "Media") + .WithMany() + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Medias") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionCombinations") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("PriceHistories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "ProductAttribute") + .WithMany("ProductTemplates") + .HasForeignKey("ProductAttributeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductTemplate", "ProductTemplate") + .WithMany("ProductAttributes") + .HasForeignKey("ProductTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ProductAttribute"); + + b.Navigation("ProductTemplate"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.Checkout", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.CheckoutItem", b => + { + b.HasOne("SimplCommerce.Module.Checkouts.Models.Checkout", "Checkout") + .WithMany("CheckoutItems") + .HasForeignKey("CheckoutId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Checkout"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Entity", "Entity") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Cms.Models.Menu", "Menu") + .WithMany("MenuItems") + .HasForeignKey("MenuId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Cms.Models.MenuItem", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Entity"); + + b.Navigation("Menu"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.HasOne("SimplCommerce.Module.Comments.Models.Comment", "Parent") + .WithMany("Replies") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Parent"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.HasOne("SimplCommerce.Module.Contacts.Models.ContactArea", "ContactArea") + .WithMany() + .HasForeignKey("ContactAreaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ContactArea"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany("Users") + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("CustomerGroups") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomerGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.EntityType", "EntityType") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("EntityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany("StatesOrProvinces") + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultBillingAddress") + .WithMany() + .HasForeignKey("DefaultBillingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultShippingAddress") + .WithMany() + .HasForeignKey("DefaultShippingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", null) + .WithMany("Users") + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("DefaultBillingAddress"); + + b.Navigation("DefaultShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany("UserAddresses") + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("UserAddresses") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Address"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Widget", "Widget") + .WithMany() + .HasForeignKey("WidgetId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.WidgetZone", "WidgetZone") + .WithMany() + .HasForeignKey("WidgetZoneId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Widget"); + + b.Navigation("WidgetZone"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", "Vendor") + .WithMany() + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Address"); + + b.Navigation("Vendor"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.HasOne("SimplCommerce.Module.News.Models.NewsCategory", "Category") + .WithMany("NewsItems") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.News.Models.NewsItem", "NewsItem") + .WithMany("Categories") + .HasForeignKey("NewsItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("NewsItem"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "BillingAddress") + .WithMany() + .HasForeignKey("BillingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("BillingAddress"); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("Parent"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany("OrderItems") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Categories") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("CustomerGroups") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Products") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany() + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Pricing.Models.Coupon", "Coupon") + .WithMany() + .HasForeignKey("CouponId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Coupon"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CatalogRule", "CatalogRule") + .WithMany("CustomerGroups") + .HasForeignKey("CatalogRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CatalogRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Coupons") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CartRule"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.HasOne("SimplCommerce.Module.Reviews.Models.Review", "Review") + .WithMany("Replies") + .HasForeignKey("ReviewId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Review"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Shipments.Models.Shipment", "Shipment") + .WithMany("Items") + .HasForeignKey("ShipmentId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Shipment"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Customer"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("StateOrProvince"); + + b.Navigation("TaxClass"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.WishList.Models.WishList", "WishList") + .WithMany("Items") + .HasForeignKey("WishListId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("WishList"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Navigation("Resources"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Navigation("AttributeValues"); + + b.Navigation("Categories"); + + b.Navigation("LinkedProductLinks"); + + b.Navigation("Medias"); + + b.Navigation("OptionCombinations"); + + b.Navigation("OptionValues"); + + b.Navigation("PriceHistories"); + + b.Navigation("ProductLinks"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Navigation("ProductTemplates"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Navigation("Attributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Navigation("ProductAttributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.Checkout", b => + { + b.Navigation("CheckoutItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Navigation("MenuItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Navigation("StatesOrProvinces"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Navigation("CustomerGroups"); + + b.Navigation("Roles"); + + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Navigation("NewsItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Navigation("Categories"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Navigation("Children"); + + b.Navigation("OrderItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Navigation("Categories"); + + b.Navigation("Coupons"); + + b.Navigation("CustomerGroups"); + + b.Navigation("Products"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Navigation("CustomerGroups"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Navigation("Items"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/SimplCommerce.WebHost/Migrations/20240217163906_AddedCatalogSetting.cs b/src/SimplCommerce.WebHost/Migrations/20240217163906_AddedCatalogSetting.cs new file mode 100644 index 0000000000..8c23cd2782 --- /dev/null +++ b/src/SimplCommerce.WebHost/Migrations/20240217163906_AddedCatalogSetting.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SimplCommerce.WebHost.Migrations +{ + /// + public partial class AddedCatalogSetting : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.InsertData( + table: "Core_AppSetting", + columns: new[] { "Id", "IsVisibleInCommonSettingPage", "Module", "Value" }, + values: new object[] { "Catalog.MinimumProductQuantityForHighlighting", true, "Catalog", "5" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "Core_AppSetting", + keyColumn: "Id", + keyValue: "Catalog.MinimumProductQuantityForHighlighting"); + } + } +} diff --git a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs b/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs index 4e199f920c..0e4fbfd2f4 100644 --- a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs +++ b/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs @@ -1236,6 +1236,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) Value = "true" }, new + { + Id = "Catalog.MinimumProductQuantityForHighlighting", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "5" + }, + new { Id = "Catalog.IsCommentsRequireApproval", IsVisibleInCommonSettingPage = true,