Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Modularization: Feature Flags Support and Installer Module Separation (#520)

Krzysztof Pajak3739d1a80ba8
diff --git a/.gitignore b/.gitignore
index bd0235a14..e317858a2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -357,9 +357,11 @@ src/Web/Grand.Web/wwwroot/assets/images/uploaded/*
src/Web/Grand.Web/App_Data/InstalledPlugins.cfg
src/Web/Grand.Web/App_Data/Settings.cfg
src/Web/Grand.Web/Plugins/*
+src/Web/Grand.Web/Modules/*
src/Web/Grand.Web.Admin/App_Data/InstalledPlugins.cfg
src/Web/Grand.Web.Admin/App_Data/Settings.cfg
src/Web/Grand.Web.Admin/Plugins/*
+src/Web/Grand.Web.Admin/Modules/*
src/Web/Grand.Web/App_Data/DataProtectionKeys/*
src/Web/Grand.Web.Admin/App_Data/DataProtectionKeys/*
!src/Web/Grand.Web/App_Data/DataProtectionKeys/Index.htm
@@ -370,5 +372,6 @@ src/Web/Grand.Web/App_Data/TempUploads/*
src/Web/Grand.Web.Vendor/App_Data/InstalledPlugins.cfg
src/Web/Grand.Web.Vendor/App_Data/Settings.cfg
src/Web/Grand.Web.Vendor/Plugins/*
+src/Web/Grand.Web.Vendor/Modules/*
src/Web/Grand.Web.Vendor/App_Data/DataProtectionKeys/*
src/Web/Grand.Web.Vendor/wwwroot/assets/images/thumbs/*.**
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 13952466e..a3cf4ee65 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,6 +9,11 @@ COPY ./src/ /app/
ARG GIT_COMMIT
ARG GIT_BRANCH
+# Build modules
+RUN for module in /app/Modules/*; do \
+ dotnet build "$module" -c Release -p:SourceRevisionId=$GIT_COMMIT -p:GitBranch=$GIT_BRANCH; \
+ done
+
# Build plugins
RUN for plugin in /app/Plugins/*; do \
dotnet build "$plugin" -c Release -p:SourceRevisionId=$GIT_COMMIT -p:GitBranch=$GIT_BRANCH; \
diff --git a/GrandNode.sln b/GrandNode.sln
index c3c609fcc..9273232b1 100644
--- a/GrandNode.sln
+++ b/GrandNode.sln
@@ -117,23 +117,27 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.SharedKernel.Tests",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.Domain.Tests", "src\Tests\Grand.Domain.Tests\Grand.Domain.Tests.csproj", "{EEEE2033-07A4-42BB-AFEE-3F83E0BD3044}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grand.Infrastructure.Tests", "src\Tests\Grand.Infrastructure.Tests\Grand.Infrastructure.Tests.csproj", "{50049A49-D27E-4200-9875-F6C486FD608D}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.Infrastructure.Tests", "src\Tests\Grand.Infrastructure.Tests\Grand.Infrastructure.Tests.csproj", "{50049A49-D27E-4200-9875-F6C486FD608D}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grand.Web.Admin.Tests", "src\Tests\Grand.Web.Admin.Tests\Grand.Web.Admin.Tests.csproj", "{0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.Web.Admin.Tests", "src\Tests\Grand.Web.Admin.Tests\Grand.Web.Admin.Tests.csproj", "{0B2B4B1B-EBF7-447F-9E5F-C55CE3247929}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grand.Web.Common.Tests", "src\Tests\Grand.Web.Common.Tests\Grand.Web.Common.Tests.csproj", "{6969D83E-567C-47A7-8E7F-7FE40940704E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.Web.Common.Tests", "src\Tests\Grand.Web.Common.Tests\Grand.Web.Common.Tests.csproj", "{6969D83E-567C-47A7-8E7F-7FE40940704E}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grand.Web.Vendor", "src\Web\Grand.Web.Vendor\Grand.Web.Vendor.csproj", "{061F07B8-067A-43E6-B0FF-250027EE705F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.Web.Vendor", "src\Web\Grand.Web.Vendor\Grand.Web.Vendor.csproj", "{061F07B8-067A-43E6-B0FF-250027EE705F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grand.Data", "src\Core\Grand.Data\Grand.Data.csproj", "{1308D857-1D87-4973-A848-077F8BBD28DF}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.Data", "src\Core\Grand.Data\Grand.Data.csproj", "{1308D857-1D87-4973-A848-077F8BBD28DF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{BF4543A8-0731-4FDD-BB6B-0ADB9561F981}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grand.SharedUIResources", "src\Web\Grand.SharedUIResources\Grand.SharedUIResources.csproj", "{09958AAA-44BC-42DE-86D1-0E39EF3C0C68}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grand.SharedUIResources", "src\Web\Grand.SharedUIResources\Grand.SharedUIResources.csproj", "{09958AAA-44BC-42DE-86D1-0E39EF3C0C68}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Theme.Modern", "src\Plugins\Theme.Modern\Theme.Modern.csproj", "{9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Theme.Modern", "src\Plugins\Theme.Modern\Theme.Modern.csproj", "{9DAAD56A-8DB7-4A41-BAF3-9486D617AB05}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payments.StripeCheckout", "src\Plugins\Payments.StripeCheckout\Payments.StripeCheckout.csproj", "{8AD9B827-7FB6-4581-85BB-82D7F298DE1A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Payments.StripeCheckout", "src\Plugins\Payments.StripeCheckout\Payments.StripeCheckout.csproj", "{8AD9B827-7FB6-4581-85BB-82D7F298DE1A}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{583FFBBD-421C-4FB7-BBDA-F9CAF35A354A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grand.Module.Installer", "src\Modules\Grand.Module.Installer\Grand.Module.Installer.csproj", "{62460E0C-D4D1-4606-9716-965267B77BA3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -356,6 +360,10 @@ Global
{8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AD9B827-7FB6-4581-85BB-82D7F298DE1A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {62460E0C-D4D1-4606-9716-965267B77BA3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -374,6 +382,7 @@ Global
{9B4BF192-F99A-4969-8472-A0C36B615DB3} = {6EAC4D2C-4A86-4C9F-8427-CB374F69F08C}
{6F9902AA-DBCE-4BB8-AEBE-47264A10D933} = {6EAC4D2C-4A86-4C9F-8427-CB374F69F08C}
{D2E8AC42-2751-4AF9-87E4-54A8B2034360} = {6EAC4D2C-4A86-4C9F-8427-CB374F69F08C}
+ {1A6A0104-F610-4DD3-88BE-C4029034E5DA} = {BF4543A8-0731-4FDD-BB6B-0ADB9561F981}
{34A46D97-5996-46B3-BDCA-631EDAA0E210} = {FA350BD6-C29D-40D9-BA47-FE5FBDFC84A0}
{BA4579AF-9C20-477A-891B-926968B11C68} = {F6F48227-B3C5-4A51-B33F-FF9AD96352DB}
{6F24BF9C-EA4E-42AB-A9A8-435CE69362B8} = {F6F48227-B3C5-4A51-B33F-FF9AD96352DB}
@@ -411,10 +420,10 @@ Global
{061F07B8-067A-43E6-B0FF-250027EE705F} = {38ECA068-176F-463C-A1D7-044341D4CACB}
{1308D857-1D87-4973-A848-077F8BBD28DF} = {FA350BD6-C29D-40D9-BA47-FE5FBDFC84A0}
{BF4543A8-0731-4FDD-BB6B-0ADB9561F981} = {38ECA068-176F-463C-A1D7-044341D4CACB}
- {1A6A0104-F610-4DD3-88BE-C4029034E5DA} = {BF4543A8-0731-4FDD-BB6B-0ADB9561F981}
{09958AAA-44BC-42DE-86D1-0E39EF3C0C68} = {BF4543A8-0731-4FDD-BB6B-0ADB9561F981}
{9DAAD56A-8DB7-4A41-BAF3-9486D617AB05} = {F6F48227-B3C5-4A51-B33F-FF9AD96352DB}
{8AD9B827-7FB6-4581-85BB-82D7F298DE1A} = {F6F48227-B3C5-4A51-B33F-FF9AD96352DB}
+ {62460E0C-D4D1-4606-9716-965267B77BA3} = {583FFBBD-421C-4FB7-BBDA-F9CAF35A354A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {88B478F4-FD3B-4C24-9E84-4FAAF0254397}
diff --git a/src/API/Grand.Api/Controllers/OData/BrandController.cs b/src/API/Grand.Api/Controllers/OData/BrandController.cs
index 6e9ec2cbd..a16d7b3d9 100644
--- a/src/API/Grand.Api/Controllers/OData/BrandController.cs
+++ b/src/API/Grand.Api/Controllers/OData/BrandController.cs
@@ -2,7 +2,7 @@
using Grand.Api.DTOs.Catalog;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.JsonPatch;
diff --git a/src/API/Grand.Api/Controllers/OData/BrandLayoutController.cs b/src/API/Grand.Api/Controllers/OData/BrandLayoutController.cs
index ddde40ae8..646e45894 100644
--- a/src/API/Grand.Api/Controllers/OData/BrandLayoutController.cs
+++ b/src/API/Grand.Api/Controllers/OData/BrandLayoutController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Common;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/CategoryController.cs b/src/API/Grand.Api/Controllers/OData/CategoryController.cs
index ced9f4aa6..e821fafa0 100644
--- a/src/API/Grand.Api/Controllers/OData/CategoryController.cs
+++ b/src/API/Grand.Api/Controllers/OData/CategoryController.cs
@@ -2,7 +2,7 @@
using Grand.Api.DTOs.Catalog;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.JsonPatch;
diff --git a/src/API/Grand.Api/Controllers/OData/CategoryLayoutController.cs b/src/API/Grand.Api/Controllers/OData/CategoryLayoutController.cs
index 63ef2a13d..aabf3761b 100644
--- a/src/API/Grand.Api/Controllers/OData/CategoryLayoutController.cs
+++ b/src/API/Grand.Api/Controllers/OData/CategoryLayoutController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Common;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/CollectionController.cs b/src/API/Grand.Api/Controllers/OData/CollectionController.cs
index d19b1aeaf..09b0a4e6f 100644
--- a/src/API/Grand.Api/Controllers/OData/CollectionController.cs
+++ b/src/API/Grand.Api/Controllers/OData/CollectionController.cs
@@ -2,7 +2,7 @@
using Grand.Api.DTOs.Catalog;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.JsonPatch;
diff --git a/src/API/Grand.Api/Controllers/OData/CollectionLayoutController.cs b/src/API/Grand.Api/Controllers/OData/CollectionLayoutController.cs
index 4b483fb8f..4c809a718 100644
--- a/src/API/Grand.Api/Controllers/OData/CollectionLayoutController.cs
+++ b/src/API/Grand.Api/Controllers/OData/CollectionLayoutController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Common;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/CountryController.cs b/src/API/Grand.Api/Controllers/OData/CountryController.cs
index 871a048f8..118f061b4 100644
--- a/src/API/Grand.Api/Controllers/OData/CountryController.cs
+++ b/src/API/Grand.Api/Controllers/OData/CountryController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Common;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/CurrencyController.cs b/src/API/Grand.Api/Controllers/OData/CurrencyController.cs
index c209addee..d3d273c5f 100644
--- a/src/API/Grand.Api/Controllers/OData/CurrencyController.cs
+++ b/src/API/Grand.Api/Controllers/OData/CurrencyController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Common;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/CustomerController.cs b/src/API/Grand.Api/Controllers/OData/CustomerController.cs
index 9adc14c37..5dc6c8dc6 100644
--- a/src/API/Grand.Api/Controllers/OData/CustomerController.cs
+++ b/src/API/Grand.Api/Controllers/OData/CustomerController.cs
@@ -3,7 +3,7 @@ using Grand.Api.DTOs.Customers;
using Grand.Api.Queries.Models.Customers;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Business.Core.Utilities.Customers;
using Grand.Domain.Customers;
using MediatR;
diff --git a/src/API/Grand.Api/Controllers/OData/CustomerGroupController.cs b/src/API/Grand.Api/Controllers/OData/CustomerGroupController.cs
index c510be1ff..118aa6972 100644
--- a/src/API/Grand.Api/Controllers/OData/CustomerGroupController.cs
+++ b/src/API/Grand.Api/Controllers/OData/CustomerGroupController.cs
@@ -2,7 +2,7 @@
using Grand.Api.DTOs.Customers;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Customers;
using MediatR;
using Microsoft.AspNetCore.JsonPatch;
diff --git a/src/API/Grand.Api/Controllers/OData/DeliveryDateController.cs b/src/API/Grand.Api/Controllers/OData/DeliveryDateController.cs
index 3ce8a783b..ab7205013 100644
--- a/src/API/Grand.Api/Controllers/OData/DeliveryDateController.cs
+++ b/src/API/Grand.Api/Controllers/OData/DeliveryDateController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Shipping;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Shipping;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/LanguageController.cs b/src/API/Grand.Api/Controllers/OData/LanguageController.cs
index 1316202a2..6f3fb7670 100644
--- a/src/API/Grand.Api/Controllers/OData/LanguageController.cs
+++ b/src/API/Grand.Api/Controllers/OData/LanguageController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Common;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Localization;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/PickupPointController.cs b/src/API/Grand.Api/Controllers/OData/PickupPointController.cs
index e3284651d..4ee33f3bb 100644
--- a/src/API/Grand.Api/Controllers/OData/PickupPointController.cs
+++ b/src/API/Grand.Api/Controllers/OData/PickupPointController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Shipping;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Shipping;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/PictureController.cs b/src/API/Grand.Api/Controllers/OData/PictureController.cs
index 3bd681947..2d092c4bd 100644
--- a/src/API/Grand.Api/Controllers/OData/PictureController.cs
+++ b/src/API/Grand.Api/Controllers/OData/PictureController.cs
@@ -2,7 +2,7 @@
using Grand.Api.DTOs.Common;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Media;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/ProductAttributeController.cs b/src/API/Grand.Api/Controllers/OData/ProductAttributeController.cs
index 229587230..37bbcb357 100644
--- a/src/API/Grand.Api/Controllers/OData/ProductAttributeController.cs
+++ b/src/API/Grand.Api/Controllers/OData/ProductAttributeController.cs
@@ -2,7 +2,7 @@
using Grand.Api.DTOs.Catalog;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.JsonPatch;
diff --git a/src/API/Grand.Api/Controllers/OData/ProductController.cs b/src/API/Grand.Api/Controllers/OData/ProductController.cs
index 99c11b029..12b63092b 100644
--- a/src/API/Grand.Api/Controllers/OData/ProductController.cs
+++ b/src/API/Grand.Api/Controllers/OData/ProductController.cs
@@ -2,7 +2,7 @@
using Grand.Api.DTOs.Catalog;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.JsonPatch;
diff --git a/src/API/Grand.Api/Controllers/OData/ProductLayoutController.cs b/src/API/Grand.Api/Controllers/OData/ProductLayoutController.cs
index 0b5791dcd..49ba61b52 100644
--- a/src/API/Grand.Api/Controllers/OData/ProductLayoutController.cs
+++ b/src/API/Grand.Api/Controllers/OData/ProductLayoutController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Common;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/ShippingMethodController.cs b/src/API/Grand.Api/Controllers/OData/ShippingMethodController.cs
index c646866d6..eea4cb144 100644
--- a/src/API/Grand.Api/Controllers/OData/ShippingMethodController.cs
+++ b/src/API/Grand.Api/Controllers/OData/ShippingMethodController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Shipping;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Shipping;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/SpecificationAttributeController.cs b/src/API/Grand.Api/Controllers/OData/SpecificationAttributeController.cs
index 17e9abe2f..af800b00c 100644
--- a/src/API/Grand.Api/Controllers/OData/SpecificationAttributeController.cs
+++ b/src/API/Grand.Api/Controllers/OData/SpecificationAttributeController.cs
@@ -2,7 +2,7 @@
using Grand.Api.DTOs.Catalog;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using MediatR;
using Microsoft.AspNetCore.JsonPatch;
diff --git a/src/API/Grand.Api/Controllers/OData/StoreController.cs b/src/API/Grand.Api/Controllers/OData/StoreController.cs
index b78f14fd5..1fc13eab9 100644
--- a/src/API/Grand.Api/Controllers/OData/StoreController.cs
+++ b/src/API/Grand.Api/Controllers/OData/StoreController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Common;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Stores;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/VendorController.cs b/src/API/Grand.Api/Controllers/OData/VendorController.cs
index 3a327a5b7..fc0299543 100644
--- a/src/API/Grand.Api/Controllers/OData/VendorController.cs
+++ b/src/API/Grand.Api/Controllers/OData/VendorController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Customers;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Vendors;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Controllers/OData/WarehouseController.cs b/src/API/Grand.Api/Controllers/OData/WarehouseController.cs
index 2bc5fef56..19abd77ee 100644
--- a/src/API/Grand.Api/Controllers/OData/WarehouseController.cs
+++ b/src/API/Grand.Api/Controllers/OData/WarehouseController.cs
@@ -1,7 +1,7 @@
using Grand.Api.DTOs.Shipping;
using Grand.Api.Queries.Models.Common;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Shipping;
using MediatR;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/API/Grand.Api/Filters/AuthorizeApiAdminAttribute.cs b/src/API/Grand.Api/Filters/AuthorizeApiAdminAttribute.cs
index fe4175564..c5e8dd6f8 100644
--- a/src/API/Grand.Api/Filters/AuthorizeApiAdminAttribute.cs
+++ b/src/API/Grand.Api/Filters/AuthorizeApiAdminAttribute.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Data;
using Grand.Domain.Security;
using Microsoft.AspNetCore.Authentication.JwtBearer;
diff --git a/src/Business/Grand.Business.Authentication/Services/JwtBearerCustomerAuthenticationService.cs b/src/Business/Grand.Business.Authentication/Services/JwtBearerCustomerAuthenticationService.cs
index f493a7c00..aa3519d23 100644
--- a/src/Business/Grand.Business.Authentication/Services/JwtBearerCustomerAuthenticationService.cs
+++ b/src/Business/Grand.Business.Authentication/Services/JwtBearerCustomerAuthenticationService.cs
@@ -2,9 +2,9 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
using Grand.Domain.Common;
using Grand.Domain.Customers;
+using Grand.Domain.Permissions;
using Microsoft.AspNetCore.Authentication.JwtBearer;
namespace Grand.Business.Authentication.Services;
diff --git a/src/Business/Grand.Business.Checkout/Validators/ShoppingCartCommonWarningsValidator.cs b/src/Business/Grand.Business.Checkout/Validators/ShoppingCartCommonWarningsValidator.cs
index 83f5c9c55..4f1a5b1f4 100644
--- a/src/Business/Grand.Business.Checkout/Validators/ShoppingCartCommonWarningsValidator.cs
+++ b/src/Business/Grand.Business.Checkout/Validators/ShoppingCartCommonWarningsValidator.cs
@@ -1,10 +1,10 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
using Grand.Domain.Catalog;
using Grand.Domain.Customers;
using Grand.Domain.Orders;
+using Grand.Domain.Permissions;
using Grand.Domain.Stores;
namespace Grand.Business.Checkout.Validators;
diff --git a/src/Business/Grand.Business.Common/Services/Localization/TranslationService.cs b/src/Business/Grand.Business.Common/Services/Localization/TranslationService.cs
index 92b7c321d..67dc8cc8f 100644
--- a/src/Business/Grand.Business.Common/Services/Localization/TranslationService.cs
+++ b/src/Business/Grand.Business.Common/Services/Localization/TranslationService.cs
@@ -4,6 +4,7 @@ using Grand.Data;
using Grand.Domain.Localization;
using Grand.Infrastructure;
using Grand.Infrastructure.Extensions;
+using Grand.SharedKernel.Extensions;
using MediatR;
using System.Collections.Concurrent;
using System.Xml;
diff --git a/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs b/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs
index d676ca743..2195c7c1f 100644
--- a/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs
+++ b/src/Business/Grand.Business.Common/Services/Security/PermissionProvider.cs
@@ -1,5 +1,4 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
using Grand.Domain.Customers;
using Grand.Domain.Permissions;
diff --git a/src/Business/Grand.Business.Core/Commands/System/Security/InstallPermissionsCommand.cs b/src/Business/Grand.Business.Core/Commands/System/Security/InstallPermissionsCommand.cs
deleted file mode 100644
index 3884284a4..000000000
--- a/src/Business/Grand.Business.Core/Commands/System/Security/InstallPermissionsCommand.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using Grand.Business.Core.Interfaces.Common.Security;
-using MediatR;
-
-namespace Grand.Business.Core.Commands.System.Security;
-
-public class InstallPermissionsCommand : IRequest<bool>
-{
- public IPermissionProvider PermissionProvider { get; set; }
-}
\ No newline at end of file
diff --git a/src/Business/Grand.Business.Core/Commands/System/Security/UninstallPermissionsCommand.cs b/src/Business/Grand.Business.Core/Commands/System/Security/UninstallPermissionsCommand.cs
deleted file mode 100644
index c0e71fd35..000000000
--- a/src/Business/Grand.Business.Core/Commands/System/Security/UninstallPermissionsCommand.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using Grand.Business.Core.Interfaces.Common.Security;
-using MediatR;
-
-namespace Grand.Business.Core.Commands.System.Security;
-
-public class UninstallPermissionsCommand : IRequest<bool>
-{
- public IPermissionProvider PermissionProvider { get; set; }
-}
\ No newline at end of file
diff --git a/src/Business/Grand.Business.Core/Interfaces/System/Installation/IInstallationService.cs b/src/Business/Grand.Business.Core/Interfaces/System/Installation/IInstallationService.cs
deleted file mode 100644
index 3c156e5f4..000000000
--- a/src/Business/Grand.Business.Core/Interfaces/System/Installation/IInstallationService.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using Microsoft.AspNetCore.Http;
-
-namespace Grand.Business.Core.Interfaces.System.Installation;
-
-public interface IInstallationService
-{
- Task InstallData(
- string httpscheme, HostString host,
- string defaultUserEmail, string defaultUserPassword, string collation, bool installSampleData = true,
- string companyName = "", string companyAddress = "", string companyPhoneNumber = "", string companyEmail = "");
-}
\ No newline at end of file
diff --git a/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallPermissionsCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallPermissionsCommandHandler.cs
deleted file mode 100644
index 60371dc42..000000000
--- a/src/Business/Grand.Business.System/Commands/Handlers/Security/InstallPermissionsCommandHandler.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using Grand.Business.Core.Commands.System.Security;
-using Grand.Business.Core.Interfaces.Common.Directory;
-using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Domain.Customers;
-using Grand.Domain.Localization;
-using Grand.Domain.Permissions;
-using MediatR;
-
-namespace Grand.Business.System.Commands.Handlers.Security;
-
-public class InstallPermissionsCommandHandler : IRequestHandler<InstallPermissionsCommand, bool>
-{
- private readonly IGroupService _groupService;
- private readonly ILanguageService _languageService;
- private readonly IPermissionService _permissionService;
- private readonly ITranslationService _translationService;
-
- public InstallPermissionsCommandHandler(
- IPermissionService permissionService,
- IGroupService groupService,
- ITranslationService translationService,
- ILanguageService languageService)
- {
- _permissionService = permissionService;
- _groupService = groupService;
- _translationService = translationService;
- _languageService = languageService;
- }
-
- public async Task<bool> Handle(InstallPermissionsCommand request, CancellationToken cancellationToken)
- {
- //install new permissions
- var permissions = request.PermissionProvider.GetPermissions();
- foreach (var permission in permissions)
- {
- var permission1 = await _permissionService.GetPermissionBySystemName(permission.SystemName);
- if (permission1 != null) continue;
- //new permission (install it)
- permission1 = new Permission {
- Name = permission.Name,
- SystemName = permission.SystemName,
- Area = permission.Area,
- Category = permission.Category,
- Actions = permission.Actions
- };
-
-
- //default customer group mappings
- var defaultPermissions = request.PermissionProvider.GetDefaultPermissions();
- foreach (var defaultPermission in defaultPermissions)
- {
- var customerGroup =
- await _groupService.GetCustomerGroupBySystemName(defaultPermission.CustomerGroupSystemName);
- if (customerGroup == null)
- {
- //new role (save it)
- customerGroup = new CustomerGroup {
- Name = defaultPermission.CustomerGroupSystemName,
- Active = true,
- SystemName = defaultPermission.CustomerGroupSystemName
- };
- await _groupService.InsertCustomerGroup(customerGroup);
- }
-
-
- var defaultMappingProvided = (from p in defaultPermission.Permissions
- where p.SystemName == permission1.SystemName
- select p).Any();
- if (defaultMappingProvided) permission1.CustomerGroups.Add(customerGroup.Id);
- }
-
- //save new permission
- await _permissionService.InsertPermission(permission1);
-
- //save localization
- await SaveTranslationPermissionName(permission1);
- }
-
- return true;
- }
- private async Task SaveTranslationPermissionName(Permission permissionRecord)
- {
- var name = $"Permission.{permissionRecord.SystemName}";
- var value = permissionRecord.Name;
-
- foreach (var lang in await _languageService.GetAllLanguages(true))
- {
- var lsr = await _translationService.GetTranslateResourceByName(name, lang.Id);
- if (lsr == null)
- {
- lsr = new TranslationResource {
- LanguageId = lang.Id,
- Name = name,
- Value = value
- };
- await _translationService.InsertTranslateResource(lsr);
- }
- else
- {
- lsr.Value = value;
- await _translationService.UpdateTranslateResource(lsr);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Business/Grand.Business.System/Commands/Handlers/Security/UninstallPermissionsCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Security/UninstallPermissionsCommandHandler.cs
deleted file mode 100644
index da9045066..000000000
--- a/src/Business/Grand.Business.System/Commands/Handlers/Security/UninstallPermissionsCommandHandler.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using Grand.Business.Core.Commands.System.Security;
-using Grand.Business.Core.Extensions;
-using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Domain.Permissions;
-using MediatR;
-
-namespace Grand.Business.System.Commands.Handlers.Security;
-
-public class UninstallPermissionsCommandHandler : IRequestHandler<UninstallPermissionsCommand, bool>
-{
- private readonly ILanguageService _languageService;
- private readonly IPermissionService _permissionService;
- private readonly ITranslationService _translationService;
-
- public UninstallPermissionsCommandHandler(
- IPermissionService permissionService,
- ITranslationService translationService,
- ILanguageService languageService)
- {
- _permissionService = permissionService;
- _translationService = translationService;
- _languageService = languageService;
- }
-
- public async Task<bool> Handle(UninstallPermissionsCommand request, CancellationToken cancellationToken)
- {
- var permissions = request.PermissionProvider.GetPermissions();
- foreach (var permission in permissions)
- {
- var permission1 = await _permissionService.GetPermissionBySystemName(permission.SystemName);
- if (permission1 == null) continue;
- await _permissionService.DeletePermission(permission1);
-
- //delete permission locales
- await DeleteTranslationPermissionName(permission1);
- }
-
- return true;
- }
- private async Task DeleteTranslationPermissionName(Permission permissionRecord)
- {
- var name = permissionRecord.GetTranslationPermissionName();
- foreach (var lang in await _languageService.GetAllLanguages(true))
- {
- var lsr = await _translationService.GetTranslateResourceByName(name, lang.Id);
- if (lsr != null)
- await _translationService.DeleteTranslateResource(lsr);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationSystemPermission.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationSystemPermission.cs
index dd6419101..21d216f91 100644
--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationSystemPermission.cs
+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationSystemPermission.cs
@@ -1,5 +1,4 @@
using Grand.Business.Core.Interfaces.Common.Directory;
-using Grand.Business.Core.Utilities.Common.Security;
using Grand.Data;
using Grand.Domain.Customers;
using Grand.Domain.Permissions;
diff --git a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateAdminSiteMap.cs b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateAdminSiteMap.cs
index 7eec8e260..82585c85e 100644
--- a/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateAdminSiteMap.cs
+++ b/src/Business/Grand.Business.System/Services/Migrations/1.1/MigrationUpdateAdminSiteMap.cs
@@ -1,6 +1,6 @@
-using Grand.Business.Core.Utilities.Common.Security;
-using Grand.Data;
+using Grand.Data;
using Grand.Domain.Admin;
+using Grand.Domain.Permissions;
using Grand.Infrastructure.Migrations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
diff --git a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateAdminSiteMap.cs b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateAdminSiteMap.cs
index 75eab705c..323d17008 100644
--- a/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateAdminSiteMap.cs
+++ b/src/Business/Grand.Business.System/Services/Migrations/2.1/MigrationUpdateAdminSiteMap.cs
@@ -1,6 +1,6 @@
-using Grand.Business.Core.Utilities.Common.Security;
-using Grand.Data;
+using Grand.Data;
using Grand.Domain.Admin;
+using Grand.Domain.Permissions;
using Grand.Infrastructure.Migrations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
diff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs
index cb76a3598..1c967b3f0 100644
--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs
+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationSystemPermission.cs
@@ -1,5 +1,4 @@
using Grand.Business.Core.Interfaces.Common.Directory;
-using Grand.Business.Core.Utilities.Common.Security;
using Grand.Data;
using Grand.Domain.Customers;
using Grand.Domain.Permissions;
diff --git a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs
index 2240ea3ff..58f24c950 100644
--- a/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs
+++ b/src/Business/Grand.Business.System/Services/Migrations/2.2/MigrationUpdateAdminSiteMap.cs
@@ -1,6 +1,6 @@
-using Grand.Business.Core.Utilities.Common.Security;
-using Grand.Data;
+using Grand.Data;
using Grand.Domain.Admin;
+using Grand.Domain.Permissions;
using Grand.Infrastructure.Migrations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
diff --git a/src/Business/Grand.Business.System/Startup/StartupApplication.cs b/src/Business/Grand.Business.System/Startup/StartupApplication.cs
index 1dd22de98..4cb44a0a3 100644
--- a/src/Business/Grand.Business.System/Startup/StartupApplication.cs
+++ b/src/Business/Grand.Business.System/Startup/StartupApplication.cs
@@ -1,15 +1,12 @@
using Grand.Business.Core.Interfaces.System.Admin;
-using Grand.Business.Core.Interfaces.System.Installation;
using Grand.Business.Core.Interfaces.System.MachineNameProvider;
using Grand.Business.Core.Interfaces.System.Reports;
using Grand.Business.Core.Interfaces.System.ScheduleTasks;
using Grand.Business.System.Services.Admin;
using Grand.Business.System.Services.BackgroundServices.ScheduleTasks;
-using Grand.Business.System.Services.Installation;
using Grand.Business.System.Services.MachineNameProvider;
using Grand.Business.System.Services.Migrations;
using Grand.Business.System.Services.Reports;
-using Grand.Data;
using Grand.Infrastructure;
using Grand.Infrastructure.Configuration;
using Grand.Infrastructure.Migrations;
@@ -27,7 +24,6 @@ public class StartupApplication : IStartupApplication
RegisterReports(services);
RegisterMachineNameProvider(services, configuration);
RegisterTask(services);
- RegisterInstallService(services);
RegisterAdmin(services);
}
@@ -68,21 +64,9 @@ public class StartupApplication : IStartupApplication
serviceCollection.AddSingleton<IMachineNameProvider, DefaultMachineNameProvider>();
}
- private void RegisterInstallService(IServiceCollection serviceCollection)
- {
- var databaseInstalled = DataSettingsManager.DatabaseIsInstalled();
- if (!databaseInstalled)
- {
- //installation service
- serviceCollection.AddScoped<IInstallationLocalizedService, InstallationLocalizedService>();
- serviceCollection.AddScoped<IInstallationService, InstallationService>();
- }
-
- serviceCollection.AddScoped<IMigrationProcess, MigrationProcess>();
- }
-
private void RegisterAdmin(IServiceCollection serviceCollection)
{
serviceCollection.AddScoped<IAdminSiteMapService, AdminSiteMapService>();
+ serviceCollection.AddScoped<IMigrationProcess, MigrationProcess>();
}
}
\ No newline at end of file
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionActionName.cs b/src/Core/Grand.Domain/Permissions/PermissionActionName.cs
similarity index 94%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionActionName.cs
rename to src/Core/Grand.Domain/Permissions/PermissionActionName.cs
index 12eeeab14..7e12e34f0 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionActionName.cs
+++ b/src/Core/Grand.Domain/Permissions/PermissionActionName.cs
@@ -1,4 +1,4 @@
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static class PermissionActionName
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionSystemName.cs b/src/Core/Grand.Domain/Permissions/PermissionSystemName.cs
similarity index 98%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionSystemName.cs
rename to src/Core/Grand.Domain/Permissions/PermissionSystemName.cs
index 066186d96..9010b8594 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/PermissionSystemName.cs
+++ b/src/Core/Grand.Domain/Permissions/PermissionSystemName.cs
@@ -1,4 +1,4 @@
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static class PermissionSystemName
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermission.cs b/src/Core/Grand.Domain/Permissions/StandardPermission.cs
similarity index 80%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermission.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermission.cs
index 71933292e..561f8fc9f 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermission.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermission.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
/// <summary>
/// Standard permissions
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionCatalog.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionCatalog.cs
similarity index 97%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionCatalog.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionCatalog.cs
index 08b46fd11..fd7419215 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionCatalog.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionCatalog.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static partial class StandardPermission
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionConfiguration.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionConfiguration.cs
similarity index 98%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionConfiguration.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionConfiguration.cs
index 68b631c33..1be1d22ea 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionConfiguration.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionConfiguration.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static partial class StandardPermission
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionContent.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionContent.cs
similarity index 96%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionContent.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionContent.cs
index 191d677aa..e14b419c9 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionContent.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionContent.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static partial class StandardPermission
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionCustomer.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionCustomer.cs
similarity index 97%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionCustomer.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionCustomer.cs
index 7aae7552a..2a4984d94 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionCustomer.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionCustomer.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static partial class StandardPermission
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionMarketing.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionMarketing.cs
similarity index 97%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionMarketing.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionMarketing.cs
index 3b470a119..5cfdbf9a2 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionMarketing.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionMarketing.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static partial class StandardPermission
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionOrder.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionOrder.cs
similarity index 97%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionOrder.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionOrder.cs
index 20c553741..ed1776554 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionOrder.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionOrder.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static partial class StandardPermission
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionPublicStore.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionPublicStore.cs
similarity index 94%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionPublicStore.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionPublicStore.cs
index 66fe68f2a..a73dceaa3 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionPublicStore.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionPublicStore.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static partial class StandardPermission
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionReport.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionReport.cs
similarity index 77%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionReport.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionReport.cs
index 823fd42e4..7090869a9 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionReport.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionReport.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static partial class StandardPermission
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionSystem.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionSystem.cs
similarity index 96%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionSystem.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionSystem.cs
index 458e9de05..18f3917bd 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionSystem.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionSystem.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
public static partial class StandardPermission
{
diff --git a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionVendor.cs b/src/Core/Grand.Domain/Permissions/StandardPermissionVendor.cs
similarity index 80%
rename from src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionVendor.cs
rename to src/Core/Grand.Domain/Permissions/StandardPermissionVendor.cs
index c9543d93c..1bc48f31f 100644
--- a/src/Business/Grand.Business.Core/Utilities/Common/Security/StandardPermissionVendor.cs
+++ b/src/Core/Grand.Domain/Permissions/StandardPermissionVendor.cs
@@ -1,6 +1,4 @@
-using Grand.Domain.Permissions;
-
-namespace Grand.Business.Core.Utilities.Common.Security;
+namespace Grand.Domain.Permissions;
/// <summary>
/// Standard permissions
diff --git a/src/Core/Grand.Infrastructure/Configuration/FeatureFlagsConfig.cs b/src/Core/Grand.Infrastructure/Configuration/FeatureFlagsConfig.cs
new file mode 100644
index 000000000..30d1b55b7
--- /dev/null
+++ b/src/Core/Grand.Infrastructure/Configuration/FeatureFlagsConfig.cs
@@ -0,0 +1,6 @@
+namespace Grand.Infrastructure.Configuration;
+
+public class FeatureFlagsConfig
+{
+ public Dictionary<string, bool> Modules { get; set; } = new Dictionary<string, bool>();
+}
diff --git a/src/Core/Grand.Infrastructure/Configuration/PerformanceConfig.cs b/src/Core/Grand.Infrastructure/Configuration/PerformanceConfig.cs
index 1fa14e21c..6597c5aac 100644
--- a/src/Core/Grand.Infrastructure/Configuration/PerformanceConfig.cs
+++ b/src/Core/Grand.Infrastructure/Configuration/PerformanceConfig.cs
@@ -10,11 +10,6 @@ public class PerformanceConfig
/// </summary>
public bool UseResponseCompression { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether ignore InstallUrlMiddleware
- /// </summary>
- public bool IgnoreInstallUrlMiddleware { get; set; }
-
/// <summary>
/// Gets or sets a value indicating whether ignore DbVersionCheckMiddleware
/// </summary>
diff --git a/src/Core/Grand.Infrastructure/Modules/ModuleLoader.cs b/src/Core/Grand.Infrastructure/Modules/ModuleLoader.cs
new file mode 100644
index 000000000..22458a050
--- /dev/null
+++ b/src/Core/Grand.Infrastructure/Modules/ModuleLoader.cs
@@ -0,0 +1,67 @@
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc.ApplicationParts;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using System.Reflection;
+using System.Runtime.Loader;
+
+namespace Grand.Infrastructure.Modules;
+
+public static class ModuleLoader
+{
+ public static void LoadModules(IMvcCoreBuilder mvcCoreBuilder, IConfiguration configuration, IWebHostEnvironment hostingEnvironment)
+ {
+ var modulesSection = configuration.GetSection("FeatureFlags:Modules");
+ if (!modulesSection.Exists())
+ {
+ return;
+ }
+
+ var logger = mvcCoreBuilder.Services.BuildServiceProvider().GetService<ILoggerFactory>().CreateLogger("ModuleManager");
+
+ var modules = modulesSection.Get<Dictionary<string, bool>>();
+
+ foreach (var module in modules)
+ {
+ if (module.Value)
+ {
+ var moduleName = module.Key;
+ var modulePath = Path.Combine(hostingEnvironment.ContentRootPath, "Modules", $"{moduleName}.dll");
+ if (File.Exists(modulePath))
+ {
+ try
+ {
+ var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(modulePath);
+ AddApplicationPart(mvcCoreBuilder, assembly);
+ logger.LogInformation($"Module '{moduleName}' has been successfully loaded.");
+ }
+ catch (Exception ex)
+ {
+ logger.LogError($"Error loading module '{moduleName}': {ex.Message}");
+ }
+ }
+ else
+ {
+ logger.LogWarning($"Module '{moduleName}' does not exist in the application directory.");
+ }
+ }
+ else
+ {
+ logger.LogInformation($"Module '{module.Key}' is disabled.");
+ }
+ }
+ }
+ private static void AddApplicationPart(IMvcCoreBuilder mvcCoreBuilder, Assembly assembly)
+ {
+ mvcCoreBuilder.AddApplicationPart(assembly);
+
+ var relatedAssemblies = RelatedAssemblyAttribute.GetRelatedAssemblies(assembly, false);
+ foreach (var relatedAssembly in relatedAssemblies)
+ {
+ var applicationPartFactory = ApplicationPartFactory.GetApplicationPartFactory(relatedAssembly);
+ foreach (var part in applicationPartFactory.GetApplicationParts(relatedAssembly))
+ mvcCoreBuilder.PartManager.ApplicationParts.Add(part);
+ }
+ }
+}
diff --git a/src/Core/Grand.Infrastructure/Plugins/PluginExtensions.cs b/src/Core/Grand.Infrastructure/Plugins/PluginExtensions.cs
index 207bfecb8..05224834d 100644
--- a/src/Core/Grand.Infrastructure/Plugins/PluginExtensions.cs
+++ b/src/Core/Grand.Infrastructure/Plugins/PluginExtensions.cs
@@ -1,4 +1,3 @@
-using Grand.SharedKernel.Extensions;
using System.Text.Json;
namespace Grand.Infrastructure.Plugins;
diff --git a/src/Core/Grand.Infrastructure/StartupBase.cs b/src/Core/Grand.Infrastructure/StartupBase.cs
index d4ba91f94..16da74a60 100644
--- a/src/Core/Grand.Infrastructure/StartupBase.cs
+++ b/src/Core/Grand.Infrastructure/StartupBase.cs
@@ -4,6 +4,7 @@ using Grand.Infrastructure.Caching.RabbitMq;
using Grand.Infrastructure.Configuration;
using Grand.Infrastructure.Extensions;
using Grand.Infrastructure.Mapper;
+using Grand.Infrastructure.Modules;
using Grand.Infrastructure.Plugins;
using Grand.Infrastructure.Roslyn;
using Grand.Infrastructure.TypeConverters;
@@ -127,6 +128,9 @@ public static class StartupBase
/// <param name="configuration"></param>
private static void RegisterExtensions(IMvcCoreBuilder mvcCoreBuilder, IConfiguration configuration, IWebHostEnvironment hostEnvironment)
{
+ //Load Modules
+ ModuleLoader.LoadModules(mvcCoreBuilder, configuration, hostEnvironment);
+
//Load plugins
PluginManager.Load(mvcCoreBuilder, configuration, hostEnvironment);
@@ -249,6 +253,7 @@ public static class StartupBase
services.StartupConfig<BackendAPIConfig>(configuration.GetSection("BackendAPI"));
services.StartupConfig<FrontendAPIConfig>(configuration.GetSection("FrontendAPI"));
services.StartupConfig<DatabaseConfig>(configuration.GetSection("Database"));
+ services.StartupConfig<FeatureFlagsConfig>(configuration.GetSection("FeatureFlags"));
services.StartupConfig<AmazonConfig>(configuration.GetSection("Amazon"));
services.StartupConfig<AzureConfig>(configuration.GetSection("Azure"));
services.StartupConfig<ApplicationInsightsConfig>(configuration.GetSection("ApplicationInsights"));
diff --git a/src/Business/Grand.Business.Common/Utilities/LanguageSchema.cs b/src/Core/Grand.SharedKernel/Extensions/LanguageSchema.cs
similarity index 94%
rename from src/Business/Grand.Business.Common/Utilities/LanguageSchema.cs
rename to src/Core/Grand.SharedKernel/Extensions/LanguageSchema.cs
index 145067371..cf11a55f1 100644
--- a/src/Business/Grand.Business.Common/Utilities/LanguageSchema.cs
+++ b/src/Core/Grand.SharedKernel/Extensions/LanguageSchema.cs
@@ -1,4 +1,4 @@
-namespace Grand.Business.Common.Utilities;
+namespace Grand.SharedKernel.Extensions;
public static class LanguageSchema
{
diff --git a/src/Web/Grand.Web/Controllers/InstallController.cs b/src/Modules/Grand.Module.Installer/Controllers/InstallController.cs
similarity index 91%
rename from src/Web/Grand.Web/Controllers/InstallController.cs
rename to src/Modules/Grand.Module.Installer/Controllers/InstallController.cs
index 2799d2014..16658e7d2 100644
--- a/src/Web/Grand.Web/Controllers/InstallController.cs
+++ b/src/Modules/Grand.Module.Installer/Controllers/InstallController.cs
@@ -1,13 +1,11 @@
-using Grand.Business.Core.Commands.System.Security;
-using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Interfaces.System.Installation;
-using Grand.Data;
+using Grand.Data;
using Grand.Infrastructure.Caching;
using Grand.Infrastructure.Configuration;
using Grand.Infrastructure.Migrations;
using Grand.Infrastructure.Plugins;
+using Grand.Module.Installer.Interfaces;
+using Grand.Module.Installer.Models;
using Grand.SharedKernel.Extensions;
-using Grand.Web.Models.Install;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -17,7 +15,7 @@ using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using MongoDB.Driver;
-namespace Grand.Web.Controllers;
+namespace Grand.Module.Installer.Controllers;
public class InstallController : Controller
{
@@ -59,7 +57,7 @@ public class InstallController : Controller
#region Methods
- protected virtual string GetLanguage()
+ protected virtual string? GetLanguage()
{
HttpContext.Request.Cookies.TryGetValue(LANGUAGE_COOKIE_NAME, out var language);
@@ -70,14 +68,16 @@ public class InstallController : Controller
return !string.IsNullOrEmpty(userLanguage) ? userLanguage : language;
}
- private InstallModel PrepareModel(InstallModel model)
+ private InstallModel PrepareModel(InstallModel? model)
{
var locService = _serviceProvider.GetRequiredService<IInstallationLocalizedService>();
model ??= new InstallModel {
AdminEmail = "[email protected]",
InstallSampleData = false,
- DatabaseConnectionString = ""
+ DatabaseConnectionString = "",
+ AdminPassword = "",
+ ConfirmPassword = ""
};
model.AvailableProviders = Enum.GetValues(typeof(DbProvider)).Cast<DbProvider>().Select(v => new SelectListItem {
@@ -120,7 +120,7 @@ public class InstallController : Controller
return RedirectToRoute("HomePage");
var installed = await _cacheBase.GetAsync("Installed", async () => await Task.FromResult(false));
- return View(installed ? new InstallModel { Installed = true } : PrepareModel(null));
+ return View(installed ? new InstallModel { Installed = true, AdminEmail = "", AdminPassword = "", ConfirmPassword = "" } : PrepareModel(null));
}
private string BuildConnectionString(IInstallationLocalizedService locService, InstallModel model)
@@ -130,8 +130,7 @@ public class InstallController : Controller
if (model.ConnectionInfo && model.DataProvider != DbProvider.LiteDB)
{
if (string.IsNullOrEmpty(model.DatabaseConnectionString))
- ModelState.AddModelError("",
- locService.GetResource(model.SelectedLanguage, "ConnectionStringRequired"));
+ ModelState.AddModelError("", locService.GetResource(model.SelectedLanguage, "ConnectionStringRequired"));
else
connectionString = model.DatabaseConnectionString;
}
@@ -211,7 +210,7 @@ public class InstallController : Controller
var installed = await _cacheBase.GetAsync("Installed", async () => await Task.FromResult(false));
if (installed)
- return View(new InstallModel { Installed = true });
+ return View(new InstallModel { Installed = true, AdminEmail = "", AdminPassword = "", ConfirmPassword = "" });
var locService = _serviceProvider.GetRequiredService<IInstallationLocalizedService>();
@@ -263,11 +262,6 @@ public class InstallController : Controller
ex.Message + " " + ex.InnerException?.Message);
}
- //register default permissions
- var permissionProvider = _serviceProvider.GetRequiredService<IPermissionProvider>();
- await _mediator.Send(new InstallPermissionsCommand { PermissionProvider = permissionProvider });
- _logger.LogInformation("Permission has been installed");
-
//install migration process - install only header
var migrationProcess = _serviceProvider.GetRequiredService<IMigrationProcess>();
migrationProcess.InstallApplication();
@@ -276,7 +270,7 @@ public class InstallController : Controller
//restart application
await _cacheBase.SetAsync("Installed", async () => await Task.FromResult(true));
- return View(new InstallModel { Installed = true });
+ return View(new InstallModel { Installed = true, AdminEmail = "", AdminPassword = "", ConfirmPassword = "" });
}
catch (Exception exception)
{
@@ -287,7 +281,7 @@ public class InstallController : Controller
System.IO.File.Delete(Path.Combine(AppContext.BaseDirectory, CommonPath.AppData, CommonPath.SettingsFile));
ModelState.AddModelError("",
- string.Format(locService.GetResource(model.SelectedLanguage, "SetupFailed"),
+ string.Format(locService.GetResource(model.SelectedLanguage!, "SetupFailed"),
exception.Message + " " + exception.InnerException?.Message));
_logger.LogError(exception, exception.InnerException?.Message);
}
diff --git a/src/Modules/Grand.Module.Installer/Extensions/PermissionExtensions.cs b/src/Modules/Grand.Module.Installer/Extensions/PermissionExtensions.cs
new file mode 100644
index 000000000..2847ce2e1
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Extensions/PermissionExtensions.cs
@@ -0,0 +1,224 @@
+using Grand.Domain.Customers;
+using Grand.Domain.Permissions;
+
+namespace Grand.Module.Installer.Extensions;
+
+public static class PermissionExtensions
+{
+ public static IEnumerable<Permission> Permissions()
+ {
+ return [
+ StandardPermission.ManageAccessAdminPanel,
+ StandardPermission.ManageAccessVendorPanel,
+ StandardPermission.AllowCustomerImpersonation,
+ StandardPermission.ManageProducts,
+ StandardPermission.ManageCategories,
+ StandardPermission.ManageBrands,
+ StandardPermission.ManageCollections,
+ StandardPermission.ManageProductReviews,
+ StandardPermission.ManageProductTags,
+ StandardPermission.ManageProductAttributes,
+ StandardPermission.ManageSpecificationAttributes,
+ StandardPermission.ManageCheckoutAttribute,
+ StandardPermission.ManageContactAttribute,
+ StandardPermission.ManageCustomers,
+ StandardPermission.ManageCustomerGroups,
+ StandardPermission.ManageCustomerTags,
+ StandardPermission.ManageSalesEmployees,
+ StandardPermission.ManageAddressAttribute,
+ StandardPermission.ManageCustomerAttribute,
+ StandardPermission.ManageVendors,
+ StandardPermission.ManageVendorReviews,
+ StandardPermission.ManageCurrentCarts,
+ StandardPermission.ManageOrders,
+ StandardPermission.ManageShipments,
+ StandardPermission.ManageGiftVouchers,
+ StandardPermission.ManageMerchandiseReturns,
+ StandardPermission.ManagePaymentTransactions,
+ StandardPermission.ManageDocuments,
+ StandardPermission.ManageReports,
+ StandardPermission.ManageAffiliates,
+ StandardPermission.ManagePushEvents,
+ StandardPermission.ManageCampaigns,
+ StandardPermission.ManageDiscounts,
+ StandardPermission.ManageNewsletterSubscribers,
+ StandardPermission.ManageNewsletterCategories,
+ StandardPermission.ManageNews,
+ StandardPermission.ManageBlog,
+ StandardPermission.ManageWidgets,
+ StandardPermission.ManagePages,
+ StandardPermission.ManageKnowledgebase,
+ StandardPermission.ManageCourses,
+ StandardPermission.ManageMessageTemplates,
+ StandardPermission.ManageCountries,
+ StandardPermission.ManageLanguages,
+ StandardPermission.ManageSettings,
+ StandardPermission.ManagePaymentMethods,
+ StandardPermission.ManageExternalAuthenticationMethods,
+ StandardPermission.ManageTaxSettings,
+ StandardPermission.ManageShippingSettings,
+ StandardPermission.ManageCurrencies,
+ StandardPermission.ManageMeasures,
+ StandardPermission.ManageAcl,
+ StandardPermission.ManageEmailAccounts,
+ StandardPermission.ManageStores,
+ StandardPermission.ManagePlugins,
+ StandardPermission.ManageMessageQueue,
+ StandardPermission.ManageMessageContactForm,
+ StandardPermission.ManageMaintenance,
+ StandardPermission.ManageSystem,
+ StandardPermission.ManageFiles,
+ StandardPermission.ManagePictures,
+ StandardPermission.HtmlEditorManagePictures,
+ StandardPermission.ManageScheduleTasks,
+ StandardPermission.DisplayPrices,
+ StandardPermission.EnableShoppingCart,
+ StandardPermission.EnableWishlist,
+ StandardPermission.PublicStoreAllowNavigation,
+ StandardPermission.AccessClosedStore,
+ StandardPermission.ManageOrderTags,
+ StandardPermission.ManageOrderStatus,
+ StandardPermission.AllowUseApi
+ ];
+ }
+
+ public static IEnumerable<DefaultPermission> DefaultPermissions()
+ {
+ return [
+ new DefaultPermission {
+ CustomerGroupSystemName = SystemCustomerGroupNames.Administrators,
+ Permissions = [
+ StandardPermission.ManageAccessAdminPanel,
+ StandardPermission.AllowCustomerImpersonation,
+ StandardPermission.ManageProducts,
+ StandardPermission.ManageCategories,
+ StandardPermission.ManageBrands,
+ StandardPermission.ManageCollections,
+ StandardPermission.ManageProductReviews,
+ StandardPermission.ManageProductTags,
+ StandardPermission.ManageOrderStatus,
+ StandardPermission.ManageOrderTags,
+ StandardPermission.ManageProductAttributes,
+ StandardPermission.ManageSpecificationAttributes,
+ StandardPermission.ManageCheckoutAttribute,
+ StandardPermission.ManageContactAttribute,
+ StandardPermission.ManageCustomers,
+ StandardPermission.ManageCustomerGroups,
+ StandardPermission.ManageCustomerTags,
+ StandardPermission.ManageVendors,
+ StandardPermission.ManageSalesEmployees,
+ StandardPermission.ManageVendorReviews,
+ StandardPermission.ManageAddressAttribute,
+ StandardPermission.ManageCustomerAttribute,
+ StandardPermission.ManageCurrentCarts,
+ StandardPermission.ManageOrders,
+ StandardPermission.ManageShipments,
+ StandardPermission.ManageGiftVouchers,
+ StandardPermission.ManagePaymentTransactions,
+ StandardPermission.ManageMerchandiseReturns,
+ StandardPermission.ManageDocuments,
+ StandardPermission.ManageReports,
+ StandardPermission.ManageAffiliates,
+ StandardPermission.ManagePushEvents,
+ StandardPermission.ManageCampaigns,
+ StandardPermission.ManageDiscounts,
+ StandardPermission.ManageNewsletterSubscribers,
+ StandardPermission.ManageNewsletterCategories,
+ StandardPermission.ManageNews,
+ StandardPermission.ManageBlog,
+ StandardPermission.ManageWidgets,
+ StandardPermission.ManagePages,
+ StandardPermission.ManageKnowledgebase,
+ StandardPermission.ManageCourses,
+ StandardPermission.ManageMessageTemplates,
+ StandardPermission.ManageCountries,
+ StandardPermission.ManageLanguages,
+ StandardPermission.ManageSettings,
+ StandardPermission.ManagePaymentMethods,
+ StandardPermission.ManageExternalAuthenticationMethods,
+ StandardPermission.ManageTaxSettings,
+ StandardPermission.ManageShippingSettings,
+ StandardPermission.ManageCurrencies,
+ StandardPermission.ManageMeasures,
+ StandardPermission.ManageAcl,
+ StandardPermission.ManageEmailAccounts,
+ StandardPermission.ManageStores,
+ StandardPermission.ManagePlugins,
+ StandardPermission.ManageMessageQueue,
+ StandardPermission.ManageMessageContactForm,
+ StandardPermission.ManageMaintenance,
+ StandardPermission.ManageSystem,
+ StandardPermission.ManageFiles,
+ StandardPermission.ManagePictures,
+ StandardPermission.HtmlEditorManagePictures,
+ StandardPermission.ManageScheduleTasks,
+ StandardPermission.DisplayPrices,
+ StandardPermission.EnableShoppingCart,
+ StandardPermission.EnableWishlist,
+ StandardPermission.PublicStoreAllowNavigation,
+ StandardPermission.AccessClosedStore,
+ StandardPermission.AllowUseApi
+ ]
+ },
+ new DefaultPermission {
+ CustomerGroupSystemName = SystemCustomerGroupNames.Guests,
+ Permissions = [
+ StandardPermission.DisplayPrices,
+ StandardPermission.EnableShoppingCart,
+ StandardPermission.EnableWishlist,
+ StandardPermission.PublicStoreAllowNavigation
+ ]
+ },
+ new DefaultPermission {
+ CustomerGroupSystemName = SystemCustomerGroupNames.Registered,
+ Permissions = [
+ StandardPermission.DisplayPrices,
+ StandardPermission.EnableShoppingCart,
+ StandardPermission.EnableWishlist,
+ StandardPermission.PublicStoreAllowNavigation,
+ StandardPermission.AllowUseApi
+ ]
+ },
+ new DefaultPermission {
+ CustomerGroupSystemName = SystemCustomerGroupNames.Vendors,
+ Permissions = [
+ StandardPermission.ManageAccessVendorPanel,
+ StandardPermission.ManageProducts,
+ StandardPermission.ManageFiles,
+ StandardPermission.ManagePictures,
+ StandardPermission.ManageOrders,
+ StandardPermission.ManageVendorReviews,
+ StandardPermission.ManageShipments,
+ StandardPermission.ManageMerchandiseReturns,
+ StandardPermission.ManageReports
+ ]
+ },
+ new DefaultPermission {
+ CustomerGroupSystemName = SystemCustomerGroupNames.Staff,
+ Permissions = [
+ StandardPermission.ManageAccessAdminPanel,
+ StandardPermission.ManageProducts,
+ StandardPermission.ManageFiles,
+ StandardPermission.ManagePictures,
+ StandardPermission.ManageCategories,
+ StandardPermission.ManageBrands,
+ StandardPermission.ManageCollections,
+ StandardPermission.ManageOrders,
+ StandardPermission.ManagePaymentTransactions,
+ StandardPermission.ManageShipments,
+ StandardPermission.ManageMerchandiseReturns,
+ StandardPermission.ManageReports
+ ]
+ },
+
+ new DefaultPermission {
+ CustomerGroupSystemName = SystemCustomerGroupNames.SalesManager,
+ Permissions = [
+ StandardPermission.ManageAccessAdminPanel,
+ StandardPermission.ManageOrders,
+ StandardPermission.ManageCustomers
+ ]
+ }
+ ];
+ }
+}
diff --git a/src/Modules/Grand.Module.Installer/Extensions/PictureExtensions.cs b/src/Modules/Grand.Module.Installer/Extensions/PictureExtensions.cs
new file mode 100644
index 000000000..70de4208a
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Extensions/PictureExtensions.cs
@@ -0,0 +1,34 @@
+using Grand.Data;
+using Grand.Domain.Common;
+using Grand.Domain.Media;
+using Grand.SharedKernel.Extensions;
+
+namespace Grand.Module.Installer.Extensions;
+
+public static class PictureExtensions
+{
+ public static async Task<Picture> InsertPicture(this IRepository<Picture> repository, byte[] pictureBinary, string mimeType, string seoFilename, string? altAttribute = null, string? titleAttribute = null,
+ bool isNew = true, Reference reference = Reference.None, string objectId = "", bool validateBinary = false)
+ {
+ mimeType = CommonHelper.EnsureNotNull(mimeType);
+ mimeType = CommonHelper.EnsureMaximumLength(mimeType, 20);
+
+ seoFilename = CommonHelper.EnsureMaximumLength(seoFilename, 100);
+
+ var picture = new Picture {
+ PictureBinary = pictureBinary,
+ MimeType = mimeType,
+ SeoFilename = seoFilename,
+ AltAttribute = altAttribute,
+ TitleAttribute = titleAttribute,
+ Reference = reference,
+ ObjectId = objectId,
+ IsNew = isNew
+ };
+
+ await repository.InsertAsync(picture);
+
+ return picture;
+ }
+
+}
diff --git a/src/Modules/Grand.Module.Installer/Extensions/SeoExtensions.cs b/src/Modules/Grand.Module.Installer/Extensions/SeoExtensions.cs
new file mode 100644
index 000000000..5b86fcfad
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Extensions/SeoExtensions.cs
@@ -0,0 +1,71 @@
+namespace Grand.Module.Installer.Extensions;
+
+public static class SeoExtensions
+{
+ /// <summary>
+ /// Get SE name
+ /// </summary>
+ /// <param name="name">Name</param>
+ /// <param name="convertNonWesternChars">A value indicating whether non western chars should be converted</param>
+ /// <param name="allowUnicodeCharsInUrls">A value indicating whether Unicode chars are allowed</param>
+ /// <param name="allowSlashChar"></param>
+ /// <param name="charConversions"></param>
+ /// <returns>Result</returns>
+ public static string GenerateSlug(string name, bool convertNonWesternChars = true, bool allowUnicodeCharsInUrls = false,
+ bool allowSlashChar = false, string? charConversions = null)
+ {
+ if (string.IsNullOrEmpty(name))
+ return name;
+
+ var okChars = "abcdefghijklmnopqrstuvwxyz1234567890 _-";
+ if (allowSlashChar)
+ okChars += '/';
+
+ name = name.Trim().ToLowerInvariant();
+
+ if (convertNonWesternChars)
+ if (!string.IsNullOrEmpty(charConversions) && _seoCharacterTable == null)
+ InitializeSeoCharacterTable(charConversions);
+
+ var sb = new StringBuilder();
+ foreach (var c in name.ToCharArray())
+ {
+ var c2 = c.ToString();
+ if (convertNonWesternChars && _seoCharacterTable != null)
+ if (_seoCharacterTable.ContainsKey(c2))
+ c2 = _seoCharacterTable[c2];
+
+ if (allowUnicodeCharsInUrls)
+ {
+ if (char.IsLetterOrDigit(c) || okChars.Contains(c2))
+ sb.Append(c2);
+ }
+ else if (okChars.Contains(c2))
+ {
+ sb.Append(c2);
+ }
+ }
+
+ var name2 = sb.ToString();
+ name2 = name2.Replace(" ", "-");
+ while (name2.Contains("--"))
+ name2 = name2.Replace("--", "-");
+ while (name2.Contains("__"))
+ name2 = name2.Replace("__", "_");
+ return name2;
+ }
+ private static void InitializeSeoCharacterTable(string charConversions)
+ {
+ if (_seoCharacterTable != null) return;
+ _seoCharacterTable = new Dictionary<string, string>();
+
+ foreach (var conversion in charConversions.Split(";"))
+ {
+ var strLeft = conversion.Split(":").FirstOrDefault();
+ var strRight = conversion.Split(":").LastOrDefault();
+ if (!string.IsNullOrEmpty(strLeft) && !_seoCharacterTable.ContainsKey(strLeft))
+ _seoCharacterTable.Add(strLeft.Trim(), strRight!.Trim());
+ }
+ }
+ private static Dictionary<string, string>? _seoCharacterTable;
+}
diff --git a/src/Modules/Grand.Module.Installer/Extensions/SettingExtensions.cs b/src/Modules/Grand.Module.Installer/Extensions/SettingExtensions.cs
new file mode 100644
index 000000000..16fc355b9
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Extensions/SettingExtensions.cs
@@ -0,0 +1,19 @@
+using Grand.Data;
+using Grand.Domain.Configuration;
+using System.Text.Json;
+
+namespace Grand.Module.Installer.Extensions;
+
+public static class SettingExtensions
+{
+ public static async Task SaveSetting<T>(this IRepository<Setting> repository, T settings, string storeId = "") where T : ISettings, new()
+ {
+ var setting = new Setting {
+ Name = typeof(T).Name.ToLowerInvariant(),
+ Metadata = JsonSerializer.Serialize(settings),
+ StoreId = storeId
+ };
+ await repository.InsertAsync(setting);
+
+ }
+}
diff --git a/src/Modules/Grand.Module.Installer/Grand.Module.Installer.csproj b/src/Modules/Grand.Module.Installer/Grand.Module.Installer.csproj
new file mode 100644
index 000000000..038a100e0
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Grand.Module.Installer.csproj
@@ -0,0 +1,33 @@
+<Project Sdk="Microsoft.NET.Sdk.Razor">
+ <Import Project="..\..\Build\Grand.Common.props" />
+ <PropertyGroup>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ <AddRazorSupportForMvc>true</AddRazorSupportForMvc>
+ </PropertyGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\Core\Grand.Data\Grand.Data.csproj">
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Core\Grand.Domain\Grand.Domain.csproj">
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Core\Grand.Infrastructure\Grand.Infrastructure.csproj">
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Core\Grand.SharedKernel\Grand.SharedKernel.csproj">
+ <Private>False</Private>
+ </ProjectReference>
+ </ItemGroup>
+
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
+ <OutputPath>..\..\Web\Grand.Web\Modules\</OutputPath>
+ <OutDir>$(OutputPath)</OutDir>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+ <OutputPath>..\..\Web\Grand.Web\Modules\</OutputPath>
+ <OutDir>$(OutputPath)</OutDir>
+ </PropertyGroup>
+
+</Project>
diff --git a/src/Business/Grand.Business.Core/Interfaces/System/Installation/IInstallationLocalizedService.cs b/src/Modules/Grand.Module.Installer/Interfaces/IInstallationLocalizedService.cs
similarity index 79%
rename from src/Business/Grand.Business.Core/Interfaces/System/Installation/IInstallationLocalizedService.cs
rename to src/Modules/Grand.Module.Installer/Interfaces/IInstallationLocalizedService.cs
index 8b1d4516c..aa60bdf35 100644
--- a/src/Business/Grand.Business.Core/Interfaces/System/Installation/IInstallationLocalizedService.cs
+++ b/src/Modules/Grand.Module.Installer/Interfaces/IInstallationLocalizedService.cs
@@ -1,6 +1,6 @@
-using Grand.Business.Core.Utilities.System;
+using Grand.Module.Installer.Utilities;
-namespace Grand.Business.Core.Interfaces.System.Installation;
+namespace Grand.Module.Installer.Interfaces;
/// <summary>
/// Translation service for installation process
@@ -13,14 +13,14 @@ public interface IInstallationLocalizedService
/// <param name="languageCode">Language code</param>
/// <param name="resourceName">Resource name</param>
/// <returns>Resource value</returns>
- string GetResource(string languageCode, string resourceName);
+ string GetResource(string? languageCode, string resourceName);
/// <summary>
/// Get current language for the installation page
/// </summary>
/// <returns>Current language</returns>
/// <param name="languageCode">Language Code</param>
- InstallationLanguage GetCurrentLanguage(string languageCode = default);
+ InstallationLanguage GetCurrentLanguage(string? languageCode = default);
/// <summary>
/// Get a list of available languages
diff --git a/src/Modules/Grand.Module.Installer/Interfaces/IInstallationService.cs b/src/Modules/Grand.Module.Installer/Interfaces/IInstallationService.cs
new file mode 100644
index 000000000..f9e68decc
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Interfaces/IInstallationService.cs
@@ -0,0 +1,11 @@
+using Microsoft.AspNetCore.Http;
+
+namespace Grand.Module.Installer.Interfaces;
+
+public interface IInstallationService
+{
+ Task InstallData(
+ string httpscheme, HostString host,
+ string defaultUserEmail, string defaultUserPassword, string? collation, bool installSampleData = true,
+ string? companyName = "", string? companyAddress = "", string? companyPhoneNumber = "", string? companyEmail = "");
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Models/InstallModel.cs b/src/Modules/Grand.Module.Installer/Models/InstallModel.cs
new file mode 100644
index 000000000..e0bb8692b
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Models/InstallModel.cs
@@ -0,0 +1,42 @@
+using Grand.Data;
+using Grand.Infrastructure.Models;
+using Microsoft.AspNetCore.Mvc.Rendering;
+using System.ComponentModel.DataAnnotations;
+
+namespace Grand.Module.Installer.Models;
+
+public class InstallModel : BaseModel
+{
+ public string? SelectedLanguage { get; set; }
+
+ [DataType(DataType.EmailAddress)]
+ public required string AdminEmail { get; set; }
+
+ [DataType(DataType.Password)]
+ public required string AdminPassword { get; set; }
+
+ [DataType(DataType.Password)]
+ public required string ConfirmPassword { get; set; }
+
+ public string? DatabaseConnectionString { get; set; }
+ public DbProvider DataProvider { get; set; }
+ public bool ConnectionInfo { get; set; }
+ public string? MongoDBServerName { get; set; }
+ public string? MongoDBDatabaseName { get; set; }
+ public string? MongoDBUsername { get; set; }
+
+ [DataType(DataType.Password)]
+ public string? MongoDBPassword { get; set; }
+
+ public bool DisableSampleDataOption { get; set; }
+ public bool InstallSampleData { get; set; }
+ public bool Installed { get; set; }
+ public string? Collation { get; set; }
+ public List<SelectListItem> AvailableLanguages { get; set; } = new();
+ public List<SelectListItem> AvailableCollation { get; set; } = new();
+ public List<SelectListItem> AvailableProviders { get; set; } = new();
+ public string? CompanyName { get; set; }
+ public string? CompanyAddress { get; set; }
+ public string? CompanyPhoneNumber { get; set; }
+ public string? CompanyEmail { get; set; }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataAffiliates.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataAffiliates.cs
new file mode 100644
index 000000000..84e14e63d
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataAffiliates.cs
@@ -0,0 +1,29 @@
+using Grand.Domain.Affiliates;
+using Grand.Domain.Common;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallAffiliates()
+ {
+ var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");
+ var affiliateAddress = new Address {
+ FirstName = "John",
+ LastName = "Smith",
+ Email = "[email protected]",
+ Company = "Company name here...",
+ City = "New York",
+ Address1 = "21 West 52nd Street",
+ ZipPostalCode = "10021",
+ PhoneNumber = "123456789",
+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,
+ CountryId = country?.Id
+ };
+ var affilate = new Affiliate {
+ Active = true,
+ Address = affiliateAddress
+ };
+ await _affiliateRepository.InsertAsync(affilate);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataBlogPosts.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataBlogPosts.cs
new file mode 100644
index 000000000..824c9b74f
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataBlogPosts.cs
@@ -0,0 +1,49 @@
+using Grand.Domain.Blogs;
+using Grand.Domain.Seo;
+using Grand.Module.Installer.Extensions;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallBlogPosts()
+ {
+ var blogPosts = new List<BlogPost> {
+ new() {
+ AllowComments = false,
+ Title = "How GrandNode became the real open-source e-Commerce platform?",
+ BodyOverview =
+ "<p>There are many e-commerce solutions on the market. Is everyone open-source? No, and even if they say yes, it may turn out to be a lie. GrandNode is a true open-source based on .NET Core and MongoDB. No hidden license fees, no additional licensing conditions. Pure open-source and GPL-3 license.</p>",
+ Body =
+ "<p>There are many e-commerce solutions on the market. Is every open-source? No, and even if they say yes, it may turn out to be a lie. GrandNode is a true open-source platform based on .NET Core and MongoDB. No hidden license fees, no additional licensing conditions. Pure open-source and GPL-3 license.</p><p>An open-source platform shouldn't block your development. Forcing the leaving of information about the platform, paid licenses, obtaining paid license keys is an artificial invention that makes the platform paid and complicated.</p>",
+ Tags = "e-commerce, blog, moey"
+ },
+ new() {
+ AllowComments = false,
+ Title = "Open-source e-commerce platform GrandNode",
+ BodyOverview =
+ "<p>GrandNode is one of a kind open-source e-commerce platform. Thanks to most advanced ASP.NET Core framework and out of the box set of features it makes a perfect fit for multiple e-business models.</p>",
+ Body =
+ "<p>Meet the flexible, the most versatile open-source e-commerce platform on the market. Use GrandNode and its ready-to-use integrations to sell everywhere with a single platform. GrandNode guarantees functionalities for now and for the future. We ensure both, the base needs of each e-commerce, and future features needed for expansion. GrandNode is one platform that suits various business models. It can successfully empower traditional B2C & B2B stores, helping local brands expand globally. Our solution supports booking processes, facilitates the management of the availability calendar and even enables the sale of online courses.</p>",
+ Tags = "e-commerce, grandnode, sample tag, money"
+ }
+ };
+
+ blogPosts.ForEach(x => _blogPostRepository.Insert(x));
+
+ //search engine names
+ foreach (var blogPost in blogPosts)
+ {
+ var seName = SeoExtensions.GenerateSlug(blogPost.Title, false, false, false);
+ await _entityUrlRepository.InsertAsync(new EntityUrl {
+ EntityId = blogPost.Id,
+ EntityName = "BlogPost",
+ LanguageId = "",
+ IsActive = true,
+ Slug = seName
+ });
+ blogPost.SeName = seName;
+ await _blogPostRepository.UpdateAsync(blogPost);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataBrandLayouts.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataBrandLayouts.cs
new file mode 100644
index 000000000..e36174cf0
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataBrandLayouts.cs
@@ -0,0 +1,19 @@
+using Grand.Domain.Catalog;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallBrandLayouts()
+ {
+ var brandLayouts = new List<BrandLayout> {
+ new() {
+ Name = "Grid or Lines",
+ ViewPath = "BrandLayout.GridOrLines",
+ DisplayOrder = 1
+ }
+ };
+ brandLayouts.ForEach(x => _brandLayoutRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataBrands.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataBrands.cs
new file mode 100644
index 000000000..ee2c67cba
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataBrands.cs
@@ -0,0 +1,82 @@
+using Grand.Domain.Catalog;
+using Grand.Domain.Common;
+using Grand.Domain.Seo;
+using Grand.Module.Installer.Extensions;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallBrands()
+ {
+ var sampleImagesPath = GetSamplesPath();
+
+ var brandLayoutInGridAndLines =
+ _brandLayoutRepository.Table.FirstOrDefault(pt => pt.Name == "Grid or Lines");
+ if (brandLayoutInGridAndLines == null)
+ throw new Exception("Brand layout cannot be loaded");
+
+ var allbrands = new List<Brand>();
+ var brandXiaomi = new Brand {
+ Name = "Xiaomi",
+ BrandLayoutId = brandLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ Published = true,
+ DisplayOrder = 1
+ };
+ brandXiaomi.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "brand_xiaomi.jpg"), "image/pjpeg",
+ "Xiaomi", "", "", false, Reference.Brand, brandXiaomi.Id)).Id;
+ await _brandRepository.InsertAsync(brandXiaomi);
+ allbrands.Add(brandXiaomi);
+
+
+ var brandDell = new Brand {
+ Name = "Dell",
+ BrandLayoutId = brandLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ Published = true,
+ DisplayOrder = 5
+ };
+ brandDell.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "brand_dell.jpg"), "image/pjpeg",
+ ("Dell"), "", "", false, Reference.Brand, brandDell.Id)).Id;
+
+ await _brandRepository.InsertAsync(brandDell);
+ allbrands.Add(brandDell);
+
+
+ var brandAdidas = new Brand {
+ Name = "Adidas",
+ BrandLayoutId = brandLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ Published = true,
+ DisplayOrder = 5
+ };
+ brandAdidas.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "brand_adidas.jpg"), "image/pjpeg",
+ ("Adidas"), "", "", false, Reference.Brand, brandAdidas.Id)).Id;
+ await _brandRepository.InsertAsync(brandAdidas);
+ allbrands.Add(brandAdidas);
+
+ //search engine names
+ foreach (var brand in allbrands)
+ {
+ brand.SeName = SeoExtensions.GenerateSlug(brand.Name, false, false, true);
+ await _entityUrlRepository.InsertAsync(new EntityUrl {
+ EntityId = brand.Id,
+ EntityName = "Brand",
+ LanguageId = "",
+ IsActive = true,
+ Slug = brand.SeName
+ });
+ await _brandRepository.UpdateAsync(brand);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataCategories.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataCategories.cs
new file mode 100644
index 000000000..a4c93fb6a
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataCategories.cs
@@ -0,0 +1,308 @@
+using Grand.Domain.Catalog;
+using Grand.Domain.Common;
+using Grand.Domain.Seo;
+using Grand.Module.Installer.Extensions;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallCategories()
+ {
+ //sample pictures
+ var sampleImagesPath = GetSamplesPath();
+
+ var categoryLayoutInGridAndLines = _categoryLayoutRepository
+ .Table.FirstOrDefault(pt => pt.Name == "Grid or Lines");
+ if (categoryLayoutInGridAndLines == null)
+ throw new Exception("Category layout cannot be loaded");
+
+
+ //categories
+ var allCategories = new List<Category>();
+ var categoryComputers = new Category {
+ Name = "Computers",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ ParentCategoryId = "",
+ IncludeInMenu = true,
+ Published = true,
+ Flag = "New",
+ FlagStyle = "badge-danger",
+ DisplayOrder = 100
+ };
+ categoryComputers.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_computers.jpeg"), "image/jpeg",
+ "Computers", reference: Reference.Category,
+ objectId: categoryComputers.Id)).Id;
+ allCategories.Add(categoryComputers);
+
+ var categoryTablets = new Category {
+ Name = "Tablets",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ ParentCategoryId = categoryComputers.Id,
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = categoryComputers.DisplayOrder + 1
+ };
+ categoryTablets.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_tablets.jpg"), "image/jpeg",
+ "Tablets", reference: Reference.Category,
+ objectId: categoryTablets.Id))
+ .Id;
+ allCategories.Add(categoryTablets);
+
+ var categoryNotebooks = new Category {
+ Name = "Notebooks",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ ParentCategoryId = categoryComputers.Id,
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = categoryComputers.DisplayOrder + 2
+ };
+ categoryNotebooks.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_notebooks.jpg"), "image/jpeg",
+ "Notebooks", reference: Reference.Category,
+ objectId: categoryNotebooks.Id)).Id;
+ allCategories.Add(categoryNotebooks);
+
+ var categorySmartwatches = new Category {
+ Name = "Smartwatches",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ ParentCategoryId = categoryComputers.Id,
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = categoryComputers.DisplayOrder + 3
+ };
+ categorySmartwatches.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_smartwatches.jpg"), "image/jpeg",
+ "Smartwatches", reference: Reference.Category,
+ objectId: categorySmartwatches.Id)).Id;
+ allCategories.Add(categorySmartwatches);
+
+ var categoryElectronics = new Category {
+ Name = "Electronics",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ ParentCategoryId = "",
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ IncludeInMenu = true,
+ Published = true,
+ ShowOnHomePage = false,
+ DisplayOrder = 200
+ };
+ categoryElectronics.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_electronics.jpeg"), "image/jpeg",
+ "Electronics", reference: Reference.Category,
+ objectId: categoryElectronics.Id)).Id;
+ allCategories.Add(categoryElectronics);
+
+ var categoryDisplay = new Category {
+ Name = "Display",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ ParentCategoryId = categoryElectronics.Id,
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = categoryElectronics.DisplayOrder + 1
+ };
+ categoryDisplay.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_display.jpeg"), "image/jpeg",
+ "Display", reference: Reference.Category,
+ objectId: categoryDisplay.Id))
+ .Id;
+ allCategories.Add(categoryDisplay);
+
+ var categorySmartphones = new Category {
+ Name = "Smartphones",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ ParentCategoryId = categoryElectronics.Id,
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = categoryElectronics.DisplayOrder + 2
+ };
+ categorySmartphones.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_smartphones.jpeg"), "image/jpeg",
+ "Smartphones", reference: Reference.Category,
+ objectId: categorySmartphones.Id)).Id;
+ allCategories.Add(categorySmartphones);
+
+ var categoryOthers = new Category {
+ Name = "Others",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ ShowOnHomePage = true,
+ PageSizeOptions = "6, 3, 9",
+ ParentCategoryId = categoryElectronics.Id,
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = categoryElectronics.DisplayOrder + 3
+ };
+ categoryOthers.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_accessories.jpg"), "image/jpeg",
+ "SmAccessoriesartphones", reference: Reference.Category,
+ objectId: categoryOthers.Id)).Id;
+
+ allCategories.Add(categoryOthers);
+
+ var categorySport = new Category {
+ Name = "Sport",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 9,
+ ParentCategoryId = "",
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9, 12",
+ IncludeInMenu = true,
+ Published = true,
+ ShowOnHomePage = true,
+ DisplayOrder = 300
+ };
+ categorySport.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_sport.jpeg"), "image/jpeg",
+ ("Sport"), reference: Reference.Category, objectId: categorySport.Id)).Id;
+ allCategories.Add(categorySport);
+
+ var categoryShoes = new Category {
+ Name = "Shoes",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ ParentCategoryId = categorySport.Id,
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = categorySport.DisplayOrder + 1
+ };
+ categoryShoes.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_shoes.jpeg"), "image/jpeg",
+ "Shoes", reference: Reference.Category, objectId: categoryShoes.Id)).Id;
+ allCategories.Add(categoryShoes);
+
+ var categoryApparel = new Category {
+ Name = "Apparel",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ ParentCategoryId = categorySport.Id,
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = categorySport.DisplayOrder + 2
+ };
+ categoryApparel.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_sport.jpeg"), "image/jpeg",
+ "Apparel", reference: Reference.Category,
+ objectId: categoryApparel.Id))
+ .Id;
+
+ allCategories.Add(categoryApparel);
+
+ var categoryBalls = new Category {
+ Name = "Balls",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ ParentCategoryId = categorySport.Id,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = categorySport.DisplayOrder + 3
+ };
+ categoryBalls.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_balls.jpeg"), "image/jpeg",
+ ("Balls"), reference: Reference.Category, objectId: categoryBalls.Id)).Id;
+ allCategories.Add(categoryBalls);
+
+ var categoryDigitalDownloads = new Category {
+ Name = "Digital downloads",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ ParentCategoryId = "",
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ IncludeInMenu = true,
+ Published = true,
+ ShowOnHomePage = false,
+ DisplayOrder = 400
+ };
+ categoryDigitalDownloads.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_digital_downloads.jpeg"), "image/jpeg",
+ ("Digital downloads"), reference: Reference.Category,
+ objectId: categoryDigitalDownloads.Id)).Id;
+ allCategories.Add(categoryDigitalDownloads);
+
+ var categoryLego = new Category {
+ Name = "Lego",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ MetaKeywords = "Lego, Dictionary, Textbooks",
+ MetaDescription = "Books category description",
+ PageSize = 6,
+ ParentCategoryId = "",
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ IncludeInMenu = true,
+ Published = true,
+ ShowOnHomePage = true,
+ DisplayOrder = 500,
+ Flag = "Promo!",
+ FlagStyle = "bg-success"
+ };
+ categoryLego.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_lego.jpeg"), "image/jpeg",
+ (categoryLego.Name), reference: Reference.Category,
+ objectId: categoryLego.Id)).Id;
+ allCategories.Add(categoryLego);
+
+ var categoryGiftVouchers = new Category {
+ Name = "Gift vouchers",
+ CategoryLayoutId = categoryLayoutInGridAndLines.Id,
+ PageSize = 6,
+ ParentCategoryId = "",
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9",
+ IncludeInMenu = true,
+ Published = true,
+ DisplayOrder = 600
+ };
+ categoryGiftVouchers.PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "category_gift_cards.jpeg"), "image/jpeg",
+ (categoryGiftVouchers.Name), reference: Reference.Category,
+ objectId: categoryGiftVouchers.Id)).Id;
+ allCategories.Add(categoryGiftVouchers);
+
+ allCategories.ForEach(x => _categoryRepository.Insert(x));
+
+ //search engine names
+ foreach (var category in allCategories)
+ {
+ category.SeName = SeoExtensions.GenerateSlug(category.Name, false, false, false);
+ await _entityUrlRepository.InsertAsync(new EntityUrl {
+ EntityId = category.Id,
+ EntityName = "Category",
+ LanguageId = "",
+ IsActive = true,
+ Slug = category.SeName
+ });
+ await _categoryRepository.UpdateAsync(category);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataCategoryLayouts.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataCategoryLayouts.cs
new file mode 100644
index 000000000..5d6711b19
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataCategoryLayouts.cs
@@ -0,0 +1,19 @@
+using Grand.Domain.Catalog;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallCategoryLayouts()
+ {
+ var categoryLayouts = new List<CategoryLayout> {
+ new() {
+ Name = "Grid or Lines",
+ ViewPath = "CategoryLayout.GridOrLines",
+ DisplayOrder = 1
+ }
+ };
+ categoryLayouts.ForEach(x => _categoryLayoutRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataCheckoutAttributes.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataCheckoutAttributes.cs
new file mode 100644
index 000000000..14c97e29a
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataCheckoutAttributes.cs
@@ -0,0 +1,34 @@
+using Grand.Domain.Catalog;
+using Grand.Domain.Orders;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallCheckoutAttributes()
+ {
+ var ca1 = new CheckoutAttribute {
+ Name = "Gift wrapping",
+ IsRequired = true,
+ ShippableProductRequired = true,
+ AttributeControlTypeId = AttributeControlType.DropdownList,
+ DisplayOrder = 1
+ };
+ await _checkoutAttributeRepository.InsertAsync(ca1);
+ ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue {
+ Name = "No",
+ PriceAdjustment = 0,
+ DisplayOrder = 1,
+ IsPreSelected = true,
+ CheckoutAttributeId = ca1.Id
+ });
+
+ ca1.CheckoutAttributeValues.Add(new CheckoutAttributeValue {
+ Name = "Yes",
+ PriceAdjustment = 10,
+ DisplayOrder = 2,
+ CheckoutAttributeId = ca1.Id
+ });
+ await _checkoutAttributeRepository.UpdateAsync(ca1);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataCollectionLayouts.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataCollectionLayouts.cs
new file mode 100644
index 000000000..8652abd35
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataCollectionLayouts.cs
@@ -0,0 +1,19 @@
+using Grand.Domain.Catalog;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallCollectionLayouts()
+ {
+ var collectionLayouts = new List<CollectionLayout> {
+ new() {
+ Name = "Grid or Lines",
+ ViewPath = "CollectionLayout.GridOrLines",
+ DisplayOrder = 1
+ }
+ };
+ collectionLayouts.ForEach(x => _collectionLayoutRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataCountriesAndStates.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataCountriesAndStates.cs
new file mode 100644
index 000000000..4095a47c7
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataCountriesAndStates.cs
@@ -0,0 +1,3173 @@
+using Grand.Domain.Directory;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallCountriesAndStates()
+ {
+ var cUsa = new Country {
+ Name = "United States",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "US",
+ ThreeLetterIsoCode = "USA",
+ NumericIsoCode = 840,
+ SubjectToVat = false,
+ DisplayOrder = 1,
+ Published = true
+ };
+
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "AA (Armed Forces Americas)",
+ Abbreviation = "AA",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "AE (Armed Forces Europe)",
+ Abbreviation = "AE",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Alabama",
+ Abbreviation = "AL",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Alaska",
+ Abbreviation = "AK",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "American Samoa",
+ Abbreviation = "AS",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "AP (Armed Forces Pacific)",
+ Abbreviation = "AP",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Arizona",
+ Abbreviation = "AZ",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Arkansas",
+ Abbreviation = "AR",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "California",
+ Abbreviation = "CA",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Colorado",
+ Abbreviation = "CO",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Connecticut",
+ Abbreviation = "CT",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Delaware",
+ Abbreviation = "DE",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "District of Columbia",
+ Abbreviation = "DC",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Federated States of Micronesia",
+ Abbreviation = "FM",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Florida",
+ Abbreviation = "FL",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Georgia",
+ Abbreviation = "GA",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Guam",
+ Abbreviation = "GU",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Hawaii",
+ Abbreviation = "HI",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Idaho",
+ Abbreviation = "ID",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Illinois",
+ Abbreviation = "IL",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Indiana",
+ Abbreviation = "IN",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Iowa",
+ Abbreviation = "IA",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Kansas",
+ Abbreviation = "KS",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Kentucky",
+ Abbreviation = "KY",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Louisiana",
+ Abbreviation = "LA",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Maine",
+ Abbreviation = "ME",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Marshall Islands",
+ Abbreviation = "MH",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Maryland",
+ Abbreviation = "MD",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Massachusetts",
+ Abbreviation = "MA",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Michigan",
+ Abbreviation = "MI",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Minnesota",
+ Abbreviation = "MN",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Mississippi",
+ Abbreviation = "MS",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Missouri",
+ Abbreviation = "MO",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Montana",
+ Abbreviation = "MT",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Nebraska",
+ Abbreviation = "NE",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Nevada",
+ Abbreviation = "NV",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "New Hampshire",
+ Abbreviation = "NH",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "New Jersey",
+ Abbreviation = "NJ",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "New Mexico",
+ Abbreviation = "NM",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "New York",
+ Abbreviation = "NY",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "North Carolina",
+ Abbreviation = "NC",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "North Dakota",
+ Abbreviation = "ND",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Northern Mariana Islands",
+ Abbreviation = "MP",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Ohio",
+ Abbreviation = "OH",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Oklahoma",
+ Abbreviation = "OK",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Oregon",
+ Abbreviation = "OR",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Palau",
+ Abbreviation = "PW",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Pennsylvania",
+ Abbreviation = "PA",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Puerto Rico",
+ Abbreviation = "PR",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Rhode Island",
+ Abbreviation = "RI",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "South Carolina",
+ Abbreviation = "SC",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "South Dakota",
+ Abbreviation = "SD",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Tennessee",
+ Abbreviation = "TN",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Texas",
+ Abbreviation = "TX",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Utah",
+ Abbreviation = "UT",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Vermont",
+ Abbreviation = "VT",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Virgin Islands",
+ Abbreviation = "VI",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Virginia",
+ Abbreviation = "VA",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Washington",
+ Abbreviation = "WA",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "West Virginia",
+ Abbreviation = "WV",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Wisconsin",
+ Abbreviation = "WI",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cUsa.StateProvinces.Add(new StateProvince {
+ Name = "Wyoming",
+ Abbreviation = "WY",
+ Published = true,
+ DisplayOrder = 1
+ });
+ await _countryRepository.InsertAsync(cUsa);
+
+ var cCanada = new Country {
+ Name = "Canada",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CA",
+ ThreeLetterIsoCode = "CAN",
+ NumericIsoCode = 124,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ };
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Alberta",
+ Abbreviation = "AB",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "British Columbia",
+ Abbreviation = "BC",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Manitoba",
+ Abbreviation = "MB",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "New Brunswick",
+ Abbreviation = "NB",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Newfoundland and Labrador",
+ Abbreviation = "NL",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Northwest Territories",
+ Abbreviation = "NT",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Nova Scotia",
+ Abbreviation = "NS",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Nunavut",
+ Abbreviation = "NU",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Ontario",
+ Abbreviation = "ON",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Prince Edward Island",
+ Abbreviation = "PE",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Quebec",
+ Abbreviation = "QC",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Saskatchewan",
+ Abbreviation = "SK",
+ Published = true,
+ DisplayOrder = 1
+ });
+ cCanada.StateProvinces.Add(new StateProvince {
+ Name = "Yukon Territory",
+ Abbreviation = "YT",
+ Published = true,
+ DisplayOrder = 1
+ });
+ await _countryRepository.InsertAsync(cCanada);
+
+ var cPoland = new Country {
+ Name = "Poland",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PL",
+ ThreeLetterIsoCode = "POL",
+ NumericIsoCode = 616,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ };
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 0,
+ Name = "dolnośląskie",
+ Published = true,
+ Abbreviation = "DŚ"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 1,
+ Name = "kujawsko-pomorskie",
+ Published = true,
+ Abbreviation = "KP"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 2,
+ Name = "lubelskie",
+ Published = true,
+ Abbreviation = "LB"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 3,
+ Name = "lubuskie",
+ Published = true,
+ Abbreviation = "LS"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 4,
+ Name = "łódzkie",
+ Published = true,
+ Abbreviation = "ŁD"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 5,
+ Name = "małopolskie",
+ Published = true,
+ Abbreviation = "MP"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 6,
+ Name = "mazowieckie",
+ Published = true,
+ Abbreviation = "MZ"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 7,
+ Name = "opolskie",
+ Published = true,
+ Abbreviation = "OP"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 8,
+ Name = "podkarpackie",
+ Published = true,
+ Abbreviation = "PK"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 9,
+ Name = "podlaskie",
+ Published = true,
+ Abbreviation = "PL"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 10,
+ Name = "pomorskie",
+ Published = true,
+ Abbreviation = "PM"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 11,
+ Name = "śląskie",
+ Published = true,
+ Abbreviation = "ŚL"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 12,
+ Name = "świętokrzyskie",
+ Published = true,
+ Abbreviation = "ŚK"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 13,
+ Name = "warmińsko-mazurskie",
+ Published = true,
+ Abbreviation = "WM"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 14,
+ Name = "wielkopolskie",
+ Published = true,
+ Abbreviation = "WP"
+ });
+ cPoland.StateProvinces.Add(new StateProvince {
+ DisplayOrder = 15,
+ Name = "zachodniopomorskie",
+ Published = true,
+ Abbreviation = "ZP"
+ });
+
+ var countries = new List<Country> {
+ new() {
+ Name = "Argentina",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AR",
+ ThreeLetterIsoCode = "ARG",
+ NumericIsoCode = 32,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Armenia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AM",
+ ThreeLetterIsoCode = "ARM",
+ NumericIsoCode = 51,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Aruba",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AW",
+ ThreeLetterIsoCode = "ABW",
+ NumericIsoCode = 533,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Australia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AU",
+ ThreeLetterIsoCode = "AUS",
+ NumericIsoCode = 36,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Austria",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AT",
+ ThreeLetterIsoCode = "AUT",
+ NumericIsoCode = 40,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Azerbaijan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AZ",
+ ThreeLetterIsoCode = "AZE",
+ NumericIsoCode = 31,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Bahamas",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BS",
+ ThreeLetterIsoCode = "BHS",
+ NumericIsoCode = 44,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Bangladesh",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BD",
+ ThreeLetterIsoCode = "BGD",
+ NumericIsoCode = 50,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Belarus",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BY",
+ ThreeLetterIsoCode = "BLR",
+ NumericIsoCode = 112,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Belgium",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BE",
+ ThreeLetterIsoCode = "BEL",
+ NumericIsoCode = 56,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Belize",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BZ",
+ ThreeLetterIsoCode = "BLZ",
+ NumericIsoCode = 84,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Bermuda",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BM",
+ ThreeLetterIsoCode = "BMU",
+ NumericIsoCode = 60,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Bolivia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BO",
+ ThreeLetterIsoCode = "BOL",
+ NumericIsoCode = 68,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Bosnia and Herzegowina",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BA",
+ ThreeLetterIsoCode = "BIH",
+ NumericIsoCode = 70,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Brazil",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BR",
+ ThreeLetterIsoCode = "BRA",
+ NumericIsoCode = 76,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Bulgaria",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BG",
+ ThreeLetterIsoCode = "BGR",
+ NumericIsoCode = 100,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Cayman Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KY",
+ ThreeLetterIsoCode = "CYM",
+ NumericIsoCode = 136,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Chile",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CL",
+ ThreeLetterIsoCode = "CHL",
+ NumericIsoCode = 152,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "China",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CN",
+ ThreeLetterIsoCode = "CHN",
+ NumericIsoCode = 156,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Colombia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CO",
+ ThreeLetterIsoCode = "COL",
+ NumericIsoCode = 170,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Costa Rica",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CR",
+ ThreeLetterIsoCode = "CRI",
+ NumericIsoCode = 188,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Croatia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "HR",
+ ThreeLetterIsoCode = "HRV",
+ NumericIsoCode = 191,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Cuba",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CU",
+ ThreeLetterIsoCode = "CUB",
+ NumericIsoCode = 192,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Cyprus",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CY",
+ ThreeLetterIsoCode = "CYP",
+ NumericIsoCode = 196,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Czech Republic",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CZ",
+ ThreeLetterIsoCode = "CZE",
+ NumericIsoCode = 203,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Denmark",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "DK",
+ ThreeLetterIsoCode = "DNK",
+ NumericIsoCode = 208,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Dominican Republic",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "DO",
+ ThreeLetterIsoCode = "DOM",
+ NumericIsoCode = 214,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Ecuador",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "EC",
+ ThreeLetterIsoCode = "ECU",
+ NumericIsoCode = 218,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Egypt",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "EG",
+ ThreeLetterIsoCode = "EGY",
+ NumericIsoCode = 818,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Finland",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "FI",
+ ThreeLetterIsoCode = "FIN",
+ NumericIsoCode = 246,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "France",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "FR",
+ ThreeLetterIsoCode = "FRA",
+ NumericIsoCode = 250,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Georgia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GE",
+ ThreeLetterIsoCode = "GEO",
+ NumericIsoCode = 268,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Germany",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "DE",
+ ThreeLetterIsoCode = "DEU",
+ NumericIsoCode = 276,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Gibraltar",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GI",
+ ThreeLetterIsoCode = "GIB",
+ NumericIsoCode = 292,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Greece",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GR",
+ ThreeLetterIsoCode = "GRC",
+ NumericIsoCode = 300,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Guatemala",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GT",
+ ThreeLetterIsoCode = "GTM",
+ NumericIsoCode = 320,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Hong Kong",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "HK",
+ ThreeLetterIsoCode = "HKG",
+ NumericIsoCode = 344,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Hungary",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "HU",
+ ThreeLetterIsoCode = "HUN",
+ NumericIsoCode = 348,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "India",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "IN",
+ ThreeLetterIsoCode = "IND",
+ NumericIsoCode = 356,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Indonesia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ID",
+ ThreeLetterIsoCode = "IDN",
+ NumericIsoCode = 360,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Ireland",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "IE",
+ ThreeLetterIsoCode = "IRL",
+ NumericIsoCode = 372,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Israel",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "IL",
+ ThreeLetterIsoCode = "ISR",
+ NumericIsoCode = 376,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Italy",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "IT",
+ ThreeLetterIsoCode = "ITA",
+ NumericIsoCode = 380,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Jamaica",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "JM",
+ ThreeLetterIsoCode = "JAM",
+ NumericIsoCode = 388,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Japan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "JP",
+ ThreeLetterIsoCode = "JPN",
+ NumericIsoCode = 392,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Jordan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "JO",
+ ThreeLetterIsoCode = "JOR",
+ NumericIsoCode = 400,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Kazakhstan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KZ",
+ ThreeLetterIsoCode = "KAZ",
+ NumericIsoCode = 398,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Korea, Democratic People's Republic of",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KP",
+ ThreeLetterIsoCode = "PRK",
+ NumericIsoCode = 408,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Kuwait",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KW",
+ ThreeLetterIsoCode = "KWT",
+ NumericIsoCode = 414,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Malaysia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MY",
+ ThreeLetterIsoCode = "MYS",
+ NumericIsoCode = 458,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Mexico",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MX",
+ ThreeLetterIsoCode = "MEX",
+ NumericIsoCode = 484,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Netherlands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NL",
+ ThreeLetterIsoCode = "NLD",
+ NumericIsoCode = 528,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "New Zealand",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NZ",
+ ThreeLetterIsoCode = "NZL",
+ NumericIsoCode = 554,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Norway",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NO",
+ ThreeLetterIsoCode = "NOR",
+ NumericIsoCode = 578,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Pakistan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PK",
+ ThreeLetterIsoCode = "PAK",
+ NumericIsoCode = 586,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Paraguay",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PY",
+ ThreeLetterIsoCode = "PRY",
+ NumericIsoCode = 600,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Peru",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PE",
+ ThreeLetterIsoCode = "PER",
+ NumericIsoCode = 604,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Philippines",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PH",
+ ThreeLetterIsoCode = "PHL",
+ NumericIsoCode = 608,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ cPoland,
+ new() {
+ Name = "Portugal",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PT",
+ ThreeLetterIsoCode = "PRT",
+ NumericIsoCode = 620,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Puerto Rico",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PR",
+ ThreeLetterIsoCode = "PRI",
+ NumericIsoCode = 630,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Qatar",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "QA",
+ ThreeLetterIsoCode = "QAT",
+ NumericIsoCode = 634,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Romania",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "RO",
+ ThreeLetterIsoCode = "ROM",
+ NumericIsoCode = 642,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Russia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "RU",
+ ThreeLetterIsoCode = "RUS",
+ NumericIsoCode = 643,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Saudi Arabia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SA",
+ ThreeLetterIsoCode = "SAU",
+ NumericIsoCode = 682,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Singapore",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SG",
+ ThreeLetterIsoCode = "SGP",
+ NumericIsoCode = 702,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Slovakia (Slovak Republic)",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SK",
+ ThreeLetterIsoCode = "SVK",
+ NumericIsoCode = 703,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Slovenia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SI",
+ ThreeLetterIsoCode = "SVN",
+ NumericIsoCode = 705,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "South Africa",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ZA",
+ ThreeLetterIsoCode = "ZAF",
+ NumericIsoCode = 710,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Spain",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ES",
+ ThreeLetterIsoCode = "ESP",
+ NumericIsoCode = 724,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Sweden",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SE",
+ ThreeLetterIsoCode = "SWE",
+ NumericIsoCode = 752,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Switzerland",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CH",
+ ThreeLetterIsoCode = "CHE",
+ NumericIsoCode = 756,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Taiwan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TW",
+ ThreeLetterIsoCode = "TWN",
+ NumericIsoCode = 158,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Thailand",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TH",
+ ThreeLetterIsoCode = "THA",
+ NumericIsoCode = 764,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Turkey",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TR",
+ ThreeLetterIsoCode = "TUR",
+ NumericIsoCode = 792,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Ukraine",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "UA",
+ ThreeLetterIsoCode = "UKR",
+ NumericIsoCode = 804,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "United Arab Emirates",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AE",
+ ThreeLetterIsoCode = "ARE",
+ NumericIsoCode = 784,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "United Kingdom",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GB",
+ ThreeLetterIsoCode = "GBR",
+ NumericIsoCode = 826,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "United States minor outlying islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "UM",
+ ThreeLetterIsoCode = "UMI",
+ NumericIsoCode = 581,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Uruguay",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "UY",
+ ThreeLetterIsoCode = "URY",
+ NumericIsoCode = 858,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Uzbekistan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "UZ",
+ ThreeLetterIsoCode = "UZB",
+ NumericIsoCode = 860,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Venezuela",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "VE",
+ ThreeLetterIsoCode = "VEN",
+ NumericIsoCode = 862,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Serbia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "RS",
+ ThreeLetterIsoCode = "SRB",
+ NumericIsoCode = 688,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Afghanistan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AF",
+ ThreeLetterIsoCode = "AFG",
+ NumericIsoCode = 4,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Albania",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AL",
+ ThreeLetterIsoCode = "ALB",
+ NumericIsoCode = 8,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Algeria",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "DZ",
+ ThreeLetterIsoCode = "DZA",
+ NumericIsoCode = 12,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "American Samoa",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AS",
+ ThreeLetterIsoCode = "ASM",
+ NumericIsoCode = 16,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Andorra",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AD",
+ ThreeLetterIsoCode = "AND",
+ NumericIsoCode = 20,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Angola",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AO",
+ ThreeLetterIsoCode = "AGO",
+ NumericIsoCode = 24,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Anguilla",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AI",
+ ThreeLetterIsoCode = "AIA",
+ NumericIsoCode = 660,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Antarctica",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AQ",
+ ThreeLetterIsoCode = "ATA",
+ NumericIsoCode = 10,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Antigua and Barbuda",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AG",
+ ThreeLetterIsoCode = "ATG",
+ NumericIsoCode = 28,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Bahrain",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BH",
+ ThreeLetterIsoCode = "BHR",
+ NumericIsoCode = 48,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Barbados",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BB",
+ ThreeLetterIsoCode = "BRB",
+ NumericIsoCode = 52,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Benin",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BJ",
+ ThreeLetterIsoCode = "BEN",
+ NumericIsoCode = 204,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Bhutan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BT",
+ ThreeLetterIsoCode = "BTN",
+ NumericIsoCode = 64,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Botswana",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BW",
+ ThreeLetterIsoCode = "BWA",
+ NumericIsoCode = 72,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Bouvet Island",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BV",
+ ThreeLetterIsoCode = "BVT",
+ NumericIsoCode = 74,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "British Indian Ocean Territory",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "IO",
+ ThreeLetterIsoCode = "IOT",
+ NumericIsoCode = 86,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Brunei Darussalam",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BN",
+ ThreeLetterIsoCode = "BRN",
+ NumericIsoCode = 96,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Burkina Faso",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BF",
+ ThreeLetterIsoCode = "BFA",
+ NumericIsoCode = 854,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Burundi",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "BI",
+ ThreeLetterIsoCode = "BDI",
+ NumericIsoCode = 108,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Cambodia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KH",
+ ThreeLetterIsoCode = "KHM",
+ NumericIsoCode = 116,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Cameroon",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CM",
+ ThreeLetterIsoCode = "CMR",
+ NumericIsoCode = 120,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Cape Verde",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CV",
+ ThreeLetterIsoCode = "CPV",
+ NumericIsoCode = 132,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Central African Republic",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CF",
+ ThreeLetterIsoCode = "CAF",
+ NumericIsoCode = 140,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Chad",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TD",
+ ThreeLetterIsoCode = "TCD",
+ NumericIsoCode = 148,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Christmas Island",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CX",
+ ThreeLetterIsoCode = "CXR",
+ NumericIsoCode = 162,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Cocos (Keeling) Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CC",
+ ThreeLetterIsoCode = "CCK",
+ NumericIsoCode = 166,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Comoros",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KM",
+ ThreeLetterIsoCode = "COM",
+ NumericIsoCode = 174,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Congo",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CG",
+ ThreeLetterIsoCode = "COG",
+ NumericIsoCode = 178,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Cook Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CK",
+ ThreeLetterIsoCode = "COK",
+ NumericIsoCode = 184,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Cote D'Ivoire",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "CI",
+ ThreeLetterIsoCode = "CIV",
+ NumericIsoCode = 384,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Djibouti",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "DJ",
+ ThreeLetterIsoCode = "DJI",
+ NumericIsoCode = 262,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Dominica",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "DM",
+ ThreeLetterIsoCode = "DMA",
+ NumericIsoCode = 212,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "El Salvador",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SV",
+ ThreeLetterIsoCode = "SLV",
+ NumericIsoCode = 222,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Equatorial Guinea",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GQ",
+ ThreeLetterIsoCode = "GNQ",
+ NumericIsoCode = 226,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Eritrea",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ER",
+ ThreeLetterIsoCode = "ERI",
+ NumericIsoCode = 232,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Estonia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "EE",
+ ThreeLetterIsoCode = "EST",
+ NumericIsoCode = 233,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Ethiopia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ET",
+ ThreeLetterIsoCode = "ETH",
+ NumericIsoCode = 231,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Falkland Islands (Malvinas)",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "FK",
+ ThreeLetterIsoCode = "FLK",
+ NumericIsoCode = 238,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Faroe Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "FO",
+ ThreeLetterIsoCode = "FRO",
+ NumericIsoCode = 234,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Fiji",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "FJ",
+ ThreeLetterIsoCode = "FJI",
+ NumericIsoCode = 242,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "French Guiana",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GF",
+ ThreeLetterIsoCode = "GUF",
+ NumericIsoCode = 254,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "French Polynesia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PF",
+ ThreeLetterIsoCode = "PYF",
+ NumericIsoCode = 258,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "French Southern Territories",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TF",
+ ThreeLetterIsoCode = "ATF",
+ NumericIsoCode = 260,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Gabon",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GA",
+ ThreeLetterIsoCode = "GAB",
+ NumericIsoCode = 266,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Gambia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GM",
+ ThreeLetterIsoCode = "GMB",
+ NumericIsoCode = 270,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Ghana",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GH",
+ ThreeLetterIsoCode = "GHA",
+ NumericIsoCode = 288,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Greenland",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GL",
+ ThreeLetterIsoCode = "GRL",
+ NumericIsoCode = 304,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Grenada",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GD",
+ ThreeLetterIsoCode = "GRD",
+ NumericIsoCode = 308,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Guadeloupe",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GP",
+ ThreeLetterIsoCode = "GLP",
+ NumericIsoCode = 312,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Guam",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GU",
+ ThreeLetterIsoCode = "GUM",
+ NumericIsoCode = 316,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Guinea",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GN",
+ ThreeLetterIsoCode = "GIN",
+ NumericIsoCode = 324,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Guinea-bissau",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GW",
+ ThreeLetterIsoCode = "GNB",
+ NumericIsoCode = 624,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Guyana",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GY",
+ ThreeLetterIsoCode = "GUY",
+ NumericIsoCode = 328,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Haiti",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "HT",
+ ThreeLetterIsoCode = "HTI",
+ NumericIsoCode = 332,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Heard and Mc Donald Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "HM",
+ ThreeLetterIsoCode = "HMD",
+ NumericIsoCode = 334,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Honduras",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "HN",
+ ThreeLetterIsoCode = "HND",
+ NumericIsoCode = 340,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Iceland",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "IS",
+ ThreeLetterIsoCode = "ISL",
+ NumericIsoCode = 352,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Iran (Islamic Republic of)",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "IR",
+ ThreeLetterIsoCode = "IRN",
+ NumericIsoCode = 364,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Iraq",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "IQ",
+ ThreeLetterIsoCode = "IRQ",
+ NumericIsoCode = 368,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Kenya",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KE",
+ ThreeLetterIsoCode = "KEN",
+ NumericIsoCode = 404,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Kiribati",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KI",
+ ThreeLetterIsoCode = "KIR",
+ NumericIsoCode = 296,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Korea",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KR",
+ ThreeLetterIsoCode = "KOR",
+ NumericIsoCode = 410,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Kyrgyzstan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KG",
+ ThreeLetterIsoCode = "KGZ",
+ NumericIsoCode = 417,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Lao People's Democratic Republic",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LA",
+ ThreeLetterIsoCode = "LAO",
+ NumericIsoCode = 418,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Latvia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LV",
+ ThreeLetterIsoCode = "LVA",
+ NumericIsoCode = 428,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Lebanon",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LB",
+ ThreeLetterIsoCode = "LBN",
+ NumericIsoCode = 422,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Lesotho",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LS",
+ ThreeLetterIsoCode = "LSO",
+ NumericIsoCode = 426,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Liberia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LR",
+ ThreeLetterIsoCode = "LBR",
+ NumericIsoCode = 430,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Libyan Arab Jamahiriya",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LY",
+ ThreeLetterIsoCode = "LBY",
+ NumericIsoCode = 434,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Liechtenstein",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LI",
+ ThreeLetterIsoCode = "LIE",
+ NumericIsoCode = 438,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Lithuania",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LT",
+ ThreeLetterIsoCode = "LTU",
+ NumericIsoCode = 440,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Luxembourg",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LU",
+ ThreeLetterIsoCode = "LUX",
+ NumericIsoCode = 442,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Macau",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MO",
+ ThreeLetterIsoCode = "MAC",
+ NumericIsoCode = 446,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Macedonia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MK",
+ ThreeLetterIsoCode = "MKD",
+ NumericIsoCode = 807,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Madagascar",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MG",
+ ThreeLetterIsoCode = "MDG",
+ NumericIsoCode = 450,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Malawi",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MW",
+ ThreeLetterIsoCode = "MWI",
+ NumericIsoCode = 454,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Maldives",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MV",
+ ThreeLetterIsoCode = "MDV",
+ NumericIsoCode = 462,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Mali",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ML",
+ ThreeLetterIsoCode = "MLI",
+ NumericIsoCode = 466,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Malta",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MT",
+ ThreeLetterIsoCode = "MLT",
+ NumericIsoCode = 470,
+ SubjectToVat = true,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Marshall Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MH",
+ ThreeLetterIsoCode = "MHL",
+ NumericIsoCode = 584,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Martinique",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MQ",
+ ThreeLetterIsoCode = "MTQ",
+ NumericIsoCode = 474,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Mauritania",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MR",
+ ThreeLetterIsoCode = "MRT",
+ NumericIsoCode = 478,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Mauritius",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MU",
+ ThreeLetterIsoCode = "MUS",
+ NumericIsoCode = 480,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Mayotte",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "YT",
+ ThreeLetterIsoCode = "MYT",
+ NumericIsoCode = 175,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Micronesia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "FM",
+ ThreeLetterIsoCode = "FSM",
+ NumericIsoCode = 583,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Moldova",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MD",
+ ThreeLetterIsoCode = "MDA",
+ NumericIsoCode = 498,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Monaco",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MC",
+ ThreeLetterIsoCode = "MCO",
+ NumericIsoCode = 492,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Mongolia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MN",
+ ThreeLetterIsoCode = "MNG",
+ NumericIsoCode = 496,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Montenegro",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ME",
+ ThreeLetterIsoCode = "MNE",
+ NumericIsoCode = 499,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Montserrat",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MS",
+ ThreeLetterIsoCode = "MSR",
+ NumericIsoCode = 500,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Morocco",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MA",
+ ThreeLetterIsoCode = "MAR",
+ NumericIsoCode = 504,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Mozambique",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MZ",
+ ThreeLetterIsoCode = "MOZ",
+ NumericIsoCode = 508,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Myanmar",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MM",
+ ThreeLetterIsoCode = "MMR",
+ NumericIsoCode = 104,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Namibia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NA",
+ ThreeLetterIsoCode = "NAM",
+ NumericIsoCode = 516,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Nauru",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NR",
+ ThreeLetterIsoCode = "NRU",
+ NumericIsoCode = 520,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Nepal",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NP",
+ ThreeLetterIsoCode = "NPL",
+ NumericIsoCode = 524,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Netherlands Antilles",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "AN",
+ ThreeLetterIsoCode = "ANT",
+ NumericIsoCode = 530,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "New Caledonia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NC",
+ ThreeLetterIsoCode = "NCL",
+ NumericIsoCode = 540,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Nicaragua",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NI",
+ ThreeLetterIsoCode = "NIC",
+ NumericIsoCode = 558,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Niger",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NE",
+ ThreeLetterIsoCode = "NER",
+ NumericIsoCode = 562,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Nigeria",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NG",
+ ThreeLetterIsoCode = "NGA",
+ NumericIsoCode = 566,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Niue",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NU",
+ ThreeLetterIsoCode = "NIU",
+ NumericIsoCode = 570,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Norfolk Island",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "NF",
+ ThreeLetterIsoCode = "NFK",
+ NumericIsoCode = 574,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Northern Mariana Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "MP",
+ ThreeLetterIsoCode = "MNP",
+ NumericIsoCode = 580,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Oman",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "OM",
+ ThreeLetterIsoCode = "OMN",
+ NumericIsoCode = 512,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Palau",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PW",
+ ThreeLetterIsoCode = "PLW",
+ NumericIsoCode = 585,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Panama",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PA",
+ ThreeLetterIsoCode = "PAN",
+ NumericIsoCode = 591,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Papua New Guinea",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PG",
+ ThreeLetterIsoCode = "PNG",
+ NumericIsoCode = 598,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Pitcairn",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PN",
+ ThreeLetterIsoCode = "PCN",
+ NumericIsoCode = 612,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Reunion",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "RE",
+ ThreeLetterIsoCode = "REU",
+ NumericIsoCode = 638,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Rwanda",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "RW",
+ ThreeLetterIsoCode = "RWA",
+ NumericIsoCode = 646,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Saint Kitts and Nevis",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "KN",
+ ThreeLetterIsoCode = "KNA",
+ NumericIsoCode = 659,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Saint Lucia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LC",
+ ThreeLetterIsoCode = "LCA",
+ NumericIsoCode = 662,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Saint Vincent and the Grenadines",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "VC",
+ ThreeLetterIsoCode = "VCT",
+ NumericIsoCode = 670,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Samoa",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "WS",
+ ThreeLetterIsoCode = "WSM",
+ NumericIsoCode = 882,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "San Marino",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SM",
+ ThreeLetterIsoCode = "SMR",
+ NumericIsoCode = 674,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Sao Tome and Principe",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ST",
+ ThreeLetterIsoCode = "STP",
+ NumericIsoCode = 678,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Senegal",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SN",
+ ThreeLetterIsoCode = "SEN",
+ NumericIsoCode = 686,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Seychelles",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SC",
+ ThreeLetterIsoCode = "SYC",
+ NumericIsoCode = 690,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Sierra Leone",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SL",
+ ThreeLetterIsoCode = "SLE",
+ NumericIsoCode = 694,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Solomon Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SB",
+ ThreeLetterIsoCode = "SLB",
+ NumericIsoCode = 90,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Somalia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SO",
+ ThreeLetterIsoCode = "SOM",
+ NumericIsoCode = 706,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "South Georgia & South Sandwich Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "GS",
+ ThreeLetterIsoCode = "SGS",
+ NumericIsoCode = 239,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Sri Lanka",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "LK",
+ ThreeLetterIsoCode = "LKA",
+ NumericIsoCode = 144,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "St. Helena",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SH",
+ ThreeLetterIsoCode = "SHN",
+ NumericIsoCode = 654,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "St. Pierre and Miquelon",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "PM",
+ ThreeLetterIsoCode = "SPM",
+ NumericIsoCode = 666,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Sudan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SD",
+ ThreeLetterIsoCode = "SDN",
+ NumericIsoCode = 736,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Suriname",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SR",
+ ThreeLetterIsoCode = "SUR",
+ NumericIsoCode = 740,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Svalbard and Jan Mayen Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SJ",
+ ThreeLetterIsoCode = "SJM",
+ NumericIsoCode = 744,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Swaziland",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SZ",
+ ThreeLetterIsoCode = "SWZ",
+ NumericIsoCode = 748,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Syrian Arab Republic",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "SY",
+ ThreeLetterIsoCode = "SYR",
+ NumericIsoCode = 760,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Tajikistan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TJ",
+ ThreeLetterIsoCode = "TJK",
+ NumericIsoCode = 762,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Tanzania",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TZ",
+ ThreeLetterIsoCode = "TZA",
+ NumericIsoCode = 834,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Togo",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TG",
+ ThreeLetterIsoCode = "TGO",
+ NumericIsoCode = 768,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Tokelau",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TK",
+ ThreeLetterIsoCode = "TKL",
+ NumericIsoCode = 772,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Tonga",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TO",
+ ThreeLetterIsoCode = "TON",
+ NumericIsoCode = 776,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Trinidad and Tobago",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TT",
+ ThreeLetterIsoCode = "TTO",
+ NumericIsoCode = 780,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Tunisia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TN",
+ ThreeLetterIsoCode = "TUN",
+ NumericIsoCode = 788,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Turkmenistan",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TM",
+ ThreeLetterIsoCode = "TKM",
+ NumericIsoCode = 795,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Turks and Caicos Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TC",
+ ThreeLetterIsoCode = "TCA",
+ NumericIsoCode = 796,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Tuvalu",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "TV",
+ ThreeLetterIsoCode = "TUV",
+ NumericIsoCode = 798,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Uganda",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "UG",
+ ThreeLetterIsoCode = "UGA",
+ NumericIsoCode = 800,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Vanuatu",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "VU",
+ ThreeLetterIsoCode = "VUT",
+ NumericIsoCode = 548,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Vatican City State (Holy See)",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "VA",
+ ThreeLetterIsoCode = "VAT",
+ NumericIsoCode = 336,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Viet Nam",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "VN",
+ ThreeLetterIsoCode = "VNM",
+ NumericIsoCode = 704,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Virgin Islands (British)",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "VG",
+ ThreeLetterIsoCode = "VGB",
+ NumericIsoCode = 92,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Virgin Islands (U.S.)",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "VI",
+ ThreeLetterIsoCode = "VIR",
+ NumericIsoCode = 850,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Wallis and Futuna Islands",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "WF",
+ ThreeLetterIsoCode = "WLF",
+ NumericIsoCode = 876,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Western Sahara",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "EH",
+ ThreeLetterIsoCode = "ESH",
+ NumericIsoCode = 732,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Yemen",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "YE",
+ ThreeLetterIsoCode = "YEM",
+ NumericIsoCode = 887,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Zambia",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ZM",
+ ThreeLetterIsoCode = "ZMB",
+ NumericIsoCode = 894,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ },
+ new() {
+ Name = "Zimbabwe",
+ AllowsBilling = true,
+ AllowsShipping = true,
+ TwoLetterIsoCode = "ZW",
+ ThreeLetterIsoCode = "ZWE",
+ NumericIsoCode = 716,
+ SubjectToVat = false,
+ DisplayOrder = 100,
+ Published = true
+ }
+ };
+ countries.ForEach(x => _countryRepository.Insert(x));
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataCurrencies.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataCurrencies.cs
new file mode 100644
index 000000000..9d04f8b19
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataCurrencies.cs
@@ -0,0 +1,86 @@
+using Grand.Domain.Directory;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallCurrencies()
+ {
+ var currencies = new List<Currency> {
+ new() {
+ Name = "US Dollar",
+ CurrencyCode = "USD",
+ Rate = 1,
+ DisplayLocale = "en-US",
+ CustomFormatting = "",
+ NumberDecimal = 2,
+ Published = true,
+ DisplayOrder = 1,
+ RoundingTypeId = RoundingType.Rounding001,
+ MidpointRoundId = MidpointRounding.ToEven
+ },
+ new() {
+ Name = "Euro",
+ CurrencyCode = "EUR",
+ Rate = 0.95,
+ DisplayLocale = "",
+ CustomFormatting = $"{"\u20ac"}0.00",
+ NumberDecimal = 2,
+ Published = true,
+ DisplayOrder = 2,
+ RoundingTypeId = RoundingType.Rounding001,
+ MidpointRoundId = MidpointRounding.AwayFromZero
+ },
+ new() {
+ Name = "British Pound",
+ CurrencyCode = "GBP",
+ Rate = 0.82,
+ DisplayLocale = "en-GB",
+ CustomFormatting = "",
+ NumberDecimal = 2,
+ Published = false,
+ DisplayOrder = 3,
+ RoundingTypeId = RoundingType.Rounding001,
+ MidpointRoundId = MidpointRounding.AwayFromZero
+ },
+ new() {
+ Name = "Chinese Yuan Renminbi",
+ CurrencyCode = "CNY",
+ Rate = 6.93,
+ DisplayLocale = "zh-CN",
+ CustomFormatting = "",
+ NumberDecimal = 2,
+ Published = false,
+ DisplayOrder = 4,
+ RoundingTypeId = RoundingType.Rounding001,
+ MidpointRoundId = MidpointRounding.ToEven
+ },
+ new() {
+ Name = "Indian Rupee",
+ CurrencyCode = "INR",
+ Rate = 68.17,
+ DisplayLocale = "en-IN",
+ CustomFormatting = "",
+ NumberDecimal = 2,
+ Published = false,
+ DisplayOrder = 5,
+ RoundingTypeId = RoundingType.Rounding001,
+ MidpointRoundId = MidpointRounding.ToEven
+ },
+ new() {
+ Name = "Złoty",
+ CurrencyCode = "PLN",
+ Rate = 3.97,
+ DisplayLocale = "pl-PL",
+ CustomFormatting = "",
+ NumberDecimal = 2,
+ Published = false,
+ DisplayOrder = 6,
+ RoundingTypeId = RoundingType.Rounding001,
+ MidpointRoundId = MidpointRounding.AwayFromZero
+ }
+ };
+ currencies.ForEach(x => _currencyRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataCustomersAndUsers.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataCustomersAndUsers.cs
new file mode 100644
index 000000000..d961e0ef5
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataCustomersAndUsers.cs
@@ -0,0 +1,139 @@
+using Grand.Domain.Common;
+using Grand.Domain.Customers;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallCustomersAndUsers(string defaultUserEmail, string defaultUserPassword)
+ {
+ var crAdministrators = new CustomerGroup {
+ Name = "Administrators",
+ Active = true,
+ IsSystem = true,
+ SystemName = SystemCustomerGroupNames.Administrators
+ };
+ await _customerGroupRepository.InsertAsync(crAdministrators);
+
+ var crRegistered = new CustomerGroup {
+ Name = "Registered",
+ Active = true,
+ IsSystem = true,
+ SystemName = SystemCustomerGroupNames.Registered
+ };
+ await _customerGroupRepository.InsertAsync(crRegistered);
+
+ var crGuests = new CustomerGroup {
+ Name = "Guests",
+ Active = true,
+ IsSystem = true,
+ SystemName = SystemCustomerGroupNames.Guests
+ };
+ await _customerGroupRepository.InsertAsync(crGuests);
+
+ var crVendors = new CustomerGroup {
+ Name = "Vendors",
+ Active = true,
+ IsSystem = true,
+ SystemName = SystemCustomerGroupNames.Vendors
+ };
+ await _customerGroupRepository.InsertAsync(crVendors);
+
+ var crStaff = new CustomerGroup {
+ Name = "Staff",
+ Active = true,
+ IsSystem = true,
+ SystemName = SystemCustomerGroupNames.Staff
+ };
+ await _customerGroupRepository.InsertAsync(crStaff);
+
+ var crSalesManager = new CustomerGroup {
+ Name = "Sales manager",
+ Active = true,
+ IsSystem = true,
+ SystemName = SystemCustomerGroupNames.SalesManager
+ };
+ await _customerGroupRepository.InsertAsync(crSalesManager);
+
+ //admin user
+ var adminUser = new Customer {
+ CustomerGuid = Guid.NewGuid(),
+ Email = defaultUserEmail,
+ Username = defaultUserEmail,
+ Password = defaultUserPassword,
+ PasswordFormatId = PasswordFormat.Clear,
+ PasswordSalt = "",
+ Active = true,
+ LastActivityDateUtc = DateTime.UtcNow,
+ PasswordChangeDateUtc = DateTime.UtcNow
+ };
+ var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");
+ var defaultAdminUserAddress = new Address {
+ FirstName = "John",
+ LastName = "Smith",
+ PhoneNumber = "12345678",
+ Email = "[email protected]",
+ FaxNumber = "",
+ Company = "GrandNode LTD",
+ Address1 = "21 West 52nd Street",
+ Address2 = "",
+ City = "New York",
+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,
+ CountryId = country?.Id,
+ ZipPostalCode = "10021"
+ };
+ adminUser.Addresses.Add(defaultAdminUserAddress);
+ adminUser.BillingAddress = defaultAdminUserAddress;
+ adminUser.ShippingAddress = defaultAdminUserAddress;
+ adminUser.Groups.Add(crAdministrators.Id);
+ adminUser.Groups.Add(crRegistered.Id);
+ adminUser.UserFields.Add(new UserField
+ { Key = SystemCustomerFieldNames.FirstName, Value = "John", StoreId = "" });
+ adminUser.UserFields.Add(new UserField
+ { Key = SystemCustomerFieldNames.LastName, Value = "Smith", StoreId = "" });
+ await _customerRepository.InsertAsync(adminUser);
+
+ //Anonymous user
+ var anonymousUser = new Customer {
+ Email = "[email protected]",
+ CustomerGuid = Guid.NewGuid(),
+ PasswordFormatId = PasswordFormat.Clear,
+ AdminComment = "Built-in system guest record used for anonymous requests.",
+ Active = true,
+ IsSystemAccount = true,
+ SystemName = SystemCustomerNames.Anonymous,
+ LastActivityDateUtc = DateTime.UtcNow
+ };
+ anonymousUser.Groups.Add(crGuests.Id);
+ await _customerRepository.InsertAsync(anonymousUser);
+
+ //search engine (crawler) built-in user
+ var searchEngineUser = new Customer {
+ Email = "builtin@search_engine_record.com",
+ CustomerGuid = Guid.NewGuid(),
+ PasswordFormatId = PasswordFormat.Clear,
+ AdminComment = "Built-in system guest record used for requests from search engines.",
+ Active = true,
+ IsSystemAccount = true,
+ SystemName = SystemCustomerNames.SearchEngine,
+ LastActivityDateUtc = DateTime.UtcNow
+ };
+ searchEngineUser.Groups.Add(crGuests.Id);
+ await _customerRepository.InsertAsync(searchEngineUser);
+
+
+ //built-in user for background tasks
+ var backgroundTaskUser = new Customer {
+ Email = "[email protected]",
+ CustomerGuid = Guid.NewGuid(),
+ PasswordFormatId = PasswordFormat.Clear,
+ AdminComment = "Built-in system record used for background tasks.",
+ Active = true,
+ IsSystemAccount = true,
+ SystemName = SystemCustomerNames.BackgroundTask,
+ LastActivityDateUtc = DateTime.UtcNow
+ };
+ backgroundTaskUser.Groups.Add(crGuests.Id);
+ await _customerRepository.InsertAsync(backgroundTaskUser);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataDeliveryDates.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataDeliveryDates.cs
new file mode 100644
index 000000000..92f400d22
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataDeliveryDates.cs
@@ -0,0 +1,26 @@
+using Grand.Domain.Shipping;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallDeliveryDates()
+ {
+ var deliveryDates = new List<DeliveryDate> {
+ new() {
+ Name = "1-2 days",
+ DisplayOrder = 1
+ },
+ new() {
+ Name = "3-5 days",
+ DisplayOrder = 5
+ },
+ new() {
+ Name = "1 week",
+ DisplayOrder = 10
+ }
+ };
+ deliveryDates.ForEach(x => _deliveryDateRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataDiscounts.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataDiscounts.cs
new file mode 100644
index 000000000..d7851eafa
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataDiscounts.cs
@@ -0,0 +1,49 @@
+using Grand.Domain.Discounts;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallDiscounts()
+ {
+ var discounts = new List<Discount> {
+ new() {
+ Name = "Sample discount with coupon code",
+ DiscountTypeId = DiscountType.AssignedToOrderTotal,
+ DiscountLimitationId = DiscountLimitationType.Nolimits,
+ UsePercentage = false,
+ DiscountAmount = 10,
+ RequiresCouponCode = true,
+ IsEnabled = true,
+ CurrencyCode = "USD"
+ },
+ new() {
+ Name = "'20% order total' discount",
+ DiscountTypeId = DiscountType.AssignedToOrderTotal,
+ DiscountLimitationId = DiscountLimitationType.Nolimits,
+ UsePercentage = true,
+ DiscountPercentage = 20,
+ StartDateUtc = new DateTime(2010, 1, 1),
+ EndDateUtc = new DateTime(2030, 1, 1),
+ RequiresCouponCode = true,
+ IsEnabled = true,
+ CurrencyCode = "USD"
+ }
+ };
+ discounts.ForEach(x => _discountRepository.Insert(x));
+
+ var coupon1 = new DiscountCoupon {
+ CouponCode = "123",
+ DiscountId = _discountRepository.Table.Where(x => x.Name == "Sample discount with coupon code")
+ .FirstOrDefault()!.Id
+ };
+ await _discountCouponRepository.InsertAsync(coupon1);
+
+ var coupon2 = new DiscountCoupon {
+ CouponCode = "456",
+ DiscountId = _discountRepository.Table.Where(x => x.Name == "'20% order total' discount").FirstOrDefault()!
+ .Id
+ };
+ await _discountCouponRepository.InsertAsync(coupon2);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataEmailAccounts.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataEmailAccounts.cs
new file mode 100644
index 000000000..be97efa20
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataEmailAccounts.cs
@@ -0,0 +1,24 @@
+using Grand.Domain.Messages;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallEmailAccounts()
+ {
+ var emailAccounts = new List<EmailAccount> {
+ new() {
+ Email = "[email protected]",
+ DisplayName = "Store name",
+ Host = "smtp.mail.com",
+ Port = 25,
+ Username = "123",
+ Password = "123",
+ SecureSocketOptionsId = 1,
+ UseServerCertificateValidation = true
+ }
+ };
+ emailAccounts.ForEach(x => _emailAccountRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataLanguages.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataLanguages.cs
new file mode 100644
index 000000000..bf9436c19
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataLanguages.cs
@@ -0,0 +1,19 @@
+using Grand.Domain.Localization;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallLanguages()
+ {
+ var language = new Language {
+ Name = "English",
+ LanguageCulture = "en-US",
+ UniqueSeoCode = "en",
+ FlagImageFileName = "us.png",
+ Published = true,
+ DisplayOrder = 1
+ };
+ await _languageRepository.InsertAsync(language);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataLocaleResources.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataLocaleResources.cs
new file mode 100644
index 000000000..af5944cf6
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataLocaleResources.cs
@@ -0,0 +1,61 @@
+using Grand.Domain.Localization;
+using Grand.SharedKernel.Extensions;
+using System.Xml;
+using System.Xml.Schema;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallLocaleResources()
+ {
+ //'English' language
+ var language = _languageRepository.Table.Single(l => l.Name == "English");
+
+ //save resources
+ var filePath = Path.Combine(_hostingEnvironment.ContentRootPath, "App_Data/Resources/DefaultLanguage.xml");
+ var localesXml = File.ReadAllText(filePath);
+
+ var xmlDoc = LanguageXmlDocument(localesXml);
+
+ var translateResources = new List<TranslationResource>();
+
+ var nodes = xmlDoc.SelectNodes("//Language/Resource");
+ if (nodes != null)
+ foreach (XmlNode node in nodes)
+ {
+ var name = node.Attributes?["Name"]?.InnerText.Trim();
+ var area = node.Attributes?["Area"]?.InnerText.Trim();
+ var value = "";
+ var valueNode = node.SelectSingleNode("Value");
+ if (valueNode != null)
+ value = valueNode.InnerText;
+
+ if (string.IsNullOrEmpty(name))
+ continue;
+
+ _ = Enum.TryParse(area, out TranslationResourceArea areaEnum);
+
+ await _lsrRepository.InsertAsync(new TranslationResource {
+ LanguageId = language.Id,
+ Name = name.ToLowerInvariant(),
+ Value = value,
+ Area = areaEnum,
+ CreatedBy = "System"
+ });
+ }
+
+ }
+ private static XmlDocument LanguageXmlDocument(string xml)
+ {
+ var schemas = new XmlSchemaSet();
+ schemas.Add("", XmlReader.Create(new StringReader(LanguageSchema.SchemaXsd)));
+
+ var xmlDoc = new XmlDocument { Schemas = schemas, XmlResolver = null };
+ xmlDoc.LoadXml(xml);
+
+ // Validate XML.
+ xmlDoc.Validate((_, e) => throw new XmlException("XML data does not conform to the schema", e.Exception));
+ return xmlDoc;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataMeasures.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataMeasures.cs
new file mode 100644
index 000000000..b59bc07f2
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataMeasures.cs
@@ -0,0 +1,78 @@
+using Grand.Domain.Directory;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallMeasures()
+ {
+ var measureDimensions = new List<MeasureDimension> {
+ new() {
+ Name = "centimetre(s)",
+ SystemKeyword = "centimetres",
+ Ratio = 1,
+ DisplayOrder = 1
+ },
+ new() {
+ Name = "inch(es)",
+ SystemKeyword = "inches",
+ Ratio = 0.393701,
+ DisplayOrder = 2
+ },
+ new() {
+ Name = "feet",
+ SystemKeyword = "feet",
+ Ratio = 0.0328084,
+ DisplayOrder = 3
+ }
+ };
+
+ measureDimensions.ForEach(x => _measureDimensionRepository.Insert(x));
+
+ var measureWeights = new List<MeasureWeight> {
+ new() {
+ Name = "ounce(s)",
+ SystemKeyword = "ounce",
+ Ratio = 16,
+ DisplayOrder = 1
+ },
+ new() {
+ Name = "lb(s)",
+ SystemKeyword = "lb",
+ Ratio = 1,
+ DisplayOrder = 2
+ },
+ new() {
+ Name = "kg(s)",
+ SystemKeyword = "kg",
+ Ratio = 0.45359237,
+ DisplayOrder = 3
+ },
+ new() {
+ Name = "gram(s)",
+ SystemKeyword = "grams",
+ Ratio = 453.59237,
+ DisplayOrder = 4
+ }
+ };
+
+ measureWeights.ForEach(x => _measureWeightRepository.Insert(x));
+
+ var measureUnits = new List<MeasureUnit> {
+ new() {
+ Name = "pcs.",
+ DisplayOrder = 1
+ },
+ new() {
+ Name = "pair",
+ DisplayOrder = 2
+ },
+ new() {
+ Name = "set",
+ DisplayOrder = 3
+ }
+ };
+ measureUnits.ForEach(x => _measureUnitRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataMerchandiseReturnActions.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataMerchandiseReturnActions.cs
new file mode 100644
index 000000000..69ce05788
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataMerchandiseReturnActions.cs
@@ -0,0 +1,26 @@
+using Grand.Domain.Orders;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallMerchandiseReturnActions()
+ {
+ var merchandiseReturnActions = new List<MerchandiseReturnAction> {
+ new() {
+ Name = "Repair",
+ DisplayOrder = 1
+ },
+ new() {
+ Name = "Replacement",
+ DisplayOrder = 2
+ },
+ new() {
+ Name = "Store Credit",
+ DisplayOrder = 3
+ }
+ };
+ merchandiseReturnActions.ForEach(x => _merchandiseReturnActionRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataMerchandiseReturnReasons.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataMerchandiseReturnReasons.cs
new file mode 100644
index 000000000..5a66e74e7
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataMerchandiseReturnReasons.cs
@@ -0,0 +1,27 @@
+using Grand.Domain.Orders;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallMerchandiseReturnReasons()
+ {
+ var merchandiseReturnReasons = new List<MerchandiseReturnReason> {
+ new() {
+ Name = "Received Wrong Product",
+ DisplayOrder = 1
+ },
+ new() {
+ Name = "Wrong Product Ordered",
+ DisplayOrder = 2
+ },
+ new() {
+ Name = "There Was A Problem With The Product",
+ DisplayOrder = 3
+ }
+ };
+
+ merchandiseReturnReasons.ForEach(x => _merchandiseReturnReasonRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataMessageTemplates.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataMessageTemplates.cs
new file mode 100644
index 000000000..742172455
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataMessageTemplates.cs
@@ -0,0 +1,590 @@
+using Grand.Domain.Messages;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallMessageTemplates()
+ {
+ var eaGeneral = _emailAccountRepository.Table.FirstOrDefault();
+ if (eaGeneral == null)
+ throw new Exception("Default email account cannot be loaded");
+
+ var OrderProducts = @"
+ <table style='width: 100%;' border='0'>
+ <tr style='background-color: #b9babe; text-align: center;'><th>Name</th><th>Price</th><th>Quantity</th><th>Total</th></tr>
+ {% for item in Order.OrderItems -%}
+ <tr style='background-color: #ebecee; text-align: center;'>
+ <td style='padding: 0.6em 0.4em; text-align: left;'>{{item.ProductName}}
+ {% if item.IsDownloadAllowed -%}
+ <br />
+ <a class='link' href='{{item.DownloadUrl}}'>Download</a>
+ {% endif %}
+
+ {% if item.IsLicenseDownloadAllowed -%}
+ <br />
+ <a class='link' href='{{item.LicenseUrl}}'>Download license</a>
+ {% endif %}
+
+ {% if item.AttributeDescription != null and item.AttributeDescription != '' %}
+ <br />
+ {{item.AttributeDescription}}
+ {% endif %}
+
+ {% if item.ProductSku != null and item.ProductSku != '' %}
+ <br />
+ Sku: {{item.ProductSku}}
+ {% endif %}
+
+ </td>
+ <td style='padding: 0.6em 0.4em; text-align: right;'>{{item.UnitPrice}}</td>
+ <td style='padding: 0.6em 0.4em; text-align: center;'>{{item.Quantity}}</td>
+ <td style='padding: 0.6em 0.4em; text-align: right;'>{{item.TotalPrice}}</td>
+ </tr>
+ {% endfor -%}
+
+ {% if Order.CheckoutAttributeDescription != null and Order.CheckoutAttributeDescription != '' %}
+ <tr><td style='text-align:right;' colspan='1'>&nbsp;</td><td colspan='3' style='text-align:right'>
+ {{Order.CheckoutAttributeDescription}}
+ </td></tr>
+ {% endif %}
+
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>Sub-Total:</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.SubTotal}}</strong></td></tr>
+
+ {% if Order.DisplaySubTotalDiscount %}
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>Discount:</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.SubTotalDiscount}}</strong></td></tr>
+ {% endif %}
+
+ {% if Order.DisplayShipping %}
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>Shipping:</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.Shipping}}</strong></td></tr>
+ {% endif %}
+
+ {% if Order.DisplayPaymentMethodFee %}
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>Payment method additional fee:</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.PaymentMethodAdditionalFee}}</strong></td></tr>
+ {% endif %}
+
+ {% if Order.DisplayTax %}
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>Tax:</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.Tax}}</strong></td></tr>
+ {% endif %}
+
+ {% if Order.DisplayTaxRates %}
+ {% for item in Order.TaxRates -%}
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{item.Key}}</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{item.Value}}</strong></td></tr>
+ {% endfor -%}
+ {% endif %}
+
+ {% if Order.DisplayDiscount %}
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>Discount:</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.Discount}}</strong></td></tr>
+ {% endif %}
+
+ {% for item in Order.GiftVouchers -%}
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{item.Key}}</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{item.Value}}</strong></td></tr>
+ {% endfor -%}
+
+ {% if Order.RedeemedLoyaltyPointsEntryExists %}
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.RPTitle}}</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.RPAmount}}</strong></td></tr>
+ {% endif %}
+
+ <tr style='text-align:right;'><td>&nbsp;</td><td colspan='2' style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>Order Total:</strong></td> <td style='background-color: #dde2e6;padding:0.6em 0.4 em;'><strong>{{Order.Total}}</strong></td></tr>
+ </table>";
+
+ var OrderVendorProducts = @"
+ <table style='width: 100%;' border='0'>
+ <tr style='background-color: #b9babe; text-align: center;'><th>Name</th><th>Price</th><th>Quantity</th><th>Total</th></tr>
+ {% for item in Order.OrderItems -%}
+ <tr style='background-color: #ebecee; text-align: center;'>
+ <td style='padding: 0.6em 0.4em; text-align: left;'>{{item.ProductName}}
+ {% if item.IsDownloadAllowed -%}
+ <br />
+ <a class='link' href='{{item.DownloadUrl}}'>Download</a>
+ {% endif %}
+
+ {% if item.IsLicenseDownloadAllowed -%}
+ <br />
+ <a class='link' href='{{item.LicenseUrl}}'>Download license</a>
+ {% endif %}
+
+ {% if item.AttributeDescription != null and item.AttributeDescription != '' %}
+ <br />
+ {{item.AttributeDescription}}
+ {% endif %}
+
+ {% if item.ProductSku != null and item.ProductSku != '' %}
+ <br />
+ Sku: {{item.ProductSku}}
+ {% endif %}
+
+ </td>
+ <td style='padding: 0.6em 0.4em; text-align: right;'>{{item.UnitPrice}}</td>
+ <td style='padding: 0.6em 0.4em; text-align: center;'>{{item.Quantity}}</td>
+ <td style='padding: 0.6em 0.4em; text-align: right;'>{{item.TotalPrice}}</td>
+ </tr>
+ {% endfor -%}
+
+ {% if Order.CheckoutAttributeDescription != null and Order.CheckoutAttributeDescription != '' %}
+ <tr><td style='text-align:right;' colspan='1'>&nbsp;</td><td colspan='3' style='text-align:right'>
+ {{Order.CheckoutAttributeDescription}}
+ </td></tr>
+ {% endif %}
+ </table>
+ ";
+
+ var ShipmentProducts = @"
+ <table border='0' style='width:100%;'>
+ <tr style='background-color:#b9babe; text-align:center;'>
+ <th>Name</th>
+ <th>Quantity</th>
+ </tr>
+
+ {% for item in Shipment.ShipmentItems -%}
+ <tr style='background-color: #ebecee; text-align: center;'>
+ <td style='padding: 0.6em 0.4em;text-align: left;'>{{item.ProductName}}
+ {% if item.AttributeDescription != null and item.AttributeDescription != '' %}
+ <br />
+ {{item.AttributeDescription}}
+ {% endif %}
+
+ {% if item.ProductSku != null and item.ProductSku != '' %}
+ <br />
+ Sku: {{item.ProductSku}}
+ {% endif %}
+
+ </td>
+ <td style='padding: 0.6em 0.4em; text-align: center;'>{{item.Quantity}}</td>
+ </tr>
+ {% endfor -%}
+ </table>
+ ";
+
+ var messageTemplates = new List<MessageTemplate> {
+ new() {
+ Name = "AuctionEnded.CustomerNotificationWin",
+ Subject = "{{Store.Name}}. Auction ended.",
+ Body =
+ "<p>Hello, {{Customer.FullName}}!</p><p></p><p>At {{Auctions.EndTime}} you have won <a href=\"{{Store.URL}}{{Auctions.ProductSeName}}\">{{Auctions.ProductName}}</a> for {{Auctions.Price}}. Visit <a href=\"{{Store.URL}}/cart\">cart</a> to finish checkout process. </p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "AuctionEnded.CustomerNotificationLost",
+ Subject = "{{Store.Name}}. Auction ended.",
+ Body =
+ "<p>Hello, {{Customer.FullName}}!</p><p></p><p>Unfortunately you did not win the bid {{Auctions.ProductName}}</p> <p>End price: {{Auctions.Price}} </p> <p>End date auction {{Auctions.EndTime}} </p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "AuctionEnded.CustomerNotificationBin",
+ Subject = "{{Store.Name}}. Auction ended.",
+ Body =
+ "<p>Hello, {{Customer.FullName}}!</p><p></p><p>Unfortunately you did not win the bid {{Product.Name}}</p> <p>Product was bought by option Buy it now for price: {{Product.Price}} </p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "AuctionEnded.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. Auction ended.",
+ Body =
+ "<p>At {{Auctions.EndTime}} {{Customer.FullName}} have won <a href=\"{{Store.URL}}{{Auctions.ProductSeName}}\">{{Auctions.ProductName}}</a> for {{Auctions.Price}}.</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "AuctionExpired.StoreOwnerNotification",
+ Subject = "Your auction to product {{Product.Name}} has expired.",
+ Body = "Hello, <br> Your auction to product {{Product.Name}} has expired without bid.",
+ IsActive = false,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "BidUp.CustomerNotification",
+ Subject = "{{Store.Name}}. Your offer has been outbid.",
+ Body =
+ "<p>Hi {{Customer.FullName}}!</p><p>Your offer for product <a href=\"{{Store.URL}}{{Auctions.ProductSeName}}\">{{Auctions.ProductName}}</a> has been outbid. Your price was {{Auctions.Price}}.<br />\r\nRaise a price by raising one's offer. Auction will be ended on {{Auctions.EndTime}}</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Blog.BlogComment",
+ Subject = "{{Store.Name}}. New blog comment.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new blog comment has been created for blog post \"{{BlogComment.BlogPostTitle}}\".</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Knowledgebase.ArticleComment",
+ Subject = "{{Store.Name}}. New article comment.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new article comment has been created for article \"{{Knowledgebase.ArticleCommentTitle}}\".</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Customer.OutOfStock",
+ Subject = "{{Store.Name}}. Back in stock notification",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}}, <br />\r\nProduct <a target=\"_blank\" href=\"{{OutOfStockSubscription.ProductUrl}}\">{{OutOfStockSubscription.ProductName}}</a> is in stock.</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "CustomerDelete.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. Customer has been deleted.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> ,<br />\r\n{{Customer.FullName}} ({{Customer.Email}}) has just deleted from your database. </p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Customer.EmailTokenValidationMessage",
+ Subject = "{{Store.Name}} - Email Verification Code",
+ Body =
+ "Hello {{Customer.FullName}}, <br /><br />\r\n Enter this 6 digit code on the sign in page to confirm your identity:<br /><br /> \r\n <b>{{Customer.Token}}</b><br /><br />\r\n Yours securely, <br /> \r\n Team",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Customer.EmailValidationMessage",
+ Subject = "{{Store.Name}}. Email validation",
+ Body =
+ "<a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n <br />\r\n To activate your account <a href=\"{{Customer.AccountActivationURL}}\">click here</a>. <br />\r\n <br />\r\n {{Store.Name}}",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Customer.NewPM",
+ Subject = "{{Store.Name}}. You have received a new private message",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nYou have received a new private message.</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Customer.PasswordRecovery",
+ Subject = "{{Store.Name}}. Password recovery",
+ Body =
+ "<a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n <br />\r\n To change your password <a href=\"{{Customer.PasswordRecoveryURL}}\">click here</a>. <br />\r\n <br />\r\n {{Store.Name}}",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Customer.WelcomeMessage",
+ Subject = "Welcome to {{Store.Name}}",
+ Body =
+ "We welcome you to <a href=\"{{Store.URL}}\"> {{Store.Name}}</a>.<br />\r\n<br />\r\nYou can now take part in the various services we have to offer you. Some of these services include:<br />\r\n<br />\r\nPermanent Cart - Any products added to your online cart remain there until you remove them, or check them out.<br />\r\nAddress Book - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.<br />\r\nOrder History - View your history of purchases that you have made with us.<br />\r\nProducts Reviews - Share your opinions on products with our other customers.<br />\r\n<br />\r\nFor help with any of our online services, please email the store-owner: <a href=\"mailto:{{Store.Email}}\">{{Store.Email}}</a>.<br />\r\n<br />\r\nNote: This email address was provided on our registration page. If you own the email and did not register on our site, please send an email to <a href=\"mailto:{{Store.Email}}\">{{Store.Email}}</a>.",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "GiftVoucher.Notification",
+ Subject = "{{GiftVoucher.SenderName}} has sent you a gift voucher for {{Store.Name}}",
+ Body =
+ "<p>You have received a gift voucher for {{Store.Name}}</p><p>Dear {{GiftVoucher.RecipientName}}, <br />\r\n<br />\r\n{{GiftVoucher.SenderName}} ({{GiftVoucher.SenderEmail}}) has sent you a {{GiftVoucher.Amount}} gift cart for <a href=\"{{Store.URL}}\"> {{Store.Name}}</a></p><p>You gift voucher code is {{GiftVoucher.CouponCode}}</p><p>{{GiftVoucher.Message}}</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "NewCustomer.Notification",
+ Subject = "{{Store.Name}}. New customer registration",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new customer registered with your store. Below are the customer's details:<br />\r\nFull name: {{Customer.FullName}}<br />\r\nEmail: {{Customer.Email}}</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "NewMerchandiseReturn.CustomerNotification",
+ Subject = "{{Store.Name}}. New merchandise return.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}}!<br />\r\n You have just submitted a new merchandise return. Details are below:<br />\r\nRequest ID: {{MerchandiseReturn.ReturnNumber}}<br />\r\nCustomer comments: {{MerchandiseReturn.CustomerComment}}<br />\r\n<br />\r\nPickup date: {{MerchandiseReturn.PickupDate}}<br />\r\n<br />\r\nPickup address:<br />\r\n{{MerchandiseReturn.PickupAddressFirstName}} {{MerchandiseReturn.PickupAddressLastName}}<br />\r\n{{MerchandiseReturn.PickupAddressAddress1}}<br />\r\n{{MerchandiseReturn.PickupAddressCity}} {{MerchandiseReturn.PickupAddressZipPostalCode}}<br />\r\n{{MerchandiseReturn.PickupAddressStateProvince}} {{MerchandiseReturn.PickupAddressCountry}}<br />\r\n</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "NewMerchandiseReturn.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. New merchandise return.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Customer.FullName}} has just submitted a new merchandise return. Details are below:<br />\r\nRequest ID: {{MerchandiseReturn.ReturnNumber}}<br />\r\nCustomer comments: {{MerchandiseReturn.CustomerComment}}<br />\r\n<br />\r\nPickup date: {{MerchandiseReturn.PickupDate}}<br />\r\n<br />\r\nPickup address:<br />\r\n{{MerchandiseReturn.PickupAddressFirstName}} {{MerchandiseReturn.PickupAddressLastName}}<br />\r\n{{MerchandiseReturn.PickupAddressAddress1}}<br />\r\n{{MerchandiseReturn.PickupAddressCity}} {{MerchandiseReturn.PickupAddressZipPostalCode}}<br />\r\n{{MerchandiseReturn.PickupAddressStateProvince}} {{MerchandiseReturn.PickupAddressCountry}}<br />\r\n</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "News.NewsComment",
+ Subject = "{{Store.Name}}. New news comment.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new news comment has been created for news \"{{NewsComment.NewsTitle}}\".</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "NewsLetterSubscription.ActivationMessage",
+ Subject = "{{Store.Name}}. Subscription activation message.",
+ Body =
+ "<p><a href=\"{{NewsLetterSubscription.ActivationUrl}}\">Click here to confirm your subscription to our list.</a></p><p>If you received this email by mistake, simply delete it.</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "NewsLetterSubscription.DeactivationMessage",
+ Subject = "{{Store.Name}}. Subscription deactivation message.",
+ Body =
+ "<p><a href=\"{{NewsLetterSubscription.DeactivationUrl}}\">Click here to unsubscribe from our newsletter.</a></p><p>If you received this email by mistake, simply delete it.</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderCancelled.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. Customer cancelled an order",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n<br />\r\nCustomer cancelled an order. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" +
+ OrderProducts + "</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderCancelled.CustomerNotification",
+ Subject = "{{Store.Name}}. Your order cancelled",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nYour order has been cancelled. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" +
+ OrderProducts + "</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderCancelled.VendorNotification",
+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} cancelled",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br /><br />Order #{{Order.OrderNumber}} has been cancelled. <br /><br />Order Number: {{Order.OrderNumber}} <br /> Date Ordered: {{Order.CreatedOn}} <br /><br /> ",
+ IsActive = false,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderCompleted.CustomerNotification",
+ Subject = "{{Store.Name}}. Your order completed",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nYour order has been completed. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" +
+ OrderProducts + "</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "ShipmentDelivered.CustomerNotification",
+ Subject = "Your order from {{Store.Name}} has been delivered.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n <br />\r\n Hello {{Order.CustomerFullName}}, <br />\r\n Good news! You order has been delivered. <br />\r\n Order Number: {{Order.OrderNumber}}<br />\r\n Order Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\n Date Ordered: {{Order.CreatedOn}}<br />\r\n <br />\r\n <br />\r\n <br />\r\n Billing Address<br />\r\n {{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n {{Order.BillingAddress1}}<br />\r\n {{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n {{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n <br />\r\n <br />\r\n <br />\r\n Shipping Address<br />\r\n {{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n {{Order.ShippingAddress1}}<br />\r\n {{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n {{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n <br />\r\n Shipping Method: {{Order.ShippingMethod}} <br />\r\n <br />\r\n Delivered Products: <br />\r\n <br />\r\n" +
+ ShipmentProducts + "</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderPlaced.CustomerNotification",
+ Subject = "Order receipt from {{Store.Name}}.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nThanks for buying from <a href=\"{{Store.URL}}\">{{Store.Name}}</a>. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" +
+ OrderProducts + "</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderPlaced.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. Purchase Receipt for Order #{{Order.OrderNumber}}",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Order.CustomerFullName}} ({{Order.CustomerEmail}}) has just placed an order from your store. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" +
+ OrderProducts + "</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "ShipmentSent.CustomerNotification",
+ Subject = "Your order from {{Store.Name}} has been shipped.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}!, <br />\r\nGood news! You order has been shipped. <br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}} <br />\r\n <br />\r\n Shipped Products: <br />\r\n <br />\r\n" +
+ ShipmentProducts + "</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Product.ProductReview",
+ Subject = "{{Store.Name}}. New product review.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new product review has been written for product \"{{ProductReview.ProductName}}\".</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "QuantityBelow.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. Quantity below notification. {{Product.Name}}",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Product.Name}} (ID: {{Product.Id}}) low quantity. <br />\r\n<br />\r\nQuantity: {{Product.StockQuantity}}<br />\r\n</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "QuantityBelow.AttributeCombination.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. Quantity below notification. {{Product.Name}}",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Product.Name}} (ID: {{Product.Id}}) low quantity. <br />\r\n{{AttributeCombination.Formatted}}<br />\r\nQuantity: {{AttributeCombination.StockQuantity}}<br />\r\n</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "MerchandiseReturnStatusChanged.CustomerNotification",
+ Subject = "{{Store.Name}}. Merchandise return status was changed.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}},<br />\r\nYour merchandise return #{{MerchandiseReturn.ReturnNumber}} status has been changed.</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Service.EmailAFriend",
+ Subject = "{{Store.Name}}. Referred Item",
+ Body =
+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\n{{EmailAFriend.Email}} was shopping on {{Store.Name}} and wanted to share the following item with you. <br />\r\n<br />\r\n<b><a target=\"_blank\" href=\"{{Product.ProductURLForCustomer}}\">{{Product.Name}}</a></b> <br />\r\n{{Product.ShortDescription}} <br />\r\n<br />\r\nFor more info click <a target=\"_blank\" href=\"{{Product.ProductURLForCustomer}}\">here</a> <br />\r\n<br />\r\n<br />\r\n{{EmailAFriend.PersonalMessage}}<br />\r\n<br />\r\n{{Store.Name}}</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Service.AskQuestion",
+ Subject = "{{Store.Name}}. Question about a product",
+ Body =
+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\n{{AskQuestion.Email}} wanted to ask question about a product {{Product.Name}}. <br />\r\n<br />\r\n<b><a target=\"_blank\" href=\"{{Product.ProductURLForCustomer}}\">{{Product.Name}}</a></b> <br />\r\n{{Product.ShortDescription}} <br />\r\n{{AskQuestion.Message}}<br />\r\n {{AskQuestion.Email}} <br />\r\n {{AskQuestion.FullName}} <br />\r\n {{AskQuestion.Phone}} <br />\r\n{{Store.Name}}</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Service.ContactUs",
+ Subject = "{{Store.Name}}. Contact us",
+ Body =
+ "<p>From {{ContactUs.SenderName}} - {{ContactUs.SenderEmail}}<br /><br />{{ContactUs.Body}}<br />{{ContactUs.AttributeDescription}}</p><br />",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Service.ContactVendor",
+ Subject = "{{Store.Name}}. Contact us",
+ Body =
+ "<p>From {{ContactUs.SenderName}} - {{ContactUs.SenderEmail}}<br /><br />{{ContactUs.Body}}</p><br />",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+
+ new() {
+ Name = "Wishlist.EmailAFriend",
+ Subject = "{{Store.Name}}. Wishlist",
+ Body =
+ "<p><a href=\"{{Store.URL}}\"> {{Store.Name}}</a> <br />\r\n<br />\r\n{{EmailAFriend.Email}} was shopping on {{Store.Name}} and wanted to share a wishlist with you <br />\r\n<br />\r\n<br />\r\nFor more info click <a target=\"_blank\" href=\"{{Customer.WishlistURLForCustomer}}\">here</a> <br />\r\n<br />\r\n<br />\r\n{{EmailAFriend.PersonalMessage}}<br />\r\n<br />\r\n{{Store.Name}}</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Customer.NewOrderNote",
+ Subject = "{{Store.Name}}. New order note has been added",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}}, <br />\r\nNew order note has been added to your account:<br />\r\n\"{{Order.NewNoteText}}\".<br />\r\n<a target=\"_blank\" href=\"{{Order.OrderURLForCustomer}}\">{{Order.OrderURLForCustomer}}</a></p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Customer.NewCustomerNote",
+ Subject = "New customer note has been added",
+ Body =
+ "<p><br />\r\nHello {{Customer.FullName}}, <br />\r\nNew customer note has been added to your account:<br />\r\n\"{{Customer.NewTitleText}}\".<br />\r\n</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Customer.NewMerchandiseReturnNote",
+ Subject = "{{Store.Name}}. New merchandise return note has been added",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Customer.FullName}},<br />\r\nYour merchandise return #{{MerchandiseReturn.ReturnNumber}} has a new note.</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderPlaced.VendorNotification",
+ Subject = "{{Store.Name}}. Order placed",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Customer.FullName}} ({{Customer.Email}}) has just placed an order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n" +
+ OrderVendorProducts + "</p>",
+ //this template is disabled by default
+ IsActive = false,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderPaid.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} paid",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nOrder #{{Order.OrderNumber}} has been just paid<br />\r\nDate Ordered: {{Order.CreatedOn}}</p>",
+ //this template is disabled by default
+ IsActive = false,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderPaid.CustomerNotification",
+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} paid",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nThanks for buying from <a href=\"{{Store.URL}}\">{{Store.Name}}</a>. Order #{{Order.OrderNumber}} has been just paid. Below is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" +
+ OrderProducts + "</p>",
+ //this template is disabled by default
+ IsActive = false,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderPaid.VendorNotification",
+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} paid",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nOrder #{{Order.OrderNumber}} has been just paid. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n" +
+ OrderVendorProducts + "</p>",
+ //this template is disabled by default
+ IsActive = false,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderRefunded.CustomerNotification",
+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} refunded",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nHello {{Order.CustomerFullName}}, <br />\r\nThanks for buying from <a href=\"{{Store.URL}}\">{{Store.Name}}</a>. Order #{{Order.OrderNumber}} has been has been refunded. Please allow 7-14 days for the refund to be reflected in your account.<br />\r\n<br />\r\nAmount refunded: {{Order.AmountRefunded}}<br />\r\n<br />\r\nBelow is the summary of the order. <br />\r\n<br />\r\nOrder Number: {{Order.OrderNumber}}<br />\r\nOrder Details: <a href=\"{{Order.OrderURLForCustomer}}\" target=\"_blank\">{{Order.OrderURLForCustomer}}</a><br />\r\nDate Ordered: {{Order.CreatedOn}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nBilling Address<br />\r\n{{Order.BillingFirstName}} {{Order.BillingLastName}}<br />\r\n{{Order.BillingAddress1}}<br />\r\n{{Order.BillingCity}} {{Order.BillingZipPostalCode}}<br />\r\n{{Order.BillingStateProvince}} {{Order.BillingCountry}}<br />\r\n<br />\r\n<br />\r\n<br />\r\nShipping Address<br />\r\n{{Order.ShippingFirstName}} {{Order.ShippingLastName}}<br />\r\n{{Order.ShippingAddress1}}<br />\r\n{{Order.ShippingCity}} {{Order.ShippingZipPostalCode}}<br />\r\n{{Order.ShippingStateProvince}} {{Order.ShippingCountry}}<br />\r\n<br />\r\nShipping Method: {{Order.ShippingMethod}}<br />\r\n<br />\r\n" +
+ OrderProducts + "</p>",
+ //this template is disabled by default
+ IsActive = false,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "OrderRefunded.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. Order #{{Order.OrderNumber}} refunded",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nOrder #{{Order.OrderNumber}} has been just refunded<br />\r\n<br />\r\nAmount refunded: {{Order.AmountRefunded}}<br />\r\n<br />\r\nDate Ordered: {{Order.CreatedOn}}</p>",
+ //this template is disabled by default
+ IsActive = false,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "VendorAccountApply.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. New vendor account submitted.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Customer.FullName}} ({{Customer.Email}}) has just submitted for a vendor account. Details are below:<br />\r\nVendor name: {{Vendor.Name}}<br />\r\nVendor email: {{Vendor.Email}}<br />\r\n<br />\r\nYou can activate it in admin area.</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "Vendor.VendorReview",
+ Subject = "{{Store.Name}}. New vendor review.",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\nA new vendor review has been written.</p>",
+ IsActive = true,
+ EmailAccountId = eaGeneral.Id
+ },
+ new() {
+ Name = "VendorInformationChange.StoreOwnerNotification",
+ Subject = "{{Store.Name}}. Vendor {{Vendor.Name}} changed provided information",
+ Body =
+ "<p><a href=\"{{Store.URL}}\">{{Store.Name}}</a> <br />\r\n<br />\r\n{{Vendor.Name}} changed provided information.</p>",
+ IsActive = false,
+ EmailAccountId = eaGeneral.Id
+ }
+ };
+
+ messageTemplates.ForEach(x => _messageTemplateRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataNews.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataNews.cs
new file mode 100644
index 000000000..7bb80669c
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataNews.cs
@@ -0,0 +1,57 @@
+using Grand.Domain.News;
+using Grand.Domain.Seo;
+using Grand.Module.Installer.Extensions;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallNews()
+ {
+ var defaultLanguage = _languageRepository.Table.FirstOrDefault();
+ var news = new List<NewsItem> {
+ new() {
+ AllowComments = false,
+ Title = "About Grandnode",
+ Short =
+ "It's stable and highly usable. From downloads to documentation, www.grandnode.com offers a comprehensive base of information, resources, and support to the grandnode community.",
+ Full =
+ "<p>For full feature list go to <a href=\"https://grandnode.com\">grandnode.com</a></p><p>Providing outstanding custom search engine optimization, web development services and e-commerce development solutions to our clients at a fair price in a professional manner.</p>",
+ Published = true
+ },
+ new() {
+ AllowComments = false,
+ Title = "Grandnode new release!",
+ Short =
+ "grandnode includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included! grandnode is a fully customizable shopping cart",
+ Full =
+ "<p>Grandnode includes everything you need to begin your e-commerce online store. We have thought of everything and it's all included!</p>",
+ Published = true
+ },
+ new() {
+ AllowComments = false,
+ Title = "New online store is open!",
+ Short =
+ "The new grandnode store is open now! We are very excited to offer our new range of products. We will be constantly adding to our range so please register on our site.",
+ Full =
+ "<p>Our online store is officially up and running. Stock up for the holiday season! We have a great selection of items. We will be constantly adding to our range so please register on our site, this will enable you to keep up to date with any new products.</p><p>All shipping is worldwide and will leave the same day an order is placed! Happy Shopping and spread the word!!</p>",
+ Published = true
+ }
+ };
+ news.ForEach(x => _newsItemRepository.Insert(x));
+
+ //search engine names
+ foreach (var newsItem in news)
+ {
+ newsItem.SeName = SeoExtensions.GenerateSlug(newsItem.Title, false, false, false);
+ await _entityUrlRepository.InsertAsync(new EntityUrl {
+ EntityId = newsItem.Id,
+ EntityName = "NewsItem",
+ LanguageId = "",
+ IsActive = true,
+ Slug = newsItem.SeName
+ });
+ await _newsItemRepository.UpdateAsync(newsItem);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataOrderStatus.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataOrderStatus.cs
new file mode 100644
index 000000000..dc79125d5
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataOrderStatus.cs
@@ -0,0 +1,38 @@
+using Grand.Domain.Orders;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallOrderStatus()
+ {
+ var statuses = new List<OrderStatus> {
+ new() {
+ IsSystem = true,
+ StatusId = 10,
+ Name = "Pending",
+ DisplayOrder = 0
+ },
+ new() {
+ IsSystem = true,
+ StatusId = 20,
+ Name = "Processing",
+ DisplayOrder = 1
+ },
+ new() {
+ IsSystem = true,
+ StatusId = 30,
+ Name = "Complete",
+ DisplayOrder = 2
+ },
+ new() {
+ IsSystem = true,
+ StatusId = 40,
+ Name = "Cancelled",
+ DisplayOrder = 3
+ }
+ };
+ statuses.ForEach(x => _orderStatusRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataOrderTags.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataOrderTags.cs
new file mode 100644
index 000000000..f413bf0ec
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataOrderTags.cs
@@ -0,0 +1,27 @@
+using Grand.Domain.Orders;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallOrderTags()
+ {
+ var coolTag = new OrderTag {
+ Name = "cool",
+ Count = 0
+ };
+ await _orderTagRepository.InsertAsync(coolTag);
+
+ var newTag = new OrderTag {
+ Name = "new",
+ Count = 0
+ };
+ await _orderTagRepository.InsertAsync(newTag);
+
+ var oldTag = new OrderTag {
+ Name = "old",
+ Count = 0
+ };
+ await _orderTagRepository.InsertAsync(oldTag);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataPageLayouts.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataPageLayouts.cs
new file mode 100644
index 000000000..cf1c176e6
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataPageLayouts.cs
@@ -0,0 +1,19 @@
+using Grand.Domain.Pages;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallPageLayouts()
+ {
+ var pageLayouts = new List<PageLayout> {
+ new() {
+ Name = "Default layout",
+ ViewPath = "PageDetails",
+ DisplayOrder = 1
+ }
+ };
+ pageLayouts.ForEach(x => _pageLayoutRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataPages.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataPages.cs
new file mode 100644
index 000000000..3d38c0a85
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataPages.cs
@@ -0,0 +1,185 @@
+using Grand.Domain.Pages;
+using Grand.Domain.Seo;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallPages()
+ {
+ var defaultPageLayout =
+ _pageLayoutRepository.Table.FirstOrDefault(tt => tt.Name == "Default layout");
+ if (defaultPageLayout == null)
+ throw new Exception("Page layout cannot be loaded");
+
+ var pages = new List<Page> {
+ new() {
+ SystemName = "AboutUs",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ IncludeInFooterRow1 = true,
+ DisplayOrder = 20,
+ Title = "About us",
+ Body = "<p>Put your &quot;About Us&quot; information here. You can edit this in the admin site.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "CheckoutAsGuestOrRegister",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "",
+ Body =
+ "<p><strong>Register and save time!</strong><br />Register with us for future convenience:</p><ul><li>Fast and easy check out</li><li>Easy access to your order history and status</li></ul>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "ConditionsOfUse",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ IncludeInFooterRow1 = true,
+ DisplayOrder = 15,
+ Title = "Conditions of Use",
+ Body = "<p>Put your conditions of use information here. You can edit this in the admin site.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "ContactUs",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "",
+ Body = "<p>Put your contact information here. You can edit this in the admin site.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "HomePageText",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "Welcome to our store",
+ Body =
+ "<p>Online shopping is the process consumers go through to purchase products or services over the Internet. You can edit this in the admin site.</p><p>If you have questions, see the <a href=\"https://grandnode.com/\">Documentation</a>, or post in the <a href=\"http://www.grandnode.com/boards/\">Forums</a> at <a href=\"http://www.grandnode.com\">grandnode.com</a></p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "LoginRegistrationInfo",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "About login / registration",
+ Body = "<p>Put your login / registration information here. You can edit this in the admin site.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "PrivacyInfo",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ IncludeInFooterRow1 = true,
+ DisplayOrder = 10,
+ Title = "Privacy notice",
+ Body = "<p>Put your privacy policy information here. You can edit this in the admin site.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "AccessDenied",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "",
+ Body = "<p><strong>Access to the page is denied .</strong></p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "PageNotFound",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "",
+ Body =
+ "<p><strong>The page you requested was not found, and we have a fine guess why.</strong></p><ul><li>If you typed the URL directly, please make sure the spelling is correct.</li><li>The page longer exists. In this case, we profusely apologize for the inconvenience and for any damage this may cause.</li></ul>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "ShippingInfo",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ IncludeInFooterRow1 = true,
+ DisplayOrder = 5,
+ Title = "Shipping & returns",
+ Body = "<p>Put your shipping &amp; returns information here. You can edit this in the admin site.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "ApplyVendor",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "",
+ Body =
+ "<p>Provide information about the application process for creating a seller (vendor) account. You can edit this in the admin panel.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "VendorTermsOfService",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "",
+ Body = "<p>Put your terms of service information here. You can edit this in the admin site.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "KnowledgebaseHomePage",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "",
+ Body = "<p>Knowledgebase homepage. You can edit this in the admin site.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ },
+ new() {
+ SystemName = "VendorPortalInfo",
+ IncludeInSitemap = false,
+ IsPasswordProtected = false,
+ DisplayOrder = 1,
+ Title = "Welcome to our Vendor Management Hub!",
+ Body =
+ "<p>Manage your product catalog, oversee customer orders, and streamline your shipping processes. Your vendor dashboard is the command center for your success. Stay organized, serve your customers efficiently, and watch your business thrive.</p>",
+ PageLayoutId = defaultPageLayout.Id,
+ Published = true
+ }
+ };
+ pages.ForEach(x => _pageRepository.Insert(x));
+
+ var lpages = from p in _pageRepository.Table
+ select p;
+ //search engine names
+ foreach (var page in lpages)
+ {
+ var seName = page.SystemName.ToLowerInvariant();
+ await _entityUrlRepository.InsertAsync(new EntityUrl {
+ EntityId = page.Id,
+ EntityName = "Page",
+ LanguageId = "",
+ IsActive = true,
+ Slug = seName
+ });
+ page.SeName = seName;
+ await _pageRepository.UpdateAsync(page);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataPermissions.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataPermissions.cs
new file mode 100644
index 000000000..2135d0344
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataPermissions.cs
@@ -0,0 +1,54 @@
+using Grand.Domain.Localization;
+using Grand.Domain.Permissions;
+using Grand.Module.Installer.Extensions;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallPermissions()
+ {
+ var permissions = PermissionExtensions.Permissions();
+ foreach (var permission in permissions)
+ {
+ var permission1 = new Permission {
+ Name = permission.Name,
+ SystemName = permission.SystemName,
+ Area = permission.Area,
+ Category = permission.Category,
+ Actions = permission.Actions
+ };
+ //default customer group mappings
+ var defaultPermissions = PermissionExtensions.DefaultPermissions();
+
+ foreach (var defaultPermission in defaultPermissions)
+ {
+ var customerGroup = _customerGroupRepository.Table.FirstOrDefault(x => x.SystemName == defaultPermission.CustomerGroupSystemName);
+ var defaultMappingProvided = (from p in defaultPermission.Permissions
+ where p.SystemName == permission1.SystemName
+ select p).Any();
+
+ if (defaultMappingProvided) permission1.CustomerGroups.Add(customerGroup!.Id);
+ }
+ //save new permission
+ await _permissionRepository.InsertAsync(permission1);
+
+ //save localization
+ await SaveTranslationPermissionName(permission1);
+ }
+ }
+ private async Task SaveTranslationPermissionName(Permission permissionRecord)
+ {
+ var name = $"Permission.{permissionRecord.SystemName}";
+ var value = permissionRecord.Name;
+ foreach (var lang in _languageRepository.Table.ToList())
+ {
+ var lsr = new TranslationResource {
+ LanguageId = lang.Id,
+ Name = name,
+ Value = value
+ };
+ await _lsrRepository.InsertAsync(lsr);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataPickupPoints.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataPickupPoints.cs
new file mode 100644
index 000000000..015ff0990
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataPickupPoints.cs
@@ -0,0 +1,25 @@
+using Grand.Domain.Common;
+using Grand.Domain.Shipping;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallPickupPoints()
+ {
+ var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");
+ var addresspoint = new Address {
+ Address1 = "21 West 52nd Street",
+ City = "New York",
+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,
+ CountryId = country?.Id,
+ ZipPostalCode = "10021"
+ };
+
+ var point = new PickupPoint {
+ Address = addresspoint,
+ Name = "My Store - New York"
+ };
+ await _pickupPointsRepository.InsertAsync(point);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataProductAttributes.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataProductAttributes.cs
new file mode 100644
index 000000000..90d850262
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataProductAttributes.cs
@@ -0,0 +1,46 @@
+using Grand.Domain.Catalog;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallProductAttributes()
+ {
+ var productAttributes = new List<ProductAttribute> {
+ new() {
+ Name = "Color",
+ SeName = "color"
+ },
+ new() {
+ Name = "Custom Text",
+ SeName = "custom-text"
+ },
+ new() {
+ Name = "HDD",
+ SeName = "hdd"
+ },
+ new() {
+ Name = "OS",
+ SeName = "os"
+ },
+ new() {
+ Name = "Processor",
+ SeName = "processor"
+ },
+ new() {
+ Name = "RAM",
+ SeName = "ram"
+ },
+ new() {
+ Name = "Size",
+ SeName = "size"
+ },
+ new() {
+ Name = "Software",
+ SeName = "software"
+ }
+ };
+ productAttributes.ForEach(x => _productAttributeRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataProductLayouts.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataProductLayouts.cs
new file mode 100644
index 000000000..fe286d418
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataProductLayouts.cs
@@ -0,0 +1,24 @@
+using Grand.Domain.Catalog;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallProductLayouts()
+ {
+ var productLayouts = new List<ProductLayout> {
+ new() {
+ Name = "Simple product",
+ ViewPath = "ProductLayout.Simple",
+ DisplayOrder = 10
+ },
+ new() {
+ Name = "Grouped product (with variants)",
+ ViewPath = "ProductLayout.Grouped",
+ DisplayOrder = 100
+ }
+ };
+ productLayouts.ForEach(x => _productLayoutRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataProducts.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataProducts.cs
new file mode 100644
index 000000000..573c80b7a
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataProducts.cs
@@ -0,0 +1,3670 @@
+using Grand.Domain.Blogs;
+using Grand.Domain.Catalog;
+using Grand.Domain.Common;
+using Grand.Domain.Media;
+using Grand.Domain.Seo;
+using Grand.Module.Installer.Extensions;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallProducts(string defaultUserEmail)
+ {
+ var productLayoutSimple = _productLayoutRepository.Table.FirstOrDefault(pt => pt.Name == "Simple product");
+ if (productLayoutSimple == null)
+ throw new Exception("Simple product layout could not be loaded");
+ var productLayoutGrouped =
+ _productLayoutRepository.Table.FirstOrDefault(pt => pt.Name == "Grouped product (with variants)");
+ if (productLayoutGrouped == null)
+ throw new Exception("Simple product layout could not be loaded");
+
+ //delivery date
+ var deliveryDate = _deliveryDateRepository.Table.FirstOrDefault();
+ if (deliveryDate == null)
+ throw new Exception("No default deliveryDate could be loaded");
+
+ //default customer/user
+ var defaultCustomer = _customerRepository.Table.FirstOrDefault(x => x.Email == defaultUserEmail);
+ if (defaultCustomer == null)
+ throw new Exception("Cannot load default customer");
+
+ //pictures
+ var sampleImagesPath = GetSamplesPath();
+
+ //downloads
+ var sampleDownloadsPath = GetSamplesPath();
+
+ //default store
+ var defaultStore = _storeRepository.Table.FirstOrDefault();
+ if (defaultStore == null)
+ throw new Exception("No default store could be loaded");
+
+ //products
+ var allProducts = new List<Product>();
+
+ #region Computers
+
+ var productBuildComputer = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Build your own computer",
+ ShortDescription = "Build it",
+ FullDescription =
+ "<p>Fight back against cluttered workspaces with the stylish DELL Inspiron desktop PC, featuring powerful computing resources and a stunning 20.1-inch widescreen display with stunning XBRITE-HiColor LCD technology. The black IBM zBC12 has a built-in microphone and MOTION EYE camera with face-tracking technology that allows for easy communication with friends and family. And it has a built-in DVD burner and Sony's Movie Store software so you can create a digital entertainment library for personal viewing at your convenience. Easy to setup and even easier to use, this JS-series All-in-One includes an elegantly designed keyboard and a USB mouse.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 1200,
+ IsShipEnabled = true,
+ IsFreeShipping = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ShowOnHomePage = true,
+ ProductAttributeMappings = {
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Processor").Id,
+ AttributeControlTypeId = AttributeControlType.DropdownList,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "2.2 GHz Intel Pentium Dual-Core E2200",
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "2.5 GHz Intel Pentium Dual-Core E2200",
+ IsPreSelected = true,
+ PriceAdjustment = 15,
+ DisplayOrder = 2
+ }
+ }
+ },
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "RAM").Id,
+ AttributeControlTypeId = AttributeControlType.DropdownList,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "2 GB",
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "4GB",
+ PriceAdjustment = 20,
+ DisplayOrder = 2
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "8GB",
+ PriceAdjustment = 60,
+ DisplayOrder = 3
+ }
+ }
+ },
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "HDD").Id,
+ AttributeControlTypeId = AttributeControlType.RadioList,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "320 GB",
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "400 GB",
+ PriceAdjustment = 100,
+ DisplayOrder = 2
+ }
+ }
+ },
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "OS").Id,
+ AttributeControlTypeId = AttributeControlType.RadioList,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Vista Home",
+ PriceAdjustment = 50,
+ IsPreSelected = true,
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Vista Premium",
+ PriceAdjustment = 60,
+ DisplayOrder = 2
+ }
+ }
+ },
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Software").Id,
+ AttributeControlTypeId = AttributeControlType.Checkboxes,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Microsoft Office",
+ PriceAdjustment = 50,
+ IsPreSelected = true,
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Acrobat Reader",
+ PriceAdjustment = 10,
+ DisplayOrder = 2
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Total Commander",
+ PriceAdjustment = 5,
+ DisplayOrder = 2
+ }
+ }
+ }
+ },
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productBuildComputer);
+
+ var picture1 = await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_desktop_1.png"),
+ "image/png", SeoExtensions.GenerateSlug(productBuildComputer.Name, true, false, false), reference: Reference.Product,
+ objectId: productBuildComputer.Id);
+ var picture2 = await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_desktop_2.png"),
+ "image/png", SeoExtensions.GenerateSlug(productBuildComputer.Name, true, false, false), reference: Reference.Product,
+ objectId: productBuildComputer.Id);
+
+ await _productRepository.InsertAsync(productBuildComputer);
+
+ var productpicture1 = new ProductPicture {
+ PictureId = picture1.Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ };
+ var productpicture2 = new ProductPicture {
+ PictureId = picture2.Id,
+ DisplayOrder = 1
+ };
+ productBuildComputer.ProductPictures.Add(productpicture1);
+ productBuildComputer.ProductPictures.Add(productpicture2);
+ await _productRepository.UpdateAsync(productBuildComputer);
+
+ var productSonyPS5Pad = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Playstation 5 Gamepad",
+ ShortDescription =
+ "The DualSense wireless controller for PS5 offers realistic touch effects2, adaptive 'Trigger' effects and a built-in microphone - all integrated into an iconic design.",
+ FullDescription =
+ "<p>The DualSense wireless controller for PS5 offers realistic touch effects2, adaptive 'Trigger' effects and a built-in microphone - all integrated into an iconic design.</p><p>Feel a physical reaction to your in-game actions thanks to dual actuators that replace traditional vibration motors. Such dynamic vibrations in your hands can simulate the tactile sensations of many things, from the world around you to the recoil of various weapons.</p><p>Enjoy intuitive motion controls for selected games thanks to the built-in accelerometer and gyroscope.</p><p>Chat with friends online using the built-in microphone or by plugging a headset into the 3.5mm jack. With the dedicated MUTE button you can disable voice recording.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 59,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+
+ allProducts.Add(productSonyPS5Pad);
+ productSonyPS5Pad.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_pad_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productSonyPS5Pad.Name), reference: Reference.Product,
+ objectId: productSonyPS5Pad.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productSonyPS5Pad.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_pad_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productSonyPS5Pad.Name), reference: Reference.Product,
+ objectId: productSonyPS5Pad.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productSonyPS5Pad);
+
+ var productLenovoIdeaPadDual = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Lenovo IdeaPad Dual 3i",
+ ShortDescription =
+ "Get dependable performance for work and play from the Dual 3i’s Intel® Pentium® processor, which gives you the ability to effortlessly multitask with multi-screen capabilities.",
+ FullDescription =
+ "<p>Get dependable performance for work and play from the Duet 3i’s Intel® Pentium® processor, which gives you the ability to effortlessly multitask with multi-screen capabilities, communicate easily with friends and family, and take all your favorite entertainment to go.</p><p>Work more freely on the elegant IdeaPad Duet 3i than on a regular laptop. The detachable Bluetooth keyboard allows you to easily switch between laptop and tablet modes, and the stand makes it easy to position your computer on any surface. The laptop runs on the power of an Intel® Pentium® processor, and the HD touchscreen, Dolby Audio ™ sound and optional LTE connectivity will keep you entertained anywhere.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 99,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Tablets").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productLenovoIdeaPadDual);
+ productLenovoIdeaPadDual.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_ideapad_dual_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLenovoIdeaPadDual.Name), reference: Reference.Product,
+ objectId: productLenovoIdeaPadDual.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productLenovoIdeaPadDual.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_ideapad_dual_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLenovoIdeaPadDual.Name), reference: Reference.Product,
+ objectId: productLenovoIdeaPadDual.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productLenovoIdeaPadDual);
+
+ #endregion
+
+ #region Notebooks
+
+ var productMiNotebook = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Mi Notebook 14",
+ ShortDescription =
+ "Designed with utmost patience and craftsmanship, the Mi NoteBook 14 is so beautiful that you can't help but notice it. Weighing just 1.5kg, the sleek unibody metal chassis and an anodized sandblasted coating makes your device sturdy and gives it a svelte look.",
+ FullDescription =
+ "<p>Designed with utmost patience and craftsmanship, the Mi NoteBook 14 is so beautiful that you can't help but notice it. Weighing just 1.5kg, the sleek unibody metal chassis and an anodized sandblasted coating makes your device sturdy and gives it a slim look.</p><p>With the power-efficient NVIDIA® GeForce® MX250 graphics, now enjoy incredible HD photo and video editing, faster and smoother gaming. The powerful graphics engine and next-gen technologies gives you performance you desire.</p><p>The Mi Notebook 14 offers great clock speeds at 2666MHz, and thus makes you say goodbye to slow and insufficient memory. This helps you multi-task with your favorite editing/productivity tools and casual games.</p><p>Comes with a wider air intake area of 2530mm² and a large diameter fan which brings excellent cooling to the whole machine. This keeps your machine cool so that you can hold onto yours. The maximum sound of the fan is a mere 37 dB even when the system is loaded to its max.</p><p>Based on the scissor mechanism, the keys have ABS texture and a travel distance of 1.3mm which makes typing a lot more comfortable and low-profile on this device. The in-built dust protection layer is also an excellent addition.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 1800,
+ OldPrice = 2000,
+ IsShipEnabled = true,
+ IsFreeShipping = true,
+ Weight = 3,
+ Length = 3,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ShowOnHomePage = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,
+ DisplayOrder = 1
+ }
+ },
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,
+ ProductSpecificationAttributes = {
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 1,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "13.0''").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 2,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "Intel Core i5").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 3,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "4 GB").Id
+ }
+ }
+ };
+ allProducts.Add(productMiNotebook);
+ productMiNotebook.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_mi_notebook_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productMiNotebook.Name), reference: Reference.Product,
+ objectId: productMiNotebook.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productMiNotebook.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_mi_notebook_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productMiNotebook.Name), reference: Reference.Product,
+ objectId: productMiNotebook.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productMiNotebook);
+
+
+ var productLenovoLegionY740 = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Lenovo Legion Y740",
+ ShortDescription =
+ "The 17.3 ”Y740 Legion is a gaming masterpiece. You will be immersed in the action thanks to best-in-class Corsair iCUE lighting and Dolby realistic image and surround sound technologies.",
+ FullDescription =
+ "<p>The 17.3 ”Y740 Legion is a gaming masterpiece. You will be immersed in the action thanks to best-in-class Corsair iCUE lighting and Dolby realistic image and surround sound technologies. Check out what the Lenovo Legion Y740 looks like in reality.Grab the photo below and drag it left or right to rotate the product, or use the navigation buttons.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 1500,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,
+ DisplayOrder = 1
+ }
+ },
+ ProductSpecificationAttributes = {
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 1,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "15.6''").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 2,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "Intel Core i7").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 3,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "16 GB").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 4,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "1 TB").Id
+ }
+ }
+ };
+ allProducts.Add(productLenovoLegionY740);
+ productLenovoLegionY740.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_legion_y740_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLenovoLegionY740.Name), reference: Reference.Product,
+ objectId: productLenovoLegionY740.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productLenovoLegionY740.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_legion_y740_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLenovoLegionY740.Name), reference: Reference.Product,
+ objectId: productLenovoLegionY740.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productLenovoLegionY740);
+
+
+ var productPs5Camera = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Playstation 5 Camera",
+ ShortDescription =
+ "Use the new Sony HD Camera for PlayStation 5 to show other players your reactions during the game.",
+ FullDescription =
+ "<p>Use the new Sony HD Camera for PlayStation 5 to show other players your reactions during the game. Equipped with two lenses, the camera can record images in 1080p quality and works seamlessly with the PS5 background removal tools. They put you in the spotlight of viewers. In addition, the camera has been equipped with a stand that makes it easy to mount it above or below the TV.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 150,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,
+ DisplayOrder = 1
+ }
+ },
+ ProductSpecificationAttributes = {
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 1,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "15.0''").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 2,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "Intel Core i5").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 3,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "8 GB").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 4,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "128 GB").Id
+ }
+ }
+ };
+ allProducts.Add(productPs5Camera);
+ productPs5Camera.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_ps5_camera_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productPs5Camera.Name), reference: Reference.Product,
+ objectId: productPs5Camera.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productPs5Camera.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_ps5_camera_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productPs5Camera.Name), reference: Reference.Product,
+ objectId: productPs5Camera.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productPs5Camera);
+
+ var productAcerNitro = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Acer Nitro 5",
+ ShortDescription =
+ "Experience a new dimension of gameplay with the Acer Nitro 5 laptop. Equipped with a powerful Intel Core i5 processor and GTX1050 graphics card, it is able to cope with even the most demanding tasks.",
+ FullDescription =
+ "<p>Experience a new dimension of gameplay with the Acer Nitro 5 laptop. Equipped with a powerful Intel Core i5 processor and GTX1050 graphics card, it is able to cope with even the most demanding tasks. Additionally, the matrix in IPS technology will ensure high quality of the displayed image, good color reproduction and wide viewing angles. The Acer Nitro 5 laptop is the perfect choice for both gaming and work. Dominate the virtual battlefield with the GeForce GTX 1050 graphics card, featuring the groundbreaking NVIDIA Pascal architecture. Excellent performance, innovative gaming technologies and support for DirectX 12 libraries will allow you to immerse yourself in phenomenal 4K resolution, enriched with HDR mode, or play in an amazingly realistic VR scenery. Every time without cuts or delays, every time on high details. Play the latest, most challenging games the way they deserve.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 1350,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,
+ DisplayOrder = 1
+ }
+ },
+ ProductSpecificationAttributes = {
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 1,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "13.3''").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 2,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "Intel Core i5").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 3,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "4 GB").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 4,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "128 GB").Id
+ }
+ }
+ };
+ allProducts.Add(productAcerNitro);
+ productAcerNitro.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_acer_nitro_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAcerNitro.Name), reference: Reference.Product,
+ objectId: productAcerNitro.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productAcerNitro.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_acer_nitro_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAcerNitro.Name), reference: Reference.Product,
+ objectId: productAcerNitro.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productAcerNitro);
+
+
+ var productDellG5 = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Dell Inspiron G5",
+ ShortDescription =
+ "The Dell Inspiron G5 is a 15-inch gaming notebook with fantastic graphics capabilities, thanks to the NVIDIA® GeForce® GTX 1060 Max-Q graphics card, the latest 8th generation Intel® Core ™ i7 hexa-core processor and efficient DDR4 2666MHz RAM memory. The Inspiron G5 is designed specifically with the specific, demanding needs of gaming enthusiasts in mind.",
+ FullDescription =
+ "The Dell Inspiron G5 is a 15-inch gaming notebook with fantastic graphics capabilities, thanks to the NVIDIA® GeForce® GTX 1060 Max-Q graphics card, the latest 8th generation Intel® Core ™ i7 hexa-core processor and efficient DDR4 2666MHz RAM memory. The Inspiron G5 is designed specifically with the specific, demanding needs of gaming enthusiasts in mind.</p><p>The enormous performance, speed and dynamics of the eighth generation Intel Core i7 Coffee Lake processor is a guarantee of the highest performance in gaming and smooth operation with advanced applications. When more power is needed, Turbo Boost 2.0 technology intelligently speeds up the clock speed, unleashing the maximum potential of each CPU core. In addition, the unit flawlessly supports the highest definition video as well as spherical videos, while ensuring the security of transactions concluded on the network.</p><p>Play the latest, most demanding games with GeForce GTX 1060 Max-Q. Pull the sliders to the maximum and admire virtual worlds in 4K quality, enriched with HDR mode and DirectX 12 functions. All this with excellent smoothness of the image, without lag and clipping, thanks to the breakthrough architecture of Pascal GPU, packed with technologies for players.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 1460,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,
+ DisplayOrder = 1
+ }
+ },
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Dell").Id,
+ ProductSpecificationAttributes = {
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 1,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "15.6''").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 2,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "Intel Core i7").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 3,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Memory").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Memory").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "8 GB").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 4,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Hardrive").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Hardrive").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "500 GB").Id
+ }
+ }
+ };
+ allProducts.Add(productDellG5);
+ productDellG5.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_dell_g5_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productDellG5.Name), reference: Reference.Product,
+ objectId: productDellG5.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productDellG5.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_dell_g5_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productDellG5.Name), reference: Reference.Product,
+ objectId: productDellG5.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productDellG5);
+
+
+ var productDellXPS = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Dell XPS",
+ ShortDescription =
+ "Dell laptop with a screen size of 13.4 inches and a resolution of 1920 x 1200 pixels. It is equipped with an Intel Core i7-1065G7 processor with a clock frequency of 1.3 - 3.9 GHz, DDR4 RAM memory with a size of 16 GB. 1000 GB SSD hard drive. Intel HD Graphics.",
+ FullDescription =
+ "<p>Dell laptop with a screen size of 13.4 inches and a resolution of 1920 x 1200 pixels. It is equipped with an Intel Core i7-1065G7 processor with a clock frequency of 1.3 - 3.9 GHz, DDR4 RAM memory with a size of 16 GB. 1000 GB SSD hard drive. Intel HD Graphics. Graphics card size shared with RA, integrated. The installed operating system is Windows 10 Home.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 1360,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Notebooks").Id,
+ DisplayOrder = 1
+ }
+ },
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Dell").Id,
+ ProductSpecificationAttributes = {
+ new ProductSpecificationAttribute {
+ AllowFiltering = false,
+ ShowOnProductPage = true,
+ DisplayOrder = 1,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "Screensize").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "Screensize").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "14.0''").Id
+ },
+ new ProductSpecificationAttribute {
+ AllowFiltering = true,
+ ShowOnProductPage = true,
+ DisplayOrder = 2,
+ SpecificationAttributeId =
+ _specificationAttributeRepository.Table.Single(sa => sa.Name == "CPU Type").Id,
+ SpecificationAttributeOptionId = _specificationAttributeRepository.Table
+ .Single(sa => sa.Name == "CPU Type").SpecificationAttributeOptions
+ .Single(sao => sao.Name == "Intel Core i7").Id
+ }
+ }
+ };
+ allProducts.Add(productDellXPS);
+ productDellXPS.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_dell_xps_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productDellXPS.Name), reference: Reference.Product,
+ objectId: productDellXPS.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productDellXPS.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_dell_xps_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productDellXPS.Name), reference: Reference.Product,
+ objectId: productDellXPS.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productDellXPS);
+
+ #endregion
+
+ #region Accessories
+
+ var productLenovoYogaDuet = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Lenovo Yoga Duet",
+ ShortDescription =
+ "The adjustable stand allows for more convenient and effective work, sketching or taking notes in laptop mode or at a lower angle. The detachable Bluetooth® keyboard allows you to write and look at the screen with even more freedom.",
+ FullDescription =
+ "<p>Weighing just 1.16 kg, the Yoga Duet 7i is light and versatile enough to be used anywhere. The adjustable stand allows for more convenient and effective work, sketching or taking notes in laptop mode or at a lower angle. The detachable Bluetooth® keyboard allows you to write and look at the screen with even more freedom.</p><p>The Yoga Duet 7i is an advanced mobile device that is not only intuitive to use and easily personalized, but also uncompromisingly efficient. How is this possible? Powered by the 10th Gen Intel® Core ™ processor and artificial intelligence features that dynamically adjust power to optimize battery life. So it works for up to 10.8 hours on a single charge. It also has USB-C ports for faster charging.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 75,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Tablets").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productLenovoYogaDuet);
+ productLenovoYogaDuet.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_yoga_duet_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLenovoYogaDuet.Name), reference: Reference.Product,
+ objectId: productLenovoYogaDuet.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productLenovoYogaDuet.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_yoga_duet_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLenovoYogaDuet.Name), reference: Reference.Product,
+ objectId: productLenovoYogaDuet.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productLenovoYogaDuet);
+
+
+ var productLenovoSmartTab = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Lenovo Smart Tab",
+ ShortDescription = "The most versatile entertainment tablet now can do even more.",
+ FullDescription =
+ "<p>The most versatile entertainment tablet now can do even more. Lenovo Yoga Smart Tab with Google Assistant is a development of the groundbreaking Yoga Tab 3 with a stand for working in various modes. This tablet offers high-end entertainment features such as an IPS display with FHD resolution and two JBL® stereo speakers. Additionally, it also acts as a digital home control center. The built-in LTE modem ensures permanent access to the Internet.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 65,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Tablets").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productLenovoSmartTab);
+ productLenovoSmartTab.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_smart_tab_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLenovoSmartTab.Name), reference: Reference.Product,
+ objectId: productLenovoSmartTab.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productLenovoSmartTab.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lenovo_smart_tab_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLenovoSmartTab.Name), reference: Reference.Product,
+ objectId: productLenovoSmartTab.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productLenovoSmartTab);
+
+
+ var productAsusMixedReality = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Asus Mixed Reality",
+ ShortDescription = "Explore exciting new virtual worlds with the ASUS Windows Mixed Reality Headset!",
+ FullDescription =
+ "<p>Explore exciting new virtual worlds with the ASUS Windows Mixed Reality Headset! It features a unique and beautiful 3D-pattern aesthetic and a comfy weight-balanced design with premium antibacterial cushioned materials, so it’s not only stylish but also supremely cool and comfortable for extended periods of exploring. Unlike other headsets, the ASUS Windows Mixed Reality Headset doesn’t need any external sensors, making initial set up super easy — you’ll be ready to play in 10 minutes or less*! It’s the revolutionary, easy-to-use and affordable way to explore your imagination.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 399,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Display").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productAsusMixedReality);
+ productAsusMixedReality.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_asus_mixed_reality_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAsusMixedReality.Name), reference: Reference.Product,
+ objectId: productAsusMixedReality.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productAsusMixedReality.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_asus_mixed_reality_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAsusMixedReality.Name), reference: Reference.Product,
+ objectId: productAsusMixedReality.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productAsusMixedReality);
+
+ #endregion
+
+ #region Display
+
+ var productAcerProjector = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Acer Projector C250",
+ ShortDescription =
+ "Auto-Portrait Technology Now the projector image can rotate automatically, just like on your phone!",
+ FullDescription =
+ "<p>Auto-Portrait Technology Now the projector image can rotate automatically, just like on your phone! Equipped with Auto-Portrait technology, the C250i is the first model to be able to rotate the projected image in real time. There is no need to customize settings or content. Simply place the image vertically and the Acer C250i projector will remove intrusive black stripes by itself when you activate this mode. No stand, projecting from any angle The projector can be easily taken anywhere. The exclusive design does not take up much space and allows a 360-degree projection from any angle without using the stand. FHD Resolutions A beautiful 100-inch 1080p Full HD picture looks almost as realistic as the view from the window.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 530,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Display").Id,
+ DisplayOrder = 3
+ }
+ }
+ };
+ allProducts.Add(productAcerProjector);
+ productAcerProjector.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_acer_projector_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAcerProjector.Name), reference: Reference.Product,
+ objectId: productAcerProjector.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productAcerProjector.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_acer_projector_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAcerProjector.Name), reference: Reference.Product,
+ objectId: productAcerProjector.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productAcerProjector);
+
+
+ var productAcerMonitor = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Acer Nitro XZ2",
+ ShortDescription =
+ "Eliminate choppy gameplay and distracting visual tear with AMD Radeon FreeSync™1. Savor the smooth, responsive visuals as the monitor’s refresh rate is synched to your computer’s framerate.",
+ FullDescription =
+ "<p>Eliminate choppy gameplay and distracting visual tear with AMD Radeon FreeSync™1. Savor the smooth, responsive visuals as the monitor’s refresh rate is synched to your computer’s framerate.</p><p>Enjoy seamless, lag-free gaming with a blazingly fast 165Hz2 refresh rate. To keep pace with the action, the rapid 4ms response time provides clearer, more immersive images.</p><p>Take your gameplay to the next level with improved color accuracy and contrast guaranteed by this VESA Certified DisplayHDR™ 400 monitor. This industry standard specifies HDR quality, including luminance, color gamut, bit depth, and rise time.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 1300,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Display").Id,
+ DisplayOrder = 2
+ }
+ }
+ };
+ allProducts.Add(productAcerMonitor);
+ productAcerMonitor.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_acer_monitor_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAcerMonitor.Name), reference: Reference.Product,
+ objectId: productAcerMonitor.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productAcerMonitor.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_acer_monitor_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAcerMonitor.Name), reference: Reference.Product,
+ objectId: productAcerMonitor.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productAcerMonitor);
+
+ #endregion
+
+ #region Smartphone
+
+ var productRedmiK30 = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Redmi K30 Ultra",
+ ShortDescription =
+ "Redmi K30 Ultra will be equipped with top-class components. The smartphone is to debut on the market with a screen made in IPS LCD technology with a maximum refresh rate of 144 Hz, which guarantees smooth scrolling and perfect sharpness in movies and video games. It is worth noting that until now, displays of this type have been reserved exclusively for high-end gaming smartphones. The heart of the latest Redmi will be the MediaTek Dimensity 1000+ processor.",
+ FullDescription =
+ "<p>Redmi K30 Ultra equipped with top-class components. The smartphone debut on the market with a screen made in IPS LCD technology with a maximum refresh rate of 144 Hz, which guarantees smooth scrolling and perfect sharpness in movies and video games. It is worth noting that until now, displays of this type have been reserved exclusively for high-end gaming smartphones. The heart of the latest Redmi will be the MediaTek Dimensity 1000+ processor. It is the collection's flagship chip offering eight cores, support for 5G connectivity and support for up to 16 GB RAM.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ Flag = "New",
+ AllowCustomerReviews = true,
+ Price = 199,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ShowOnHomePage = true,
+ MarkAsNew = true,
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartphones").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productRedmiK30);
+ productRedmiK30.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_Redmi_K30.png"), "image/png",
+ SeoExtensions.GenerateSlug(productRedmiK30.Name), reference: Reference.Product,
+ objectId: productRedmiK30.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productRedmiK30);
+
+
+ var productRedmiNote9 = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Redmi Note 9",
+ ShortDescription =
+ "Redmi Note 9 is equipped with a high-performance octa-core processor with a maximum clock frequency of 2.0 GHz. The maximum GPU frequency of 1.0GHz ensures better performance and thus offers a smooth gaming experience.",
+ FullDescription =
+ "<p>Redmi Note 9 is equipped with a high-performance octa-core processor with a maximum clock frequency of 2.0 GHz. The maximum GPU frequency of 1.0GHz ensures better performance and thus offers a smooth gaming experience.</p><p>Thanks to the improved 5020mAh battery, you can enjoy long work on a single charge. In combination with the 18W fast charge, you will get excellent results and charge the battery in no time.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 249,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartphones").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productRedmiNote9);
+ productRedmiNote9.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_Redmi_Note_9_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productRedmiNote9.Name), reference: Reference.Product,
+ objectId: productRedmiNote9.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productRedmiNote9.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_Redmi_Note_9_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productRedmiNote9.Name), reference: Reference.Product,
+ objectId: productRedmiNote9.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productRedmiNote9);
+
+
+ var productPocoF2Pro = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "POCO F2 Pro",
+ ShortDescription =
+ "The speed demon is now even better. Powered by an octa-core trifecta processor with a liquid cooling system, it provides a perfect working experience. Quad Camera with Pro Mode support.",
+ FullDescription =
+ "<p>The speed demon is now even better. Powered by an octa-core trifecta processor with a liquid cooling system, it provides a perfect working experience. Quad Camera with Pro Mode support.</p><p>The technology of execution in 7nm provides a 25% increase in performance, improving the smoothness of graphics rendering, while significantly reducing energy consumption. Kryo 585 ™ processor | Adreno 650 ™ graphics processor</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 299,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartphones").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productPocoF2Pro);
+ productPocoF2Pro.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_POCO_F2_Pro.png"), "image/png",
+ SeoExtensions.GenerateSlug(productPocoF2Pro.Name), reference: Reference.Product,
+ objectId: productPocoF2Pro.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productPocoF2Pro);
+
+ #endregion
+
+ #region Others
+
+ var productMiSmartBand = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Mi Smart Band 3i",
+ ShortDescription =
+ "<b>Mi Smart Band 3i:</b> Ignite your fitness journey with water resistant smart watch. Intuitive and Easy to View with large 0.78 inch OLED touch display. Get moving with the Fit App. Activity tracker and sleep tracker included.",
+ FullDescription =
+ "<p><b>Mi Smart Band 3i:</b> Ignite your fitness journey with water resistant smart watch. Intuitive and Easy to View with large 0.78 inch OLED touch display. Get moving with the Fit App. Activity tracker and sleep tracker included.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 79.99,
+ IsShipEnabled = true,
+ IsFreeShipping = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ MarkAsNew = true,
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,
+ TierPrices = {
+ new TierPrice {
+ Quantity = 2,
+ Price = 19,
+ StartDateTimeUtc = DateTime.UtcNow,
+ EndDateTimeUtc = null
+ },
+ new TierPrice {
+ Quantity = 5,
+ Price = 17
+ },
+ new TierPrice {
+ Quantity = 10,
+ Price = 15
+ }
+ },
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productMiSmartBand);
+ productMiSmartBand.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_Mi_Smart_Band_3i_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productMiSmartBand.Name), reference: Reference.Product,
+ objectId: productMiSmartBand.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productMiSmartBand.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_Mi_Smart_Band_3i_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productMiSmartBand.Name), reference: Reference.Product,
+ objectId: productMiSmartBand.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productMiSmartBand);
+
+
+ var productPs4 = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Playstation 4 Slim",
+ ShortDescription =
+ "Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4™.",
+ FullDescription =
+ "<p>Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4 ™.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 39,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productPs4);
+ productPs4.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ps4_1.png"),
+ "image/png", SeoExtensions.GenerateSlug(productPs4.Name), reference: Reference.Product,
+ objectId: productPs4.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productPs4.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_ps4_2.png"),
+ "image/png", SeoExtensions.GenerateSlug(productPs4.Name), reference: Reference.Product,
+ objectId: productPs4.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productPs4);
+
+
+ var productMiBeard = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Xiaomi Mi Beard",
+ ShortDescription =
+ "Rounded blades for skin - friendly performance. Advanced self - sharpening. When in a rush, simply plug in the cord and get trimming. IPX7 fully-washable body The whole body is hydro - resistant and fully washable for your convenience.Comes with detachable head.",
+ FullDescription =
+ "<p>Rounded blades for skin - friendly performance. Advanced self - sharpening. With 2 combs that can go between 0.5mm and 20mm, this trimmer will perfectly sculpt your beard.Precision is at its finest with 6000 oscillations per min delivering accurate cuts and even shape.</p><p>IPX7 fully-washable body The whole body is hydro - resistant and fully washable for your convenience.Comes with detachable head.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 37,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Xiaomi").Id,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productMiBeard);
+ productMiBeard.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_mi_beard_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productMiBeard.Name), reference: Reference.Product,
+ objectId: productMiBeard.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productMiBeard.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_mi_beard_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productMiBeard.Name), reference: Reference.Product,
+ objectId: productMiBeard.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productMiBeard);
+
+ #endregion
+
+ #region Shoes
+
+ var productAdidasPredator = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "adidas Predator Instinct",
+ ShortDescription =
+ "Adidas Predator is the highest quality model of football boots. The special construction of the sole guarantees high flexibility and great adhesion, and the ingredients used to make the upper (synthetic material) ensure optimal weight of the shoe and adequate protection throughout the year.",
+ FullDescription =
+ "<p>Adidas Predator is the highest quality model of football boots. The special construction of the sole guarantees high flexibility and great adhesion, and the ingredients used to make the upper (synthetic material) ensure optimal weight of the shoe and adequate protection throughout the year. A feature of this model is also excellent vapor permeability - the moisture generated during the game is effectively expelled to the outside. The unique comfort and excellent foot support are due to the modern construction elements used by Adidas, which improve the player's features on the pitch. In Adidas footwear, the footballer turns into a ruthless predator. Thanks to the combination of modern technologies and great design, it is an excellent choice and fun to play.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 149,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductAttributeMappings = {
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,
+ AttributeControlTypeId = AttributeControlType.DropdownList,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "8",
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "9",
+ DisplayOrder = 2
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "10",
+ DisplayOrder = 3
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "11",
+ DisplayOrder = 4
+ }
+ }
+ },
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Color").Id,
+ AttributeControlTypeId = AttributeControlType.DropdownList,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "White/Blue",
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "White/Black",
+ DisplayOrder = 2
+ }
+ }
+ }
+ },
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Shoes").Id,
+ DisplayOrder = 1
+ }
+ },
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Adidas").Id
+ };
+ allProducts.Add(productAdidasPredator);
+ productAdidasPredator.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_predator_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAdidasPredator.Name), reference: Reference.Product,
+ objectId: productAdidasPredator.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productAdidasPredator);
+
+
+ var productAdidasNitrocharge = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Adidas Nitrocharge",
+ ShortDescription =
+ "The shoes are made of synthetic materials, they fit well to the foot thanks to their anatomical design and the insole made of Eva material. They are designed for playing and running on natural surfaces.",
+ FullDescription =
+ "<p>One of three colorways of the adidas Consortium Campus 80s Primeknit set to drop alongside each other. This pair comes in light maroon and running white. Featuring a maroon-based primeknit upper with white accents. A limited release, look out for these at select adidas Consortium accounts worldwide.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 99,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductAttributeMappings = {
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,
+ AttributeControlTypeId = AttributeControlType.DropdownList,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "8",
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "9",
+ DisplayOrder = 2
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "10",
+ DisplayOrder = 3
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "11",
+ DisplayOrder = 4
+ }
+ }
+ },
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Color").Id,
+ AttributeControlTypeId = AttributeControlType.ColorSquares,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Yellow",
+ IsPreSelected = true,
+ ColorSquaresRgb = "#FFFF00",
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Blue",
+ ColorSquaresRgb = "#363656",
+ DisplayOrder = 2
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Orange",
+ ColorSquaresRgb = "#FF8000",
+ DisplayOrder = 3
+ }
+ }
+ }
+ },
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Shoes").Id,
+ DisplayOrder = 1
+ }
+ },
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Adidas").Id
+ };
+ allProducts.Add(productAdidasNitrocharge);
+ productAdidasNitrocharge.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_adidas.png"),
+ "image/png", SeoExtensions.GenerateSlug(productAdidasNitrocharge.Name),
+ reference: Reference.Product, objectId: productAdidasNitrocharge.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productAdidasNitrocharge.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_adidas_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAdidasNitrocharge.Name), reference: Reference.Product,
+ objectId: productAdidasNitrocharge.Id)).Id,
+ DisplayOrder = 2
+ });
+ productAdidasNitrocharge.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_adidas_3.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAdidasNitrocharge.Name), reference: Reference.Product,
+ objectId: productAdidasNitrocharge.Id)).Id,
+ DisplayOrder = 3
+ });
+ productAdidasNitrocharge.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_adidas_4.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAdidasNitrocharge.Name), reference: Reference.Product,
+ objectId: productAdidasNitrocharge.Id)).Id,
+ DisplayOrder = 4
+ });
+
+
+ await _productRepository.InsertAsync(productAdidasNitrocharge);
+
+ var productAttribute = _productAttributeRepository.Table.Where(x => x.Name == "Color").FirstOrDefault()!;
+
+ productAdidasNitrocharge.ProductAttributeMappings.Where(x => x.ProductAttributeId == productAttribute.Id)
+ .First().ProductAttributeValues.Where(x => x.Name == "Blue").First().PictureId =
+ productAdidasNitrocharge.ProductPictures.ElementAt(1).PictureId;
+ productAdidasNitrocharge.ProductAttributeMappings.Where(x => x.ProductAttributeId == productAttribute.Id)
+ .First().ProductAttributeValues.Where(x => x.Name == "Yellow").First().PictureId =
+ productAdidasNitrocharge.ProductPictures.ElementAt(2).PictureId;
+ productAdidasNitrocharge.ProductAttributeMappings.Where(x => x.ProductAttributeId == productAttribute.Id)
+ .First().ProductAttributeValues.Where(x => x.Name == "Orange").First().PictureId =
+ productAdidasNitrocharge.ProductPictures.ElementAt(3).PictureId;
+ await _productRepository.UpdateAsync(productAdidasNitrocharge);
+
+
+ var productAdidasTurfs = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Adidas Turfs",
+ ShortDescription =
+ "Be unpredictable. Shoes designed for the youngest players starting their adventure with football. The sole is designed to provide perfect grip on artificial turf and hard or frozen surfaces.",
+ FullDescription =
+ "Be unpredictable. Shoes designed for the youngest players starting their adventure with football. The sole is designed to provide perfect grip on artificial turf and hard or frozen surfaces. The X-SKIN INSPIRATION upper made of synthetic material will give a feeling of lightness and support while guiding the ball thanks to the convex texture. The heel stiffening will provide stability, and the textile inner lining will provide comfort and adequate cushioning. A profiled insole reflecting the anatomical shape of the foot and symmetrical lacing will keep the foot in the right position. The sole will allow for dynamic feints and changes in the direction of the run on artificial turf as well as hard or frozen surfaces.",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 89,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Shoes").Id,
+ DisplayOrder = 1
+ }
+ },
+ BrandId = _brandRepository.Table.Single(c => c.Name == "Adidas").Id
+ };
+ allProducts.Add(productAdidasTurfs);
+ productAdidasTurfs.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_adidasturfs.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAdidasTurfs.Name), reference: Reference.Product,
+ objectId: productAdidasTurfs.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productAdidasTurfs);
+
+ #endregion
+
+ #region Apparel
+
+ //this one is a grouped product with two associated ones
+ var productDerbyKit = new Product {
+ ProductTypeId = ProductType.GroupedProduct,
+ VisibleIndividually = true,
+ Name = "Derby County Kit",
+ ShortDescription = "Show your pride and support and show off in The Rams Homemade Costumes.",
+ FullDescription =
+ "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",
+ ProductLayoutId = productLayoutGrouped.Id,
+ AllowCustomerReviews = true,
+ Published = true,
+ Price = 129.99,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productDerbyKit);
+ productDerbyKit.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_derby_awayshirt_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productDerbyKit.Name), reference: Reference.Product,
+ objectId: productDerbyKit.Id)).Id,
+ DisplayOrder = 1
+ });
+ productDerbyKit.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productDerbyKit.Name), reference: Reference.Product,
+ objectId: productDerbyKit.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productDerbyKit);
+ var productDerbyKit_associated_1 = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = false, //hide this products
+ ParentGroupedProductId = productDerbyKit.Id,
+ Name = "Derby County Shirt - Away",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Published = true,
+ Price = 129.99,
+ IsShipEnabled = true,
+ Flag = "Grouped",
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productDerbyKit_associated_1);
+ productDerbyKit_associated_1.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_derby_awayshirt_1.png"), "image/png",
+ ("Derby County Away Shirt"), reference: Reference.Product,
+ objectId: productDerbyKit_associated_1.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productDerbyKit_associated_1);
+ var productDerbyKit_associated_2 = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = false,
+ ParentGroupedProductId = productDerbyKit.Id,
+ Name = "Derby County Shirt - Home",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Published = true,
+ Price = 149.99,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productDerbyKit_associated_2);
+ productDerbyKit_associated_2.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png",
+ SeoExtensions.GenerateSlug("Derby County Shirt - Home"), reference: Reference.Product,
+ objectId: productDerbyKit_associated_2.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productDerbyKit_associated_2);
+
+ var productNikeKids = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Nike Kids Kit",
+ ShortDescription =
+ "Nike Dry-FIT football kit for kids. The set includes a T-shirt, shorts and football socks. Clothes made of high-quality synthetic materials that perfectly transport moisture and dry quickly.",
+ FullDescription =
+ "<p>Nike Dry-FIT football kit for kids. The set includes a T-shirt, shorts and football socks. Clothes made of high-quality synthetic materials that perfectly transport moisture and dry quickly. The set is perfect for training, matches, PE lessons, and the T-shirt and shorts are also perfect for everyday use. The shirt has ventilation panels under the arms and the back is made of airy mesh that removes excess heat. Children's shorts with an elastic, rubber belt will adapt to any figure. The set also includes football socks made of a pleasant-to-touch material that ensures high comfort of use.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Published = true,
+ Price = 39,
+ IsShipEnabled = true,
+ Weight = 1,
+ Length = 2,
+ Width = 3,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ ProductAttributeMappings = {
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,
+ AttributeControlTypeId = AttributeControlType.DropdownList,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Small",
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "1X",
+ DisplayOrder = 2
+ },
+
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "2X",
+ DisplayOrder = 3
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "3X",
+ DisplayOrder = 4
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "4X",
+ DisplayOrder = 5
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "5X",
+ DisplayOrder = 6
+ }
+ }
+ }
+ },
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productNikeKids);
+ productNikeKids.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_kidskit.png"),
+ "image/png", SeoExtensions.GenerateSlug(productNikeKids.Name), reference: Reference.Product,
+ objectId: productNikeKids.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productNikeKids);
+
+ var productPsgKit = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Paris Saint Germain Home Kit",
+ ShortDescription = "",
+ FullDescription =
+ "<p>This oversized women t-Shirt needs minimum ironing. It is a great product at a great value!</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 99.99,
+ IsShipEnabled = true,
+ Weight = 4,
+ Length = 3,
+ Width = 3,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ TierPrices = {
+ new TierPrice {
+ Quantity = 3,
+ Price = 21
+ },
+ new TierPrice {
+ Quantity = 7,
+ Price = 19
+ },
+ new TierPrice {
+ Quantity = 10,
+ Price = 16
+ }
+ },
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productPsgKit);
+ productPsgKit.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_psg_1.png"),
+ "image/png", SeoExtensions.GenerateSlug(productPsgKit.Name), reference: Reference.Product,
+ objectId: productPsgKit.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productPsgKit.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_psg_2.png"),
+ "image/png", SeoExtensions.GenerateSlug(productPsgKit.Name), reference: Reference.Product,
+ objectId: productPsgKit.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productPsgKit);
+
+
+ var productDerbyShirt = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Derby County Home Shirt",
+ ShortDescription = "Show your pride and support and show off in The Rams Homemade Kits.",
+ FullDescription =
+ "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 59,
+ IsShipEnabled = true,
+ Weight = 4,
+ Length = 3,
+ Width = 3,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductAttributeMappings = {
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Custom Text").Id,
+ TextPrompt = "Enter your text:",
+ AttributeControlTypeId = AttributeControlType.TextBox,
+ IsRequired = true
+ }
+ },
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productDerbyShirt);
+ productDerbyShirt.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productDerbyShirt.Name), reference: Reference.Product,
+ objectId: productDerbyShirt.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productDerbyShirt);
+
+ var productDerbyShorts = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Derby County Home Shorts",
+ ShortDescription = "Show your pride and support and show off in The Rams Homemade Kits.",
+ FullDescription =
+ "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 29,
+ IsShipEnabled = true,
+ Weight = 4,
+ Length = 3,
+ Width = 3,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productDerbyShorts);
+ productDerbyShorts.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_derby_shorts_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productDerbyShorts.Name), reference: Reference.Product,
+ objectId: productDerbyShorts.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productDerbyShorts);
+
+ var productDerbyKitHome = new Product {
+ ProductTypeId = ProductType.BundledProduct,
+ VisibleIndividually = true,
+ Name = "Derby County Home Shirt",
+ ShortDescription = "Show your pride and support and show off in The Rams Homemade Kits.",
+ FullDescription =
+ "<p>Show your pride and support and show off in The Rams Homemade Costumes.</p><p>This is an official t-shirt made according to The Rams homewear specification. The whole is decorated with the club badge and the Umbro Double Diamond logo.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 15,
+ IsShipEnabled = true,
+ Weight = 4,
+ Length = 3,
+ Width = 3,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productDerbyKitHome);
+ productDerbyKitHome.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_derby_shirt_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productDerbyKitHome.Name), reference: Reference.Product,
+ objectId: productDerbyKitHome.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productDerbyKitHome);
+
+ var productChicagoBulls = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Chicago Bulls Jersey",
+ ShortDescription =
+ "Capture your team's distinct identity when you grab this custom Chicago Bulls jersey, It features classic trims and Chicago Bulls graphics along with Nike Dry and Dri-FIT technologies for added comfort.",
+ FullDescription =
+ "<p>Capture your team's distinct identity when you grab this custom Chicago Bulls jersey, It features classic trims and Chicago Bulls graphics along with Nike Dry and Dri-FIT technologies for added comfort. Before you watch the next game, grab this incredible jersey so everyone knows your fandom is on the cutting edge.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 43.5,
+ OldPrice = 55,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ TierPrices = {
+ new TierPrice {
+ Quantity = 3,
+ Price = 40
+ },
+ new TierPrice {
+ Quantity = 6,
+ Price = 38
+ },
+ new TierPrice {
+ Quantity = 10,
+ Price = 35
+ }
+ },
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Apparel").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productChicagoBulls);
+
+ productChicagoBulls.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_chicago_jersey_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productChicagoBulls.Name), reference: Reference.Product,
+ objectId: productChicagoBulls.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productChicagoBulls.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_chicago_jersey_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productChicagoBulls.Name), reference: Reference.Product,
+ objectId: productChicagoBulls.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productChicagoBulls);
+
+ #endregion
+
+ #region Smartwatches
+
+ var productVivoactive = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Garmin VivoActive",
+ ShortDescription =
+ "The Vívoactive watch offers easy-to-repeat animated cardio, strength, yoga and Pilates exercises that you can view on your watch screen. Choose from preloaded animated workouts or download more from the Garmin Connect ™ community site.",
+ FullDescription =
+ "<p>You no longer need to search for videos and advice on the web to know what to do while training. The Vívoactive watch offers easy-to-repeat animated cardio, strength, yoga and Pilates exercises that you can view on your watch screen. Choose from preloaded animated workouts or download more from the Garmin Connect ™ community site.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 30,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductAttributeMappings = {
+ new ProductAttributeMapping {
+ ProductAttributeId = _productAttributeRepository.Table.Single(x => x.Name == "Size").Id,
+ AttributeControlTypeId = AttributeControlType.DropdownList,
+ IsRequired = true,
+ ProductAttributeValues = {
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Small",
+ DisplayOrder = 1
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Medium",
+ DisplayOrder = 2
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "Large",
+ DisplayOrder = 3
+ },
+ new ProductAttributeValue {
+ AttributeValueTypeId = AttributeValueType.Simple,
+ Name = "X-Large",
+ DisplayOrder = 4
+ }
+ }
+ }
+ },
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productVivoactive);
+ productVivoactive.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_vivoactive.png"), "image/png",
+ SeoExtensions.GenerateSlug(productVivoactive.Name), reference: Reference.Product,
+ objectId: productVivoactive.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productVivoactive);
+
+
+ var productGarminFenix = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Garmin Fenix 2",
+ ShortDescription =
+ "Fēnix 2 combines the best features of our fitness watches with outdoor training watches. It is both a great navigation system and an ideal training partner in many different sports.",
+ FullDescription =
+ "<p>Fēnix 2 combines the best features of our fitness watches with outdoor training watches. It is both a great navigation system and an ideal training partner in many different sports. Whether you're running, swimming, skiing, cycling or hiking in the mountains, fēnix 2 lets you easily switch between groups of settings optimized for each activity.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 45,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productGarminFenix);
+ productGarminFenix.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_garmin_fenix_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productGarminFenix.Name), reference: Reference.Product,
+ objectId: productGarminFenix.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productGarminFenix.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_garmin_fenix_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productGarminFenix.Name), reference: Reference.Product,
+ objectId: productGarminFenix.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productGarminFenix);
+
+
+ var productForerunner = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Garmin Forerunner",
+ ShortDescription =
+ "This easy-to-use running watch is great for everyday runs, workouts and even pre-race training in a 10k run. Built-in GPS tracks your running route and provides accurate distance, pace and interval statistics.",
+ FullDescription =
+ "<p>This easy-to-use running watch is great for everyday runs, workouts and even pre-race training in a 10k run. Built-in GPS tracks your running route and provides accurate distance, pace and interval statistics. Its intuitive interface makes it easy to mark laps or pause the timer, even with sweaty hands. Forerunner 45 also monitors heart rate on the wrist during the day and while you sleep.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 25,
+ IsShipEnabled = true,
+ Weight = 7,
+ Length = 7,
+ Width = 7,
+ Height = 7,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Apparel").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Smartwatches").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productForerunner);
+ productForerunner.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_forerunner.png"), "image/png",
+ SeoExtensions.GenerateSlug(productForerunner.Name), reference: Reference.Product,
+ objectId: productForerunner.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productForerunner);
+
+ #endregion
+
+ #region Digital Downloads
+
+ var downloadCyberpunk1 = new Download {
+ DownloadGuid = Guid.NewGuid(),
+ ContentType = "application/x-zip-co",
+ UseDownloadUrl = true,
+ DownloadUrl = "https://raw.githubusercontent.com/grandnode/sample/refs/heads/main/product_cyberpunk_1.zip",
+ Extension = ".zip",
+ Filename = "Cyberpunk",
+ DownloadType = DownloadType.Product
+ };
+ await _downloadRepository.InsertAsync(downloadCyberpunk1);
+ var downloadCyberpunk2 = new Download {
+ DownloadGuid = Guid.NewGuid(),
+ ContentType = "text/plain",
+ UseDownloadUrl = true,
+ DownloadUrl = "https://raw.githubusercontent.com/grandnode/sample/refs/heads/main/product_cyberpunk_2.txt",
+ Extension = ".txt",
+ Filename = "Cyberpunk",
+ DownloadType = DownloadType.Product
+ };
+ await _downloadRepository.InsertAsync(downloadCyberpunk2);
+
+ var productCyberpunk = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Cyberpunk 2077",
+ ShortDescription =
+ "Cyberpunk 2077 is an open-world adventure set in Night City, a megalopolis ruled by an obsessive quest for power, fame and body remake. Your name is V and you must acquire a one-of-a-kind implant - the key to immortality. Create your own playstyle and set out to conquer the mighty city of the future, whose history is shaped by your decisions.",
+ FullDescription =
+ "<p>Cyberpunk 2077 is an open-world adventure set in Night City, a megalopolis ruled by an obsessive quest for power, fame and body remake. Your name is V and you must acquire a one-of-a-kind implant - the key to immortality. Create your own playstyle and set out to conquer the mighty city of the future, whose history is shaped by your decisions.</p><p>Become a cyberpunk, a freelance armed to the teeth, and become the legend of the most dangerous city of the future. Create your character from scratch. Take on the role of the outlaw Punk, freedom-loving Nomad or ruthless Corp.</p><p>Get the most powerful implant in Night City and take on those who shake the whole city. Follow Rockerboy Johnny Silverhand (played by Keanu Reeves) and change a world ruled by large corporations forever. And all this is accompanied by music from bands and creators such as Run the Jewels, Refused, Grimes, A $ AP Rocky, Gazelle Twin, Ilan Rubin, Richard Devine, Nina Kraviz, Deadly Hunta, Rat Boy and Tina Guo.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 69,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ IsDownload = true,
+ DownloadId = downloadCyberpunk1.Id,
+ DownloadActivationTypeId = DownloadActivationType.WhenOrderIsPaid,
+ UnlimitedDownloads = true,
+ HasUserAgreement = false,
+ HasSampleDownload = true,
+ SampleDownloadId = downloadCyberpunk2.Id,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Digital downloads").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productCyberpunk);
+ productCyberpunk.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_cyberpunk_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productCyberpunk.Name), reference: Reference.Product,
+ objectId: productCyberpunk.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productCyberpunk);
+
+ var downloadGTA1 = new Download {
+ DownloadGuid = Guid.NewGuid(),
+ ContentType = "application/x-zip-co",
+ UseDownloadUrl = true,
+ DownloadUrl = "https://raw.githubusercontent.com/grandnode/sample/refs/heads/main/product_GTA_1.zip",
+ Extension = ".zip",
+ Filename = "GTA",
+ DownloadType = DownloadType.Product
+ };
+ await _downloadRepository.InsertAsync(downloadGTA1);
+
+ var downloadGTA2 = new Download {
+ DownloadGuid = Guid.NewGuid(),
+ ContentType = "text/plain",
+ DownloadUrl = "https://raw.githubusercontent.com/grandnode/sample/refs/heads/main/product_GTA_2.txt",
+ Extension = ".txt",
+ Filename = "GTA",
+ DownloadType = DownloadType.Product
+ };
+ await _downloadRepository.InsertAsync(downloadGTA2);
+ var productGTA = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Grand Theft Auto 5",
+ ShortDescription =
+ "When a young street hustler, a retired bank robber and a terrifying psychopath land themselves in trouble, they must pull off a series of dangerous heists to survive in a city in which they can trust nobody, least of all each other.",
+ FullDescription =
+ "<p>When a young street hustler, a retired bank robber and a terrifying psychopath land themselves in trouble, they must pull off a series of dangerous heists to survive in a city in which they can trust nobody, least of all each other.</p><p>Launch business ventures from your Maze Bank West Executive Office, research powerful weapons technology from your underground Gunrunning Bunker and use your Counterfeit Cash Factory to start a lucrative counterfeiting operation.</p><p>Tear through the streets with a range of 10 high performance vehicles including a Supercar, Motorcycles, the weaponized Dune FAV, a Helicopter, a Rally Car and more. You’ll also get properties including a 10 car garage to store your growing fleet.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 49,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ IsDownload = true,
+ DownloadId = downloadGTA1.Id,
+ DownloadActivationTypeId = DownloadActivationType.WhenOrderIsPaid,
+ UnlimitedDownloads = true,
+ HasUserAgreement = false,
+ HasSampleDownload = true,
+ SampleDownloadId = downloadGTA2.Id,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Digital downloads").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productGTA);
+
+ productGTA.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_gta_1.png"),
+ "image/png", SeoExtensions.GenerateSlug(productGTA.Name), reference: Reference.Product,
+ objectId: productGTA.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productGTA);
+
+
+ var downloadCod = new Download {
+ DownloadGuid = Guid.NewGuid(),
+ ContentType = "application/x-zip-co",
+ UseDownloadUrl = true,
+ DownloadUrl = "https://raw.githubusercontent.com/grandnode/sample/refs/heads/main/product_cod_1.zip",
+ Extension = ".zip",
+ Filename = "Call of Duty",
+ DownloadType = DownloadType.Product
+ };
+ await _downloadRepository.InsertAsync(downloadCod);
+
+ var productCod = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Call of Duty: ColdWar",
+ ShortDescription =
+ "The iconic Black Ops series is back with Call of Duty®: Black Ops Cold War - the direct sequel to the original and fan-favorite Call of Duty®: Black Ops. Black Ops Cold War will drop fans into the depths of the Cold War’s volatile geopolitical battle of the early 1980s.",
+ FullDescription =
+ "<p>The iconic Black Ops series is back with Call of Duty®: Black Ops Cold War - the direct sequel to the original and fan-favorite Call of Duty®: Black Ops. Black Ops Cold War will drop fans into the depths of the Cold War’s volatile geopolitical battle of the early 1980s. Nothing is ever as it seems in a gripping single-player Campaign, where players will come face-to-face with historical figures and hard truths, as they battle around the globe through iconic locales like East Berlin, Vietnam, Turkey, Soviet KGB headquarters and more. As elite operatives, you will follow the trail of a shadowy figure named Perseus who is on a mission to destabilize the global balance of power and change the course of history. Descend into the dark center of this global conspiracy alongside iconic characters Woods, Mason and Hudson and a new cast of operatives attempting to stop a plot decades in the making. Beyond the Campaign, players will bring a Cold War arsenal of weapons and equipment into the next generation of Multiplayer and Zombies experiences.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 69,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Downloadable Products").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ IsDownload = true,
+ DownloadId = downloadCod.Id,
+ DownloadActivationTypeId = DownloadActivationType.WhenOrderIsPaid,
+ UnlimitedDownloads = true,
+ HasUserAgreement = false,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Digital downloads").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+
+ productCod.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_cod_1.png"),
+ "image/png", SeoExtensions.GenerateSlug(productCod.Name, true, false, false), reference: Reference.Product,
+ objectId: productCod.Id)).Id,
+ DisplayOrder = 1
+ });
+
+ allProducts.Add(productCod);
+ await _productRepository.InsertAsync(productCod);
+
+ #endregion
+
+ #region Lego
+
+ var productLegoFalcon = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "LEGO Millennium Falcon",
+ ShortDescription =
+ "Inspire kids and adults with the LEGO® Star Wars ™ 75257 Millennium Falcon model. The brick-built version of the iconic Corellian freighter features a variety of details. This iconic set from the LEGO Star Wars series is a great addition to any fan's collection.",
+ FullDescription =
+ "<p>Inspire kids and adults with the LEGO® Star Wars ™ 75257 Millennium Falcon model. The brick-built version of the iconic Corellian freighter features a variety of details, including a rotating lower and upper gun turret, 2 spring-loaded shooters, a lowering ramp and an opening cockpit with space for 2 minifigures. The top panels fold out to reveal a detailed interior where children will love to reenact scenes from Star Wars: Skywalker. Rebirth ”featuring characters from the“ Star Wars ”universe - Finn, Chewbakka, Lando Calrissian, Boolio, C-3PO, R2-D2 and D-O. This iconic set from the LEGO Star Wars series is a great addition to any fan's collection.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 109,
+ OldPrice = 199,
+ IsShipEnabled = true,
+ IsFreeShipping = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Lego").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Lego").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productLegoFalcon);
+ productLegoFalcon.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lego_falcon_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLegoFalcon.Name), reference: Reference.Product,
+ objectId: productLegoFalcon.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productLegoFalcon.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lego_falcon_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLegoFalcon.Name), reference: Reference.Product,
+ objectId: productLegoFalcon.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productLegoFalcon);
+
+
+ var productLegoHogwarts = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Lego Hogwarts",
+ ShortDescription =
+ "Taste real magic at the LEGO® Harry Potter™ Hogwarts™ Castle! Unforgettable building satisfaction with this highly detailed LEGO Harry Potter collectible set with over 6,000 pieces.",
+ FullDescription =
+ "<p>Taste real magic at the LEGO® Harry Potter™ Hogwarts™ Castle! Unforgettable building satisfaction with this highly detailed LEGO Harry Potter collectible set with over 6,000 pieces. It is packed with elements from the Harry Potter series - you will find towers, turrets, chambers, classrooms, creatures, Whomping Willow ™, Hagrid's hut and many other signature details. Plus, with 4 minifigures and 27 microfigures of students, teachers, statues and 5 Dementors, this advanced construction toy set is the perfect gift for any Harry Potter fan.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 99,
+ OldPrice = 149,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Lego").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Lego").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productLegoHogwarts);
+ productLegoHogwarts.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lego_hogwarts_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLegoHogwarts.Name), reference: Reference.Product,
+ objectId: productLegoHogwarts.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productLegoHogwarts.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_lego_hogwarts_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLegoHogwarts.Name), reference: Reference.Product,
+ objectId: productLegoHogwarts.Id)).Id,
+ DisplayOrder = 1
+ });
+ await _productRepository.InsertAsync(productLegoHogwarts);
+
+ var productLegoCity = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Lego City Police Base",
+ ShortDescription =
+ "Everything is awesome about the LEGO® City Police Station (60246) playset. Little law enforcers and fans of the LEGO City TV series will love creating stories with a host of fun characters, including Duke DeTain, Chief Wheeler and Daisy Kaboom. ",
+ FullDescription =
+ "<p>Everything is awesome about the LEGO® City Police Station (60246) playset. Little law enforcers and fans of the LEGO City TV series will love creating stories with a host of fun characters, including Duke DeTain, Chief Wheeler and Daisy Kaboom. </p><p>This fantastic set includes a police station with a light-brick searchlight and a police car with sound-brick siren, plus a cool truck, motorcycle and surveillance drone. A building toy with a little extra With this toy playset you get a simple building guide and Instructions.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 59,
+ OldPrice = 99,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Lego").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Lego").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productLegoCity);
+ productLegoCity.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_LegoCity_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLegoCity.Name), reference: Reference.Product,
+ objectId: productLegoCity.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productLegoCity.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_LegoCity_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productLegoCity.Name), reference: Reference.Product,
+ objectId: productLegoCity.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productLegoCity);
+
+ #endregion
+
+ #region Balls
+
+ var productAdidasBall = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Adidas Ball",
+ ShortDescription =
+ "The Adidas Finale Top Capitano is a durable training ball with strong references to the UEFA Champions League. The ball is a replica of the model used in this year's Champions League group stage and is perfect for training and spontaneous games.",
+ FullDescription =
+ "<p>The Adidas Finale Top Capitano is a durable training ball with strong references to the UEFA Champions League. The ball is a replica of the model used in this year's Champions League group stage and is perfect for training and spontaneous games. The strong TPU coating has been machine-stitched to increase the durability of the ball. The ball's electrifying multicolored design shows the emotions of fans around the world as Europe's top teams compete for the highest honor.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 69,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Balls").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ MarkAsNew = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Balls").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productAdidasBall);
+ productAdidasBall.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_adidasball.png"), "image/png",
+ SeoExtensions.GenerateSlug(productAdidasBall.Name), reference: Reference.Product,
+ objectId: productAdidasBall.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productAdidasBall);
+
+
+ var productMikasa = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Volleyball Ball",
+ ShortDescription =
+ "Made of high-quality synthetic leather (PU) A high-class ball based on the V200W match model. Solid and strong machine sewing.The 18 - panel, colorful design increases the visibility of the ball during the game.",
+ FullDescription =
+ "<p>Made of high-quality synthetic leather (PU) A high-class ball based on the V200W match model. Solid and strong machine sewing.The 18 - panel, colorful design increases the visibility of the ball during the game.</p><p> Weight: 260 - 280g </p><p> Circumference: 65 - 67cm </p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 29.99,
+ IsShipEnabled = true,
+ IsFreeShipping = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Balls").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Balls").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productMikasa);
+ productMikasa.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(sampleImagesPath + "product_mikasa.png"),
+ "image/png", SeoExtensions.GenerateSlug(productMikasa.Name), reference: Reference.Product,
+ objectId: productMikasa.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productMikasa);
+
+
+ var productSpalding = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "Spalding Basketball Ball",
+ ShortDescription =
+ "The panels of leather, composite leather are attached to the rubber body by hand. This technique is used for indoor and indoor / outdoor balls. Balloon - the highest quality inner tube that maintains the pressure of the ball.",
+ FullDescription =
+ "<p>The panels of leather, composite leather are attached to the rubber body by hand. This technique is used for indoor and indoor / outdoor balls. Balloon - the highest quality inner tube that maintains the pressure of the ball. A specialized nylon braid - nylon lines give the ball integrity and durability. Smooth body and channels for a softer feel and strength - optimized deep channel design for better grip and control. Composite leather cover - provides a good grip, feel and aesthetic appearance of the ball, as well as the necessary strength and resistance to abrasion. Composite leather has an advanced moisture management system to improve dry and wet grip.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 49,
+ IsShipEnabled = true,
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 2,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Balls").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Balls").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productSpalding);
+ productSpalding.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_spalding.png"), "image/png",
+ SeoExtensions.GenerateSlug(productSpalding.Name), reference: Reference.Product,
+ objectId: productSpalding.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(productSpalding);
+
+ #endregion
+
+ #region Gift vouchers
+
+ var product25GiftVoucher = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "$25 Virtual Gift voucher",
+ ShortDescription =
+ "$25 Gift voucher. Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products.",
+ FullDescription =
+ "<p>Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftVoucher balance. Any unused balance will be placed in the recipient's GiftVoucher account when redeemed. If an order exceeds the amount of the GiftVoucher, the balance must be paid with a credit card or other available payment method.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 25,
+ IsGiftVoucher = true,
+ GiftVoucherTypeId = GiftVoucherType.Virtual,
+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ Published = true,
+ ShowOnHomePage = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Gift vouchers").Id,
+ DisplayOrder = 2
+ }
+ }
+ };
+ allProducts.Add(product25GiftVoucher);
+ product25GiftVoucher.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_25giftcart.png"), "image/png",
+ SeoExtensions.GenerateSlug(product25GiftVoucher.Name), reference: Reference.Product,
+ objectId: product25GiftVoucher.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(product25GiftVoucher);
+
+
+ var product50GiftVoucher = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "$50 Physical Gift voucher",
+ ShortDescription =
+ "$50 Gift voucher. Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products.",
+ FullDescription =
+ "<p>Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftVoucher balance. Any unused balance will be placed in the recipient's GiftVoucher account when redeemed. If an order exceeds the amount of the GiftVoucher, the balance must be paid with a credit card or other available payment method.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 50,
+ IsGiftVoucher = true,
+ GiftVoucherTypeId = GiftVoucherType.Physical,
+ IsShipEnabled = true,
+ IsFreeShipping = true,
+ DeliveryDateId = deliveryDate.Id,
+ Weight = 1,
+ Length = 1,
+ Width = 1,
+ Height = 1,
+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ Published = true,
+ MarkAsNew = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Gift vouchers").Id,
+ DisplayOrder = 3
+ }
+ }
+ };
+ allProducts.Add(product50GiftVoucher);
+ product50GiftVoucher.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_50giftcart.png"), "image/png",
+ SeoExtensions.GenerateSlug(product50GiftVoucher.Name), reference: Reference.Product,
+ objectId: product50GiftVoucher.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(product50GiftVoucher);
+
+
+ var product100GiftVoucher = new Product {
+ ProductTypeId = ProductType.SimpleProduct,
+ VisibleIndividually = true,
+ Name = "$100 Physical Gift voucher",
+ ShortDescription =
+ "$100 Gift voucher. Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products.",
+ FullDescription =
+ "<p>Gift vouchers must be redeemed through our site Web site toward the purchase of eligible products. Purchases are deducted from the GiftVoucher balance. Any unused balance will be placed in the recipient's GiftVoucher account when redeemed. If an order exceeds the amount of the GiftVoucher, the balance must be paid with a credit card or other available payment method.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 100,
+ IsGiftVoucher = true,
+ GiftVoucherTypeId = GiftVoucherType.Physical,
+ IsShipEnabled = true,
+ DeliveryDateId = deliveryDate.Id,
+ Weight = 1,
+ Length = 1,
+ Width = 1,
+ Height = 1,
+ ManageInventoryMethodId = ManageInventoryMethod.DontManageStock,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Gift vouchers").Id,
+ DisplayOrder = 4
+ }
+ }
+ };
+ allProducts.Add(product100GiftVoucher);
+ product100GiftVoucher.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_100giftcart.png"), "image/png",
+ SeoExtensions.GenerateSlug(product100GiftVoucher.Name), reference: Reference.Product,
+ objectId: product100GiftVoucher.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ await _productRepository.InsertAsync(product100GiftVoucher);
+
+ var productPlaystationBundlePack = new Product {
+ ProductTypeId = ProductType.BundledProduct,
+ VisibleIndividually = true,
+ Name = "Playstation 5 Kit",
+ ShortDescription =
+ "Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4™.",
+ FullDescription =
+ "<p>Meet the sleeker, smaller PS4 ™ that offers gamers an amazing gaming experience. The volume of the new PS4 is more than 30% smaller compared to previous console models, and its weight has been reduced by 25% and 16% respectively compared to the first (CUH-1000 series) and current (CUH-1200) versions of the PS4 ™.</p>",
+ ProductLayoutId = productLayoutSimple.Id,
+ AllowCustomerReviews = true,
+ Price = 259,
+ IsShipEnabled = true,
+ Flag = "Bundle Product",
+ Weight = 2,
+ Length = 2,
+ Width = 2,
+ Height = 3,
+ TaxCategoryId = _taxCategoryRepository.Table.Single(tc => tc.Name == "Electronics & Software").Id,
+ ManageInventoryMethodId = ManageInventoryMethod.ManageStock,
+ StockQuantity = 10000,
+ NotifyAdminForQuantityBelow = 1,
+ AllowOutOfStockSubscriptions = false,
+ StockAvailability = true,
+ LowStockActivityId = LowStockActivity.DisableBuyButton,
+ BackorderModeId = BackorderMode.NoBackorders,
+ OrderMinimumQuantity = 1,
+ OrderMaximumQuantity = 10000,
+ Published = true,
+ ProductCategories = {
+ new ProductCategory {
+ CategoryId = _categoryRepository.Table.Single(c => c.Name == "Others").Id,
+ DisplayOrder = 1
+ }
+ }
+ };
+ allProducts.Add(productPlaystationBundlePack);
+ productPlaystationBundlePack.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_console_1.png"), "image/png",
+ SeoExtensions.GenerateSlug(productPlaystationBundlePack.Name), reference: Reference.Product,
+ objectId: productPlaystationBundlePack.Id)).Id,
+ DisplayOrder = 1,
+ IsDefault = true
+ });
+ productPlaystationBundlePack.ProductPictures.Add(new ProductPicture {
+ PictureId = (await _pictureRepository.InsertPicture(
+ File.ReadAllBytes(sampleImagesPath + "product_sony_ps5_console_2.png"), "image/png",
+ SeoExtensions.GenerateSlug(productPlaystationBundlePack.Name), reference: Reference.Product,
+ objectId: productPlaystationBundlePack.Id)).Id,
+ DisplayOrder = 2
+ });
+ await _productRepository.InsertAsync(productPlaystationBundlePack);
+
+ var productbundle1 = new BundleProduct {
+ ProductId = productPs4.Id,
+ DisplayOrder = 1,
+ Quantity = 1
+ };
+ var productbundle2 = new BundleProduct {
+ ProductId = productSonyPS5Pad.Id,
+ DisplayOrder = 2,
+ Quantity = 2
+ };
+ var productbundle3 = new BundleProduct {
+ ProductId = productPs5Camera.Id,
+ DisplayOrder = 3,
+ Quantity = 1
+ };
+ var productbundle4 = new BundleProduct {
+ ProductId = productCod.Id,
+ DisplayOrder = 4,
+ Quantity = 1
+ };
+ productPlaystationBundlePack.BundleProducts.Add(productbundle1);
+ productPlaystationBundlePack.BundleProducts.Add(productbundle2);
+ productPlaystationBundlePack.BundleProducts.Add(productbundle3);
+ productPlaystationBundlePack.BundleProducts.Add(productbundle4);
+ await _productRepository.UpdateAsync(productPlaystationBundlePack);
+
+ #endregion
+
+ //search engine names
+ foreach (var product in allProducts)
+ {
+ product.SeName = SeoExtensions.GenerateSlug(product.Name, false, false, false);
+ await _entityUrlRepository.InsertAsync(new EntityUrl {
+ EntityId = product.Id,
+ EntityName = "Product",
+ LanguageId = "",
+ IsActive = true,
+ Slug = product.SeName
+ });
+
+ await _productRepository.UpdateAsync(product);
+ }
+
+
+ #region Related Products
+
+ //related products
+
+ productMikasa.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productSpalding.Id
+ });
+
+ productMikasa.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAdidasBall.Id
+ });
+
+ productSpalding.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMikasa.Id
+ });
+
+ productSpalding.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAdidasBall.Id
+ });
+
+ productAdidasBall.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMikasa.Id
+ });
+
+ productAdidasBall.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productSpalding.Id
+ });
+
+ productGTA.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productCyberpunk.Id
+ });
+
+ productGTA.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productCod.Id
+ });
+
+ productCyberpunk.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productGTA.Id
+ });
+
+ productCyberpunk.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productCod.Id
+ });
+
+ productLegoCity.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLegoHogwarts.Id
+ });
+
+ productLegoCity.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLegoFalcon.Id
+ });
+
+ productLegoHogwarts.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLegoCity.Id
+ });
+
+ productLegoHogwarts.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLegoFalcon.Id
+ });
+
+ productLegoFalcon.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLegoHogwarts.Id
+ });
+
+ productLegoFalcon.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLegoCity.Id
+ });
+
+ productLenovoLegionY740.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productDellXPS.Id
+ });
+
+ productLenovoLegionY740.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiNotebook.Id
+ });
+
+ productLenovoLegionY740.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAsusMixedReality.Id
+ });
+
+ productLenovoLegionY740.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAcerNitro.Id
+ });
+
+ productDellXPS.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLenovoLegionY740.Id
+ });
+
+ productDellXPS.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiNotebook.Id
+ });
+
+ productDellXPS.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAcerMonitor.Id
+ });
+
+ productDellXPS.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productDellG5.Id
+ });
+
+ productMiNotebook.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productDellXPS.Id
+ });
+
+ productMiNotebook.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAcerMonitor.Id
+ });
+
+ productMiNotebook.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLenovoLegionY740.Id
+ });
+
+ productMiNotebook.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAcerNitro.Id
+ });
+
+ productAcerNitro.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productDellXPS.Id
+ });
+
+ productAcerNitro.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAcerProjector.Id
+ });
+
+ productAcerNitro.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLenovoLegionY740.Id
+ });
+
+ productAcerNitro.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productDellG5.Id
+ });
+
+ productDellG5.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLenovoLegionY740.Id
+ });
+
+ productDellG5.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiNotebook.Id
+ });
+
+ productDellG5.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAcerNitro.Id
+ });
+
+ productDellG5.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAcerMonitor.Id
+ });
+ productPs5Camera.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productPlaystationBundlePack.Id
+ });
+ productPs5Camera.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productPs4.Id
+ });
+
+ productPs5Camera.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productDellG5.Id
+ });
+ productPs5Camera.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAcerNitro.Id
+ });
+ productAcerProjector.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productRedmiNote9.Id
+ });
+
+ productAcerProjector.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productDerbyKit.Id
+ });
+
+ productAcerProjector.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAcerMonitor.Id
+ });
+
+ productAcerProjector.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productPocoF2Pro.Id
+ });
+ productRedmiK30.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productRedmiNote9.Id
+ });
+
+ productRedmiK30.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productPocoF2Pro.Id
+ });
+ productRedmiK30.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiSmartBand.Id
+ });
+
+ productRedmiK30.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiBeard.Id
+ });
+
+ productRedmiNote9.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productRedmiK30.Id
+ });
+ productRedmiNote9.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productPocoF2Pro.Id
+ });
+
+ productRedmiNote9.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiSmartBand.Id
+ });
+ productRedmiNote9.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiBeard.Id
+ });
+ productPocoF2Pro.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productRedmiK30.Id
+ });
+ productPocoF2Pro.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productRedmiNote9.Id
+ });
+
+ productPocoF2Pro.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiSmartBand.Id
+ });
+ productPocoF2Pro.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiBeard.Id
+ });
+
+ productAdidasNitrocharge.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productChicagoBulls.Id
+ });
+
+ productAdidasNitrocharge.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAdidasPredator.Id
+ });
+
+ productAdidasNitrocharge.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAdidasTurfs.Id
+ });
+ productAdidasNitrocharge.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productNikeKids.Id
+ });
+ productChicagoBulls.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAdidasNitrocharge.Id
+ });
+ productChicagoBulls.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAdidasPredator.Id
+ });
+
+ productChicagoBulls.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productAdidasTurfs.Id
+ });
+ productChicagoBulls.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productNikeKids.Id
+ });
+
+ productDerbyShirt.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productChicagoBulls.Id
+ });
+
+ productDerbyShirt.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productNikeKids.Id
+ });
+ productDerbyShirt.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productPsgKit.Id
+ });
+ productDerbyShirt.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productVivoactive.Id
+ });
+ productSonyPS5Pad.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productBuildComputer.Id
+ });
+ productSonyPS5Pad.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productLenovoIdeaPadDual.Id
+ });
+ productSonyPS5Pad.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productDellXPS.Id
+ });
+ productSonyPS5Pad.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiNotebook.Id
+ });
+
+ productLenovoIdeaPadDual.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productBuildComputer.Id
+ });
+
+ productLenovoIdeaPadDual.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productSonyPS5Pad.Id
+ });
+
+ productLenovoIdeaPadDual.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productDellXPS.Id
+ });
+
+ productLenovoIdeaPadDual.RelatedProducts.Add(
+ new RelatedProduct {
+ ProductId2 = productMiNotebook.Id
+ });
+
+ #endregion
+
+ #region Product Tags
+
+ //product tags
+ await AddProductTag(product25GiftVoucher, "nice");
+ await AddProductTag(product25GiftVoucher, "gift");
+ await AddProductTag(productNikeKids, "cool");
+ await AddProductTag(productNikeKids, "apparel");
+ await AddProductTag(productNikeKids, "shirt");
+ await AddProductTag(productMiSmartBand, "computer");
+ await AddProductTag(productMiSmartBand, "cool");
+ await AddProductTag(productAdidasPredator, "cool");
+ await AddProductTag(productAdidasPredator, "shoes");
+ await AddProductTag(productAdidasPredator, "apparel");
+ await AddProductTag(productLenovoYogaDuet, "tablet");
+ await AddProductTag(productLenovoYogaDuet, "awesome");
+ await AddProductTag(productPs4, "computer");
+ await AddProductTag(productPs4, "cool");
+ await AddProductTag(productPsgKit, "cool");
+ await AddProductTag(productPsgKit, "apparel");
+ await AddProductTag(productPsgKit, "shirt");
+ await AddProductTag(productMiNotebook, "compact");
+ await AddProductTag(productMiNotebook, "awesome");
+ await AddProductTag(productMiNotebook, "computer");
+ await AddProductTag(productLenovoLegionY740, "compact");
+ await AddProductTag(productLenovoLegionY740, "awesome");
+ await AddProductTag(productLenovoLegionY740, "computer");
+ await AddProductTag(productLegoFalcon, "awesome");
+ await AddProductTag(productLegoFalcon, "lego");
+ await AddProductTag(productLegoFalcon, "nice");
+ await AddProductTag(productRedmiK30, "cell");
+ await AddProductTag(productRedmiK30, "compact");
+ await AddProductTag(productRedmiK30, "awesome");
+ await AddProductTag(productBuildComputer, "awesome");
+ await AddProductTag(productBuildComputer, "computer");
+ await AddProductTag(productDerbyKit, "cool");
+ await AddProductTag(productDerbyKit, "football kit");
+ await AddProductTag(productAcerProjector, "projector");
+ await AddProductTag(productAcerProjector, "cool");
+ await AddProductTag(productSonyPS5Pad, "cool");
+ await AddProductTag(productSonyPS5Pad, "computer");
+ await AddProductTag(productLenovoSmartTab, "awesome");
+ await AddProductTag(productLenovoSmartTab, "tablet");
+ await AddProductTag(productDerbyShirt, "cool");
+ await AddProductTag(productDerbyShirt, "shirt");
+ await AddProductTag(productDerbyShirt, "apparel");
+ await AddProductTag(productAdidasBall, "Balls");
+ await AddProductTag(productAdidasBall, "awesome");
+ await AddProductTag(productMikasa, "awesome");
+ await AddProductTag(productMikasa, "Balls");
+ await AddProductTag(productLegoHogwarts, "lego");
+ await AddProductTag(productAdidasNitrocharge, "cool");
+ await AddProductTag(productAdidasNitrocharge, "shoes");
+ await AddProductTag(productAdidasNitrocharge, "apparel");
+ await AddProductTag(productLenovoIdeaPadDual, "awesome");
+ await AddProductTag(productLenovoIdeaPadDual, "tablet");
+ await AddProductTag(productPs5Camera, "nice");
+ await AddProductTag(productPs5Camera, "computer");
+ await AddProductTag(productPs5Camera, "compact");
+ await AddProductTag(productAcerNitro, "nice");
+ await AddProductTag(productAcerNitro, "computer");
+ await AddProductTag(productDellG5, "computer");
+ await AddProductTag(productDellG5, "cool");
+ await AddProductTag(productDellG5, "compact");
+ await AddProductTag(productVivoactive, "apparel");
+ await AddProductTag(productVivoactive, "cool");
+ await AddProductTag(productChicagoBulls, "cool");
+ await AddProductTag(productChicagoBulls, "sport");
+ await AddProductTag(productChicagoBulls, "apparel");
+ await AddProductTag(productAsusMixedReality, "game");
+ await AddProductTag(productAsusMixedReality, "computer");
+ await AddProductTag(productAsusMixedReality, "cool");
+ await AddProductTag(productCyberpunk, "awesome");
+ await AddProductTag(productCyberpunk, "digital");
+ await AddProductTag(productForerunner, "apparel");
+ await AddProductTag(productForerunner, "cool");
+ await AddProductTag(productRedmiNote9, "awesome");
+ await AddProductTag(productRedmiNote9, "compact");
+ await AddProductTag(productRedmiNote9, "cell");
+ await AddProductTag(productGTA, "digital");
+ await AddProductTag(productGTA, "game");
+ await AddProductTag(productPocoF2Pro, "awesome");
+ await AddProductTag(productPocoF2Pro, "cool");
+ await AddProductTag(productPocoF2Pro, "camera");
+ await AddProductTag(productCod, "digital");
+ await AddProductTag(productCod, "awesome");
+ await AddProductTag(productLegoCity, "lego");
+ await AddProductTag(productDellXPS, "awesome");
+ await AddProductTag(productDellXPS, "computer");
+ await AddProductTag(productDellXPS, "compact");
+ await AddProductTag(productAdidasTurfs, "jeans");
+ await AddProductTag(productAdidasTurfs, "cool");
+ await AddProductTag(productAdidasTurfs, "apparel");
+ await AddProductTag(productSpalding, "Balls");
+ await AddProductTag(productSpalding, "awesome");
+
+ #endregion
+
+ //reviews
+ var random = new Random();
+ foreach (var product in allProducts)
+ {
+ if (product.ProductTypeId != ProductType.SimpleProduct)
+ continue;
+
+ //only 3 of 4 products will have reviews
+ if (random.Next(4) == 3)
+ continue;
+
+ //rating from 4 to 5
+ var rating = random.Next(4, 6);
+ var productReview = new ProductReview {
+ CustomerId = defaultCustomer.Id,
+ ProductId = product.Id,
+ IsApproved = true,
+ StoreId = defaultStore.Id,
+ Title = "Some sample review",
+ ReviewText =
+ $"This sample review is for the {product.Name}. I've been waiting for this product to be available. It is priced just right.",
+ Rating = rating,
+ HelpfulYesTotal = 0,
+ HelpfulNoTotal = 0
+ };
+ await _productReviewRepository.InsertAsync(productReview);
+
+ product.ApprovedRatingSum = rating;
+ product.ApprovedTotalReviews += 1;
+ product.AvgRating = rating / product.ApprovedTotalReviews;
+ }
+
+ allProducts.ForEach(x => _productRepository.Update(x));
+ }
+
+ private async Task AddProductTag(Product product, string tag)
+ {
+ var productTag = _productTagRepository.Table.FirstOrDefault(pt => pt.Name == tag);
+ if (productTag == null)
+ {
+ productTag = new ProductTag {
+ Name = tag,
+ SeName = SeoExtensions.GenerateSlug(tag, false, false, false)
+ };
+
+ await _productTagRepository.InsertAsync(productTag);
+ }
+
+ productTag.Count = productTag.Count + 1;
+ await _productTagRepository.UpdateAsync(productTag);
+ product.ProductTags.Add(productTag.Name);
+ await _productRepository.UpdateAsync(product);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataRobotsTxt.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataRobotsTxt.cs
new file mode 100644
index 000000000..75c76cdaf
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataRobotsTxt.cs
@@ -0,0 +1,58 @@
+using Grand.Domain.Common;
+using Grand.Domain.Stores;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallDataRobotsTxt(
+ Store store)
+ {
+ var url = store.SslEnabled ? store.SecureUrl : store.Url;
+
+ var robotsTxt = new RobotsTxt {
+ Name = "RobotsTXT",
+ StoreId = store.Id,
+ Text = @$"User-agent: *
+Sitemap: {url}sitemap.xml
+Host: {url}
+Disallow: /admin
+Disallow: /bin/
+Disallow: /assets/files/
+Disallow: /assets/files/exportimport/
+Disallow: /country/getstatesbycountryid
+Disallow: /install
+Disallow: /setproductreviewhelpfulness
+Disallow: /addproducttocart/catalog/
+Disallow: /addproducttocart/details/
+Disallow: /outofstocksubscriptions/manage
+Disallow: /cart
+Disallow: /changelanguage/*
+Disallow: /changecurrency/*
+Disallow: /checkout/*
+Disallow: /compareproducts
+Disallow: /account/*
+Disallow: /emailwishlist
+Disallow: /login/*
+Disallow: /newsletter/subscriptionactivation
+Disallow: /order/*
+Disallow: /orderdetails
+Disallow: /passwordrecovery/confirm
+Disallow: /register/*
+Disallow: /merchandisereturn
+Disallow: /merchandisereturn/history
+Disallow: /loyaltypoints/history
+Disallow: /search?
+Disallow: /shoppingcart/*
+Disallow: /storeclosed
+Disallow: /subscribenewsletter/*
+Disallow: /page/authenticate
+Disallow: /uploadfileproductattribute
+Disallow: /uploadfilecheckoutattribute
+Disallow: /wishlist
+Disallow: /quickview/*"
+ };
+
+ await _robotsTxtRepository.InsertAsync(robotsTxt);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataScheduleTasks.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataScheduleTasks.cs
new file mode 100644
index 000000000..a7954da76
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataScheduleTasks.cs
@@ -0,0 +1,73 @@
+using Grand.Domain.Tasks;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallScheduleTasks()
+ {
+ //these tasks are default - they are created in order to insert them into database
+ //and nothing above it
+ //there is no need to send arguments into ctor - all are null
+ var tasks = new List<ScheduleTask> {
+ new() {
+ ScheduleTaskName = "Send emails",
+ Type =
+ "Grand.Module.Installer.BackgroundServices.ScheduleTasks.QueuedMessagesSendScheduleTask, Grand.Business.System",
+ Enabled = true,
+ StopOnError = false,
+ TimeInterval = 1
+ },
+ new() {
+ ScheduleTaskName = "Delete guests",
+ Type =
+ "Grand.Module.Installer.BackgroundServices.ScheduleTasks.DeleteGuestsScheduleTask, Grand.Business.System",
+ Enabled = true,
+ StopOnError = false,
+ TimeInterval = 1440
+ },
+ new() {
+ ScheduleTaskName = "Clear cache",
+ Type =
+ "Grand.Module.Installer.BackgroundServices.ScheduleTasks.ClearCacheScheduleTask, Grand.Business.System",
+ Enabled = false,
+ StopOnError = false,
+ TimeInterval = 120
+ },
+ new() {
+ ScheduleTaskName = "Update currency exchange rates",
+ Type =
+ "Grand.Module.Installer.BackgroundServices.ScheduleTasks.UpdateExchangeRateScheduleTask, Grand.Business.System",
+ Enabled = true,
+ StopOnError = false,
+ TimeInterval = 1440
+ },
+ new() {
+ ScheduleTaskName = "Generate sitemap XML file",
+ Type =
+ "Grand.Module.Installer.BackgroundServices.ScheduleTasks.GenerateSitemapXmlTask, Grand.Business.System",
+ Enabled = false,
+ StopOnError = false,
+ TimeInterval = 10080
+ },
+ new() {
+ ScheduleTaskName = "End of the auctions",
+ Type =
+ "Grand.Module.Installer.BackgroundServices.ScheduleTasks.EndAuctionsTask, Grand.Business.System",
+ Enabled = false,
+ StopOnError = false,
+ TimeInterval = 60
+ },
+ new() {
+ ScheduleTaskName = "Cancel unpaid and pending orders",
+ Type =
+ "Grand.Module.Installer.BackgroundServices.ScheduleTasks.CancelOrderScheduledTask, Grand.Business.System",
+ Enabled = false,
+ StopOnError = false,
+ TimeInterval = 1440
+ }
+ };
+ tasks.ForEach(x => _scheduleTaskRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataSettings.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataSettings.cs
new file mode 100644
index 000000000..71949d040
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataSettings.cs
@@ -0,0 +1,552 @@
+using Grand.Domain.Admin;
+using Grand.Domain.Blogs;
+using Grand.Domain.Catalog;
+using Grand.Domain.Cms;
+using Grand.Domain.Common;
+using Grand.Domain.Customers;
+using Grand.Domain.Directory;
+using Grand.Domain.Knowledgebase;
+using Grand.Domain.Localization;
+using Grand.Domain.Media;
+using Grand.Domain.Messages;
+using Grand.Domain.News;
+using Grand.Domain.Orders;
+using Grand.Domain.Payments;
+using Grand.Domain.PushNotifications;
+using Grand.Domain.Security;
+using Grand.Domain.Seo;
+using Grand.Domain.Shipping;
+using Grand.Domain.Stores;
+using Grand.Domain.Tax;
+using Grand.Domain.Vendors;
+using Grand.Module.Installer.Extensions;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallSettings(bool installSampleData)
+ {
+ var path = Path.Combine(_hostingEnvironment.WebRootPath, "logo.png");
+
+ var storePictureId = (await _pictureRepository.InsertPicture(File.ReadAllBytes(path), "image/png", "Logo")).Id;
+
+ await _settingRepository.SaveSetting(new MenuItemSettings {
+ DisplayHomePageMenu = !installSampleData,
+ DisplayNewProductsMenu = true,
+ DisplaySearchMenu = !installSampleData,
+ DisplayCustomerMenu = !installSampleData,
+ DisplayBlogMenu = true,
+ DisplayContactUsMenu = true
+ });
+
+ await _settingRepository.SaveSetting(new PdfSettings {
+ LogoPictureId = "",
+ InvoiceHeaderText = null,
+ InvoiceFooterText = null
+ });
+
+ await _settingRepository.SaveSetting(new CommonSettings {
+ StoreInDatabaseContactUsForm = true,
+ UseSystemEmailForContactUsForm = true,
+ SitemapEnabled = true,
+ SitemapIncludeCategories = true,
+ SitemapIncludeBrands = true,
+ SitemapIncludeProducts = false,
+ PopupForTermsOfServiceLinks = true,
+ AllowToSelectStore = false
+ });
+ await _settingRepository.SaveSetting(new SystemSettings {
+ DeleteGuestTaskOlderThanMinutes = 1440
+ });
+ await _settingRepository.SaveSetting(new SecuritySettings {
+ AdminAreaAllowedIpAddresses = null
+ });
+ await _settingRepository.SaveSetting(new MediaSettings {
+ BlogThumbPictureSize = 450,
+ ProductThumbPictureSize = 415,
+ ProductDetailsPictureSize = 800,
+ ProductThumbPictureSizeOnProductDetailsPage = 100,
+ AssociatedProductPictureSize = 220,
+ CategoryThumbPictureSize = 450,
+ BrandThumbPictureSize = 420,
+ CollectionThumbPictureSize = 420,
+ VendorThumbPictureSize = 450,
+ CourseThumbPictureSize = 200,
+ LessonThumbPictureSize = 64,
+ CartThumbPictureSize = 80,
+ MiniCartThumbPictureSize = 100,
+ AddToCartThumbPictureSize = 200,
+ AutoCompleteSearchThumbPictureSize = 50,
+ ImageSquarePictureSize = 32,
+ MaximumImageSize = 1980,
+ ImageQuality = 100,
+ DefaultPictureZoomEnabled = true,
+ AllowedFileTypes = ".gif, .jpg, .jpeg, .png, .bmp, .webp"
+ });
+
+ await _settingRepository.SaveSetting(new StorageSettings {
+ PictureStoreInDb = true
+ });
+
+ await _settingRepository.SaveSetting(new SeoSettings {
+ PageTitleSeparator = ". ",
+ PageTitleSeoAdjustment = true,
+ DefaultTitle = "Your store",
+ DefaultMetaKeywords = "",
+ DefaultMetaDescription = "",
+ GenerateProductMetaDescription = true,
+ ConvertNonWesternChars = false,
+ SeoCharConversion = "ą:a;ę:e;ó:o;ć:c;ł:l;ś:s;ź:z;ż:z",
+ AllowUnicodeCharsInUrls = true,
+ CanonicalUrlsEnabled = false,
+ TwitterMetaTags = true,
+ OpenGraphMetaTags = true,
+ ReservedEntityUrlSlugs = [
+ "admin",
+ "install",
+ "recentlyviewedproducts",
+ "newproducts",
+ "compareproducts",
+ "clearcomparelist",
+ "setproductreviewhelpfulness",
+ "login",
+ "register",
+ "logout",
+ "cart",
+ "wishlist",
+ "emailwishlist",
+ "checkout",
+ "onepagecheckout",
+ "contactus",
+ "passwordrecovery",
+ "subscribenewsletter",
+ "blog",
+ "knowledgebase",
+ "news",
+ "sitemap",
+ "search",
+ "config",
+ "cookieaccept",
+ "access-denied",
+ "page-not-found",
+ "home",
+ "con",
+ "lpt1",
+ "lpt2",
+ "lpt3",
+ "lpt4",
+ "lpt5",
+ "lpt6",
+ "lpt7",
+ "lpt8",
+ "lpt9",
+ "com1",
+ "com2",
+ "com3",
+ "com4",
+ "com5",
+ "com6",
+ "com7",
+ "com8",
+ "com9",
+ "null",
+ "prn",
+ "aux"
+ ]
+ });
+
+ await _settingRepository.SaveSetting(new AdminAreaSettings {
+ DefaultGridPageSize = 15,
+ GridPageSizes = "10, 15, 20, 50, 100",
+ UseIsoDateTimeConverterInJson = true,
+ HideStoreColumn = true
+ });
+
+ await _settingRepository.SaveSetting(new CatalogSettings {
+ AllowViewUnpublishedProductPage = true,
+ DisplayDiscontinuedMessageForUnpublishedProducts = true,
+ PublishBackProductWhenCancellingOrders = false,
+ ShowSkuOnProductDetailsPage = false,
+ ShowSkuOnCatalogPages = false,
+ ShowMpn = false,
+ ShowGtin = false,
+ ShowFreeShippingNotification = true,
+ AllowProductSorting = true,
+ AllowProductViewModeChanging = true,
+ DefaultViewMode = "grid",
+ ShowProductsFromSubcategories = true,
+ ShowCategoryProductNumber = false,
+ ShowCategoryProductNumberIncludingSubcategories = false,
+ CategoryBreadcrumbEnabled = true,
+ ShowShareButton = false,
+ PageShareCode =
+ "<!-- AddThis Button BEGIN --><div class=\"addthis_inline_share_toolbox\"></div><script type=\"text/javascript\" src=\"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5bbf4b026e74abf6\"></script><!-- AddThis Button END -->",
+ ProductReviewsMustBeApproved = false,
+ DefaultProductRatingValue = 5,
+ AllowAnonymousUsersToReviewProduct = false,
+ FilterProductRating = "4.6,4.7,4.8,4.9,5",
+ ProductReviewPossibleOnlyAfterPurchasing = false,
+ ProductReviewPossibleOnlyOnce = false,
+ NotifyStoreOwnerAboutNewProductReviews = false,
+ EmailAFriendEnabled = true,
+ AskQuestionOnProduct = true,
+ AllowAnonymousUsersToEmailAFriend = false,
+ RecentlyViewedProductsNumber = 3,
+ RecentlyViewedProductsEnabled = true,
+ RecommendedProductsEnabled = false,
+ SuggestedProductsEnabled = false,
+ SuggestedProductsNumber = 6,
+ PersonalizedProductsEnabled = false,
+ PersonalizedProductsNumber = 6,
+ NewProductsNumber = 6,
+ NewProductsEnabled = true,
+ NewProductsOnHomePage = false,
+ NewProductsNumberOnHomePage = 6,
+ CompareProductsEnabled = true,
+ CompareProductsNumber = 4,
+ ProductSearchAutoCompleteEnabled = true,
+ ProductSearchAutoCompleteNumberOfProducts = 10,
+ ProductSearchTermMinimumLength = 3,
+ ShowProductImagesInSearchAutoComplete = true,
+ ShowBestsellersOnHomepage = false,
+ NumberOfBestsellersOnHomepage = 4,
+ BestsellersFromReports = false,
+ PeriodBestsellers = 6,
+ NumberOfReview = 10,
+ SearchPageProductsPerPage = 6,
+ SearchPageAllowCustomersToSelectPageSize = true,
+ SearchPagePageSizeOptions = "6, 3, 9, 18",
+ ProductsAlsoPurchasedEnabled = true,
+ ProductsAlsoPurchasedNumber = 3,
+ NumberOfProductTags = 15,
+ ProductsByTagPageSize = 6,
+ IncludeShortDescriptionInCompareProducts = false,
+ IncludeFullDescriptionInCompareProducts = false,
+ IncludeFeaturedProductsInNormalLists = false,
+ DisplayTierPricesWithDiscounts = true,
+ IgnoreDiscounts = false,
+ IgnoreFeaturedProducts = false,
+ IgnoreFilterableSpecAttributeOption = false,
+ IgnoreFilterableAvailableStartEndDateTime = true,
+ CustomerProductPrice = false,
+ ProductsByTagAllowCustomersToSelectPageSize = true,
+ ProductsByTagPageSizeOptions = "6, 3, 9, 18",
+ CollectionsBlockItemsToDisplay = 2,
+ DefaultCategoryPageSizeOptions = "6, 3, 9",
+ DefaultCollectionPageSize = 6,
+ LimitOfFeaturedProducts = 30,
+ SecondPictureOnCatalogPages = true
+ });
+
+ await _settingRepository.SaveSetting(new LanguageSettings {
+ DefaultAdminLanguageId = _languageRepository.Table.Single(l => l.Name == "English").Id,
+ AutomaticallyDetectLanguage = false,
+ IgnoreRtlPropertyForAdminArea = false
+ });
+
+ await _settingRepository.SaveSetting(new CustomerSettings {
+ UsernamesEnabled = false,
+ CheckUsernameAvailabilityEnabled = false,
+ AllowUsersToChangeUsernames = false,
+ DefaultPasswordFormat = PasswordFormat.Hashed,
+ HashedPasswordFormat = HashedPasswordFormat.SHA1,
+ PasswordRegularExpression = "^.{6,}$",
+ PasswordRecoveryLinkDaysValid = 7,
+ PasswordLifetime = 90,
+ FailedPasswordAllowedAttempts = 0,
+ FailedPasswordLockoutMinutes = 30,
+ UserRegistrationType = UserRegistrationType.Standard,
+ NotifyNewCustomerRegistration = false,
+ HideDownloadableProductsTab = true,
+ HideReviewsTab = false,
+ HideCoursesTab = true,
+ HideSubAccountsTab = true,
+ HideOutOfStockSubscriptionsTab = false,
+ HideAuctionsTab = true,
+ HideNotesTab = true,
+ HideDocumentsTab = true,
+ DownloadableProductsValidateUser = true,
+ CustomerNameFormat = CustomerNameFormat.FirstName,
+ GenderEnabled = false,
+ GeoEnabled = false,
+ DateOfBirthEnabled = false,
+ DateOfBirthRequired = false,
+ DateOfBirthMinimumAge = 0,
+ CompanyEnabled = false,
+ StreetAddressEnabled = false,
+ StreetAddress2Enabled = false,
+ ZipPostalCodeEnabled = false,
+ CityEnabled = false,
+ CountryEnabled = false,
+ CountryRequired = false,
+ StateProvinceEnabled = false,
+ StateProvinceRequired = false,
+ PhoneEnabled = false,
+ FaxEnabled = false,
+ AcceptPrivacyPolicyEnabled = false,
+ NewsletterEnabled = true,
+ NewsletterTickedByDefault = true,
+ HideNewsletterBlock = false,
+ RegistrationFreeShipping = false,
+ NewsletterBlockAllowToUnsubscribe = false,
+ OnlineCustomerMinutes = 20,
+ OnlineShoppingCartMinutes = 60,
+ StoreLastVisitedPage = false,
+ AllowUsersToDeleteAccount = false,
+ AllowUsersToExportData = false,
+ TwoFactorAuthenticationEnabled = false
+ });
+
+ await _settingRepository.SaveSetting(new AddressSettings {
+ NameEnabled = false,
+ CompanyEnabled = true,
+ StreetAddressEnabled = true,
+ StreetAddressRequired = true,
+ StreetAddress2Enabled = true,
+ ZipPostalCodeEnabled = true,
+ ZipPostalCodeRequired = true,
+ CityEnabled = true,
+ CityRequired = true,
+ CountryEnabled = true,
+ StateProvinceEnabled = true,
+ PhoneEnabled = true,
+ PhoneRequired = true,
+ FaxEnabled = false,
+ NoteEnabled = false
+ });
+
+ await _settingRepository.SaveSetting(new StoreInformationSettings {
+ LogoPictureId = storePictureId,
+ StoreClosed = false,
+ DefaultStoreTheme = "Default",
+ AllowCustomerToSelectTheme = false,
+ DisplayCookieInformation = false,
+ FacebookLink = "https://www.facebook.com/grandnodecom",
+ TwitterLink = "https://twitter.com/grandnode",
+ YoutubeLink = "http://www.youtube.com/user/grandnode",
+ InstagramLink = "https://www.instagram.com/grandnode/",
+ LinkedInLink = "https://www.linkedin.com/company/grandnode.com/",
+ PinterestLink = "",
+ VoiceNavigation = false
+ });
+
+ await _settingRepository.SaveSetting(new LoyaltyPointsSettings {
+ Enabled = true,
+ ExchangeRate = 1,
+ PointsForRegistration = 0,
+ PointsForPurchases_Amount = 10,
+ PointsForPurchases_Points = 1,
+ PointsForPurchases_Awarded = (int)OrderStatusSystem.Complete,
+ ReduceLoyaltyPointsAfterCancelOrder = true,
+ DisplayHowMuchWillBeEarned = true,
+ PointsAccumulatedForAllStores = true
+ });
+
+ await _settingRepository.SaveSetting(new CurrencySettings {
+ PrimaryStoreCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id,
+ PrimaryExchangeRateCurrencyId = _currencyRepository.Table.Single(c => c.CurrencyCode == "USD").Id,
+ ActiveExchangeRateProviderSystemName = "CurrencyExchange.MoneyConverter",
+ AutoUpdateEnabled = false
+ });
+
+ await _settingRepository.SaveSetting(new MeasureSettings {
+ BaseDimensionId = _measureDimensionRepository.Table.Single(m => m.SystemKeyword == "centimetres").Id,
+ BaseWeightId = _measureWeightRepository.Table.Single(m => m.SystemKeyword == "lb").Id
+ });
+
+ await _settingRepository.SaveSetting(new ShoppingCartSettings {
+ DisplayCartAfterAddingProduct = false,
+ DisplayWishlistAfterAddingProduct = false,
+ MaximumShoppingCartItems = 1000,
+ MaximumWishlistItems = 1000,
+ AllowOutOfStockItemsToBeAddedToWishlist = false,
+ MoveItemsFromWishlistToCart = true,
+ ShowProductImagesOnShoppingCart = true,
+ ShowProductImagesOnWishList = true,
+ ShowDiscountBox = true,
+ ShowGiftVoucherBox = true,
+ CrossSellsNumber = 4,
+ EmailWishlistEnabled = true,
+ AllowAnonymousUsersToEmailWishlist = false,
+ MiniShoppingCartEnabled = true,
+ ShowImagesInsidebarCart = true,
+ MiniCartProductNumber = 5,
+ RoundPrices = true,
+ GroupTierPrices = false,
+ AllowCartItemEditing = true,
+ AllowOnHoldCart = true
+ });
+
+ await _settingRepository.SaveSetting(new OrderSettings {
+ IsReOrderAllowed = true,
+ MinOrderSubtotalAmount = 0,
+ MinOrderSubtotalAmountIncludingTax = false,
+ MinOrderTotalAmount = 0,
+ AnonymousCheckoutAllowed = true,
+ TermsOfServiceOnShoppingCartPage = true,
+ TermsOfServiceOnOrderConfirmPage = false,
+ DisableOrderCompletedPage = false,
+ AttachPdfInvoiceToOrderPlacedEmail = false,
+ AttachPdfInvoiceToOrderCompletedEmail = false,
+ AttachPdfInvoiceToOrderPaidEmail = false,
+ MerchandiseReturnsEnabled = true,
+ MerchandiseReturns_AllowToSpecifyPickupAddress = false,
+ MerchandiseReturns_AllowToSpecifyPickupDate = false,
+ MerchandiseReturns_PickupDateRequired = false,
+ NumberOfDaysMerchandiseReturnAvailable = 365,
+ MinimumOrderPlacementInterval = 30,
+ DeactivateGiftVouchersAfterDeletingOrder = true,
+ DeactivateGiftVouchersAfterCancelOrder = true,
+ GiftVouchers_Activated_OrderStatusId = 30,
+ CompleteOrderWhenDelivered = true,
+ UserCanCancelUnpaidOrder = false,
+ LengthCode = 8,
+ PageSize = 10
+ });
+
+ await _settingRepository.SaveSetting(new ShippingSettings {
+ AllowPickUpInStore = true,
+ FreeShippingOverXEnabled = false,
+ FreeShippingOverXValue = 0,
+ FreeShippingOverXIncludingTax = false,
+ EstimateShippingEnabled = false,
+ DisplayShipmentEventsToCustomers = false,
+ DisplayShipmentEventsToStoreOwner = false,
+ SkipShippingMethodSelectionIfOnlyOne = false
+ });
+
+ await _settingRepository.SaveSetting(new ShippingProviderSettings {
+ ActiveSystemNames = ["Shipping.FixedRate"]
+ });
+
+ await _settingRepository.SaveSetting(new PaymentSettings {
+ ActivePaymentProviderSystemNames = [
+ "Payments.CashOnDelivery",
+ "Payments.StripeCheckout",
+ "Payments.BrainTree"
+ ],
+ AllowRePostingPayments = true,
+ SkipPaymentIfOnlyOne = true,
+ ShowPaymentDescriptions = true,
+ SkipPaymentInfo = false
+ });
+
+ await _settingRepository.SaveSetting(new TaxSettings {
+ TaxBasedOn = TaxBasedOn.BillingAddress,
+ TaxDisplayType = TaxDisplayType.ExcludingTax,
+ DisplayTaxRates = false,
+ PricesIncludeTax = false,
+ CalculateRoundPrice = 2,
+ MidpointRounding = MidpointRounding.ToEven,
+ AllowCustomersToSelectTaxDisplayType = false,
+ ForceTaxExclusionFromOrderSubtotal = false,
+ HideZeroTax = false,
+ HideTaxInOrderSummary = false,
+ DefaultTaxCategoryId = "",
+ ShippingIsTaxable = false,
+ ShippingPriceIncludesTax = false,
+ ShippingTaxCategoryId = "",
+ PaymentMethodAdditionalFeeIsTaxable = false,
+ PaymentMethodAdditionalFeeIncludesTax = false,
+ PaymentMethodAdditionalFeeTaxCategoryId = "",
+ EuVatEnabled = false,
+ EuVatShopCountryId = "",
+ EuVatAllowVatExemption = true,
+ EuVatUseWebService = false,
+ EuVatAssumeValid = false
+ });
+
+ await _settingRepository.SaveSetting(new TaxProviderSettings {
+ ActiveTaxProviderSystemName = "Tax.FixedRate"
+ });
+
+ await _settingRepository.SaveSetting(new DateTimeSettings {
+ DefaultStoreTimeZoneId = ""
+ });
+
+ await _settingRepository.SaveSetting(new BlogSettings {
+ Enabled = true,
+ PostsPageSize = 10,
+ AllowNotRegisteredUsersToLeaveComments = false,
+ NotifyAboutNewBlogComments = false,
+ NumberOfTags = 15,
+ ShowBlogOnHomePage = false,
+ HomePageBlogCount = 3,
+ MaxTextSizeHomePage = 200
+ });
+
+ await _settingRepository.SaveSetting(new KnowledgebaseSettings {
+ Enabled = false,
+ AllowNotRegisteredUsersToLeaveComments = false,
+ NotifyAboutNewArticleComments = false
+ });
+
+ await _settingRepository.SaveSetting(new PushNotificationsSettings {
+ Enabled = false,
+ AllowGuestNotifications = true
+ });
+
+ await _settingRepository.SaveSetting(new AdminSearchSettings {
+ BlogsDisplayOrder = 0,
+ CategoriesDisplayOrder = 0,
+ CustomersDisplayOrder = 0,
+ CollectionsDisplayOrder = 0,
+ MaxSearchResultsCount = 10,
+ MinSearchTermLength = 3,
+ NewsDisplayOrder = 0,
+ OrdersDisplayOrder = 0,
+ ProductsDisplayOrder = 0,
+ SearchInBlogs = true,
+ SearchInCategories = true,
+ SearchInCustomers = true,
+ SearchInCollections = true,
+ SearchInNews = true,
+ SearchInOrders = true,
+ SearchInProducts = true,
+ SearchInPages = true,
+ PagesDisplayOrder = 0,
+ SearchInMenu = true,
+ MenuDisplayOrder = -1,
+ CategorySizeLimit = 100,
+ BrandSizeLimit = 100,
+ CollectionSizeLimit = 100,
+ VendorSizeLimit = 100,
+ CustomerGroupSizeLimit = 100
+ });
+
+ await _settingRepository.SaveSetting(new NewsSettings {
+ Enabled = true,
+ AllowNotRegisteredUsersToLeaveComments = false,
+ NotifyAboutNewNewsComments = false,
+ ShowNewsOnMainPage = true,
+ MainPageNewsCount = 3,
+ NewsArchivePageSize = 10
+ });
+
+ await _settingRepository.SaveSetting(new VendorSettings {
+ DefaultVendorPageSizeOptions = "6, 3, 9",
+ VendorsBlockItemsToDisplay = 0,
+ ShowVendorOnProductDetailsPage = true,
+ AllowCustomersToContactVendors = true,
+ AllowCustomersToApplyForVendorAccount = false,
+ AllowAnonymousUsersToReviewVendor = false,
+ DefaultVendorRatingValue = 5,
+ NumberOfReview = 10,
+ VendorReviewsMustBeApproved = true,
+ VendorReviewPossibleOnlyAfterPurchasing = true,
+ NotifyVendorAboutNewVendorReviews = true
+ });
+
+ var eaGeneral = _emailAccountRepository.Table.FirstOrDefault();
+ if (eaGeneral == null)
+ throw new Exception("Default email account cannot be loaded");
+ await _settingRepository.SaveSetting(new EmailAccountSettings {
+ DefaultEmailAccountId = eaGeneral.Id
+ });
+
+ await _settingRepository.SaveSetting(new WidgetSettings {
+ ActiveWidgetSystemNames = ["Widgets.Slider"]
+ });
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataShippingMethods.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataShippingMethods.cs
new file mode 100644
index 000000000..9ea4caea3
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataShippingMethods.cs
@@ -0,0 +1,29 @@
+using Grand.Domain.Shipping;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallShippingMethods()
+ {
+ var shippingMethods = new List<ShippingMethod> {
+ new() {
+ Name = "Ground",
+ Description = "Compared to other shipping methods, ground shipping is carried out closer to the earth",
+ DisplayOrder = 1
+ },
+ new() {
+ Name = "Next Day Air",
+ Description = "The one day air shipping",
+ DisplayOrder = 3
+ },
+ new() {
+ Name = "2nd Day Air",
+ Description = "The two day air shipping",
+ DisplayOrder = 3
+ }
+ };
+ shippingMethods.ForEach(x => _shippingMethodRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataSpecificationAttributes.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataSpecificationAttributes.cs
new file mode 100644
index 000000000..df5aac96b
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataSpecificationAttributes.cs
@@ -0,0 +1,112 @@
+using Grand.Domain.Catalog;
+using Grand.Module.Installer.Extensions;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallSpecificationAttributes()
+ {
+ var sa1 = new SpecificationAttribute {
+ Name = "Screensize",
+ DisplayOrder = 1,
+ SeName = SeoExtensions.GenerateSlug("Screensize", false, false, false)
+ };
+ await _specificationAttributeRepository.InsertAsync(sa1);
+
+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "13.0''",
+ DisplayOrder = 2,
+ SeName = SeoExtensions.GenerateSlug("13.0''", false, false, false)
+ });
+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "13.3''",
+ DisplayOrder = 3,
+ SeName = SeoExtensions.GenerateSlug("13.3''", false, false, false)
+ });
+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "14.0''",
+ DisplayOrder = 4,
+ SeName = SeoExtensions.GenerateSlug("14.0''", false, false, false)
+ });
+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "15.0''",
+ DisplayOrder = 4,
+ SeName = SeoExtensions.GenerateSlug("15.0''", false, false, false)
+ });
+ sa1.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "15.6''",
+ DisplayOrder = 5,
+ SeName = SeoExtensions.GenerateSlug("15.6''", false, false, false)
+ });
+ await _specificationAttributeRepository.UpdateAsync(sa1);
+
+ var sa2 = new SpecificationAttribute {
+ Name = "CPU Type",
+ DisplayOrder = 2,
+ SeName = SeoExtensions.GenerateSlug("CPU Type", false, false, false)
+ };
+ await _specificationAttributeRepository.InsertAsync(sa2);
+
+ sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "Intel Core i5",
+ DisplayOrder = 1,
+ SeName = SeoExtensions.GenerateSlug("Intel Core i5", false, false, false)
+ });
+
+ sa2.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "Intel Core i7",
+ DisplayOrder = 2,
+ SeName = SeoExtensions.GenerateSlug("Intel Core i7", false, false, false)
+ });
+ await _specificationAttributeRepository.UpdateAsync(sa2);
+
+ var sa3 = new SpecificationAttribute {
+ Name = "Memory",
+ DisplayOrder = 3,
+ SeName = SeoExtensions.GenerateSlug("Memory", false, false, false)
+ };
+ await _specificationAttributeRepository.InsertAsync(sa3);
+
+ sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "4 GB",
+ DisplayOrder = 1,
+ SeName = SeoExtensions.GenerateSlug("4 GB", false, false, false)
+ });
+ sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "8 GB",
+ DisplayOrder = 2,
+ SeName = SeoExtensions.GenerateSlug("8 GB", false, false, false)
+ });
+ sa3.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "16 GB",
+ DisplayOrder = 3,
+ SeName = SeoExtensions.GenerateSlug("16 GB", false, false, false)
+ });
+ await _specificationAttributeRepository.UpdateAsync(sa3);
+
+ var sa4 = new SpecificationAttribute {
+ Name = "Hardrive",
+ DisplayOrder = 5,
+ SeName = SeoExtensions.GenerateSlug("Hardrive", false, false, false)
+ };
+ await _specificationAttributeRepository.InsertAsync(sa4);
+
+ sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "128 GB",
+ DisplayOrder = 7,
+ SeName = SeoExtensions.GenerateSlug("128 GB", false, false, false)
+ });
+ sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "500 GB",
+ DisplayOrder = 4,
+ SeName = SeoExtensions.GenerateSlug("500 GB", false, false, false)
+ });
+ sa4.SpecificationAttributeOptions.Add(new SpecificationAttributeOption {
+ Name = "1 TB",
+ DisplayOrder = 3,
+ SeName = SeoExtensions.GenerateSlug("1 TB", false, false, false)
+ });
+ await _specificationAttributeRepository.UpdateAsync(sa4);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataStores.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataStores.cs
new file mode 100644
index 000000000..790308394
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataStores.cs
@@ -0,0 +1,35 @@
+using Grand.Domain.Stores;
+using Microsoft.AspNetCore.Http;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallStores(
+ string httpscheme, HostString host,
+ string? companyName, string? companyAddress, string? companyPhoneNumber, string? companyEmail)
+ {
+ var store =
+ new Store {
+ Name = "Your store name",
+ Shortcut = "Store",
+ Url = $"http://{host}/",
+ SecureUrl = $"https://{host}/",
+ SslEnabled = httpscheme.ToLowerInvariant() == "https",
+ DisplayOrder = 1,
+ CompanyName = companyName,
+ CompanyAddress = companyAddress,
+ CompanyPhoneNumber = companyPhoneNumber,
+ CompanyRegNo = null,
+ CompanyVat = null,
+ CompanyEmail = companyEmail,
+ CompanyHours = "Monday - Sunday / 8:00AM - 6:00PM",
+ Domains = new List<DomainHost>
+ { new() { HostName = host.Value, Url = $"{httpscheme}://{host}/", Primary = true } }
+ };
+
+ store = await _storeRepository.InsertAsync(store);
+
+ await InstallDataRobotsTxt(store);
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataTaxCategories.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataTaxCategories.cs
new file mode 100644
index 000000000..2221fcd46
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataTaxCategories.cs
@@ -0,0 +1,34 @@
+using Grand.Domain.Tax;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallTaxCategories()
+ {
+ var taxCategories = new List<TaxCategory> {
+ new() {
+ Name = "Lego",
+ DisplayOrder = 1
+ },
+ new() {
+ Name = "Electronics & Software",
+ DisplayOrder = 5
+ },
+ new() {
+ Name = "Downloadable Products",
+ DisplayOrder = 10
+ },
+ new() {
+ Name = "Balls",
+ DisplayOrder = 15
+ },
+ new() {
+ Name = "Apparel",
+ DisplayOrder = 20
+ }
+ };
+ taxCategories.ForEach(x => _taxCategoryRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataVendors.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataVendors.cs
new file mode 100644
index 000000000..d29a38217
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataVendors.cs
@@ -0,0 +1,55 @@
+using Grand.Domain.Seo;
+using Grand.Domain.Vendors;
+using Grand.Module.Installer.Extensions;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual async Task InstallVendors()
+ {
+ var vendors = new List<Vendor> {
+ new() {
+ Name = "Vendor 1",
+ Email = "[email protected]",
+ Description = "Some description...",
+ AdminComment = "",
+ PictureId = "",
+ Active = true,
+ DisplayOrder = 1,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9, 18"
+ },
+ new() {
+ Name = "Vendor 2",
+ Email = "[email protected]",
+ Description = "Some description...",
+ AdminComment = "",
+ PictureId = "",
+ Active = true,
+ DisplayOrder = 2,
+ PageSize = 6,
+ AllowCustomersToSelectPageSize = true,
+ PageSizeOptions = "6, 3, 9, 18"
+ }
+ };
+
+ vendors.ForEach(x => _vendorRepository.Insert(x));
+
+ //search engine names
+ foreach (var vendor in vendors)
+ {
+ var seName = SeoExtensions.GenerateSlug(vendor.Name, false, false, false);
+ await _entityUrlRepository.InsertAsync(new EntityUrl {
+ EntityId = vendor.Id,
+ EntityName = "Vendor",
+ LanguageId = "",
+ IsActive = true,
+ Slug = seName
+ });
+ vendor.SeName = seName;
+ await _vendorRepository.UpdateAsync(vendor);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallDataWarehouses.cs b/src/Modules/Grand.Module.Installer/Services/InstallDataWarehouses.cs
new file mode 100644
index 000000000..5f19f1318
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallDataWarehouses.cs
@@ -0,0 +1,45 @@
+using Grand.Domain.Common;
+using Grand.Domain.Shipping;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService
+{
+ protected virtual Task InstallWarehouses()
+ {
+ var country = _countryRepository.Table.FirstOrDefault(c => c.ThreeLetterIsoCode == "USA");
+ var warehouse1address = new Address {
+ Address1 = "21 West 52nd Street",
+ City = "New York",
+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "New York")?.Id,
+ CountryId = country?.Id,
+ ZipPostalCode = "10021"
+ };
+
+ var warehouse2address = new Address {
+ Address1 = "300 South Spring Stree",
+ City = "Los Angeles",
+ StateProvinceId = country?.StateProvinces.FirstOrDefault(sp => sp.Name == "California")?.Id,
+ CountryId = country?.Id,
+ ZipPostalCode = "90013"
+ };
+
+ var warehouses = new List<Warehouse> {
+ new() {
+ Code = "WHS01",
+ Name = "Warehouse 1",
+ Address = warehouse1address,
+ DisplayOrder = 0
+ },
+ new() {
+ Code = "WHS02",
+ Name = "Warehouse 2",
+ Address = warehouse2address,
+ DisplayOrder = 1
+ }
+ };
+
+ warehouses.ForEach(x => _warehouseRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallationLocalizedService.cs b/src/Modules/Grand.Module.Installer/Services/InstallationLocalizedService.cs
new file mode 100644
index 000000000..b06d44459
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallationLocalizedService.cs
@@ -0,0 +1,185 @@
+using Grand.Module.Installer.Interfaces;
+using Grand.Module.Installer.Utilities;
+using Microsoft.AspNetCore.Hosting;
+using System.Text.RegularExpressions;
+using System.Xml;
+
+namespace Grand.Module.Installer.Services;
+
+/// <summary>
+/// Translation service for installation process
+/// </summary>
+public class InstallationLocalizedService(IWebHostEnvironment hostingEnvironment) : IInstallationLocalizedService
+{
+ /// <summary>
+ /// Available collation
+ /// </summary>
+ private IList<InstallationCollation>? _availableCollation;
+
+ /// <summary>
+ /// Available languages
+ /// </summary>
+ private IList<InstallationLanguage>? _availableLanguages;
+
+ private readonly IWebHostEnvironment _hostingEnvironment = hostingEnvironment;
+
+ /// <summary>
+ /// Get locale resource value
+ /// </summary>
+ /// <param name="languageCode">Language code</param>
+ /// <param name="resourceName">Resource name</param>
+ /// <returns>Resource value</returns>
+ public string GetResource(string? languageCode, string resourceName)
+ {
+ var language = GetCurrentLanguage(languageCode);
+ if (language == null)
+ return resourceName;
+ var resourceValue = language.Resources
+ .Where(r => r.Name!.Equals(resourceName, StringComparison.OrdinalIgnoreCase))
+ .Select(r => r.Value)
+ .FirstOrDefault();
+
+ return string.IsNullOrEmpty(resourceValue) ? resourceName : resourceValue;
+ }
+
+ /// <summary>
+ /// Get current language for the installation page
+ /// </summary>
+ /// <returns>Current language</returns>
+ /// <param name="languageCode">Language Code</param>
+ public virtual InstallationLanguage GetCurrentLanguage(string? languageCode = default)
+ {
+ var availableLanguages = GetAvailableLanguages();
+ if (!string.IsNullOrEmpty(languageCode))
+ {
+ var selectedlanguage = availableLanguages
+ .FirstOrDefault(l => l.Code!.Equals(languageCode, StringComparison.OrdinalIgnoreCase));
+ if (selectedlanguage != null)
+ return selectedlanguage;
+ }
+
+ //return the default one
+ var language = availableLanguages.FirstOrDefault(l => l.IsDefault);
+ if (language != null)
+ return language;
+
+ //return any available language
+ language = availableLanguages.FirstOrDefault();
+ return language!;
+ }
+
+ /// <summary>
+ /// Get a list of available languages
+ /// </summary>
+ /// <returns>Available installation languages</returns>
+ public virtual IList<InstallationLanguage> GetAvailableLanguages()
+ {
+ if (_availableLanguages != null)
+ return _availableLanguages;
+
+ _availableLanguages = new List<InstallationLanguage>();
+ var path = Path.Combine(_hostingEnvironment.ContentRootPath, "App_Data/Resources/Installation");
+ foreach (var filePath in Directory.EnumerateFiles(path, "*.xml"))
+ {
+ var xmlDocument = new XmlDocument();
+ xmlDocument.Load(File.OpenRead(filePath));
+
+ var languageCode = "";
+ var r = new Regex(Regex.Escape("installation.") + "(.*?)" + Regex.Escape(".xml"));
+ var matches = r.Matches(Path.GetFileName(filePath));
+ foreach (Match match in matches)
+ languageCode = match.Groups[1].Value;
+
+ var languageNode = xmlDocument.SelectSingleNode("//Language");
+
+ if (languageNode?.Attributes == null)
+ continue;
+
+ //get language friendly name
+ var languageName = languageNode.Attributes["Name"]?.InnerText.Trim();
+
+ //is default
+ var isDefaultAttribute = languageNode.Attributes["IsDefault"];
+ var isDefault = isDefaultAttribute != null && Convert.ToBoolean(isDefaultAttribute.InnerText.Trim());
+
+ //is default
+ var isRightToLeftAttribute = languageNode.Attributes["IsRightToLeft"];
+ var isRightToLeft = isRightToLeftAttribute != null &&
+ Convert.ToBoolean(isRightToLeftAttribute.InnerText.Trim());
+
+ //create language
+ var language = new InstallationLanguage {
+ Code = languageCode,
+ Name = languageName,
+ IsDefault = isDefault,
+ IsRightToLeft = isRightToLeft
+ };
+
+ //load resources
+ var resources = xmlDocument.SelectNodes("//Language/LocaleResource");
+ if (resources == null)
+ continue;
+ foreach (XmlNode resNode in resources)
+ {
+ if (resNode.Attributes == null)
+ continue;
+
+ var resNameAttribute = resNode.Attributes["Name"];
+ var resValueNode = resNode.SelectSingleNode("Value");
+
+ if (resNameAttribute == null)
+ continue;
+ var resourceName = resNameAttribute.Value.Trim();
+ if (string.IsNullOrEmpty(resourceName))
+ continue;
+
+ if (resValueNode == null)
+ continue;
+ var resourceValue = resValueNode.InnerText.Trim();
+
+ language.Resources.Add(new InstallationLocaleResource {
+ Name = resourceName,
+ Value = resourceValue
+ });
+ }
+
+ _availableLanguages.Add(language);
+ _availableLanguages = _availableLanguages.OrderBy(l => l.Name).ToList();
+ }
+
+ return _availableLanguages;
+ }
+
+ /// <summary>
+ /// Get a list of available collactions
+ /// </summary>
+ /// <returns>Available collations mongodb</returns>
+ public virtual IList<InstallationCollation> GetAvailableCollations()
+ {
+ if (_availableCollation != null)
+ return _availableCollation;
+
+ _availableCollation = new List<InstallationCollation>();
+ var filePath = Path.Combine(_hostingEnvironment.ContentRootPath, "App_Data/Resources/supportedcollation.xml");
+ var xmlDocument = new XmlDocument { XmlResolver = null };
+ xmlDocument.Load(File.OpenRead(filePath));
+
+ var collation = xmlDocument.SelectNodes("//Collations/Collation");
+
+ foreach (XmlNode resNode in collation!)
+ {
+ var resNameAttribute = resNode.Attributes!["Name"];
+ var resValueNode = resNode.SelectSingleNode("Value");
+
+ var resourceName = resNameAttribute!.Value.Trim();
+ var resourceValue = resValueNode!.InnerText.Trim();
+
+ _availableCollation.Add(new InstallationCollation {
+ Name = resourceName,
+ Value = resourceValue
+ });
+ }
+
+ return _availableCollation;
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Services/InstallationService.cs b/src/Modules/Grand.Module.Installer/Services/InstallationService.cs
new file mode 100644
index 000000000..ed6c1e61c
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Services/InstallationService.cs
@@ -0,0 +1,1032 @@
+using Grand.Data;
+using Grand.Domain;
+using Grand.Domain.Admin;
+using Grand.Domain.Affiliates;
+using Grand.Domain.Blogs;
+using Grand.Domain.Catalog;
+using Grand.Domain.Common;
+using Grand.Domain.Configuration;
+using Grand.Domain.Courses;
+using Grand.Domain.Customers;
+using Grand.Domain.Directory;
+using Grand.Domain.Discounts;
+using Grand.Domain.Documents;
+using Grand.Domain.Knowledgebase;
+using Grand.Domain.Localization;
+using Grand.Domain.Media;
+using Grand.Domain.Messages;
+using Grand.Domain.News;
+using Grand.Domain.Orders;
+using Grand.Domain.Pages;
+using Grand.Domain.Payments;
+using Grand.Domain.Permissions;
+using Grand.Domain.Seo;
+using Grand.Domain.Shipping;
+using Grand.Domain.Stores;
+using Grand.Domain.Tasks;
+using Grand.Domain.Tax;
+using Grand.Domain.Vendors;
+using Grand.Infrastructure;
+using Grand.Infrastructure.TypeSearch;
+using Grand.Module.Installer.Interfaces;
+using Grand.Module.Installer.Utilities;
+using Grand.SharedKernel;
+using Grand.SharedKernel.Extensions;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.DependencyInjection;
+using System.Security.Cryptography;
+
+namespace Grand.Module.Installer.Services;
+
+public partial class InstallationService : IInstallationService
+{
+ #region Ctor
+
+ public InstallationService(
+ IServiceProvider serviceProvider,
+ IWebHostEnvironment webHostEnvironment,
+ IRepository<GrandNodeVersion> versionRepository,
+ IRepository<AdminSiteMap> adminRepository,
+ IRepository<Bid> bidRepository,
+ IRepository<Affiliate> affiliateRepository,
+ IRepository<CampaignHistory> campaignHistoryRepository,
+ IRepository<Campaign> campaignRepository,
+ IRepository<Order> orderRepository,
+ IRepository<OrderNote> orderNoteRepository,
+ IRepository<MerchandiseReturn> merchandiseReturnRepository,
+ IRepository<MerchandiseReturnNote> merchandiseReturnNoteRepository,
+ IRepository<Store> storeRepository,
+ IRepository<MeasureDimension> measureDimensionRepository,
+ IRepository<MeasureWeight> measureWeightRepository,
+ IRepository<MeasureUnit> measureUnitRepository,
+ IRepository<TaxCategory> taxCategoryRepository,
+ IRepository<Language> languageRepository,
+ IRepository<TranslationResource> lsrRepository,
+ IRepository<Currency> currencyRepository,
+ IRepository<Customer> customerRepository,
+ IRepository<CustomerGroup> customerGroupRepository,
+ IRepository<CustomerGroupProduct> customerGroupProductRepository,
+ IRepository<CustomerProduct> customerProductRepository,
+ IRepository<CustomerProductPrice> customerProductPriceRepository,
+ IRepository<CustomerTagProduct> customerTagProductRepository,
+ IRepository<CustomerHistoryPassword> customerHistoryPasswordRepository,
+ IRepository<CustomerNote> customerNoteRepository,
+ IRepository<UserApi> userapiRepository,
+ IRepository<SpecificationAttribute> specificationAttributeRepository,
+ IRepository<CheckoutAttribute> checkoutAttributeRepository,
+ IRepository<ProductAttribute> productAttributeRepository,
+ IRepository<AddressAttribute> addressAttributeRepository,
+ IRepository<CustomerAttribute> customerAttributeRepository,
+ IRepository<ContactAttribute> contactAttributeRepository,
+ IRepository<Category> categoryRepository,
+ IRepository<Brand> brandRepository,
+ IRepository<Vendor> vendorRepository,
+ IRepository<Collection> collectionRepository,
+ IRepository<Product> productRepository,
+ IRepository<ProductReservation> productReservationRepository,
+ IRepository<ProductAlsoPurchased> productalsopurchasedRepository,
+ IRepository<EntityUrl> entityUrlRepository,
+ IRepository<EmailAccount> emailAccountRepository,
+ IRepository<MessageTemplate> messageTemplateRepository,
+ IRepository<Country> countryRepository,
+ IRepository<Discount> discountRepository,
+ IRepository<DiscountCoupon> discountCouponRepository,
+ IRepository<DiscountUsageHistory> discountusageRepository,
+ IRepository<BlogPost> blogPostRepository,
+ IRepository<BlogCategory> blogCategoryRepository,
+ IRepository<BlogComment> blogCommentRepository,
+ IRepository<Page> pageRepository,
+ IRepository<NewsItem> newsItemRepository,
+ IRepository<NewsLetterSubscription> newslettersubscriptionRepository,
+ IRepository<ShippingMethod> shippingMethodRepository,
+ IRepository<DeliveryDate> deliveryDateRepository,
+ IRepository<ProductTag> productTagRepository,
+ IRepository<ProductReview> productReviewRepository,
+ IRepository<ProductLayout> productLayoutRepository,
+ IRepository<CategoryLayout> categoryLayoutRepository,
+ IRepository<BrandLayout> brandLayoutRepository,
+ IRepository<CollectionLayout> collectionLayoutRepository,
+ IRepository<PageLayout> pageLayoutRepository,
+ IRepository<ScheduleTask> scheduleTaskRepository,
+ IRepository<LoyaltyPointsHistory> loyaltypointshistoryRepository,
+ IRepository<SearchTerm> searchtermRepository,
+ IRepository<Setting> settingRepository,
+ IRepository<Shipment> shipmentRepository,
+ IRepository<Warehouse> warehouseRepository,
+ IRepository<PickupPoint> pickupPointsRepository,
+ IRepository<Permission> permissionRepository,
+ IRepository<PermissionAction> permissionAction,
+ IRepository<ExternalAuthentication> externalAuthenticationRepository,
+ IRepository<MerchandiseReturnReason> merchandiseReturnReasonRepository,
+ IRepository<MerchandiseReturnAction> merchandiseReturnActionRepository,
+ IRepository<ContactUs> contactUsRepository,
+ IRepository<RecentlyViewedProduct> recentlyViewedProductRepository,
+ IRepository<KnowledgebaseArticle> knowledgebaseArticleRepository,
+ IRepository<KnowledgebaseCategory> knowledgebaseCategoryRepository,
+ IRepository<OrderTag> orderTagRepository,
+ IRepository<OrderStatus> orderStatusRepository,
+ IRepository<PickupPoint> pickupPointRepository,
+ IRepository<OutOfStockSubscription> outOfStockSubscriptionRepository,
+ IRepository<ShipmentNote> shipmentNoteRepository,
+ IRepository<PaymentTransaction> paymentTransactionRepository,
+ IRepository<QueuedEmail> queuedEmailRepository,
+ IRepository<GiftVoucher> giftVoucherRepository,
+ IRepository<DocumentType> documentTypeRepository,
+ IRepository<Document> documentRepository,
+ IRepository<SalesEmployee> salesRepository,
+ IRepository<VendorReview> vendorReviewRepository,
+ IRepository<NewsletterCategory> newsletterCategoryRepository,
+ IRepository<Course> courseRepository,
+ IRepository<CourseLevel> courseLevelRepository,
+ IRepository<RobotsTxt> robotsTxtRepository,
+ IRepository<Picture> pictureRepository,
+ IRepository<Download> downloadRepository)
+ {
+ _versionRepository = versionRepository;
+ _adminRepository = adminRepository;
+ _bidRepository = bidRepository;
+ _affiliateRepository = affiliateRepository;
+ _campaignHistoryRepository = campaignHistoryRepository;
+ _campaignRepository = campaignRepository;
+ _orderRepository = orderRepository;
+ _orderNoteRepository = orderNoteRepository;
+ _storeRepository = storeRepository;
+ _measureDimensionRepository = measureDimensionRepository;
+ _measureWeightRepository = measureWeightRepository;
+ _measureUnitRepository = measureUnitRepository;
+ _taxCategoryRepository = taxCategoryRepository;
+ _languageRepository = languageRepository;
+ _lsrRepository = lsrRepository;
+ _currencyRepository = currencyRepository;
+ _customerRepository = customerRepository;
+ _customerGroupRepository = customerGroupRepository;
+ _customerProductRepository = customerProductRepository;
+ _customerProductPriceRepository = customerProductPriceRepository;
+ _customerGroupProductRepository = customerGroupProductRepository;
+ _customerTagProductRepository = customerTagProductRepository;
+ _customerHistoryPasswordRepository = customerHistoryPasswordRepository;
+ _customerNoteRepository = customerNoteRepository;
+ _userapiRepository = userapiRepository;
+ _specificationAttributeRepository = specificationAttributeRepository;
+ _checkoutAttributeRepository = checkoutAttributeRepository;
+ _productAttributeRepository = productAttributeRepository;
+ _addressAttributeRepository = addressAttributeRepository;
+ _customerAttributeRepository = customerAttributeRepository;
+ _categoryRepository = categoryRepository;
+ _brandRepository = brandRepository;
+ _collectionRepository = collectionRepository;
+ _productRepository = productRepository;
+ _productReservationRepository = productReservationRepository;
+ _productalsopurchasedRepository = productalsopurchasedRepository;
+ _entityUrlRepository = entityUrlRepository;
+ _emailAccountRepository = emailAccountRepository;
+ _messageTemplateRepository = messageTemplateRepository;
+ _countryRepository = countryRepository;
+ _discountRepository = discountRepository;
+ _discountCouponRepository = discountCouponRepository;
+ _blogPostRepository = blogPostRepository;
+ _blogCommentRepository = blogCommentRepository;
+ _pageRepository = pageRepository;
+ _productReviewRepository = productReviewRepository;
+ _newsItemRepository = newsItemRepository;
+ _newslettersubscriptionRepository = newslettersubscriptionRepository;
+ _shippingMethodRepository = shippingMethodRepository;
+ _deliveryDateRepository = deliveryDateRepository;
+ _productTagRepository = productTagRepository;
+ _productLayoutRepository = productLayoutRepository;
+ _recentlyViewedProductRepository = recentlyViewedProductRepository;
+ _categoryLayoutRepository = categoryLayoutRepository;
+ _brandLayoutRepository = brandLayoutRepository;
+ _collectionLayoutRepository = collectionLayoutRepository;
+ _pageLayoutRepository = pageLayoutRepository;
+ _scheduleTaskRepository = scheduleTaskRepository;
+ _merchandiseReturnRepository = merchandiseReturnRepository;
+ _merchandiseReturnNoteRepository = merchandiseReturnNoteRepository;
+ _loyaltypointshistoryRepository = loyaltypointshistoryRepository;
+ _searchtermRepository = searchtermRepository;
+ _settingRepository = settingRepository;
+ _shipmentRepository = shipmentRepository;
+ _shipmentNoteRepository = shipmentNoteRepository;
+ _warehouseRepository = warehouseRepository;
+ _pickupPointsRepository = pickupPointsRepository;
+ _permissionRepository = permissionRepository;
+ _permissionAction = permissionAction;
+ _vendorRepository = vendorRepository;
+ _externalAuthenticationRepository = externalAuthenticationRepository;
+ _discountusageRepository = discountusageRepository;
+ _merchandiseReturnReasonRepository = merchandiseReturnReasonRepository;
+ _contactUsRepository = contactUsRepository;
+ _merchandiseReturnActionRepository = merchandiseReturnActionRepository;
+ _knowledgebaseArticleRepository = knowledgebaseArticleRepository;
+ _knowledgebaseCategoryRepository = knowledgebaseCategoryRepository;
+ _orderTagRepository = orderTagRepository;
+ _orderStatusRepository = orderStatusRepository;
+ _pickupPointRepository = pickupPointRepository;
+ _outOfStockSubscriptionRepository = outOfStockSubscriptionRepository;
+ _blogCategoryRepository = blogCategoryRepository;
+ _paymentTransactionRepository = paymentTransactionRepository;
+ _queuedEmailRepository = queuedEmailRepository;
+ _giftVoucherRepository = giftVoucherRepository;
+ _documentTypeRepository = documentTypeRepository;
+ _documentRepository = documentRepository;
+ _salesRepository = salesRepository;
+ _vendorReviewRepository = vendorReviewRepository;
+ _contactAttributeRepository = contactAttributeRepository;
+ _newsletterCategoryRepository = newsletterCategoryRepository;
+ _courseRepository = courseRepository;
+ _courseLevelRepository = courseLevelRepository;
+ _robotsTxtRepository = robotsTxtRepository;
+ _hostingEnvironment = webHostEnvironment;
+ _serviceProvider = serviceProvider;
+ _pictureRepository = pictureRepository;
+ _downloadRepository = downloadRepository;
+ }
+
+ #endregion
+
+ #region Methods
+
+ public virtual async Task InstallData(string httpscheme, HostString host, string defaultUserEmail,
+ string defaultUserPassword, string? collation, bool installSampleData = true, string? companyName = "",
+ string? companyAddress = "",
+ string? companyPhoneNumber = "", string? companyEmail = "")
+ {
+ defaultUserEmail = defaultUserEmail.ToLower();
+
+ await CreateTables(collation);
+ await InstallVersion();
+ await InstallMenuAdminSiteMap();
+ await InstallStores(httpscheme, host, companyName, companyAddress, companyPhoneNumber, companyEmail);
+ await InstallMeasures();
+ await InstallTaxCategories();
+ await InstallLanguages();
+ await InstallCurrencies();
+ await InstallCountriesAndStates();
+ await InstallShippingMethods();
+ await InstallDeliveryDates();
+ await InstallCustomersAndUsers(defaultUserEmail, defaultUserPassword);
+ await InstallEmailAccounts();
+ await InstallMessageTemplates();
+ await InstallSettings(installSampleData);
+ await InstallPageLayouts();
+ await InstallPages();
+ await InstallLocaleResources();
+ await HashDefaultCustomerPassword(defaultUserEmail, defaultUserPassword);
+ await InstallProductLayouts();
+ await InstallCategoryLayouts();
+ await InstallBrandLayouts();
+ await InstallCollectionLayouts();
+ await InstallScheduleTasks();
+ await InstallMerchandiseReturnReasons();
+ await InstallMerchandiseReturnActions();
+ await InstallOrderStatus();
+ await InstallPermissions();
+
+ if (installSampleData)
+ {
+ await InstallCheckoutAttributes();
+ await InstallSpecificationAttributes();
+ await InstallProductAttributes();
+ await InstallCategories();
+ await InstallBrands();
+ await InstallProducts(defaultUserEmail);
+ await InstallDiscounts();
+ await InstallBlogPosts();
+ await InstallNews();
+ await InstallWarehouses();
+ await InstallPickupPoints();
+ await InstallVendors();
+ await InstallAffiliates();
+ await InstallOrderTags();
+ }
+ }
+
+ #endregion
+
+ #region Fields
+
+ private readonly IRepository<GrandNodeVersion> _versionRepository;
+ private readonly IRepository<AdminSiteMap> _adminRepository;
+ private readonly IRepository<Bid> _bidRepository;
+ private readonly IRepository<Affiliate> _affiliateRepository;
+ private readonly IRepository<CampaignHistory> _campaignHistoryRepository;
+ private readonly IRepository<Campaign> _campaignRepository;
+ private readonly IRepository<Order> _orderRepository;
+ private readonly IRepository<OrderNote> _orderNoteRepository;
+ private readonly IRepository<MerchandiseReturn> _merchandiseReturnRepository;
+ private readonly IRepository<MerchandiseReturnNote> _merchandiseReturnNoteRepository;
+ private readonly IRepository<Store> _storeRepository;
+ private readonly IRepository<MeasureDimension> _measureDimensionRepository;
+ private readonly IRepository<MeasureWeight> _measureWeightRepository;
+ private readonly IRepository<MeasureUnit> _measureUnitRepository;
+ private readonly IRepository<TaxCategory> _taxCategoryRepository;
+ private readonly IRepository<Language> _languageRepository;
+ private readonly IRepository<TranslationResource> _lsrRepository;
+ private readonly IRepository<Currency> _currencyRepository;
+ private readonly IRepository<Customer> _customerRepository;
+ private readonly IRepository<CustomerGroup> _customerGroupRepository;
+ private readonly IRepository<CustomerGroupProduct> _customerGroupProductRepository;
+ private readonly IRepository<CustomerProduct> _customerProductRepository;
+ private readonly IRepository<CustomerProductPrice> _customerProductPriceRepository;
+ private readonly IRepository<CustomerTagProduct> _customerTagProductRepository;
+ private readonly IRepository<CustomerHistoryPassword> _customerHistoryPasswordRepository;
+ private readonly IRepository<CustomerNote> _customerNoteRepository;
+ private readonly IRepository<UserApi> _userapiRepository;
+ private readonly IRepository<SpecificationAttribute> _specificationAttributeRepository;
+ private readonly IRepository<CheckoutAttribute> _checkoutAttributeRepository;
+ private readonly IRepository<ProductAttribute> _productAttributeRepository;
+ private readonly IRepository<AddressAttribute> _addressAttributeRepository;
+ private readonly IRepository<CustomerAttribute> _customerAttributeRepository;
+ private readonly IRepository<ContactAttribute> _contactAttributeRepository;
+ private readonly IRepository<Category> _categoryRepository;
+ private readonly IRepository<Brand> _brandRepository;
+ private readonly IRepository<Vendor> _vendorRepository;
+ private readonly IRepository<Collection> _collectionRepository;
+ private readonly IRepository<Product> _productRepository;
+ private readonly IRepository<ProductReservation> _productReservationRepository;
+ private readonly IRepository<ProductAlsoPurchased> _productalsopurchasedRepository;
+ private readonly IRepository<EntityUrl> _entityUrlRepository;
+ private readonly IRepository<EmailAccount> _emailAccountRepository;
+ private readonly IRepository<MessageTemplate> _messageTemplateRepository;
+ private readonly IRepository<Country> _countryRepository;
+ private readonly IRepository<Discount> _discountRepository;
+ private readonly IRepository<DiscountCoupon> _discountCouponRepository;
+ private readonly IRepository<DiscountUsageHistory> _discountusageRepository;
+ private readonly IRepository<BlogPost> _blogPostRepository;
+ private readonly IRepository<BlogCategory> _blogCategoryRepository;
+ private readonly IRepository<BlogComment> _blogCommentRepository;
+ private readonly IRepository<Page> _pageRepository;
+ private readonly IRepository<NewsItem> _newsItemRepository;
+ private readonly IRepository<NewsLetterSubscription> _newslettersubscriptionRepository;
+ private readonly IRepository<ShippingMethod> _shippingMethodRepository;
+ private readonly IRepository<DeliveryDate> _deliveryDateRepository;
+ private readonly IRepository<ProductTag> _productTagRepository;
+ private readonly IRepository<ProductReview> _productReviewRepository;
+ private readonly IRepository<ProductLayout> _productLayoutRepository;
+ private readonly IRepository<CategoryLayout> _categoryLayoutRepository;
+ private readonly IRepository<BrandLayout> _brandLayoutRepository;
+ private readonly IRepository<CollectionLayout> _collectionLayoutRepository;
+ private readonly IRepository<PageLayout> _pageLayoutRepository;
+ private readonly IRepository<ScheduleTask> _scheduleTaskRepository;
+ private readonly IRepository<LoyaltyPointsHistory> _loyaltypointshistoryRepository;
+ private readonly IRepository<SearchTerm> _searchtermRepository;
+ private readonly IRepository<Setting> _settingRepository;
+ private readonly IRepository<Shipment> _shipmentRepository;
+ private readonly IRepository<Warehouse> _warehouseRepository;
+ private readonly IRepository<PickupPoint> _pickupPointsRepository;
+ private readonly IRepository<Permission> _permissionRepository;
+ private readonly IRepository<PermissionAction> _permissionAction;
+ private readonly IRepository<ExternalAuthentication> _externalAuthenticationRepository;
+ private readonly IRepository<MerchandiseReturnReason> _merchandiseReturnReasonRepository;
+ private readonly IRepository<MerchandiseReturnAction> _merchandiseReturnActionRepository;
+ private readonly IRepository<ContactUs> _contactUsRepository;
+ private readonly IRepository<RecentlyViewedProduct> _recentlyViewedProductRepository;
+ private readonly IRepository<KnowledgebaseArticle> _knowledgebaseArticleRepository;
+ private readonly IRepository<KnowledgebaseCategory> _knowledgebaseCategoryRepository;
+ private readonly IRepository<OrderTag> _orderTagRepository;
+ private readonly IRepository<OrderStatus> _orderStatusRepository;
+ private readonly IRepository<PickupPoint> _pickupPointRepository;
+ private readonly IRepository<OutOfStockSubscription> _outOfStockSubscriptionRepository;
+ private readonly IRepository<ShipmentNote> _shipmentNoteRepository;
+ private readonly IRepository<PaymentTransaction> _paymentTransactionRepository;
+ private readonly IRepository<QueuedEmail> _queuedEmailRepository;
+ private readonly IRepository<GiftVoucher> _giftVoucherRepository;
+ private readonly IRepository<DocumentType> _documentTypeRepository;
+ private readonly IRepository<Document> _documentRepository;
+ private readonly IRepository<SalesEmployee> _salesRepository;
+ private readonly IRepository<VendorReview> _vendorReviewRepository;
+ private readonly IRepository<NewsletterCategory> _newsletterCategoryRepository;
+ private readonly IRepository<Course> _courseRepository;
+ private readonly IRepository<CourseLevel> _courseLevelRepository;
+ private readonly IRepository<RobotsTxt> _robotsTxtRepository;
+ private readonly IRepository<Picture> _pictureRepository;
+ private readonly IRepository<Download> _downloadRepository;
+ private readonly IWebHostEnvironment _hostingEnvironment;
+ private readonly IServiceProvider _serviceProvider;
+
+ #endregion
+
+ #region Utilities
+
+ protected virtual string GetSamplesPath()
+ {
+ return Path.Combine(_hostingEnvironment.WebRootPath, "assets/samples/");
+ }
+
+
+ protected virtual async Task InstallVersion()
+ {
+ var version = new GrandNodeVersion {
+ DataBaseVersion = GrandVersion.SupportedDBVersion
+ };
+ await _versionRepository.InsertAsync(version);
+ }
+
+ protected virtual Task InstallMenuAdminSiteMap()
+ {
+ StandardAdminSiteMap.SiteMap.ForEach(x => _adminRepository.Insert(x));
+ return Task.CompletedTask;
+ }
+
+ protected virtual async Task HashDefaultCustomerPassword(string defaultUserEmail, string defaultUserPassword)
+ {
+ var passwordSalt = CommonHelper.GenerateRandomDigitCode(24);
+
+ var tDes = TripleDES.Create();
+
+ tDes.Key = new ASCIIEncoding().GetBytes(passwordSalt);
+ tDes.IV = new ASCIIEncoding().GetBytes(passwordSalt[^8..]);
+
+ var encryptedBinary = EncryptTextToMemory(defaultUserPassword, tDes.Key, tDes.IV);
+ var password = Convert.ToBase64String(encryptedBinary);
+ var customer = _customerRepository.Table.FirstOrDefault(x=>x.Email == defaultUserEmail);
+ customer!.Password = password;
+ customer!.PasswordSalt = passwordSalt;
+ customer!.PasswordFormatId = PasswordFormat.Encrypted;
+ await _customerRepository.UpdateAsync(customer);
+
+ }
+ private byte[] EncryptTextToMemory(string data, byte[] key, byte[] iv)
+ {
+ using var ms = new MemoryStream();
+ using (var cs = new CryptoStream(ms, TripleDES.Create().CreateEncryptor(key, iv), CryptoStreamMode.Write))
+ {
+ var toEncrypt = new UnicodeEncoding().GetBytes(data);
+ cs.Write(toEncrypt, 0, toEncrypt.Length);
+ cs.FlushFinalBlock();
+ }
+
+ return ms.ToArray();
+ }
+
+ private async Task CreateIndexes(IDatabaseContext dbContext, DataSettings dataSettings)
+ {
+ //version
+ await dbContext.CreateIndex(_versionRepository,
+ OrderBuilder<GrandNodeVersion>.Create().Ascending(x => x.DataBaseVersion), "DataBaseVersion", true);
+
+ //Store
+ await dbContext.CreateIndex(_storeRepository, OrderBuilder<Store>.Create().Ascending(x => x.DisplayOrder),
+ "DisplayOrder");
+
+ //Language
+ await dbContext.CreateIndex(_lsrRepository,
+ OrderBuilder<TranslationResource>.Create().Ascending(x => x.LanguageId).Ascending(x => x.Name), "Language");
+ await dbContext.CreateIndex(_lsrRepository, OrderBuilder<TranslationResource>.Create().Ascending(x => x.Name),
+ "ResourceName");
+ await dbContext.CreateIndex(_languageRepository, OrderBuilder<Language>.Create().Ascending(x => x.DisplayOrder),
+ "DisplayOrder");
+
+ //Currency
+ await dbContext.CreateIndex(_currencyRepository, OrderBuilder<Currency>.Create().Ascending(x => x.DisplayOrder),
+ "DisplayOrder");
+
+ //customer
+ await dbContext.CreateIndex(_customerRepository,
+ OrderBuilder<Customer>.Create().Descending(x => x.CreatedOnUtc).Ascending(x => x.Deleted),
+ "CreatedOnUtc_1");
+ await dbContext.CreateIndex(_customerRepository,
+ OrderBuilder<Customer>.Create().Ascending(x => x.LastActivityDateUtc), "LastActivityDateUtc_1");
+ await dbContext.CreateIndex(_customerRepository, OrderBuilder<Customer>.Create().Ascending(x => x.CustomerGuid),
+ "CustomerGuid_1");
+ await dbContext.CreateIndex(_customerRepository, OrderBuilder<Customer>.Create().Ascending(x => x.Email),
+ "Email_1");
+ await dbContext.CreateIndex(_customerRepository,
+ OrderBuilder<Customer>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ await dbContext.CreateIndex(_customerGroupRepository,
+ OrderBuilder<CustomerGroup>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_customerGroupRepository,
+ OrderBuilder<CustomerGroup>.Create().Ascending(x => x.Name), "Name");
+ await dbContext.CreateIndex(_customerGroupRepository,
+ OrderBuilder<CustomerGroup>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name),
+ "DisplayOrder_Name");
+
+ await dbContext.CreateIndex(_vendorRepository,
+ OrderBuilder<Vendor>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");
+ await dbContext.CreateIndex(_vendorReviewRepository,
+ OrderBuilder<VendorReview>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+
+ await dbContext.CreateIndex(_addressAttributeRepository,
+ OrderBuilder<AddressAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_customerAttributeRepository,
+ OrderBuilder<CustomerAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ await dbContext.CreateIndex(_customerHistoryPasswordRepository,
+ OrderBuilder<CustomerHistoryPassword>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //product customer group
+ await dbContext.CreateIndex(_customerGroupProductRepository,
+ OrderBuilder<CustomerGroupProduct>.Create().Ascending(x => x.CustomerGroupId)
+ .Ascending(x => x.DisplayOrder), "CustomerGroupId_DisplayOrder");
+ await dbContext.CreateIndex(_customerGroupProductRepository,
+ OrderBuilder<CustomerGroupProduct>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //customer personalize product
+ await dbContext.CreateIndex(_customerProductRepository,
+ OrderBuilder<CustomerProduct>.Create().Ascending(x => x.CustomerId).Ascending(x => x.DisplayOrder),
+ "CustomerProduct");
+ await dbContext.CreateIndex(_customerProductRepository,
+ OrderBuilder<CustomerProduct>.Create().Ascending(x => x.CustomerId).Ascending(x => x.ProductId),
+ "CustomerProduct_Unique", true);
+ await dbContext.CreateIndex(_customerProductRepository,
+ OrderBuilder<CustomerProduct>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //customer product price
+ await dbContext.CreateIndex(_customerProductPriceRepository,
+ OrderBuilder<CustomerProductPrice>.Create().Ascending(x => x.CustomerId).Ascending(x => x.ProductId),
+ "CustomerProduct", true);
+
+ //customer tag history
+ await dbContext.CreateIndex(_customerTagProductRepository,
+ OrderBuilder<CustomerTagProduct>.Create().Ascending(x => x.Id).Ascending(x => x.DisplayOrder),
+ "CustomerTagId_DisplayOrder");
+ await dbContext.CreateIndex(_customerTagProductRepository,
+ OrderBuilder<CustomerTagProduct>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //customer history password
+ await dbContext.CreateIndex(_customerHistoryPasswordRepository,
+ OrderBuilder<CustomerHistoryPassword>.Create().Ascending(x => x.CustomerId).Descending(x => x.CreatedOnUtc),
+ "CustomerId");
+
+ //customer note
+ await dbContext.CreateIndex(_customerNoteRepository,
+ OrderBuilder<CustomerNote>.Create().Ascending(x => x.CustomerId).Descending(x => x.CreatedOnUtc),
+ "CustomerId");
+ await dbContext.CreateIndex(_customerNoteRepository,
+ OrderBuilder<CustomerNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //user api
+ await dbContext.CreateIndex(_userapiRepository, OrderBuilder<UserApi>.Create().Ascending(x => x.Email), "Email",
+ true);
+
+ //specificationAttribute
+ await dbContext.CreateIndex(_specificationAttributeRepository,
+ OrderBuilder<SpecificationAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //checkoutAttribute
+ await dbContext.CreateIndex(_checkoutAttributeRepository,
+ OrderBuilder<CheckoutAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //contact attr
+ await dbContext.CreateIndex(_contactAttributeRepository,
+ OrderBuilder<ContactAttribute>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //category
+ await dbContext.CreateIndex(_categoryRepository,
+ OrderBuilder<Category>.Create().Ascending(x => x.Published).Ascending(x => x.ShowOnHomePage)
+ .Ascending(x => x.DisplayOrder), "ShowOnHomePage_DisplayOrder_1");
+ await dbContext.CreateIndex(_categoryRepository,
+ OrderBuilder<Category>.Create().Ascending(x => x.ParentCategoryId).Ascending(x => x.Published)
+ .Ascending(x => x.DisplayOrder), "ParentCategoryId_1_DisplayOrder_1");
+ await dbContext.CreateIndex(_categoryRepository,
+ OrderBuilder<Category>.Create().Ascending(x => x.FeaturedProductsOnHomePage).Ascending(x => x.Published)
+ .Ascending(x => x.DisplayOrder), "FeaturedProductsOnHomePage_DisplayOrder_1");
+ await dbContext.CreateIndex(_categoryRepository,
+ OrderBuilder<Category>.Create().Ascending(x => x.SearchBoxDisplayOrder), "SearchBoxDisplayOrder");
+ await dbContext.CreateIndex(_categoryRepository,
+ OrderBuilder<Category>.Create().Ascending(x => x.ParentCategoryId).Ascending(x => x.DisplayOrder)
+ .Ascending(x => x.Name), "ParentCategoryId_1_DisplayOrder_1_Name_1");
+
+ await dbContext.CreateIndex(_categoryRepository, OrderBuilder<Category>.Create().Ascending(x => x.DisplayOrder),
+ "DisplayOrder_1");
+
+ //collection
+ await dbContext.CreateIndex(_collectionRepository,
+ OrderBuilder<Collection>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name),
+ "DisplayOrder_Name");
+ await dbContext.CreateIndex(_collectionRepository,
+ OrderBuilder<Collection>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_collectionRepository,
+ OrderBuilder<Collection>.Create().Ascending(x => x.ShowOnHomePage).Ascending(x => x.Published)
+ .Ascending(x => x.DisplayOrder), "ShowOnHomePage_DisplayOrder_1");
+ await dbContext.CreateIndex(_collectionRepository,
+ OrderBuilder<Collection>.Create().Ascending(x => x.AppliedDiscounts), "AppliedDiscounts");
+
+ //brands
+ await dbContext.CreateIndex(_brandRepository,
+ OrderBuilder<Brand>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");
+ await dbContext.CreateIndex(_brandRepository,
+ OrderBuilder<Brand>.Create().Ascending(x => x.ShowOnHomePage).Ascending(x => x.Published)
+ .Ascending(x => x.DisplayOrder), "ShowOnHomePage_DisplayOrder_1");
+ await dbContext.CreateIndex(_brandRepository, OrderBuilder<Brand>.Create().Ascending(x => x.AppliedDiscounts),
+ "AppliedDiscounts");
+
+ //Product
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.MarkAsNew).Ascending(x => x.CreatedOnUtc),
+ "MarkAsNew_1_CreatedOnUtc_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.ShowOnHomePage)
+ .Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "ShowOnHomePage_1_Published_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.BestSeller)
+ .Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "ShowOnBestSeller_1_Published_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.ParentGroupedProductId).Ascending(x => x.DisplayOrder),
+ "ParentGroupedProductId_1_DisplayOrder_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.ProductTags).Ascending(x => x.Published)
+ .Ascending(x => x.VisibleIndividually).Ascending(x => x.Name), "ProductTags._id_1_Name_1");
+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Name),
+ "Name_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending("ProductCategories.DisplayOrder"), "CategoryId_1_DisplayOrder_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)
+ .Ascending(x => x.DisplayOrderCategory).Ascending("ProductCategories.CategoryId"),
+ "ProductCategories.CategoryId_1_OrderCategory_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)
+ .Ascending(x => x.Name).Ascending("ProductCategories.CategoryId"),
+ "ProductCategories.CategoryId_1_Name_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)
+ .Ascending(x => x.Price).Ascending("ProductCategories.CategoryId"),
+ "ProductCategories.CategoryId_1_Price_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)
+ .Ascending(x => x.Sold).Ascending("ProductCategories.CategoryId"),
+ "ProductCategories.CategoryId_1_Sold_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)
+ .Ascending("ProductCategories.CategoryId").Ascending("ProductCategories.IsFeaturedProduct"),
+ "ProductCategories.CategoryId_1_IsFeaturedProduct_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending(x => x.Published)
+ .Ascending(x => x.VisibleIndividually).Ascending(x => x.DisplayOrderCollection),
+ "ProductCollections.CollectionId_1_OrderCategory_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending(x => x.Published)
+ .Ascending(x => x.VisibleIndividually).Ascending(x => x.Name),
+ "ProductCollections.CollectionId_1_Name_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId").Ascending(x => x.Published)
+ .Ascending(x => x.VisibleIndividually).Ascending(x => x.Sold),
+ "ProductCollections.CollectionId_1_Sold_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending("ProductCollections.CollectionId")
+ .Ascending("ProductCollections.IsFeaturedProduct").Ascending(x => x.Published)
+ .Ascending(x => x.VisibleIndividually), "ProductCollections.CollectionId_1_IsFeaturedProduct_1");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)
+ .Ascending(x => x.BrandId).Ascending(x => x.DisplayOrderBrand), "ProductBrand");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.Published).Ascending(x => x.VisibleIndividually)
+ .Ascending("ProductSpecificationAttributes.SpecificationAttributeOptionId")
+ .Ascending("ProductSpecificationAttributes.AllowFiltering"), "ProductSpecificationAttributes");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");
+
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrderCategory), "DisplayOrderCategory");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrderBrand), "DisplayOrderBrand");
+ await dbContext.CreateIndex(_productRepository,
+ OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrderCollection), "DisplayOrderCollection");
+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.DisplayOrder),
+ "DisplayOrder");
+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Price),
+ "Price");
+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.CreatedOnUtc),
+ "CreatedOnUtc");
+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.OnSale),
+ "OnSale");
+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Viewed),
+ "Viewed");
+ await dbContext.CreateIndex(_productRepository, OrderBuilder<Product>.Create().Ascending(x => x.Sold), "Sold");
+
+ //product attribute
+ await dbContext.CreateIndex(_productAttributeRepository,
+ OrderBuilder<ProductAttribute>.Create().Ascending(x => x.Name), "Name");
+
+ //Product layout
+ await dbContext.CreateIndex(_productLayoutRepository,
+ OrderBuilder<ProductLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_categoryLayoutRepository,
+ OrderBuilder<CategoryLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_brandLayoutRepository,
+ OrderBuilder<BrandLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_collectionLayoutRepository,
+ OrderBuilder<CollectionLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_pageLayoutRepository,
+ OrderBuilder<PageLayout>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //Delivery date
+ await dbContext.CreateIndex(_deliveryDateRepository,
+ OrderBuilder<DeliveryDate>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //Tax
+ await dbContext.CreateIndex(_taxCategoryRepository,
+ OrderBuilder<TaxCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //Measure
+ await dbContext.CreateIndex(_measureWeightRepository,
+ OrderBuilder<MeasureWeight>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_measureUnitRepository,
+ OrderBuilder<MeasureUnit>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_measureDimensionRepository,
+ OrderBuilder<MeasureDimension>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //productreseration
+ await dbContext.CreateIndex(_productReservationRepository,
+ OrderBuilder<ProductReservation>.Create().Ascending(x => x.ProductId).Ascending(x => x.Date),
+ "ProductReservation");
+ await dbContext.CreateIndex(_productReservationRepository,
+ OrderBuilder<ProductReservation>.Create().Ascending(x => x.Date), "Date");
+
+ //bid
+ await dbContext.CreateIndex(_bidRepository,
+ OrderBuilder<Bid>.Create().Ascending(x => x.ProductId).Ascending(x => x.CustomerId).Descending(x => x.Date),
+ "ProductCustomer");
+ await dbContext.CreateIndex(_bidRepository,
+ OrderBuilder<Bid>.Create().Ascending(x => x.ProductId).Descending(x => x.Date), "ProductDate");
+ await dbContext.CreateIndex(_bidRepository, OrderBuilder<Bid>.Create().Descending(x => x.Date), "Date");
+
+ //ProductReview
+ await dbContext.CreateIndex(_productReviewRepository,
+ OrderBuilder<ProductReview>.Create().Ascending(x => x.ProductId).Ascending(x => x.CreatedOnUtc),
+ "ProductId");
+ await dbContext.CreateIndex(_productReviewRepository,
+ OrderBuilder<ProductReview>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //Recently Viewed Products
+ await dbContext.CreateIndex(_recentlyViewedProductRepository,
+ OrderBuilder<RecentlyViewedProduct>.Create().Ascending(x => x.CustomerId).Ascending(x => x.ProductId)
+ .Descending(x => x.CreatedOnUtc), "CustomerId.ProductId");
+ await dbContext.CreateIndex(_recentlyViewedProductRepository,
+ OrderBuilder<RecentlyViewedProduct>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //Product also purchased
+ await dbContext.CreateIndex(_productalsopurchasedRepository,
+ OrderBuilder<ProductAlsoPurchased>.Create().Ascending(x => x.ProductId), "ProductId");
+
+ //url record
+ await dbContext.CreateIndex(_entityUrlRepository, OrderBuilder<EntityUrl>.Create().Ascending(x => x.Slug),
+ "Slug");
+ await dbContext.CreateIndex(_entityUrlRepository,
+ OrderBuilder<EntityUrl>.Create().Ascending(x => x.Slug).Ascending(x => x.IsActive), "SlugActive");
+ await dbContext.CreateIndex(_entityUrlRepository,
+ OrderBuilder<EntityUrl>.Create().Ascending(x => x.EntityId).Ascending(x => x.EntityName)
+ .Ascending(x => x.LanguageId).Ascending(x => x.IsActive), "UrlEntity");
+ await dbContext.CreateIndex(_entityUrlRepository, OrderBuilder<EntityUrl>.Create().Ascending(x => x.IsActive),
+ "IsActive");
+
+ //message template
+ await dbContext.CreateIndex(_messageTemplateRepository,
+ OrderBuilder<MessageTemplate>.Create().Ascending(x => x.Name), "Name");
+
+ // Country and Stateprovince
+ await dbContext.CreateIndex(_countryRepository, OrderBuilder<Country>.Create().Ascending(x => x.DisplayOrder),
+ "DisplayOrder");
+
+ //discount
+ await dbContext.CreateIndex(_discountRepository, OrderBuilder<Discount>.Create().Ascending(x => x.Name),
+ "Name)");
+
+ await dbContext.CreateIndex(_discountCouponRepository,
+ OrderBuilder<DiscountCoupon>.Create().Ascending(x => x.CouponCode), "CouponCode", true);
+ await dbContext.CreateIndex(_discountCouponRepository,
+ OrderBuilder<DiscountCoupon>.Create().Ascending(x => x.DiscountId), "DiscountId");
+
+ await dbContext.CreateIndex(_discountusageRepository,
+ OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.CustomerId), "CustomerId");
+ await dbContext.CreateIndex(_discountusageRepository,
+ OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.DiscountId), "DiscountId");
+ await dbContext.CreateIndex(_discountusageRepository,
+ OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.OrderId), "OrderId");
+
+ await dbContext.CreateIndex(_discountusageRepository,
+ OrderBuilder<DiscountUsageHistory>.Create().Ascending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //blog
+ await dbContext.CreateIndex(_blogPostRepository,
+ OrderBuilder<BlogPost>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+ await dbContext.CreateIndex(_blogCategoryRepository,
+ OrderBuilder<BlogCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_blogCommentRepository,
+ OrderBuilder<BlogComment>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //knowledgebase
+ await dbContext.CreateIndex(_knowledgebaseArticleRepository,
+ OrderBuilder<KnowledgebaseArticle>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_knowledgebaseCategoryRepository,
+ OrderBuilder<KnowledgebaseCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_knowledgebaseCategoryRepository,
+ OrderBuilder<KnowledgebaseCategory>.Create().Ascending(x => x.ParentCategoryId)
+ .Ascending(x => x.DisplayOrder), "ParentCategoryId_DisplayOrder");
+
+ //page
+ await dbContext.CreateIndex(_pageRepository, OrderBuilder<Page>.Create().Ascending(x => x.SystemName),
+ "SystemName");
+
+ //news
+ await dbContext.CreateIndex(_newsItemRepository, OrderBuilder<NewsItem>.Create().Ascending(x => x.CreatedOnUtc),
+ "CreatedOnUtc");
+
+ //newsletter
+ await dbContext.CreateIndex(_newslettersubscriptionRepository,
+ OrderBuilder<NewsLetterSubscription>.Create().Ascending(x => x.CustomerId), "CustomerId");
+ await dbContext.CreateIndex(_newslettersubscriptionRepository,
+ OrderBuilder<NewsLetterSubscription>.Create().Ascending(x => x.Email), "Email");
+
+ //Campaign
+ await dbContext.CreateIndex(_campaignRepository, OrderBuilder<Campaign>.Create().Ascending(x => x.CreatedOnUtc),
+ "CreatedOnUtc");
+ await dbContext.CreateIndex(_campaignHistoryRepository,
+ OrderBuilder<CampaignHistory>.Create().Ascending(x => x.CampaignId).Descending(x => x.CreatedDateUtc),
+ "CampaignId");
+
+ //loyalty points
+ await dbContext.CreateIndex(_loyaltypointshistoryRepository,
+ OrderBuilder<LoyaltyPointsHistory>.Create().Ascending(x => x.CustomerId), "CustomerId");
+ await dbContext.CreateIndex(_loyaltypointshistoryRepository,
+ OrderBuilder<LoyaltyPointsHistory>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //giftvoucher
+ await dbContext.CreateIndex(_giftVoucherRepository,
+ OrderBuilder<GiftVoucher>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //search term
+ await dbContext.CreateIndex(_searchtermRepository, OrderBuilder<SearchTerm>.Create().Descending(x => x.Count),
+ "Count");
+
+ //setting
+ await dbContext.CreateIndex(_settingRepository, OrderBuilder<Setting>.Create().Ascending(x => x.Name), "Name");
+
+ //shipment
+ await dbContext.CreateIndex(_shipmentRepository,
+ OrderBuilder<Shipment>.Create().Ascending(x => x.ShipmentNumber), "ShipmentNumber", true);
+ await dbContext.CreateIndex(_shipmentRepository, OrderBuilder<Shipment>.Create().Ascending(x => x.OrderId),
+ "OrderId");
+ await dbContext.CreateIndex(_shipmentRepository,
+ OrderBuilder<Shipment>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ await dbContext.CreateIndex(_shipmentNoteRepository,
+ OrderBuilder<ShipmentNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //order
+ await dbContext.CreateIndex(_orderRepository,
+ OrderBuilder<Order>.Create().Ascending(x => x.CustomerId).Descending(x => x.CreatedOnUtc),
+ "CustomerId_1_CreatedOnUtc_-1");
+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Descending(x => x.CreatedOnUtc),
+ "CreatedOnUtc_-1");
+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Descending(x => x.OrderNumber),
+ "OrderNumber");
+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending(x => x.Code), "OrderCode");
+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending("OrderItems.ProductId"),
+ "OrderItemProductId");
+ await dbContext.CreateIndex(_orderRepository, OrderBuilder<Order>.Create().Ascending("OrderItems.Id"),
+ "OrderItems._id");
+
+ await dbContext.CreateIndex(_orderStatusRepository,
+ OrderBuilder<OrderStatus>.Create().Ascending(x => x.StatusId), "StatusId", true);
+
+ await dbContext.CreateIndex(_orderNoteRepository,
+ OrderBuilder<OrderNote>.Create().Ascending(x => x.OrderId).Descending(x => x.CreatedOnUtc),
+ "OrderId_Created");
+ await dbContext.CreateIndex(_orderNoteRepository,
+ OrderBuilder<OrderNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //payments
+ await dbContext.CreateIndex(_paymentTransactionRepository,
+ OrderBuilder<PaymentTransaction>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //queuemail
+ await dbContext.CreateIndex(_queuedEmailRepository,
+ OrderBuilder<QueuedEmail>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+ await dbContext.CreateIndex(_queuedEmailRepository,
+ OrderBuilder<QueuedEmail>.Create().Descending(x => x.PriorityId).Ascending(x => x.CreatedOnUtc),
+ "PriorityId_CreatedOnUtc");
+
+ //permision
+ await dbContext.CreateIndex(_permissionRepository,
+ OrderBuilder<Permission>.Create().Ascending(x => x.SystemName), "SystemName", true);
+ await dbContext.CreateIndex(_permissionRepository, OrderBuilder<Permission>.Create().Ascending(x => x.Name),
+ "Name");
+
+ await dbContext.CreateIndex(_permissionAction,
+ OrderBuilder<PermissionAction>.Create().Ascending(x => x.SystemName), "SystemName");
+
+ //externalauth
+ await dbContext.CreateIndex(_externalAuthenticationRepository,
+ OrderBuilder<ExternalAuthentication>.Create().Ascending(x => x.CustomerId), "CustomerId");
+
+ //merchandise return
+ await dbContext.CreateIndex(_merchandiseReturnRepository,
+ OrderBuilder<MerchandiseReturn>.Create().Ascending(x => x.ReturnNumber), "ReturnNumber", true);
+ await dbContext.CreateIndex(_merchandiseReturnRepository,
+ OrderBuilder<MerchandiseReturn>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+ await dbContext.CreateIndex(_merchandiseReturnActionRepository,
+ OrderBuilder<MerchandiseReturnAction>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_merchandiseReturnReasonRepository,
+ OrderBuilder<MerchandiseReturnReason>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ await dbContext.CreateIndex(_merchandiseReturnNoteRepository,
+ OrderBuilder<MerchandiseReturnNote>.Create().Ascending(x => x.MerchandiseReturnId)
+ .Descending(x => x.CreatedOnUtc), "MerchandiseReturnId_CreatedOn");
+ await dbContext.CreateIndex(_merchandiseReturnNoteRepository,
+ OrderBuilder<MerchandiseReturnNote>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //contactus
+ await dbContext.CreateIndex(_contactUsRepository, OrderBuilder<ContactUs>.Create().Ascending(x => x.Email),
+ "Email");
+ await dbContext.CreateIndex(_contactUsRepository,
+ OrderBuilder<ContactUs>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //page
+ await dbContext.CreateIndex(_pageRepository,
+ OrderBuilder<Page>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.SystemName),
+ "DisplayOrder_SystemName");
+
+ //warehouse
+ await dbContext.CreateIndex(_warehouseRepository,
+ OrderBuilder<Warehouse>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //shipping method
+ await dbContext.CreateIndex(_shippingMethodRepository,
+ OrderBuilder<ShippingMethod>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //order status
+ await dbContext.CreateIndex(_orderStatusRepository,
+ OrderBuilder<OrderStatus>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //country
+ await dbContext.CreateIndex(_countryRepository,
+ OrderBuilder<Country>.Create().Ascending(x => x.DisplayOrder).Ascending(x => x.Name), "DisplayOrder_Name");
+
+ //picpup points
+ await dbContext.CreateIndex(_pickupPointRepository,
+ OrderBuilder<PickupPoint>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //outofstock
+ await dbContext.CreateIndex(_outOfStockSubscriptionRepository,
+ OrderBuilder<OutOfStockSubscription>.Create().Descending(x => x.CreatedOnUtc), "CreatedOnUtc");
+
+ //document
+ await dbContext.CreateIndex(_documentTypeRepository,
+ OrderBuilder<DocumentType>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+ await dbContext.CreateIndex(_documentTypeRepository,
+ OrderBuilder<DocumentType>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //sales
+ await dbContext.CreateIndex(_salesRepository,
+ OrderBuilder<SalesEmployee>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //newslettercategory
+ await dbContext.CreateIndex(_newsletterCategoryRepository,
+ OrderBuilder<NewsletterCategory>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //course
+ await dbContext.CreateIndex(_courseRepository, OrderBuilder<Course>.Create().Ascending(x => x.CreatedOnUtc),
+ "CreatedOnUtc");
+ await dbContext.CreateIndex(_courseLevelRepository,
+ OrderBuilder<CourseLevel>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //admin site map
+ await dbContext.CreateIndex(_adminRepository,
+ OrderBuilder<AdminSiteMap>.Create().Ascending(x => x.DisplayOrder), "DisplayOrder");
+
+ //if(dataSettings.DbProvider == DbProvider.CosmosDB)
+ //{
+ // //
+ // //db.fs.chunks.createIndex({'n': 1})
+ // //To Fix problem with download files from GridFSBucket
+ // //
+ //}
+ }
+
+ private async Task CreateTables(string? local)
+ {
+ if (string.IsNullOrEmpty(local))
+ return;
+
+ try
+ {
+ var dataSettings = DataSettingsManager.Instance.LoadSettings(true);
+ var dbContext = _serviceProvider.GetRequiredService<IDatabaseContext>();
+ dbContext.SetConnection(dataSettings.ConnectionString);
+
+ if (dbContext.InstallProcessCreateTable)
+ {
+ var typeSearcher = _serviceProvider.GetRequiredService<ITypeSearcher>();
+ var q = typeSearcher.GetAssemblies().FirstOrDefault(x => x.GetName().Name == "Grand.Domain");
+
+ foreach (var item in q!.GetTypes())
+ if (item.BaseType != null && item.IsClass && item.BaseType == typeof(BaseEntity))
+ await dbContext.CreateTable(item.Name, local);
+ }
+
+ if (dbContext.InstallProcessCreateIndex)
+ await CreateIndexes(dbContext, dataSettings);
+ }
+ catch (Exception ex)
+ {
+ throw new GrandException(ex.Message);
+ }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Startup/StartupApplication.cs b/src/Modules/Grand.Module.Installer/Startup/StartupApplication.cs
new file mode 100644
index 000000000..c86276400
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Startup/StartupApplication.cs
@@ -0,0 +1,36 @@
+using Grand.Data;
+using Grand.Infrastructure;
+using Grand.Module.Installer.Interfaces;
+using Grand.Module.Installer.Services;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Grand.Module.Installer.Startup;
+
+public class StartupApplication : IStartupApplication
+{
+ public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
+ {
+ RegisterInstallService(services);
+ }
+
+ public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
+ {
+ }
+
+ public int Priority => 100;
+ public bool BeforeConfigure => false;
+
+ private void RegisterInstallService(IServiceCollection serviceCollection)
+ {
+ var databaseInstalled = DataSettingsManager.DatabaseIsInstalled();
+ if (!databaseInstalled)
+ {
+ //installation service
+ serviceCollection.AddScoped<IInstallationLocalizedService, InstallationLocalizedService>();
+ serviceCollection.AddScoped<IInstallationService, InstallationService>();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Business/Grand.Business.Core/Utilities/System/InstallationLanguage.cs b/src/Modules/Grand.Module.Installer/Utilities/InstallationLanguage.cs
similarity index 57%
rename from src/Business/Grand.Business.Core/Utilities/System/InstallationLanguage.cs
rename to src/Modules/Grand.Module.Installer/Utilities/InstallationLanguage.cs
index 3741b3a04..79f407887 100644
--- a/src/Business/Grand.Business.Core/Utilities/System/InstallationLanguage.cs
+++ b/src/Modules/Grand.Module.Installer/Utilities/InstallationLanguage.cs
@@ -1,12 +1,12 @@
-namespace Grand.Business.Core.Utilities.System;
+namespace Grand.Module.Installer.Utilities;
/// <summary>
/// Language class for installation process
/// </summary>
public class InstallationLanguage
{
- public string Name { get; set; }
- public string Code { get; set; }
+ public string? Name { get; set; }
+ public string? Code { get; set; }
public bool IsDefault { get; set; }
public bool IsRightToLeft { get; set; }
@@ -15,12 +15,12 @@ public class InstallationLanguage
public class InstallationLocaleResource
{
- public string Name { get; set; }
- public string Value { get; set; }
+ public string? Name { get; set; }
+ public string? Value { get; set; }
}
public class InstallationCollation
{
- public string Name { get; set; }
- public string Value { get; set; }
+ public string? Name { get; set; }
+ public string? Value { get; set; }
}
\ No newline at end of file
diff --git a/src/Modules/Grand.Module.Installer/Utilities/PermissionSystemName.cs b/src/Modules/Grand.Module.Installer/Utilities/PermissionSystemName.cs
new file mode 100644
index 000000000..b2b910a88
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Utilities/PermissionSystemName.cs
@@ -0,0 +1,79 @@
+namespace Grand.Module.Installer.Utilities;
+
+public static class PermissionSystemName
+{
+ public const string AccessAdminPanel = "AccessAdminPanel";
+ public const string AccessVendorPanel = "AccessVendorPanel";
+ public const string AllowCustomerImpersonation = "AllowCustomerImpersonation";
+ public const string Products = "ManageProducts";
+ public const string Categories = "ManageCategories";
+ public const string Brands = "ManageBrands";
+ public const string ProductReviews = "ManageProductReviews";
+ public const string Collections = "ManageCollections";
+ public const string ProductTags = "ManageProductTags";
+ public const string ProductAttributes = "ManageProductAttributes";
+ public const string SpecificationAttributes = "ManageSpecificationAttributes";
+ public const string CheckoutAttributes = "ManageCheckoutAttributes";
+ public const string ContactAttributes = "ManageContactAttributes";
+ public const string Customers = "ManageCustomers";
+ public const string CustomerAttributes = "ManageCustomerAttributes";
+ public const string AddressAttributes = "ManageAddressAttributes";
+ public const string CustomerTags = "ManageCustomerTags";
+ public const string Documents = "ManageDocuments";
+ public const string Reports = "ManageReports";
+ public const string CustomerGroups = "ManageCustomerGroups";
+ public const string SalesEmployees = "ManageSalesEmployees";
+ public const string Vendors = "ManageVendors";
+ public const string VendorReviews = "ManageVendorReviews";
+ public const string CurrentCarts = "ManageCurrentCarts";
+ public const string Orders = "ManageOrders";
+ public const string OrderTags = "ManageOrderTags";
+ public const string OrderStatus = "ManageOrderStatus";
+ public const string Shipments = "ManageShipments";
+ public const string GiftVouchers = "ManageGiftVouchers";
+ public const string MerchandiseReturns = "ManageMerchandiseReturns";
+ public const string PaymentTransactions = "PaymentTransactions";
+ public const string Affiliates = "ManageAffiliates";
+ public const string PushNotifications = "ManagePushNotifications";
+ public const string Campaigns = "ManageCampaigns";
+ public const string Discounts = "ManageDiscounts";
+ public const string NewsletterSubscribers = "ManageNewsletterSubscribers";
+ public const string NewsletterCategories = "ManageNewsletterCategories";
+ public const string News = "ManageNews";
+ public const string Blog = "ManageBlog";
+ public const string Widgets = "ManageWidgets";
+ public const string Pages = "ManagePages";
+ public const string Knowledgebase = "ManageKnowledgebase";
+ public const string Courses = "ManageCourses";
+ public const string MessageTemplates = "ManageMessageTemplates";
+ public const string Countries = "ManageCountries";
+ public const string Languages = "ManageLanguages";
+ public const string Settings = "ManageSettings";
+ public const string PaymentMethods = "ManagePaymentMethods";
+ public const string ExternalAuthenticationMethods = "ManageExternalAuthenticationMethods";
+ public const string TaxSettings = "ManageTaxSettings";
+ public const string ShippingSettings = "ManageShippingSettings";
+ public const string Currencies = "ManageCurrencies";
+ public const string Measures = "ManageMeasures";
+ public const string Acl = "ManageACL";
+ public const string EmailAccounts = "ManageEmailAccounts";
+ public const string Stores = "ManageStores";
+ public const string Plugins = "ManagePlugins";
+ public const string MessageQueue = "ManageMessageQueue";
+ public const string MessageContactForm = "ManageMessageContactForm";
+ public const string Maintenance = "ManageMaintenance";
+ public const string System = "ManageSystem";
+ public const string Files = "ManageFiles";
+ public const string Pictures = "ManagePictures";
+ public const string HtmlEditor = "HtmlEditor.ManagePictures";
+ public const string ScheduleTasks = "ManageScheduleTasks";
+
+ public const string AllowUseApi = "AllowUseApi";
+
+ //public store permissions
+ public const string DisplayPrices = "DisplayPrices";
+ public const string EnableShoppingCart = "EnableShoppingCart";
+ public const string EnableWishlist = "EnableWishlist";
+ public const string PublicStoreAllowNavigation = "PublicStoreAllowNavigation";
+ public const string AccessClosedStore = "AccessClosedStore";
+}
\ No newline at end of file
diff --git a/src/Business/Grand.Business.Core/Utilities/System/StandardAdminSiteMap.cs b/src/Modules/Grand.Module.Installer/Utilities/StandardAdminSiteMap.cs
similarity index 99%
rename from src/Business/Grand.Business.Core/Utilities/System/StandardAdminSiteMap.cs
rename to src/Modules/Grand.Module.Installer/Utilities/StandardAdminSiteMap.cs
index 6ed4abfa1..15297f172 100644
--- a/src/Business/Grand.Business.Core/Utilities/System/StandardAdminSiteMap.cs
+++ b/src/Modules/Grand.Module.Installer/Utilities/StandardAdminSiteMap.cs
@@ -1,7 +1,6 @@
-using Grand.Business.Core.Utilities.Common.Security;
-using Grand.Domain.Admin;
+using Grand.Domain.Admin;
-namespace Grand.Business.Core.Utilities.System;
+namespace Grand.Module.Installer.Utilities;
public static class StandardAdminSiteMap
{
diff --git a/src/Web/Grand.Web/Validators/Install/InstallValidator.cs b/src/Modules/Grand.Module.Installer/Validators/InstallValidator.cs
similarity index 87%
rename from src/Web/Grand.Web/Validators/Install/InstallValidator.cs
rename to src/Modules/Grand.Module.Installer/Validators/InstallValidator.cs
index e6ab02230..7a6416576 100644
--- a/src/Web/Grand.Web/Validators/Install/InstallValidator.cs
+++ b/src/Modules/Grand.Module.Installer/Validators/InstallValidator.cs
@@ -1,8 +1,8 @@
using FluentValidation;
using Grand.Infrastructure.Validators;
-using Grand.Web.Models.Install;
+using Grand.Module.Installer.Models;
-namespace Grand.Web.Validators.Install;
+namespace Grand.Module.Installer.Validators;
public class InstallValidator : BaseGrandValidator<InstallModel>
{
diff --git a/src/Web/Grand.Web/Views/Install/Index.cshtml b/src/Modules/Grand.Module.Installer/Views/Install/Index.cshtml
similarity index 99%
rename from src/Web/Grand.Web/Views/Install/Index.cshtml
rename to src/Modules/Grand.Module.Installer/Views/Install/Index.cshtml
index 441c83548..67bf6b696 100644
--- a/src/Web/Grand.Web/Views/Install/Index.cshtml
+++ b/src/Modules/Grand.Module.Installer/Views/Install/Index.cshtml
@@ -1,5 +1,6 @@
-@using Grand.Business.Core.Interfaces.System.Installation
-@model Grand.Web.Models.Install.InstallModel
+@model Grand.Module.Installer.Models.InstallModel
+@using Grand.Module.Installer.Interfaces
+
@inject IInstallationLocalizedService LocalizedService
@{
Layout = null;
diff --git a/src/Modules/Grand.Module.Installer/Views/_ViewImports.cshtml b/src/Modules/Grand.Module.Installer/Views/_ViewImports.cshtml
new file mode 100644
index 000000000..87b8ec613
--- /dev/null
+++ b/src/Modules/Grand.Module.Installer/Views/_ViewImports.cshtml
@@ -0,0 +1,6 @@
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+
+@using Microsoft.AspNetCore.Mvc.ViewFeatures
+@using Microsoft.AspNetCore.Mvc.Razor
+@using Grand.Infrastructure.Extensions
+@using Grand.Domain.Common
\ No newline at end of file
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataAffiliates.cs b/src/Modules/InstallerModule/Installation/InstallDataAffiliates.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataAffiliates.cs
rename to src/Modules/InstallerModule/Installation/InstallDataAffiliates.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataBlogPosts.cs b/src/Modules/InstallerModule/Installation/InstallDataBlogPosts.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataBlogPosts.cs
rename to src/Modules/InstallerModule/Installation/InstallDataBlogPosts.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataBrandLayouts.cs b/src/Modules/InstallerModule/Installation/InstallDataBrandLayouts.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataBrandLayouts.cs
rename to src/Modules/InstallerModule/Installation/InstallDataBrandLayouts.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataBrands.cs b/src/Modules/InstallerModule/Installation/InstallDataBrands.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataBrands.cs
rename to src/Modules/InstallerModule/Installation/InstallDataBrands.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCategories.cs b/src/Modules/InstallerModule/Installation/InstallDataCategories.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataCategories.cs
rename to src/Modules/InstallerModule/Installation/InstallDataCategories.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCategoryLayouts.cs b/src/Modules/InstallerModule/Installation/InstallDataCategoryLayouts.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataCategoryLayouts.cs
rename to src/Modules/InstallerModule/Installation/InstallDataCategoryLayouts.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCheckoutAttributes.cs b/src/Modules/InstallerModule/Installation/InstallDataCheckoutAttributes.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataCheckoutAttributes.cs
rename to src/Modules/InstallerModule/Installation/InstallDataCheckoutAttributes.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCollectionLayouts.cs b/src/Modules/InstallerModule/Installation/InstallDataCollectionLayouts.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataCollectionLayouts.cs
rename to src/Modules/InstallerModule/Installation/InstallDataCollectionLayouts.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCountriesAndStates.cs b/src/Modules/InstallerModule/Installation/InstallDataCountriesAndStates.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataCountriesAndStates.cs
rename to src/Modules/InstallerModule/Installation/InstallDataCountriesAndStates.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCurrencies.cs b/src/Modules/InstallerModule/Installation/InstallDataCurrencies.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataCurrencies.cs
rename to src/Modules/InstallerModule/Installation/InstallDataCurrencies.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataCustomersAndUsers.cs b/src/Modules/InstallerModule/Installation/InstallDataCustomersAndUsers.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataCustomersAndUsers.cs
rename to src/Modules/InstallerModule/Installation/InstallDataCustomersAndUsers.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataDeliveryDates.cs b/src/Modules/InstallerModule/Installation/InstallDataDeliveryDates.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataDeliveryDates.cs
rename to src/Modules/InstallerModule/Installation/InstallDataDeliveryDates.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataDiscounts.cs b/src/Modules/InstallerModule/Installation/InstallDataDiscounts.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataDiscounts.cs
rename to src/Modules/InstallerModule/Installation/InstallDataDiscounts.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataEmailAccounts.cs b/src/Modules/InstallerModule/Installation/InstallDataEmailAccounts.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataEmailAccounts.cs
rename to src/Modules/InstallerModule/Installation/InstallDataEmailAccounts.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataLanguages.cs b/src/Modules/InstallerModule/Installation/InstallDataLanguages.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataLanguages.cs
rename to src/Modules/InstallerModule/Installation/InstallDataLanguages.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataLocaleResources.cs b/src/Modules/InstallerModule/Installation/InstallDataLocaleResources.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataLocaleResources.cs
rename to src/Modules/InstallerModule/Installation/InstallDataLocaleResources.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataMeasures.cs b/src/Modules/InstallerModule/Installation/InstallDataMeasures.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataMeasures.cs
rename to src/Modules/InstallerModule/Installation/InstallDataMeasures.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnActions.cs b/src/Modules/InstallerModule/Installation/InstallDataMerchandiseReturnActions.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnActions.cs
rename to src/Modules/InstallerModule/Installation/InstallDataMerchandiseReturnActions.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnReasons.cs b/src/Modules/InstallerModule/Installation/InstallDataMerchandiseReturnReasons.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataMerchandiseReturnReasons.cs
rename to src/Modules/InstallerModule/Installation/InstallDataMerchandiseReturnReasons.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataMessageTemplates.cs b/src/Modules/InstallerModule/Installation/InstallDataMessageTemplates.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataMessageTemplates.cs
rename to src/Modules/InstallerModule/Installation/InstallDataMessageTemplates.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataNews.cs b/src/Modules/InstallerModule/Installation/InstallDataNews.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataNews.cs
rename to src/Modules/InstallerModule/Installation/InstallDataNews.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderStatus.cs b/src/Modules/InstallerModule/Installation/InstallDataOrderStatus.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataOrderStatus.cs
rename to src/Modules/InstallerModule/Installation/InstallDataOrderStatus.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataOrderTags.cs b/src/Modules/InstallerModule/Installation/InstallDataOrderTags.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataOrderTags.cs
rename to src/Modules/InstallerModule/Installation/InstallDataOrderTags.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataPageLayouts.cs b/src/Modules/InstallerModule/Installation/InstallDataPageLayouts.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataPageLayouts.cs
rename to src/Modules/InstallerModule/Installation/InstallDataPageLayouts.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataPages.cs b/src/Modules/InstallerModule/Installation/InstallDataPages.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataPages.cs
rename to src/Modules/InstallerModule/Installation/InstallDataPages.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataPickupPoints.cs b/src/Modules/InstallerModule/Installation/InstallDataPickupPoints.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataPickupPoints.cs
rename to src/Modules/InstallerModule/Installation/InstallDataPickupPoints.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataProductAttributes.cs b/src/Modules/InstallerModule/Installation/InstallDataProductAttributes.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataProductAttributes.cs
rename to src/Modules/InstallerModule/Installation/InstallDataProductAttributes.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataProductLayouts.cs b/src/Modules/InstallerModule/Installation/InstallDataProductLayouts.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataProductLayouts.cs
rename to src/Modules/InstallerModule/Installation/InstallDataProductLayouts.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataProducts.cs b/src/Modules/InstallerModule/Installation/InstallDataProducts.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataProducts.cs
rename to src/Modules/InstallerModule/Installation/InstallDataProducts.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataRobotsTxt.cs b/src/Modules/InstallerModule/Installation/InstallDataRobotsTxt.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataRobotsTxt.cs
rename to src/Modules/InstallerModule/Installation/InstallDataRobotsTxt.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataScheduleTasks.cs b/src/Modules/InstallerModule/Installation/InstallDataScheduleTasks.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataScheduleTasks.cs
rename to src/Modules/InstallerModule/Installation/InstallDataScheduleTasks.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs b/src/Modules/InstallerModule/Installation/InstallDataSettings.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataSettings.cs
rename to src/Modules/InstallerModule/Installation/InstallDataSettings.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataShippingMethods.cs b/src/Modules/InstallerModule/Installation/InstallDataShippingMethods.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataShippingMethods.cs
rename to src/Modules/InstallerModule/Installation/InstallDataShippingMethods.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataSpecificationAttributes.cs b/src/Modules/InstallerModule/Installation/InstallDataSpecificationAttributes.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataSpecificationAttributes.cs
rename to src/Modules/InstallerModule/Installation/InstallDataSpecificationAttributes.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataStores.cs b/src/Modules/InstallerModule/Installation/InstallDataStores.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataStores.cs
rename to src/Modules/InstallerModule/Installation/InstallDataStores.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataTaxCategories.cs b/src/Modules/InstallerModule/Installation/InstallDataTaxCategories.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataTaxCategories.cs
rename to src/Modules/InstallerModule/Installation/InstallDataTaxCategories.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataVendors.cs b/src/Modules/InstallerModule/Installation/InstallDataVendors.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataVendors.cs
rename to src/Modules/InstallerModule/Installation/InstallDataVendors.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallDataWarehouses.cs b/src/Modules/InstallerModule/Installation/InstallDataWarehouses.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallDataWarehouses.cs
rename to src/Modules/InstallerModule/Installation/InstallDataWarehouses.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.cs b/src/Modules/InstallerModule/Installation/InstallationLocalizedService.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallationLocalizedService.cs
rename to src/Modules/InstallerModule/Installation/InstallationLocalizedService.cs
diff --git a/src/Business/Grand.Business.System/Services/Installation/InstallationService.cs b/src/Modules/InstallerModule/Installation/InstallationService.cs
similarity index 100%
rename from src/Business/Grand.Business.System/Services/Installation/InstallationService.cs
rename to src/Modules/InstallerModule/Installation/InstallationService.cs
diff --git a/src/Modules/InstallerModule/InstallerModule.csproj b/src/Modules/InstallerModule/InstallerModule.csproj
new file mode 100644
index 000000000..8d81e0fae
--- /dev/null
+++ b/src/Modules/InstallerModule/InstallerModule.csproj
@@ -0,0 +1,3 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <Import Project="..\..\Build\Grand.Common.props" />
+</Project>
diff --git a/src/Plugins/Authentication.Facebook/Areas/Admin/Controllers/FacebookAuthenticationSettingsController.cs b/src/Plugins/Authentication.Facebook/Areas/Admin/Controllers/FacebookAuthenticationSettingsController.cs
index 40f575769..374fd3165 100644
--- a/src/Plugins/Authentication.Facebook/Areas/Admin/Controllers/FacebookAuthenticationSettingsController.cs
+++ b/src/Plugins/Authentication.Facebook/Areas/Admin/Controllers/FacebookAuthenticationSettingsController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Plugins/Authentication.Google/Areas/Admin/Controllers/GoogleAuthenticationSettingsController.cs b/src/Plugins/Authentication.Google/Areas/Admin/Controllers/GoogleAuthenticationSettingsController.cs
index ce1afb1a2..e834e3644 100644
--- a/src/Plugins/Authentication.Google/Areas/Admin/Controllers/GoogleAuthenticationSettingsController.cs
+++ b/src/Plugins/Authentication.Google/Areas/Admin/Controllers/GoogleAuthenticationSettingsController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs
index 4499b1942..01d655271 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/CustomerGroupsController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Discounts;
using Grand.Web.Common.Controllers;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs
index a421d4b68..2a0372642 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HadSpentAmountController.cs
@@ -1,7 +1,7 @@
using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Discounts;
using Grand.Web.Common.Controllers;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs
index b0ccab735..704435502 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasAllProductsController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
using Grand.Infrastructure;
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs
index 680c146ac..02bdf423d 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/HasOneProductController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
using Grand.Infrastructure;
diff --git a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs
index c3fcc6be6..99d1b911f 100644
--- a/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs
+++ b/src/Plugins/DiscountRules.Standard/Areas/Admin/Controllers/ShoppingCartAmountController.cs
@@ -1,7 +1,7 @@
using DiscountRules.Standard.Models;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Discounts;
using Grand.Web.Common.Controllers;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Plugins/Payments.BrainTree/Areas/Admin/Controllers/PaymentBrainTreeController.cs b/src/Plugins/Payments.BrainTree/Areas/Admin/Controllers/PaymentBrainTreeController.cs
index f02da02c5..8f41dd8c1 100644
--- a/src/Plugins/Payments.BrainTree/Areas/Admin/Controllers/PaymentBrainTreeController.cs
+++ b/src/Plugins/Payments.BrainTree/Areas/Admin/Controllers/PaymentBrainTreeController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Filters;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs b/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs
index 039914c91..8c7bbf8e6 100644
--- a/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs
+++ b/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Infrastructure;
diff --git a/src/Plugins/Payments.StripeCheckout/Areas/Admin/Controllers/StripeCheckoutController.cs b/src/Plugins/Payments.StripeCheckout/Areas/Admin/Controllers/StripeCheckoutController.cs
index ea853e4e5..7c8a3ba8d 100644
--- a/src/Plugins/Payments.StripeCheckout/Areas/Admin/Controllers/StripeCheckoutController.cs
+++ b/src/Plugins/Payments.StripeCheckout/Areas/Admin/Controllers/StripeCheckoutController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Infrastructure;
diff --git a/src/Plugins/Shipping.ByWeight/Areas/Admin/Controllers/ShippingByWeightController.cs b/src/Plugins/Shipping.ByWeight/Areas/Admin/Controllers/ShippingByWeightController.cs
index af7a45006..758218bbe 100644
--- a/src/Plugins/Shipping.ByWeight/Areas/Admin/Controllers/ShippingByWeightController.cs
+++ b/src/Plugins/Shipping.ByWeight/Areas/Admin/Controllers/ShippingByWeightController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.DataSource;
diff --git a/src/Plugins/Shipping.FixedRateShipping/Areas/Admin/Controllers/ShippingFixedRateController.cs b/src/Plugins/Shipping.FixedRateShipping/Areas/Admin/Controllers/ShippingFixedRateController.cs
index 9a8111bc8..60b5ab8cc 100644
--- a/src/Plugins/Shipping.FixedRateShipping/Areas/Admin/Controllers/ShippingFixedRateController.cs
+++ b/src/Plugins/Shipping.FixedRateShipping/Areas/Admin/Controllers/ShippingFixedRateController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
diff --git a/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Controllers/ShippingPointController.cs b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Controllers/ShippingPointController.cs
index c5be89072..fa0b1e38d 100644
--- a/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Controllers/ShippingPointController.cs
+++ b/src/Plugins/Shipping.ShippingPoint/Areas/Admin/Controllers/ShippingPointController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
diff --git a/src/Plugins/Tax.CountryStateZip/Areas/Admin/Controllers/TaxCountryStateZipController.cs b/src/Plugins/Tax.CountryStateZip/Areas/Admin/Controllers/TaxCountryStateZipController.cs
index 1a82d83d3..fa899e62e 100644
--- a/src/Plugins/Tax.CountryStateZip/Areas/Admin/Controllers/TaxCountryStateZipController.cs
+++ b/src/Plugins/Tax.CountryStateZip/Areas/Admin/Controllers/TaxCountryStateZipController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Catalog.Tax;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Plugins/Tax.FixedRate/Areas/Admin/Controllers/TaxFixedRateController.cs b/src/Plugins/Tax.FixedRate/Areas/Admin/Controllers/TaxFixedRateController.cs
index a439e8daa..843b0c91e 100644
--- a/src/Plugins/Tax.FixedRate/Areas/Admin/Controllers/TaxFixedRateController.cs
+++ b/src/Plugins/Tax.FixedRate/Areas/Admin/Controllers/TaxFixedRateController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Catalog.Tax;
using Grand.Business.Core.Interfaces.Common.Configuration;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
diff --git a/src/Plugins/Theme.Modern/Views/Modern/Shared/Partials/ShoppingCartLinks.cshtml b/src/Plugins/Theme.Modern/Views/Modern/Shared/Partials/ShoppingCartLinks.cshtml
index 735c065f1..0c2739912 100644
--- a/src/Plugins/Theme.Modern/Views/Modern/Shared/Partials/ShoppingCartLinks.cshtml
+++ b/src/Plugins/Theme.Modern/Views/Modern/Shared/Partials/ShoppingCartLinks.cshtml
@@ -1,6 +1,7 @@
@using Grand.Business.Core.Interfaces.Checkout.Orders
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
+
@inject IWorkContext workContext
@inject IPermissionService permissionService
@inject IShoppingCartService shoppingCartService
diff --git a/src/Plugins/Widgets.FacebookPixel/Areas/Admin/Controllers/WidgetsFacebookPixelController.cs b/src/Plugins/Widgets.FacebookPixel/Areas/Admin/Controllers/WidgetsFacebookPixelController.cs
index 6c2ca1a38..2da61bb36 100644
--- a/src/Plugins/Widgets.FacebookPixel/Areas/Admin/Controllers/WidgetsFacebookPixelController.cs
+++ b/src/Plugins/Widgets.FacebookPixel/Areas/Admin/Controllers/WidgetsFacebookPixelController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Infrastructure;
diff --git a/src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Controllers/WidgetsGoogleAnalyticsController.cs b/src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Controllers/WidgetsGoogleAnalyticsController.cs
index 1e688d3b0..f651fffd2 100644
--- a/src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Controllers/WidgetsGoogleAnalyticsController.cs
+++ b/src/Plugins/Widgets.GoogleAnalytics/Areas/Admin/Controllers/WidgetsGoogleAnalyticsController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Infrastructure;
diff --git a/src/Plugins/Widgets.Slider/Areas/Admin/Controllers/WidgetsSliderController.cs b/src/Plugins/Widgets.Slider/Areas/Admin/Controllers/WidgetsSliderController.cs
index 71d0bd18d..502f0f02b 100644
--- a/src/Plugins/Widgets.Slider/Areas/Admin/Controllers/WidgetsSliderController.cs
+++ b/src/Plugins/Widgets.Slider/Areas/Admin/Controllers/WidgetsSliderController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
diff --git a/src/Tests/Grand.Business.Authentication.Tests/Services/JwtBearerCustomerAuthenticationServiceTests.cs b/src/Tests/Grand.Business.Authentication.Tests/Services/JwtBearerCustomerAuthenticationServiceTests.cs
index 362f60118..0b92234da 100644
--- a/src/Tests/Grand.Business.Authentication.Tests/Services/JwtBearerCustomerAuthenticationServiceTests.cs
+++ b/src/Tests/Grand.Business.Authentication.Tests/Services/JwtBearerCustomerAuthenticationServiceTests.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Authentication;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Domain.Security;
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.cshtml
index beaa26cde..a7b9987f5 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/Partials/CreateOrUpdate.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model BrandModel
@inject IPermissionService permissionService
@{
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.cshtml
index 1dde7c899..7b397fed3 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/Partials/CreateOrUpdate.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model CategoryModel
@inject IPermissionService permissionService
@{
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.cshtml
index 0eccc245a..da1a5b18e 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/Partials/CreateOrUpdate.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model CollectionModel
@inject IPermissionService permissionService
@{
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabActivityLog.cshtml
index 6be51a043..6706f4814 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabActivityLog.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.TabActivityLog.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model CustomerModel
@inject AdminAreaSettings adminAreaSettings
@inject IPermissionService permissionService
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.cshtml
index 66893a385..b1d1cf65d 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Customer/Partials/CreateOrUpdate.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@using Constants = Grand.SharedUIResources.Constants
@model CustomerModel
@inject IPermissionService permissionService
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/CustomerGroup/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/CustomerGroup/Partials/CreateOrUpdate.cshtml
index b2a394fb0..43996bdf2 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/CustomerGroup/Partials/CreateOrUpdate.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/CustomerGroup/Partials/CreateOrUpdate.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model CustomerGroupModel
@inject IPermissionService permissionService
@{
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Home/Index.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Home/Index.cshtml
index 7b347983f..adc3b002b 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Home/Index.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Home/Index.cshtml
@@ -3,7 +3,7 @@
@using Grand.Business.Core.Interfaces.Common.Security
@using Grand.Business.Core.Interfaces.Customers
@using Grand.Business.Core.Interfaces.System.Reports
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@using Grand.Domain.Customers
@inject CustomerSettings customerSettings
@inject IPermissionService permissionService
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Home/Statistics.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Home/Statistics.cshtml
index 63049092a..4543b7085 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Home/Statistics.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Home/Statistics.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@inject IPermissionService permissionService
@{
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/MerchandiseReturn/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/MerchandiseReturn/Partials/CreateOrUpdate.cshtml
index cf5a8c4ac..0efc911ea 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/MerchandiseReturn/Partials/CreateOrUpdate.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/MerchandiseReturn/Partials/CreateOrUpdate.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model MerchandiseReturnModel
@inject OrderSettings orderSettings
@inject IPermissionService permissionService
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Edit.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Edit.cshtml
index ebeb12b7c..8695293df 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Edit.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Edit.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model OrderModel
@inject IPermissionService permissionService
@{
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Shipment.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Shipment.cshtml
index 91f7dc7c7..619073d3d 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Shipment.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Shipment.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model OrderModel
@inject IPermissionService permissionService;
<vc:admin-widget widget-zone="order_details_address_top" additional-data="Model"/>
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.cshtml
index 8940ad8ef..51140f456 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model ProductModel
@inject IPermissionService permissionService
@{
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/EditorTemplates/Editor.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/EditorTemplates/Editor.cshtml
index aaaa92d6c..d354f9375 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/EditorTemplates/Editor.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/EditorTemplates/Editor.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@using Constants = Grand.SharedUIResources.Constants
@model string
@inject IPermissionService permissionService
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/Partials/Menu.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/Partials/Menu.cshtml
index aeea60c3c..4b93f96be 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/Partials/Menu.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/Partials/Menu.cshtml
@@ -1,6 +1,6 @@
@using Grand.Business.Core.Interfaces.Common.Security
@using Grand.Business.Core.Interfaces.System.Admin
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@using Grand.Web.Common.Menu
@using Constants = Grand.SharedUIResources.Constants
@inject IPermissionService permissionService
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/_AdminLayout.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/_AdminLayout.cshtml
index dce7cad6f..2c0e02d1f 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/_AdminLayout.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/_AdminLayout.cshtml
@@ -1,7 +1,7 @@
@using System.Text.Encodings.Web
@using Grand.Business.Core.Interfaces.Common.Directory
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@using Grand.Domain.Customers
@using Grand.Domain.Localization
@inject IWorkContext workContext
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipment/ShipmentDetails.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipment/ShipmentDetails.cshtml
index f62f97a5d..3a439f29e 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipment/ShipmentDetails.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipment/ShipmentDetails.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model ShipmentModel
@inject IPermissionService permissionService
@{
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Vendor/Partials/CreateOrUpdate.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Vendor/Partials/CreateOrUpdate.cshtml
index de856d409..cd26b2e20 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Vendor/Partials/CreateOrUpdate.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Vendor/Partials/CreateOrUpdate.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model VendorModel
@inject IPermissionService permissionService
@{
diff --git a/src/Web/Grand.Web.Admin/Components/BestsellersBriefReportByAmount.cs b/src/Web/Grand.Web.Admin/Components/BestsellersBriefReportByAmount.cs
index 44cd88650..f6659d3d7 100644
--- a/src/Web/Grand.Web.Admin/Components/BestsellersBriefReportByAmount.cs
+++ b/src/Web/Grand.Web.Admin/Components/BestsellersBriefReportByAmount.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/BestsellersBriefReportByQuantity.cs b/src/Web/Grand.Web.Admin/Components/BestsellersBriefReportByQuantity.cs
index 709518b1b..d611fab3c 100644
--- a/src/Web/Grand.Web.Admin/Components/BestsellersBriefReportByQuantity.cs
+++ b/src/Web/Grand.Web.Admin/Components/BestsellersBriefReportByQuantity.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/CustomerReportRegistered.cs b/src/Web/Grand.Web.Admin/Components/CustomerReportRegistered.cs
index af4a40287..3326333b7 100644
--- a/src/Web/Grand.Web.Admin/Components/CustomerReportRegistered.cs
+++ b/src/Web/Grand.Web.Admin/Components/CustomerReportRegistered.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/CustomerReportTimeChart.cs b/src/Web/Grand.Web.Admin/Components/CustomerReportTimeChart.cs
index 9d37c707e..19fabfaee 100644
--- a/src/Web/Grand.Web.Admin/Components/CustomerReportTimeChart.cs
+++ b/src/Web/Grand.Web.Admin/Components/CustomerReportTimeChart.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/LatestOrder.cs b/src/Web/Grand.Web.Admin/Components/LatestOrder.cs
index 15012e23a..95186754d 100644
--- a/src/Web/Grand.Web.Admin/Components/LatestOrder.cs
+++ b/src/Web/Grand.Web.Admin/Components/LatestOrder.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/OrderAverageReport.cs b/src/Web/Grand.Web.Admin/Components/OrderAverageReport.cs
index 8bf4ed772..a55d7739b 100644
--- a/src/Web/Grand.Web.Admin/Components/OrderAverageReport.cs
+++ b/src/Web/Grand.Web.Admin/Components/OrderAverageReport.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/OrderIncompleteReport.cs b/src/Web/Grand.Web.Admin/Components/OrderIncompleteReport.cs
index 8bafe44f1..6ec058618 100644
--- a/src/Web/Grand.Web.Admin/Components/OrderIncompleteReport.cs
+++ b/src/Web/Grand.Web.Admin/Components/OrderIncompleteReport.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/OrderPeriodReport.cs b/src/Web/Grand.Web.Admin/Components/OrderPeriodReport.cs
index 66e0ed01d..db2ee896a 100644
--- a/src/Web/Grand.Web.Admin/Components/OrderPeriodReport.cs
+++ b/src/Web/Grand.Web.Admin/Components/OrderPeriodReport.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/OrderTimeChart.cs b/src/Web/Grand.Web.Admin/Components/OrderTimeChart.cs
index 3e654b759..27b90bcf6 100644
--- a/src/Web/Grand.Web.Admin/Components/OrderTimeChart.cs
+++ b/src/Web/Grand.Web.Admin/Components/OrderTimeChart.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Components/PopularSearchTermsReport.cs b/src/Web/Grand.Web.Admin/Components/PopularSearchTermsReport.cs
index fb66de4e2..004e61112 100644
--- a/src/Web/Grand.Web.Admin/Components/PopularSearchTermsReport.cs
+++ b/src/Web/Grand.Web.Admin/Components/PopularSearchTermsReport.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/AddressAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/AddressAttributeController.cs
index 32778d470..cf4ba175c 100644
--- a/src/Web/Grand.Web.Admin/Controllers/AddressAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/AddressAttributeController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Common;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Admin/Controllers/AffiliateController.cs b/src/Web/Grand.Web.Admin/Controllers/AffiliateController.cs
index 7e4b74fea..676425161 100644
--- a/src/Web/Grand.Web.Admin/Controllers/AffiliateController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/AffiliateController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Affiliates;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ApiUserController.cs b/src/Web/Grand.Web.Admin/Controllers/ApiUserController.cs
index 0903fd944..828f2f5bb 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ApiUserController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ApiUserController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.SharedKernel.Extensions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Models.Customers;
diff --git a/src/Web/Grand.Web.Admin/Controllers/BlogController.cs b/src/Web/Grand.Web.Admin/Controllers/BlogController.cs
index f3870bf56..6af570c6e 100644
--- a/src/Web/Grand.Web.Admin/Controllers/BlogController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/BlogController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
diff --git a/src/Web/Grand.Web.Admin/Controllers/BrandController.cs b/src/Web/Grand.Web.Admin/Controllers/BrandController.cs
index 8516a1edc..564c03cad 100644
--- a/src/Web/Grand.Web.Admin/Controllers/BrandController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/BrandController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.ExportImport;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CampaignController.cs b/src/Web/Grand.Web.Admin/Controllers/CampaignController.cs
index 7992f7797..429952d19 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CampaignController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CampaignController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Marketing.Campaigns;
using Grand.Business.Core.Interfaces.Marketing.Newsletters;
using Grand.Business.Core.Interfaces.Messages;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Messages;
using Grand.Infrastructure;
using Grand.SharedKernel;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs b/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs
index 58a9174a2..51e4ef020 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Catalog.Categories;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.ExportImport;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs
index 4c595d37f..12be9a0fb 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Catalog.Directory;
using Grand.Business.Core.Interfaces.Checkout.CheckoutAttributes;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs b/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs
index 0300fa38c..97798944a 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.ExportImport;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs
index 6254c1734..318bc65e4 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ContactAttributeController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Contacts;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ContactFormController.cs b/src/Web/Grand.Web.Admin/Controllers/ContactFormController.cs
index 0676cc44f..5e9a5d67c 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ContactFormController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ContactFormController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Contacts;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Messages;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CountryController.cs b/src/Web/Grand.Web.Admin/Controllers/CountryController.cs
index cfd13d6da..4fe6616d1 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CountryController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CountryController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.ExportImport;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Country;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CourseController.cs b/src/Web/Grand.Web.Admin/Controllers/CourseController.cs
index 31cf41d06..5e9f27b54 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CourseController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CourseController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Courses;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Courses;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CurrencyController.cs b/src/Web/Grand.Web.Admin/Controllers/CurrencyController.cs
index e82a69480..940718228 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CurrencyController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CurrencyController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using Grand.Infrastructure.Caching;
using Grand.SharedKernel;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CustomerAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/CustomerAttributeController.cs
index 02432ae05..6dee3b44e 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CustomerAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CustomerAttributeController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Customers;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs b/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs
index 153e5c440..3a2d47e3d 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CustomerController.cs
@@ -7,7 +7,7 @@ using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.ExportImport;
using Grand.Business.Core.Interfaces.Messages;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Business.Core.Utilities.Customers;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CustomerGroupController.cs b/src/Web/Grand.Web.Admin/Controllers/CustomerGroupController.cs
index ed99f4e43..e50c21c42 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CustomerGroupController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CustomerGroupController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
diff --git a/src/Web/Grand.Web.Admin/Controllers/CustomerTagController.cs b/src/Web/Grand.Web.Admin/Controllers/CustomerTagController.cs
index efbf6baf0..3abe0b1e9 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CustomerTagController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CustomerTagController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Customers;
diff --git a/src/Web/Grand.Web.Admin/Controllers/DiscountController.cs b/src/Web/Grand.Web.Admin/Controllers/DiscountController.cs
index 6afef5e41..7aa760f36 100644
--- a/src/Web/Grand.Web.Admin/Controllers/DiscountController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/DiscountController.cs
@@ -7,7 +7,7 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Queries.Catalog;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain;
using Grand.Domain.Vendors;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs b/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs
index 514d8b048..4b2394a81 100644
--- a/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/DocumentController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Marketing.Documents;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Documents;
diff --git a/src/Web/Grand.Web.Admin/Controllers/DownloadController.cs b/src/Web/Grand.Web.Admin/Controllers/DownloadController.cs
index 4fa170c28..a7a90265d 100644
--- a/src/Web/Grand.Web.Admin/Controllers/DownloadController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/DownloadController.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Media;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ElFinderController.cs b/src/Web/Grand.Web.Admin/Controllers/ElFinderController.cs
index dba5b2087..6016e4e3b 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ElFinderController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ElFinderController.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Admin/Controllers/EmailAccountController.cs b/src/Web/Grand.Web.Admin/Controllers/EmailAccountController.cs
index 31fca7c81..e0ba39e55 100644
--- a/src/Web/Grand.Web.Admin/Controllers/EmailAccountController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/EmailAccountController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Messages;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Messages;
using Grand.Infrastructure.Caching;
using Grand.SharedKernel;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ExternalAuthenticationController.cs b/src/Web/Grand.Web.Admin/Controllers/ExternalAuthenticationController.cs
index 88d605af1..7ab4775a7 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ExternalAuthenticationController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ExternalAuthenticationController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Authentication;
using Grand.Business.Core.Interfaces.Common.Configuration;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Customers;
using Grand.Infrastructure.Plugins;
using Grand.Web.Admin.Extensions.Mapping;
diff --git a/src/Web/Grand.Web.Admin/Controllers/GiftVoucherController.cs b/src/Web/Grand.Web.Admin/Controllers/GiftVoucherController.cs
index 49fcb0ee9..96a1c81f6 100644
--- a/src/Web/Grand.Web.Admin/Controllers/GiftVoucherController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/GiftVoucherController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Checkout.GiftVouchers;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Orders;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs b/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs
index 57419cc9f..fad94bbe7 100644
--- a/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/KnowledgebaseController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Knowledgebase;
diff --git a/src/Web/Grand.Web.Admin/Controllers/LanguageController.cs b/src/Web/Grand.Web.Admin/Controllers/LanguageController.cs
index f61414bd3..96d6af6cb 100644
--- a/src/Web/Grand.Web.Admin/Controllers/LanguageController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/LanguageController.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Localization;
diff --git a/src/Web/Grand.Web.Admin/Controllers/LayoutController.cs b/src/Web/Grand.Web.Admin/Controllers/LayoutController.cs
index e11e0fe75..c65799b7a 100644
--- a/src/Web/Grand.Web.Admin/Controllers/LayoutController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/LayoutController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Catalog.Categories;
using Grand.Business.Core.Interfaces.Catalog.Collections;
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Cms;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Pages;
using Grand.Web.Admin.Extensions.Mapping.Layouts;
diff --git a/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs b/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs
index 8f33e4bd0..c37cfaba2 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Seo;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Media;
using Grand.Domain.Seo;
diff --git a/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs b/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs
index a0e3b3691..ca1e4b462 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Catalog.Directory;
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using Grand.Infrastructure.Caching;
using Grand.Web.Admin.Extensions.Mapping;
diff --git a/src/Web/Grand.Web.Admin/Controllers/MenuController.cs b/src/Web/Grand.Web.Admin/Controllers/MenuController.cs
index 6d9c69016..2db7a59c7 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MenuController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MenuController.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Menu;
diff --git a/src/Web/Grand.Web.Admin/Controllers/MerchandiseReturnController.cs b/src/Web/Grand.Web.Admin/Controllers/MerchandiseReturnController.cs
index 5703e27bd..aab38b887 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MerchandiseReturnController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MerchandiseReturnController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Orders;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web.Admin/Controllers/MessageTemplateController.cs b/src/Web/Grand.Web.Admin/Controllers/MessageTemplateController.cs
index 66d1e3d01..d0c53535b 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MessageTemplateController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MessageTemplateController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Messages;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Messages;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Models.Messages;
diff --git a/src/Web/Grand.Web.Admin/Controllers/NewsController.cs b/src/Web/Grand.Web.Admin/Controllers/NewsController.cs
index 654f49f08..654e7e741 100644
--- a/src/Web/Grand.Web.Admin/Controllers/NewsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/NewsController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.News;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
diff --git a/src/Web/Grand.Web.Admin/Controllers/NewsLetterCategoryController.cs b/src/Web/Grand.Web.Admin/Controllers/NewsLetterCategoryController.cs
index 763692f86..175b9988a 100644
--- a/src/Web/Grand.Web.Admin/Controllers/NewsLetterCategoryController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/NewsLetterCategoryController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Marketing.Newsletters;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Models.Messages;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Admin/Controllers/NewsLetterSubscriptionController.cs b/src/Web/Grand.Web.Admin/Controllers/NewsLetterSubscriptionController.cs
index 3b72d6e8a..18e3d817f 100644
--- a/src/Web/Grand.Web.Admin/Controllers/NewsLetterSubscriptionController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/NewsLetterSubscriptionController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Marketing.Newsletters;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.SharedKernel.Extensions;
using Grand.Web.Admin.Extensions.Mapping;
diff --git a/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs b/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs
index 6f937b499..8d40f7401 100644
--- a/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Customers;
using Grand.Infrastructure;
using Grand.Web.Admin.Models.Customers;
diff --git a/src/Web/Grand.Web.Admin/Controllers/OrderController.cs b/src/Web/Grand.Web.Admin/Controllers/OrderController.cs
index 7c05e55be..258fe41a1 100644
--- a/src/Web/Grand.Web.Admin/Controllers/OrderController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/OrderController.cs
@@ -7,7 +7,7 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Pdf;
using Grand.Business.Core.Interfaces.ExportImport;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Orders;
diff --git a/src/Web/Grand.Web.Admin/Controllers/OrderStatusController.cs b/src/Web/Grand.Web.Admin/Controllers/OrderStatusController.cs
index acf6b19be..7654f3e12 100644
--- a/src/Web/Grand.Web.Admin/Controllers/OrderStatusController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/OrderStatusController.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Orders;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Models.Orders;
diff --git a/src/Web/Grand.Web.Admin/Controllers/OrderTagsController.cs b/src/Web/Grand.Web.Admin/Controllers/OrderTagsController.cs
index c27ca7377..1323a272b 100644
--- a/src/Web/Grand.Web.Admin/Controllers/OrderTagsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/OrderTagsController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Models.Orders;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Extensions;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PageController.cs b/src/Web/Grand.Web.Admin/Controllers/PageController.cs
index 586404b1d..a53ce1d67 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PageController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PageController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs b/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs
index 944ee0bc0..2375cbc1c 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PaymentController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Payments;
using Grand.Infrastructure;
using Grand.Infrastructure.Plugins;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PaymentTransactionController.cs b/src/Web/Grand.Web.Admin/Controllers/PaymentTransactionController.cs
index b42809cac..799203029 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PaymentTransactionController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PaymentTransactionController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Checkout.Payments;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Queries.Checkout.Orders;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Payments;
using Grand.Infrastructure;
using Grand.SharedKernel;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PermissionController.cs b/src/Web/Grand.Web.Admin/Controllers/PermissionController.cs
index 3aff73df0..b41df7fdb 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PermissionController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PermissionController.cs
@@ -3,7 +3,6 @@ using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions.Mapping;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PictureController.cs b/src/Web/Grand.Web.Admin/Controllers/PictureController.cs
index 35c2ef35f..32620989c 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PictureController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PictureController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Media;
using Grand.Web.Admin.Extensions;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PluginController.cs b/src/Web/Grand.Web.Admin/Controllers/PluginController.cs
index 6ddc55249..8bebb3e5a 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PluginController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PluginController.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Infrastructure.Configuration;
using Grand.Infrastructure.Plugins;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs
index 58b268c5a..df333bc08 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ProductAttributeController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions.Mapping;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductController.cs
index 3bb89d273..e63bbd412 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ProductController.cs
@@ -6,7 +6,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.ExportImport;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Media;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductReviewController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductReviewController.cs
index 11d1c84e5..a5164f879 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ProductReviewController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ProductReviewController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Catalog;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductTagsController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductTagsController.cs
index 7e836f30c..1849f57a2 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ProductTagsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ProductTagsController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Seo;
using Grand.Web.Admin.Models.Catalog;
diff --git a/src/Web/Grand.Web.Admin/Controllers/PushNotificationsController.cs b/src/Web/Grand.Web.Admin/Controllers/PushNotificationsController.cs
index f0148685a..6339b5277 100644
--- a/src/Web/Grand.Web.Admin/Controllers/PushNotificationsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/PushNotificationsController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Marketing.PushNotifications;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.PushNotifications;
using Grand.Web.Admin.Models.PushNotifications;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Admin/Controllers/QueuedEmailController.cs b/src/Web/Grand.Web.Admin/Controllers/QueuedEmailController.cs
index cbfc4c52a..6b5ee2646 100644
--- a/src/Web/Grand.Web.Admin/Controllers/QueuedEmailController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/QueuedEmailController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Messages;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain;
using Grand.Domain.Messages;
using Grand.Web.Admin.Extensions.Mapping;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs b/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs
index ec633c533..995e4b189 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs
@@ -9,7 +9,7 @@ using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.System.Reports;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Business.Core.Utilities.System;
using Grand.Domain.Orders;
using Grand.Domain.Payments;
diff --git a/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs b/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs
index 411e46aa9..32faea8f0 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SalesEmployeeController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Marketing.Documents;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Customers;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Models.Customers;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ScheduleTaskController.cs b/src/Web/Grand.Web.Admin/Controllers/ScheduleTaskController.cs
index 5f24dea96..53e38fcbd 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ScheduleTaskController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ScheduleTaskController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.System.ScheduleTasks;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Tasks;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Models.Tasks;
diff --git a/src/Web/Grand.Web.Admin/Controllers/SettingController.cs b/src/Web/Grand.Web.Admin/Controllers/SettingController.cs
index ed4435870..755ba2020 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SettingController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SettingController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Admin;
using Grand.Domain.Blogs;
using Grand.Domain.Catalog;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs b/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs
index 9ea6a5add..624afb463 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ShipmentController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Pdf;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Orders;
using Grand.Domain.Shipping;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs b/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs
index 00b959c34..a2f75035a 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ShippingController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain;
using Grand.Domain.Customers;
using Grand.Domain.Directory;
diff --git a/src/Web/Grand.Web.Admin/Controllers/ShoppingCartController.cs b/src/Web/Grand.Web.Admin/Controllers/ShoppingCartController.cs
index 9d86500b3..b48a05877 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ShoppingCartController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ShoppingCartController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Orders;
using Grand.Web.Admin.Models.ShoppingCart;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs
index 5a9e3cad0..46b1d7475 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SpecificationAttributeController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Infrastructure;
using Grand.Web.Admin.Extensions.Mapping;
diff --git a/src/Web/Grand.Web.Admin/Controllers/StoreController.cs b/src/Web/Grand.Web.Admin/Controllers/StoreController.cs
index 134857f56..a4ca219b4 100644
--- a/src/Web/Grand.Web.Admin/Controllers/StoreController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/StoreController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Stores;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Stores;
diff --git a/src/Web/Grand.Web.Admin/Controllers/SystemController.cs b/src/Web/Grand.Web.Admin/Controllers/SystemController.cs
index 694890497..4f71a7ad0 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SystemController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SystemController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.System.MachineNameProvider;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using Grand.Infrastructure;
using Grand.Infrastructure.Caching;
diff --git a/src/Web/Grand.Web.Admin/Controllers/TaxController.cs b/src/Web/Grand.Web.Admin/Controllers/TaxController.cs
index 3829b3dfd..fb2a050ab 100644
--- a/src/Web/Grand.Web.Admin/Controllers/TaxController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/TaxController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Directory;
using Grand.Domain.Tax;
using Grand.Infrastructure.Caching;
diff --git a/src/Web/Grand.Web.Admin/Controllers/VendorController.cs b/src/Web/Grand.Web.Admin/Controllers/VendorController.cs
index 3cce42504..7d72bb4ce 100644
--- a/src/Web/Grand.Web.Admin/Controllers/VendorController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/VendorController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Admin.Extensions.Mapping;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Vendors;
diff --git a/src/Web/Grand.Web.Admin/Controllers/VendorReviewController.cs b/src/Web/Grand.Web.Admin/Controllers/VendorReviewController.cs
index 5f2b16711..2e3bc910b 100644
--- a/src/Web/Grand.Web.Admin/Controllers/VendorReviewController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/VendorReviewController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Web.Admin.Interfaces;
using Grand.Web.Admin.Models.Vendors;
diff --git a/src/Web/Grand.Web.Admin/Controllers/WidgetController.cs b/src/Web/Grand.Web.Admin/Controllers/WidgetController.cs
index 642c62af9..9791e3fb0 100644
--- a/src/Web/Grand.Web.Admin/Controllers/WidgetController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/WidgetController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Configuration;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Cms;
using Grand.Infrastructure.Caching;
using Grand.Infrastructure.Plugins;
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupAclUpdateValidator.cs b/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupAclUpdateValidator.cs
index 80e6eb521..50f0c280a 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupAclUpdateValidator.cs
+++ b/src/Web/Grand.Web.Admin/Validators/Customers/CustomerGroupAclUpdateValidator.cs
@@ -1,7 +1,7 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure.Validators;
using Grand.Web.Admin.Models.Customers;
diff --git a/src/Web/Grand.Web.Common/Filters/AuthorizeAdminAttribute.cs b/src/Web/Grand.Web.Common/Filters/AuthorizeAdminAttribute.cs
index 5d16b3513..27a1e572c 100644
--- a/src/Web/Grand.Web.Common/Filters/AuthorizeAdminAttribute.cs
+++ b/src/Web/Grand.Web.Common/Filters/AuthorizeAdminAttribute.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Data;
using Grand.Domain.Security;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web.Common/Filters/AuthorizeVendorAttribute.cs b/src/Web/Grand.Web.Common/Filters/AuthorizeVendorAttribute.cs
index 1a5bf2e30..a1e3af9b1 100644
--- a/src/Web/Grand.Web.Common/Filters/AuthorizeVendorAttribute.cs
+++ b/src/Web/Grand.Web.Common/Filters/AuthorizeVendorAttribute.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Data;
using Grand.Infrastructure;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Common/Filters/ClosedStoreAttribute.cs b/src/Web/Grand.Web.Common/Filters/ClosedStoreAttribute.cs
index b2e55eda1..18d9cc6e6 100644
--- a/src/Web/Grand.Web.Common/Filters/ClosedStoreAttribute.cs
+++ b/src/Web/Grand.Web.Common/Filters/ClosedStoreAttribute.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Data;
using Grand.Domain.Stores;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web.Common/Filters/PublicStoreAttribute.cs b/src/Web/Grand.Web.Common/Filters/PublicStoreAttribute.cs
index b1e0fcbf1..757e761ab 100644
--- a/src/Web/Grand.Web.Common/Filters/PublicStoreAttribute.cs
+++ b/src/Web/Grand.Web.Common/Filters/PublicStoreAttribute.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Data;
using Grand.Domain.Stores;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Common/Middleware/InstallUrlMiddleware.cs b/src/Web/Grand.Web.Common/Middleware/InstallUrlMiddleware.cs
index 858419ba4..64c7f88b8 100644
--- a/src/Web/Grand.Web.Common/Middleware/InstallUrlMiddleware.cs
+++ b/src/Web/Grand.Web.Common/Middleware/InstallUrlMiddleware.cs
@@ -1,6 +1,8 @@
using Grand.Data;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
namespace Grand.Web.Common.Middleware;
@@ -33,6 +35,16 @@ public class InstallUrlMiddleware
//whether database is installed
if (!DataSettingsManager.DatabaseIsInstalled())
{
+ var configuration = context.RequestServices.GetService<IConfiguration>();
+ var isInstallerModuleEnabled = configuration.GetValue<bool>("FeatureFlags:Modules:Grand.Module.Installer");
+ if (!isInstallerModuleEnabled)
+ {
+ // Return a response indicating the installer module is not enabled
+ context.Response.StatusCode = StatusCodes.Status403Forbidden;
+ await context.Response.WriteAsync("The installation module is not enabled.");
+ return;
+ }
+
const string installUrl = "/install";
if (!context.Request.GetEncodedPathAndQuery().StartsWith(installUrl, StringComparison.OrdinalIgnoreCase))
{
diff --git a/src/Web/Grand.Web.Common/Security/Authorization/PermissionAuthorizeActionAttribute.cs b/src/Web/Grand.Web.Common/Security/Authorization/PermissionAuthorizeActionAttribute.cs
index 62cb8a7ad..a5b24ec64 100644
--- a/src/Web/Grand.Web.Common/Security/Authorization/PermissionAuthorizeActionAttribute.cs
+++ b/src/Web/Grand.Web.Common/Security/Authorization/PermissionAuthorizeActionAttribute.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.DataSource;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
diff --git a/src/Web/Grand.Web.Common/Security/Authorization/PermissionAuthorizeAttribute.cs b/src/Web/Grand.Web.Common/Security/Authorization/PermissionAuthorizeAttribute.cs
index 98c328197..52db8c2bf 100644
--- a/src/Web/Grand.Web.Common/Security/Authorization/PermissionAuthorizeAttribute.cs
+++ b/src/Web/Grand.Web.Common/Security/Authorization/PermissionAuthorizeAttribute.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Routing;
diff --git a/src/Web/Grand.Web.Common/Startup/GrandCommonStartup.cs b/src/Web/Grand.Web.Common/Startup/GrandCommonStartup.cs
index fee85e5c8..59bfc99e3 100644
--- a/src/Web/Grand.Web.Common/Startup/GrandCommonStartup.cs
+++ b/src/Web/Grand.Web.Common/Startup/GrandCommonStartup.cs
@@ -72,6 +72,7 @@ public class GrandCommonStartup : IStartupApplication
var appConfig = serviceProvider.GetRequiredService<AppConfig>();
var performanceConfig = serviceProvider.GetRequiredService<PerformanceConfig>();
var securityConfig = serviceProvider.GetRequiredService<SecurityConfig>();
+ var featureFlagsConfig = serviceProvider.GetRequiredService<FeatureFlagsConfig>();
//add HealthChecks
application.UseGrandHealthChecks();
@@ -93,7 +94,7 @@ public class GrandCommonStartup : IStartupApplication
application.UseGrandStaticFiles(appConfig);
//check whether database is installed
- if (!performanceConfig.IgnoreInstallUrlMiddleware)
+ if (featureFlagsConfig.Modules.TryGetValue("Grand.Module.Installer", out var value) && value)
application.UseInstallUrl();
//use HTTP session
diff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Order/Partials/OrderDetails.Shipment.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Order/Partials/OrderDetails.Shipment.cshtml
index 81a5db470..e38ab5628 100644
--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Order/Partials/OrderDetails.Shipment.cshtml
+++ b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Order/Partials/OrderDetails.Shipment.cshtml
@@ -1,5 +1,5 @@
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@model OrderModel
@inject IPermissionService permissionService;
<vc:vendor-widget widget-zone="vendor_order_details_address_top" additional-data="Model"/>
diff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Shared/Partials/Menu.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Shared/Partials/Menu.cshtml
index 9910337fd..7064e3054 100644
--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Shared/Partials/Menu.cshtml
+++ b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Shared/Partials/Menu.cshtml
@@ -1,6 +1,6 @@
@using Grand.Business.Core.Interfaces.Common.Security
@using Grand.Business.Core.Interfaces.System.Admin
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@using Grand.Web.Common.Menu
@using Constants = Grand.SharedUIResources.Constants
@inject IPermissionService permissionService
diff --git a/src/Web/Grand.Web.Vendor/Components/LatestVendorOrder.cs b/src/Web/Grand.Web.Vendor/Components/LatestVendorOrder.cs
index f208a5fdd..4bdabf4f2 100644
--- a/src/Web/Grand.Web.Vendor/Components/LatestVendorOrder.cs
+++ b/src/Web/Grand.Web.Vendor/Components/LatestVendorOrder.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Components;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/Web/Grand.Web.Vendor/Controllers/MerchandiseReturnController.cs b/src/Web/Grand.Web.Vendor/Controllers/MerchandiseReturnController.cs
index aa2bb039a..d808969d9 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/MerchandiseReturnController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/MerchandiseReturnController.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Addresses;
using Grand.Business.Core.Interfaces.Common.Localization;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Common;
using Grand.Domain.Orders;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web.Vendor/Controllers/OrderController.cs b/src/Web/Grand.Web.Vendor/Controllers/OrderController.cs
index 51e74f786..2ffffc30f 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/OrderController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/OrderController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Pdf;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Orders;
using Grand.Infrastructure;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs b/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs
index 7232b77c1..b01637e4f 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/ProductController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.ExportImport;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Media;
diff --git a/src/Web/Grand.Web.Vendor/Controllers/ReportsController.cs b/src/Web/Grand.Web.Vendor/Controllers/ReportsController.cs
index d4f1b827e..a6885da28 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/ReportsController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/ReportsController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.System.Reports;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Payments;
using Grand.Infrastructure;
using Grand.Web.Common.DataSource;
diff --git a/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.cs b/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.cs
index 14e474c86..dfb59ade9 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/ShipmentController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Pdf;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Orders;
using Grand.Domain.Shipping;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web.Vendor/Controllers/VendorReviewController.cs b/src/Web/Grand.Web.Vendor/Controllers/VendorReviewController.cs
index 418da2a59..32e51919d 100644
--- a/src/Web/Grand.Web.Vendor/Controllers/VendorReviewController.cs
+++ b/src/Web/Grand.Web.Vendor/Controllers/VendorReviewController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Filters;
diff --git a/src/Web/Grand.Web/App_Data/appsettings.json b/src/Web/Grand.Web/App_Data/appsettings.json
index 84a46fdf6..6a0e1b05b 100644
--- a/src/Web/Grand.Web/App_Data/appsettings.json
+++ b/src/Web/Grand.Web/App_Data/appsettings.json
@@ -28,7 +28,7 @@
//Gets or sets the maximum allowed size of any request body in bytes
//the default value is 30MB
"MaxRequestBodySize": null, //max 2147483648
-
+
//Gets or sets the value to enable a middleware for logging additional information about CurrentCustomer and CurrentStore
"EnableContextLoggingMiddleware": true
},
@@ -140,9 +140,6 @@
//You may want to disable it, for example, If you have an active IIS Dynamic Compression Module configured at the server level
"UseResponseCompression": false,
- //Indicates whether to ignore InstallUrlMiddleware
- "IgnoreInstallUrlMiddleware": false,
-
//Indicates whether to ignore DbVersionCheckMiddleware
"IgnoreDbVersionCheckMiddleware": false,
@@ -150,7 +147,11 @@
"IgnoreUsePoweredByMiddleware": false
},
-
+ "FeatureFlags": {
+ "Modules": {
+ "Grand.Module.Installer": true
+ }
+ },
"Redis": {
///Enable the Publish/Subscribe messaging with redis to manage memory cache on every server
"RedisPubSubEnabled": false,
@@ -197,7 +198,7 @@
"DataProtectionContainerName": "", //required
"DataProtectionBlobName": "keys.xml", //required
"KeyIdentifier": "", //required when use PersistKeysToAzureKeyVault
-
+
//Azure App Configuration
"AppConfiguration": "",
"AppKeyPrefix": ""
@@ -253,7 +254,7 @@
"SystemModel": true
},
"UseSwagger": false,
-
+
"Logging": {
"LogLevel": {
"Default": "Information",
diff --git a/src/Web/Grand.Web/Components/EmailWishlist.cs b/src/Web/Grand.Web/Components/EmailWishlist.cs
index 163024734..2ce6aa813 100644
--- a/src/Web/Grand.Web/Components/EmailWishlist.cs
+++ b/src/Web/Grand.Web/Components/EmailWishlist.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Orders;
using Grand.Infrastructure;
using Grand.Web.Common.Components;
diff --git a/src/Web/Grand.Web/Components/Footer.cs b/src/Web/Grand.Web/Components/Footer.cs
index d097cde41..5dec1300c 100644
--- a/src/Web/Grand.Web/Components/Footer.cs
+++ b/src/Web/Grand.Web/Components/Footer.cs
@@ -1,7 +1,7 @@
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Blogs;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
diff --git a/src/Web/Grand.Web/Components/Menu.cs b/src/Web/Grand.Web/Components/Menu.cs
index 81cf2e23d..d5f83b4f5 100644
--- a/src/Web/Grand.Web/Components/Menu.cs
+++ b/src/Web/Grand.Web/Components/Menu.cs
@@ -1,5 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Infrastructure;
using Grand.Web.Common.Components;
using Grand.Web.Features.Models.Catalog;
diff --git a/src/Web/Grand.Web/Controllers/BlogController.cs b/src/Web/Grand.Web/Controllers/BlogController.cs
index 34284ae05..1671c532a 100644
--- a/src/Web/Grand.Web/Controllers/BlogController.cs
+++ b/src/Web/Grand.Web/Controllers/BlogController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Blogs;
using Grand.Domain.Customers;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web/Controllers/CatalogController.cs b/src/Web/Grand.Web/Controllers/CatalogController.cs
index 175deed7c..448174ee6 100644
--- a/src/Web/Grand.Web/Controllers/CatalogController.cs
+++ b/src/Web/Grand.Web/Controllers/CatalogController.cs
@@ -7,7 +7,7 @@ using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Customers;
using Grand.Domain.Vendors;
diff --git a/src/Web/Grand.Web/Controllers/CourseController.cs b/src/Web/Grand.Web/Controllers/CourseController.cs
index b51049159..46f679fab 100644
--- a/src/Web/Grand.Web/Controllers/CourseController.cs
+++ b/src/Web/Grand.Web/Controllers/CourseController.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Marketing.Courses;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Courses;
using Grand.Domain.Customers;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs b/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs
index a0bbacf0a..c4edd8141 100644
--- a/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs
+++ b/src/Web/Grand.Web/Controllers/KnowledgebaseController.cs
@@ -5,7 +5,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Messages;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Customers;
using Grand.Domain.Knowledgebase;
using Grand.Domain.Localization;
diff --git a/src/Web/Grand.Web/Controllers/NewsController.cs b/src/Web/Grand.Web/Controllers/NewsController.cs
index f0d31037b..1efad8a6e 100644
--- a/src/Web/Grand.Web/Controllers/NewsController.cs
+++ b/src/Web/Grand.Web/Controllers/NewsController.cs
@@ -2,7 +2,7 @@
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Customers;
using Grand.Domain.News;
using Grand.Infrastructure;
diff --git a/src/Web/Grand.Web/Controllers/PageController.cs b/src/Web/Grand.Web/Controllers/PageController.cs
index 8cec6bf57..4564cfcc2 100644
--- a/src/Web/Grand.Web/Controllers/PageController.cs
+++ b/src/Web/Grand.Web/Controllers/PageController.cs
@@ -1,6 +1,6 @@
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Filters;
using Grand.Web.Features.Models.Pages;
diff --git a/src/Web/Grand.Web/Controllers/ProductController.cs b/src/Web/Grand.Web/Controllers/ProductController.cs
index 4fe591573..1d3d16867 100644
--- a/src/Web/Grand.Web/Controllers/ProductController.cs
+++ b/src/Web/Grand.Web/Controllers/ProductController.cs
@@ -7,7 +7,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Media;
diff --git a/src/Web/Grand.Web/Controllers/ShoppingCartController.cs b/src/Web/Grand.Web/Controllers/ShoppingCartController.cs
index ce8a348b5..133a174de 100644
--- a/src/Web/Grand.Web/Controllers/ShoppingCartController.cs
+++ b/src/Web/Grand.Web/Controllers/ShoppingCartController.cs
@@ -7,7 +7,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Customers;
diff --git a/src/Web/Grand.Web/Controllers/WishlistController.cs b/src/Web/Grand.Web/Controllers/WishlistController.cs
index 47d475f2a..c1ccb83a2 100644
--- a/src/Web/Grand.Web/Controllers/WishlistController.cs
+++ b/src/Web/Grand.Web/Controllers/WishlistController.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Messages;
using Grand.Business.Core.Utilities.Checkout;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Orders;
using Grand.Infrastructure;
using Grand.SharedKernel.Extensions;
diff --git a/src/Web/Grand.Web/Features/Handlers/Catalog/GetSearchAutoCompleteHandler.cs b/src/Web/Grand.Web/Features/Handlers/Catalog/GetSearchAutoCompleteHandler.cs
index 489b661e3..20eec3b1a 100644
--- a/src/Web/Grand.Web/Features/Handlers/Catalog/GetSearchAutoCompleteHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Catalog/GetSearchAutoCompleteHandler.cs
@@ -8,7 +8,7 @@ using Grand.Business.Core.Interfaces.Cms;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Business.Core.Queries.Catalog;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Blogs;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
diff --git a/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsAttributeChangeHandler.cs b/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsAttributeChangeHandler.cs
index fa04fa48f..52402b1c2 100644
--- a/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsAttributeChangeHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsAttributeChangeHandler.cs
@@ -4,7 +4,7 @@ using Grand.Business.Core.Interfaces.Catalog.Tax;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Media;
diff --git a/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs b/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs
index 136c44a33..98ea39ba8 100644
--- a/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs
@@ -12,7 +12,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Customers;
diff --git a/src/Web/Grand.Web/Features/Handlers/Products/GetProductOverviewHandler.cs b/src/Web/Grand.Web/Features/Handlers/Products/GetProductOverviewHandler.cs
index 2f35c2703..516fb51f9 100644
--- a/src/Web/Grand.Web/Features/Handlers/Products/GetProductOverviewHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Products/GetProductOverviewHandler.cs
@@ -6,7 +6,7 @@ using Grand.Business.Core.Interfaces.Catalog.Tax;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Storage;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Media;
using Grand.Domain.Tax;
diff --git a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetShoppingCartHandler.cs b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetShoppingCartHandler.cs
index b5202497f..34402328d 100644
--- a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetShoppingCartHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetShoppingCartHandler.cs
@@ -13,7 +13,7 @@ using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Business.Core.Utilities.Checkout;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Customers;
diff --git a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetWishlistHandler.cs b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetWishlistHandler.cs
index 7ab9513fe..435b9672d 100644
--- a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetWishlistHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetWishlistHandler.cs
@@ -8,7 +8,7 @@ using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Business.Core.Interfaces.Storage;
using Grand.Business.Core.Utilities.Checkout;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Grand.Domain.Customers;
diff --git a/src/Web/Grand.Web/Grand.Web.csproj b/src/Web/Grand.Web/Grand.Web.csproj
index 90ffaff13..23d4b371c 100644
--- a/src/Web/Grand.Web/Grand.Web.csproj
+++ b/src/Web/Grand.Web/Grand.Web.csproj
@@ -49,4 +49,13 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
+ <ItemGroup>
+ <Content Remove="Modules\**" />
+ <Compile Remove="Modules\**" />
+ <EmbeddedResource Remove="Modules\**" />
+ <None Remove="Modules\**" />
+ <Content Update="Modules\**">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
</Project>
diff --git a/src/Web/Grand.Web/Models/Install/InstallModel.cs b/src/Web/Grand.Web/Models/Install/InstallModel.cs
deleted file mode 100644
index 7070371c4..000000000
--- a/src/Web/Grand.Web/Models/Install/InstallModel.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using Grand.Data;
-using Grand.Infrastructure.Models;
-using Microsoft.AspNetCore.Mvc.Rendering;
-using System.ComponentModel.DataAnnotations;
-
-namespace Grand.Web.Models.Install;
-
-public class InstallModel : BaseModel
-{
- public string SelectedLanguage { get; set; }
-
- [DataType(DataType.EmailAddress)] public string AdminEmail { get; set; }
-
- [DataType(DataType.Password)] public string AdminPassword { get; set; }
-
- [DataType(DataType.Password)] public string ConfirmPassword { get; set; }
-
- public string DatabaseConnectionString { get; set; }
- public DbProvider DataProvider { get; set; }
- public bool ConnectionInfo { get; set; }
- public string MongoDBServerName { get; set; }
- public string MongoDBDatabaseName { get; set; }
- public string MongoDBUsername { get; set; }
-
- [DataType(DataType.Password)] public string MongoDBPassword { get; set; }
-
- public bool DisableSampleDataOption { get; set; }
- public bool InstallSampleData { get; set; }
- public bool Installed { get; set; }
- public string Collation { get; set; }
- public List<SelectListItem> AvailableLanguages { get; set; } = new();
- public List<SelectListItem> AvailableCollation { get; set; } = new();
- public List<SelectListItem> AvailableProviders { get; set; } = new();
- public string CompanyName { get; set; }
- public string CompanyAddress { get; set; }
- public string CompanyPhoneNumber { get; set; }
- public string CompanyEmail { get; set; }
-}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Validators/ShoppingCart/UpdateQuantityValidator.cs b/src/Web/Grand.Web/Validators/ShoppingCart/UpdateQuantityValidator.cs
index 9057bcffe..8abcf3894 100644
--- a/src/Web/Grand.Web/Validators/ShoppingCart/UpdateQuantityValidator.cs
+++ b/src/Web/Grand.Web/Validators/ShoppingCart/UpdateQuantityValidator.cs
@@ -1,7 +1,7 @@
using FluentValidation;
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Common.Security;
-using Grand.Business.Core.Utilities.Common.Security;
+using Grand.Domain.Permissions;
using Grand.Domain.Orders;
using Grand.Infrastructure;
using Grand.Infrastructure.Validators;
diff --git a/src/Web/Grand.Web/Views/Shared/Partials/HeaderLinks.cshtml b/src/Web/Grand.Web/Views/Shared/Partials/HeaderLinks.cshtml
index a245ba415..4c3935265 100644
--- a/src/Web/Grand.Web/Views/Shared/Partials/HeaderLinks.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/Partials/HeaderLinks.cshtml
@@ -1,6 +1,6 @@
@using Grand.Business.Core.Interfaces.Common.Directory
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@inject IGroupService groupService
@inject IWorkContext workContext
@inject IPageHeadBuilder pagebuilder
diff --git a/src/Web/Grand.Web/Views/Shared/Partials/ShoppingCartLinks.cshtml b/src/Web/Grand.Web/Views/Shared/Partials/ShoppingCartLinks.cshtml
index 9401fcfbf..424e2f6c6 100644
--- a/src/Web/Grand.Web/Views/Shared/Partials/ShoppingCartLinks.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/Partials/ShoppingCartLinks.cshtml
@@ -1,6 +1,6 @@
@using Grand.Business.Core.Interfaces.Checkout.Orders
@using Grand.Business.Core.Interfaces.Common.Security
-@using Grand.Business.Core.Utilities.Common.Security
+@using Grand.Domain.Permissions
@inject IWorkContext workContext
@inject IPermissionService permissionService
@inject IShoppingCartService shoppingCartService
diff --git a/src/Web/Grand.Web/wwwroot/assets/samples/product_GTA_1.zip b/src/Web/Grand.Web/wwwroot/assets/samples/product_GTA_1.zip
deleted file mode 100644
index b1111ffb6..000000000
Binary files a/src/Web/Grand.Web/wwwroot/assets/samples/product_GTA_1.zip and /dev/null differ
diff --git a/src/Web/Grand.Web/wwwroot/assets/samples/product_GTA_2.txt b/src/Web/Grand.Web/wwwroot/assets/samples/product_GTA_2.txt
deleted file mode 100644
index d5420f50b..000000000
--- a/src/Web/Grand.Web/wwwroot/assets/samples/product_GTA_2.txt
+++ /dev/null
@@ -1 +0,0 @@
-Example: This is a sample download
\ No newline at end of file
diff --git a/src/Web/Grand.Web/wwwroot/assets/samples/product_cod_1.zip b/src/Web/Grand.Web/wwwroot/assets/samples/product_cod_1.zip
deleted file mode 100644
index b1111ffb6..000000000
Binary files a/src/Web/Grand.Web/wwwroot/assets/samples/product_cod_1.zip and /dev/null differ
diff --git a/src/Web/Grand.Web/wwwroot/assets/samples/product_cyberpunk_1.zip b/src/Web/Grand.Web/wwwroot/assets/samples/product_cyberpunk_1.zip
deleted file mode 100644
index 3a76a5acb..000000000
Binary files a/src/Web/Grand.Web/wwwroot/assets/samples/product_cyberpunk_1.zip and /dev/null differ
diff --git a/src/Web/Grand.Web/wwwroot/assets/samples/product_cyberpunk_2.txt b/src/Web/Grand.Web/wwwroot/assets/samples/product_cyberpunk_2.txt
deleted file mode 100644
index d5420f50b..000000000
--- a/src/Web/Grand.Web/wwwroot/assets/samples/product_cyberpunk_2.txt
+++ /dev/null
@@ -1 +0,0 @@
-Example: This is a sample download
\ No newline at end of file