From dfb77cd8fa67105b1ea948325ff91ea0506ac8e1 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Tue, 28 Mar 2023 15:14:28 +0800 Subject: [PATCH 1/2] Initialize the new `Promotions` plugin module --- EShop.sln | 121 ++++++++ plugins/Promotions/.gitattributes | 1 + plugins/Promotions/.gitignore | 262 ++++++++++++++++++ plugins/Promotions/.prettierrc | 5 + ...syAbp.EShop.Plugins.Promotions.abpmdl.json | 111 ++++++++ ...syAbp.EShop.Plugins.Promotions.abpsln.json | 7 + .../EasyAbp.EShop.Plugins.Promotions.sln | 146 ++++++++++ ...p.EShop.Plugins.Promotions.sln.DotSettings | 23 ++ plugins/Promotions/NuGet.Config | 5 + ...Plugins.Promotions.Host.Shared.abppkg.json | 1 + ...Shop.Plugins.Promotions.Host.Shared.csproj | 11 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../MultiTenancy/MultiTenancyConsts.cs | 9 + ...omotions.Application.Contracts.abppkg.json | 3 + ...ns.Promotions.Application.Contracts.csproj | 17 ++ ...insPromotionsApplicationContractsModule.cs | 15 + .../PromotionsPermissionDefinitionProvider.cs | 18 ++ .../Permissions/PromotionsPermissions.cs | 13 + .../PromotionsRemoteServiceConsts.cs | 8 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...Plugins.Promotions.Application.abppkg.json | 3 + ...Shop.Plugins.Promotions.Application.csproj | 18 ++ .../EShopPluginsPromotionsAppService.cs | 13 + ...EShopPluginsPromotionsApplicationModule.cs | 24 ++ .../PromotionsApplicationAutoMapperProfile.cs | 13 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...ugins.Promotions.Domain.Shared.abppkg.json | 3 + ...op.Plugins.Promotions.Domain.Shared.csproj | 25 ++ ...ShopPluginsPromotionsDomainSharedModule.cs | 36 +++ .../Localization/PromotionsResource.cs | 9 + .../Plugins/Promotions/Localization/en.json | 5 + .../Promotions/Localization/zh-Hans.json | 5 + .../Promotions/Localization/zh-Hant.json | 5 + .../Promotions/PromotionsErrorCodes.cs | 6 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...Shop.Plugins.Promotions.Domain.abppkg.json | 3 + ...Abp.EShop.Plugins.Promotions.Domain.csproj | 16 ++ .../EShopPluginsPromotionsDomainModule.cs | 13 + .../Promotions/PromotionsDbProperties.cs | 10 + .../PromotionsSettingDefinitionProvider.cs | 13 + .../Promotions/Settings/PromotionsSettings.cs | 10 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...Promotions.EntityFrameworkCore.abppkg.json | 3 + ...gins.Promotions.EntityFrameworkCore.csproj | 20 ++ ...ginsPromotionsEntityFrameworkCoreModule.cs | 22 ++ .../IPromotionsDbContext.cs | 12 + .../PromotionsDbContext.cs | 26 ++ ...motionsDbContextModelCreatingExtensions.cs | 33 +++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...gins.Promotions.HttpApi.Client.abppkg.json | 3 + ...p.Plugins.Promotions.HttpApi.Client.csproj | 21 ++ ...hopPluginsPromotionsHttpApiClientModule.cs | 26 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...hop.Plugins.Promotions.HttpApi.abppkg.json | 3 + ...bp.EShop.Plugins.Promotions.HttpApi.csproj | 16 ++ .../EShopPluginsPromotionsHttpApiModule.cs | 32 +++ .../Promotions/PromotionsController.cs | 12 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ....EShop.Plugins.Promotions.Installer.csproj | 21 ++ .../EShopPluginsPromotionsInstallerModule.cs | 18 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...hop.Plugins.Promotions.MongoDB.abppkg.json | 3 + ...bp.EShop.Plugins.Promotions.MongoDB.csproj | 20 ++ .../EShopPluginsPromotionsMongoDbModule.cs | 22 ++ .../MongoDB/IPromotionsMongoDbContext.cs | 12 + .../MongoDB/PromotionsMongoDbContext.cs | 19 ++ .../PromotionsMongoDbContextExtensions.cs | 13 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../EShopPluginsPromotionsWebModule.cs | 58 ++++ ...p.EShop.Plugins.Promotions.Web.abppkg.json | 3 + ...asyAbp.EShop.Plugins.Promotions.Web.csproj | 45 +++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../Menus/PromotionsMenuContributor.cs | 22 ++ .../Menus/PromotionsMenus.cs | 10 + .../Pages/PromotionsPageModel.cs | 15 + .../Pages/_ViewImports.cshtml | 4 + .../PromotionsWebAutoMapperProfile.cs | 13 + .../Properties/launchSettings.json | 12 + ...s.Promotions.Application.Tests.abppkg.json | 3 + ...lugins.Promotions.Application.Tests.csproj | 17 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../PromotionsApplicationTestBase.cs | 9 + .../PromotionsApplicationTestModule.cs | 12 + ...lugins.Promotions.Domain.Tests.abppkg.json | 3 + ...hop.Plugins.Promotions.Domain.Tests.csproj | 16 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../PromotionsDomainTestBase.cs | 9 + .../PromotionsDomainTestModule.cs | 16 ++ ...ions.EntityFrameworkCore.Tests.abppkg.json | 3 + ...romotions.EntityFrameworkCore.Tests.csproj | 19 ++ .../PromotionsEntityFrameworkCoreTestBase.cs | 9 + ...PromotionsEntityFrameworkCoreTestModule.cs | 45 +++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../ClientDemoService.cs | 143 ++++++++++ .../ConsoleTestAppHostedService.cs | 40 +++ ....HttpApi.Client.ConsoleTestApp.abppkg.json | 1 + ...tions.HttpApi.Client.ConsoleTestApp.csproj | 33 +++ .../Program.cs | 22 ++ .../PromotionsConsoleApiClientModule.cs | 15 + .../appsettings.json | 21 ++ .../appsettings.secrets.json | 2 + ...ugins.Promotions.MongoDB.Tests.abppkg.json | 3 + ...op.Plugins.Promotions.MongoDB.Tests.csproj | 18 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../MongoDB/MongoDbFixture.cs | 21 ++ .../MongoDB/MongoTestCollection.cs | 9 + .../MongoDB/PromotionsMongoDbTestBase.cs | 9 + .../MongoDB/PromotionsMongoDbTestModule.cs | 26 ++ ...op.Plugins.Promotions.TestBase.abppkg.json | 1 + ...p.EShop.Plugins.Promotions.TestBase.csproj | 28 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../PromotionsDataSeedContributor.cs | 32 +++ .../PromotionsTestBase.cs | 59 ++++ .../PromotionsTestBaseModule.cs | 41 +++ .../Security/FakeCurrentPrincipalAccessor.cs | 27 ++ .../EShopSample.Application.Contracts.csproj | 1 + .../EShopSample.Application.csproj | 1 + .../EShopSample.Domain.Shared.csproj | 1 + .../EShopSample.Domain.csproj | 1 + .../EShopSample.EntityFrameworkCore.csproj | 1 + .../EShopSample.HttpApi.Client.csproj | 1 + .../EShopSample.HttpApi.csproj | 1 + .../EShopSample.Web/EShopSample.Web.csproj | 1 + .../EShopSample.Web/EShopSampleWebModule.cs | 9 + .../src/EShopSample.Web/Pages/Index.cshtml | 6 + 141 files changed, 2808 insertions(+) create mode 100644 plugins/Promotions/.gitattributes create mode 100644 plugins/Promotions/.gitignore create mode 100644 plugins/Promotions/.prettierrc create mode 100644 plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpmdl.json create mode 100644 plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpsln.json create mode 100644 plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln create mode 100644 plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln.DotSettings create mode 100644 plugins/Promotions/NuGet.Config create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xml create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xsd create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/MultiTenancy/MultiTenancyConsts.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsAppService.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainSharedModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionsDbProperties.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettingDefinitionProvider.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettings.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/PromotionsController.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp.EShop.Plugins.Promotions.Installer.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsInstallerModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/EShopPluginsPromotionsMongoDbModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/IPromotionsMongoDbContext.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContext.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContextExtensions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/PromotionsPageModel.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/_ViewImports.cshtml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Properties/launchSettings.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/Program.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/PromotionsConsoleApiClientModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoDbFixture.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoTestCollection.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsDataSeedContributor.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/Security/FakeCurrentPrincipalAccessor.cs diff --git a/EShop.sln b/EShop.sln index 15b9023c..dff3e078 100644 --- a/EShop.sln +++ b/EShop.sln @@ -469,6 +469,44 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Products.Plug EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Orders.Plugins.FlashSales.Application.Tests", "plugins\FlashSales\test\EasyAbp.EShop.Orders.Plugins.FlashSales.Application.Tests\EasyAbp.EShop.Orders.Plugins.FlashSales.Application.Tests.csproj", "{17A3486C-1845-4B4E-B1A6-752106F0C309}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Promotions", "Promotions", "{5DF280FF-28A9-4406-8D7A-1E10150B9AB0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2661CE36-99D1-4D28-A956-6581552F8889}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Application", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Application\EasyAbp.EShop.Plugins.Promotions.Application.csproj", "{7E8FB015-17C9-4170-86DD-2A588F0C328A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Application.Contracts", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Application.Contracts\EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj", "{3F40E7BB-A864-440B-91D5-5EBA0F52514B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Domain", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Domain\EasyAbp.EShop.Plugins.Promotions.Domain.csproj", "{C8AE050A-D84F-4487-98F1-0992DCB54E22}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Domain.Shared", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Domain.Shared\EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj", "{29EB001D-B020-4380-B0F6-C3C4EAD63C29}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj", "{A03EAB5F-C165-452C-8CFD-EBF2E935C599}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.HttpApi\EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj", "{4F349BA1-4EAD-4690-B271-9B920BDD2DF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj", "{35894E48-7E52-475F-AB6F-DB9E73010271}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Installer", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Installer\EasyAbp.EShop.Plugins.Promotions.Installer.csproj", "{FA8FA705-5675-44FB-B9B0-60B32885C7B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.MongoDB", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.MongoDB\EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj", "{F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Web", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Web\EasyAbp.EShop.Plugins.Promotions.Web.csproj", "{A31CA5E7-4E45-4572-8CF4-67C4316CE47A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9AE8FE82-7A05-4E2A-98E2-A98F5845B02A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Application.Tests", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.Application.Tests\EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj", "{6485CCBD-EC99-468B-B005-886F2AD5AA9A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Domain.Tests", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.Domain.Tests\EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj", "{3EE730D4-C8F6-4729-AD34-A7A485E3B932}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj", "{846C3769-2DC7-441F-94C1-714B30110FC5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj", "{5F0FE595-625E-4657-ADF2-25F0803D4578}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests\EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj", "{B43EB182-F725-4DBD-891B-E576A5B8D2D2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.TestBase", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.TestBase\EasyAbp.EShop.Plugins.Promotions.TestBase.csproj", "{E590820A-A125-4133-9E9C-DA47BCC8FCE6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1227,6 +1265,70 @@ Global {17A3486C-1845-4B4E-B1A6-752106F0C309}.Debug|Any CPU.Build.0 = Debug|Any CPU {17A3486C-1845-4B4E-B1A6-752106F0C309}.Release|Any CPU.ActiveCfg = Release|Any CPU {17A3486C-1845-4B4E-B1A6-752106F0C309}.Release|Any CPU.Build.0 = Release|Any CPU + {7E8FB015-17C9-4170-86DD-2A588F0C328A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E8FB015-17C9-4170-86DD-2A588F0C328A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E8FB015-17C9-4170-86DD-2A588F0C328A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E8FB015-17C9-4170-86DD-2A588F0C328A}.Release|Any CPU.Build.0 = Release|Any CPU + {3F40E7BB-A864-440B-91D5-5EBA0F52514B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F40E7BB-A864-440B-91D5-5EBA0F52514B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F40E7BB-A864-440B-91D5-5EBA0F52514B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F40E7BB-A864-440B-91D5-5EBA0F52514B}.Release|Any CPU.Build.0 = Release|Any CPU + {C8AE050A-D84F-4487-98F1-0992DCB54E22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8AE050A-D84F-4487-98F1-0992DCB54E22}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8AE050A-D84F-4487-98F1-0992DCB54E22}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8AE050A-D84F-4487-98F1-0992DCB54E22}.Release|Any CPU.Build.0 = Release|Any CPU + {29EB001D-B020-4380-B0F6-C3C4EAD63C29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29EB001D-B020-4380-B0F6-C3C4EAD63C29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29EB001D-B020-4380-B0F6-C3C4EAD63C29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29EB001D-B020-4380-B0F6-C3C4EAD63C29}.Release|Any CPU.Build.0 = Release|Any CPU + {A03EAB5F-C165-452C-8CFD-EBF2E935C599}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A03EAB5F-C165-452C-8CFD-EBF2E935C599}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A03EAB5F-C165-452C-8CFD-EBF2E935C599}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A03EAB5F-C165-452C-8CFD-EBF2E935C599}.Release|Any CPU.Build.0 = Release|Any CPU + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6}.Release|Any CPU.Build.0 = Release|Any CPU + {35894E48-7E52-475F-AB6F-DB9E73010271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35894E48-7E52-475F-AB6F-DB9E73010271}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35894E48-7E52-475F-AB6F-DB9E73010271}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35894E48-7E52-475F-AB6F-DB9E73010271}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8FA705-5675-44FB-B9B0-60B32885C7B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8FA705-5675-44FB-B9B0-60B32885C7B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8FA705-5675-44FB-B9B0-60B32885C7B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8FA705-5675-44FB-B9B0-60B32885C7B1}.Release|Any CPU.Build.0 = Release|Any CPU + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}.Release|Any CPU.Build.0 = Release|Any CPU + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A}.Release|Any CPU.Build.0 = Release|Any CPU + {6485CCBD-EC99-468B-B005-886F2AD5AA9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6485CCBD-EC99-468B-B005-886F2AD5AA9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6485CCBD-EC99-468B-B005-886F2AD5AA9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6485CCBD-EC99-468B-B005-886F2AD5AA9A}.Release|Any CPU.Build.0 = Release|Any CPU + {3EE730D4-C8F6-4729-AD34-A7A485E3B932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3EE730D4-C8F6-4729-AD34-A7A485E3B932}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3EE730D4-C8F6-4729-AD34-A7A485E3B932}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3EE730D4-C8F6-4729-AD34-A7A485E3B932}.Release|Any CPU.Build.0 = Release|Any CPU + {846C3769-2DC7-441F-94C1-714B30110FC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {846C3769-2DC7-441F-94C1-714B30110FC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {846C3769-2DC7-441F-94C1-714B30110FC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {846C3769-2DC7-441F-94C1-714B30110FC5}.Release|Any CPU.Build.0 = Release|Any CPU + {5F0FE595-625E-4657-ADF2-25F0803D4578}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5F0FE595-625E-4657-ADF2-25F0803D4578}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F0FE595-625E-4657-ADF2-25F0803D4578}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5F0FE595-625E-4657-ADF2-25F0803D4578}.Release|Any CPU.Build.0 = Release|Any CPU + {B43EB182-F725-4DBD-891B-E576A5B8D2D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B43EB182-F725-4DBD-891B-E576A5B8D2D2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B43EB182-F725-4DBD-891B-E576A5B8D2D2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B43EB182-F725-4DBD-891B-E576A5B8D2D2}.Release|Any CPU.Build.0 = Release|Any CPU + {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1461,6 +1563,25 @@ Global {B137BF4B-8C0A-4CE2-AF22-BD9BD29C86B7} = {F29C5BCD-E6C0-4556-A631-CACA41B1050B} {274769DC-5DD6-4CFD-8078-5E0E0CE8D6D8} = {F29C5BCD-E6C0-4556-A631-CACA41B1050B} {17A3486C-1845-4B4E-B1A6-752106F0C309} = {9C180C9E-50E9-4624-BE06-5C8C24A028E4} + {5DF280FF-28A9-4406-8D7A-1E10150B9AB0} = {94CC5A11-DA0F-413C-96CA-01DB0FC426E0} + {2661CE36-99D1-4D28-A956-6581552F8889} = {5DF280FF-28A9-4406-8D7A-1E10150B9AB0} + {7E8FB015-17C9-4170-86DD-2A588F0C328A} = {2661CE36-99D1-4D28-A956-6581552F8889} + {3F40E7BB-A864-440B-91D5-5EBA0F52514B} = {2661CE36-99D1-4D28-A956-6581552F8889} + {C8AE050A-D84F-4487-98F1-0992DCB54E22} = {2661CE36-99D1-4D28-A956-6581552F8889} + {29EB001D-B020-4380-B0F6-C3C4EAD63C29} = {2661CE36-99D1-4D28-A956-6581552F8889} + {A03EAB5F-C165-452C-8CFD-EBF2E935C599} = {2661CE36-99D1-4D28-A956-6581552F8889} + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6} = {2661CE36-99D1-4D28-A956-6581552F8889} + {35894E48-7E52-475F-AB6F-DB9E73010271} = {2661CE36-99D1-4D28-A956-6581552F8889} + {FA8FA705-5675-44FB-B9B0-60B32885C7B1} = {2661CE36-99D1-4D28-A956-6581552F8889} + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE} = {2661CE36-99D1-4D28-A956-6581552F8889} + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A} = {2661CE36-99D1-4D28-A956-6581552F8889} + {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} = {5DF280FF-28A9-4406-8D7A-1E10150B9AB0} + {6485CCBD-EC99-468B-B005-886F2AD5AA9A} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {3EE730D4-C8F6-4729-AD34-A7A485E3B932} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {846C3769-2DC7-441F-94C1-714B30110FC5} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {5F0FE595-625E-4657-ADF2-25F0803D4578} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {B43EB182-F725-4DBD-891B-E576A5B8D2D2} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {E590820A-A125-4133-9E9C-DA47BCC8FCE6} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} diff --git a/plugins/Promotions/.gitattributes b/plugins/Promotions/.gitattributes new file mode 100644 index 00000000..c941e526 --- /dev/null +++ b/plugins/Promotions/.gitattributes @@ -0,0 +1 @@ +**/wwwroot/libs/** linguist-vendored diff --git a/plugins/Promotions/.gitignore b/plugins/Promotions/.gitignore new file mode 100644 index 00000000..0c71d45f --- /dev/null +++ b/plugins/Promotions/.gitignore @@ -0,0 +1,262 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# Promotions +host/EasyAbp.EShop.Plugins.Promotions.AuthServer/Logs/logs.txt +host/EasyAbp.EShop.Plugins.Promotions.HttpApi.Host/Logs/logs.txt +host/EasyAbp.EShop.Plugins.Promotions.Web.Host/Logs/logs.txt +host/EasyAbp.EShop.Plugins.Promotions.Web.Unified/Logs/logs.txt +host/EasyAbp.EShop.Plugins.Promotions.Blazor.Server.Host/Logs/logs.txt + +# Use abp install-libs to restore. +**/wwwroot/libs/* diff --git a/plugins/Promotions/.prettierrc b/plugins/Promotions/.prettierrc new file mode 100644 index 00000000..56af76bd --- /dev/null +++ b/plugins/Promotions/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpmdl.json b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpmdl.json new file mode 100644 index 00000000..41c36add --- /dev/null +++ b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpmdl.json @@ -0,0 +1,111 @@ +{ + "folders": { + "items": { + "src": {}, + "test": {}, + "host": {} + } + }, + "packages": { + "EasyAbp.EShop.Plugins.Promotions.Domain.Shared": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Domain": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Application.Contracts": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Application": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.MongoDB": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.HttpApi": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.TestBase": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.Domain.Tests": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.Application.Tests": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.HttpApi.Host": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.HttpApi.Host/EasyAbp.EShop.Plugins.Promotions.HttpApi.Host.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Web": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.Web.Host": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Web.Host/EasyAbp.EShop.Plugins.Promotions.Web.Host.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.AuthServer": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.AuthServer/EasyAbp.EShop.Plugins.Promotions.AuthServer.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Host.Shared": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Web.Unified": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Web.Unified/EasyAbp.EShop.Plugins.Promotions.Web.Unified.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Blazor/EasyAbp.EShop.Plugins.Promotions.Blazor.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor.Host": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Blazor.Host/EasyAbp.EShop.Plugins.Promotions.Blazor.Host.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor.Server": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Blazor.Server/EasyAbp.EShop.Plugins.Promotions.Blazor.Server.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor.WebAssembly": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Blazor.WebAssembly/EasyAbp.EShop.Plugins.Promotions.Blazor.WebAssembly.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor.Server.Host": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Blazor.Server.Host/EasyAbp.EShop.Plugins.Promotions.Blazor.Server.Host.abppkg.json", + "folder": "host" + } + } +} diff --git a/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpsln.json b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpsln.json new file mode 100644 index 00000000..0588ac37 --- /dev/null +++ b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpsln.json @@ -0,0 +1,7 @@ +{ + "modules": { + "EasyAbp.EShop.Plugins.Promotions": { + "path": "EasyAbp.EShop.Plugins.Promotions.abpmdl.json" + } + } +} \ No newline at end of file diff --git a/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln new file mode 100644 index 00000000..30289be9 --- /dev/null +++ b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln @@ -0,0 +1,146 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29001.49 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Domain.Shared", "src\EasyAbp.EShop.Plugins.Promotions.Domain.Shared\EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Domain", "src\EasyAbp.EShop.Plugins.Promotions.Domain\EasyAbp.EShop.Plugins.Promotions.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Application.Contracts", "src\EasyAbp.EShop.Plugins.Promotions.Application.Contracts\EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Application", "src\EasyAbp.EShop.Plugins.Promotions.Application\EasyAbp.EShop.Plugins.Promotions.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore", "src\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.MongoDB", "src\EasyAbp.EShop.Plugins.Promotions.MongoDB\EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj", "{F1C58097-4C08-4D88-8976-6B3389391481}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi", "src\EasyAbp.EShop.Plugins.Promotions.HttpApi\EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client", "src\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.TestBase", "test\EasyAbp.EShop.Plugins.Promotions.TestBase\EasyAbp.EShop.Plugins.Promotions.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests", "test\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests", "test\EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests\EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj", "{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Domain.Tests", "test\EasyAbp.EShop.Plugins.Promotions.Domain.Tests\EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Application.Tests", "test\EasyAbp.EShop.Plugins.Promotions.Application.Tests\EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Web", "src\EasyAbp.EShop.Plugins.Promotions.Web\EasyAbp.EShop.Plugins.Promotions.Web.csproj", "{3B7B6317-1B85-4164-8E11-75574F80AE17}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp", "test\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Host.Shared", "host\EasyAbp.EShop.Plugins.Promotions.Host.Shared\EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj", "{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Installer", "src\EasyAbp.EShop.Plugins.Promotions.Installer\EasyAbp.EShop.Plugins.Promotions.Installer.csproj", "{BE39FD00-745B-4049-8161-FC129817CBE4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.Build.0 = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.Build.0 = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.Build.0 = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.Build.0 = Release|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.Build.0 = Release|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.Build.0 = Release|Any CPU + {BE39FD00-745B-4049-8161-FC129817CBE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE39FD00-745B-4049-8161-FC129817CBE4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE39FD00-745B-4049-8161-FC129817CBE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE39FD00-745B-4049-8161-FC129817CBE4}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F1C58097-4C08-4D88-8976-6B3389391481} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {3B7B6317-1B85-4164-8E11-75574F80AE17} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB} = {E400416D-2895-4512-9D17-90681EEC7E0A} + {BE39FD00-745B-4049-8161-FC129817CBE4} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} + EndGlobalSection +EndGlobal diff --git a/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln.DotSettings b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln.DotSettings new file mode 100644 index 00000000..cb0b2c91 --- /dev/null +++ b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln.DotSettings @@ -0,0 +1,23 @@ + + True + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + Required + Required + Required + Required + False + True + False + False + True + False + False + SQL + \ No newline at end of file diff --git a/plugins/Promotions/NuGet.Config b/plugins/Promotions/NuGet.Config new file mode 100644 index 00000000..bdc45197 --- /dev/null +++ b/plugins/Promotions/NuGet.Config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj new file mode 100644 index 00000000..5f0f99af --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj @@ -0,0 +1,11 @@ + + + + + + netstandard2.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + diff --git a/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xml b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xsd b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/MultiTenancy/MultiTenancyConsts.cs b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 00000000..b911c9cc --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions.MultiTenancy; + +public static class MultiTenancyConsts +{ + /* Enable/disable multi-tenancy in a single point + * to test your module with multi-tenancy. + */ + public const bool IsEnabled = false; +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json new file mode 100644 index 00000000..49032794 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.application-contracts" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj new file mode 100644 index 00000000..e24a4a33 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj @@ -0,0 +1,17 @@ + + + + + + netstandard2.0 + enable + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs new file mode 100644 index 00000000..d1a2206b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Application; +using Volo.Abp.Modularity; +using Volo.Abp.Authorization; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsDomainSharedModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationModule) + )] +public class EShopPluginsPromotionsApplicationContractsModule : AbpModule +{ + +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs new file mode 100644 index 00000000..209ac19e --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs @@ -0,0 +1,18 @@ +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace EasyAbp.EShop.Plugins.Promotions.Permissions; + +public class PromotionsPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(PromotionsPermissions.GroupName, L("Permission:Promotions")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs new file mode 100644 index 00000000..bbd17e43 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Reflection; + +namespace EasyAbp.EShop.Plugins.Promotions.Permissions; + +public class PromotionsPermissions +{ + public const string GroupName = "EasyAbp.EShop.Plugins.Promotions"; + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(PromotionsPermissions)); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs new file mode 100644 index 00000000..f60fa78c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs @@ -0,0 +1,8 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +public class PromotionsRemoteServiceConsts +{ + public const string RemoteServiceName = "EasyAbpEShopPluginsPromotions"; + + public const string ModuleName = "easyAbpEShopPluginsPromotions"; +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json new file mode 100644 index 00000000..412567ac --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.application" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj new file mode 100644 index 00000000..303ab2bb --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj @@ -0,0 +1,18 @@ + + + + + + net7.0 + enable + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsAppService.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsAppService.cs new file mode 100644 index 00000000..332f0ff3 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsAppService.cs @@ -0,0 +1,13 @@ +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public abstract class EShopPluginsPromotionsAppService : ApplicationService +{ + protected EShopPluginsPromotionsAppService() + { + LocalizationResource = typeof(PromotionsResource); + ObjectMapperContext = typeof(EShopPluginsPromotionsApplicationModule); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs new file mode 100644 index 00000000..65931d0a --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.Application; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsDomainModule), + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule) + )] +public class EShopPluginsPromotionsApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs new file mode 100644 index 00000000..1ace252b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public class PromotionsApplicationAutoMapperProfile : Profile +{ + public PromotionsApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json new file mode 100644 index 00000000..8b3de05f --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.domain-shared" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj new file mode 100644 index 00000000..feef7612 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj @@ -0,0 +1,25 @@ + + + + + + netstandard2.0 + enable + + true + + + + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainSharedModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainSharedModule.cs new file mode 100644 index 00000000..afab57b1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainSharedModule.cs @@ -0,0 +1,36 @@ +using Volo.Abp.Modularity; +using Volo.Abp.Localization; +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Validation; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(AbpValidationModule) +)] +public class EShopPluginsPromotionsDomainSharedModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/EasyAbp/EShop/Plugins/Promotions/Localization"); + }); + + Configure(options => + { + options.MapCodeNamespace("EasyAbp.EShop.Plugins.Promotions", typeof(PromotionsResource)); + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs new file mode 100644 index 00000000..0ee6930a --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace EasyAbp.EShop.Plugins.Promotions.Localization; + +[LocalizationResourceName("Promotions")] +public class PromotionsResource +{ + +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json new file mode 100644 index 00000000..189662ee --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json @@ -0,0 +1,5 @@ +{ + "culture": "en", + "texts": { + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json new file mode 100644 index 00000000..df772fa6 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json @@ -0,0 +1,5 @@ +{ + "culture": "zh-Hans", + "texts": { + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json new file mode 100644 index 00000000..7de37982 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json @@ -0,0 +1,5 @@ +{ + "culture": "zh-Hant", + "texts": { + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs new file mode 100644 index 00000000..ec39ee5a --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs @@ -0,0 +1,6 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +public static class PromotionsErrorCodes +{ + //Add your business exception error codes here... +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json new file mode 100644 index 00000000..1d574efe --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.domain" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj new file mode 100644 index 00000000..10cf83ed --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj @@ -0,0 +1,16 @@ + + + + + + netstandard2.0 + enable + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs new file mode 100644 index 00000000..b380c9d0 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Domain; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(AbpDddDomainModule), + typeof(EShopPluginsPromotionsDomainSharedModule) +)] +public class EShopPluginsPromotionsDomainModule : AbpModule +{ + +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionsDbProperties.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionsDbProperties.cs new file mode 100644 index 00000000..954ca9a6 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionsDbProperties.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +public static class PromotionsDbProperties +{ + public static string DbTablePrefix { get; set; } = "EasyAbpEShopPluginsPromotions"; + + public static string? DbSchema { get; set; } = null; + + public const string ConnectionStringName = "EasyAbpEShopPluginsPromotions"; +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettingDefinitionProvider.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettingDefinitionProvider.cs new file mode 100644 index 00000000..0b4df8aa --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettingDefinitionProvider.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Settings; + +namespace EasyAbp.EShop.Plugins.Promotions.Settings; + +public class PromotionsSettingDefinitionProvider : SettingDefinitionProvider +{ + public override void Define(ISettingDefinitionContext context) + { + /* Define module settings here. + * Use names from PromotionsSettings class. + */ + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettings.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettings.cs new file mode 100644 index 00000000..776f55a3 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettings.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.Promotions.Settings; + +public static class PromotionsSettings +{ + public const string GroupName = "EasyAbp.EShop.Plugins.Promotions"; + + /* Add constants for setting names. Example: + * public const string MySettingName = GroupName + ".MySettingName"; + */ +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json new file mode 100644 index 00000000..e1c64f01 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.ef" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj new file mode 100644 index 00000000..961f21c1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj @@ -0,0 +1,20 @@ + + + + + + net7.0 + enable + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs new file mode 100644 index 00000000..cf2dcebb --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +[DependsOn( + typeof(EShopPluginsPromotionsDomainModule), + typeof(AbpEntityFrameworkCoreModule) +)] +public class EShopPluginsPromotionsEntityFrameworkCoreModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs new file mode 100644 index 00000000..848c9467 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +[ConnectionStringName(PromotionsDbProperties.ConnectionStringName)] +public interface IPromotionsDbContext : IEfCoreDbContext +{ + /* Add DbSet for each Aggregate Root here. Example: + * DbSet Questions { get; } + */ +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs new file mode 100644 index 00000000..e3b282a6 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +[ConnectionStringName(PromotionsDbProperties.ConnectionStringName)] +public class PromotionsDbContext : AbpDbContext, IPromotionsDbContext +{ + /* Add DbSet for each Aggregate Root here. Example: + * public DbSet Questions { get; set; } + */ + + public PromotionsDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureEShopPluginsPromotions(); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs new file mode 100644 index 00000000..4dad1816 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +public static class PromotionsDbContextModelCreatingExtensions +{ + public static void ConfigureEShopPluginsPromotions( + this ModelBuilder builder) + { + Check.NotNull(builder, nameof(builder)); + + /* Configure all entities here. Example: + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(PromotionsDbProperties.DbTablePrefix + "Questions", PromotionsDbProperties.DbSchema); + + b.ConfigureByConvention(); + + //Properties + b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); + + //Relations + b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); + + //Indexes + b.HasIndex(q => q.CreationTime); + }); + */ + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json new file mode 100644 index 00000000..7deef5e3 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.http-api-client" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj new file mode 100644 index 00000000..eccecb96 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj @@ -0,0 +1,21 @@ + + + + + + netstandard2.0 + enable + + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs new file mode 100644 index 00000000..b347384e --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs @@ -0,0 +1,26 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(AbpHttpClientModule))] +public class EShopPluginsPromotionsHttpApiClientModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(EShopPluginsPromotionsApplicationContractsModule).Assembly, + PromotionsRemoteServiceConsts.RemoteServiceName + ); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json new file mode 100644 index 00000000..515bfe64 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.http-api" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj new file mode 100644 index 00000000..aeee4280 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj @@ -0,0 +1,16 @@ + + + + + + net7.0 + enable + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiModule.cs new file mode 100644 index 00000000..c9c3e207 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiModule.cs @@ -0,0 +1,32 @@ +using Localization.Resources.AbpUi; +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Microsoft.Extensions.DependencyInjection; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] +public class EShopPluginsPromotionsHttpApiModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(EShopPluginsPromotionsHttpApiModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/PromotionsController.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/PromotionsController.cs new file mode 100644 index 00000000..7a5198e1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/PromotionsController.cs @@ -0,0 +1,12 @@ +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public abstract class PromotionsController : AbpControllerBase +{ + protected PromotionsController() + { + LocalizationResource = typeof(PromotionsResource); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp.EShop.Plugins.Promotions.Installer.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp.EShop.Plugins.Promotions.Installer.csproj new file mode 100644 index 00000000..a3539ad5 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp.EShop.Plugins.Promotions.Installer.csproj @@ -0,0 +1,21 @@ + + + + + + net7.0 + enable + true + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsInstallerModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsInstallerModule.cs new file mode 100644 index 00000000..14075bb1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsInstallerModule.cs @@ -0,0 +1,18 @@ +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(AbpVirtualFileSystemModule) + )] +public class EShopPluginsPromotionsInstallerModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json new file mode 100644 index 00000000..8b23fd1e --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.mongodb" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj new file mode 100644 index 00000000..565089bd --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj @@ -0,0 +1,20 @@ + + + + + + netstandard2.0 + enable + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/EShopPluginsPromotionsMongoDbModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/EShopPluginsPromotionsMongoDbModule.cs new file mode 100644 index 00000000..57bddb08 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/EShopPluginsPromotionsMongoDbModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[DependsOn( + typeof(EShopPluginsPromotionsDomainModule), + typeof(AbpMongoDbModule) + )] +public class EShopPluginsPromotionsMongoDbModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddMongoDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/IPromotionsMongoDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/IPromotionsMongoDbContext.cs new file mode 100644 index 00000000..8c8b0dda --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/IPromotionsMongoDbContext.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[ConnectionStringName(PromotionsDbProperties.ConnectionStringName)] +public interface IPromotionsMongoDbContext : IAbpMongoDbContext +{ + /* Define mongo collections here. Example: + * IMongoCollection Questions { get; } + */ +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContext.cs new file mode 100644 index 00000000..bd84d6f3 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContext.cs @@ -0,0 +1,19 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[ConnectionStringName(PromotionsDbProperties.ConnectionStringName)] +public class PromotionsMongoDbContext : AbpMongoDbContext, IPromotionsMongoDbContext +{ + /* Add mongo collections here. Example: + * public IMongoCollection Questions => Collection(); + */ + + protected override void CreateModel(IMongoModelBuilder modelBuilder) + { + base.CreateModel(modelBuilder); + + modelBuilder.ConfigureEShopPluginsPromotions(); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContextExtensions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContextExtensions.cs new file mode 100644 index 00000000..fe79215e --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContextExtensions.cs @@ -0,0 +1,13 @@ +using Volo.Abp; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +public static class PromotionsMongoDbContextExtensions +{ + public static void ConfigureEShopPluginsPromotions( + this IMongoModelBuilder builder) + { + Check.NotNull(builder, nameof(builder)); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs new file mode 100644 index 00000000..e3a5f917 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs @@ -0,0 +1,58 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.DependencyInjection; +using EasyAbp.EShop.Plugins.Promotions.Localization; +using EasyAbp.EShop.Plugins.Promotions.Web.Menus; +using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; +using Volo.Abp.VirtualFileSystem; +using EasyAbp.EShop.Plugins.Promotions.Permissions; + +namespace EasyAbp.EShop.Plugins.Promotions.Web; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(AbpAspNetCoreMvcUiThemeSharedModule), + typeof(AbpAutoMapperModule) + )] +public class EShopPluginsPromotionsWebModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.PreConfigure(options => + { + options.AddAssemblyResource(typeof(PromotionsResource), typeof(EShopPluginsPromotionsWebModule).Assembly); + }); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(EShopPluginsPromotionsWebModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.MenuContributors.Add(new PromotionsMenuContributor()); + }); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + + Configure(options => + { + //Configure authorization. + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json new file mode 100644 index 00000000..930c4018 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.mvc" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj new file mode 100644 index 00000000..8c4ef6e9 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj @@ -0,0 +1,45 @@ + + + + + + net7.0 + enable + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + Library + EasyAbp.EShop.Plugins.Promotions.Web + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs new file mode 100644 index 00000000..545921a6 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Volo.Abp.UI.Navigation; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Menus; + +public class PromotionsMenuContributor : IMenuContributor +{ + public async Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name == StandardMenus.Main) + { + await ConfigureMainMenuAsync(context); + } + } + + private Task ConfigureMainMenuAsync(MenuConfigurationContext context) + { + //Add main menu items. + + return Task.CompletedTask; + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs new file mode 100644 index 00000000..df493461 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.Promotions.Web.Menus; + +public class PromotionsMenus +{ + public const string Prefix = "EasyAbp.EShop.Plugins.Promotions"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/PromotionsPageModel.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/PromotionsPageModel.cs new file mode 100644 index 00000000..f48af135 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/PromotionsPageModel.cs @@ -0,0 +1,15 @@ +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Pages; + +/* Inherit your PageModel classes from this class. + */ +public abstract class PromotionsPageModel : AbpPageModel +{ + protected PromotionsPageModel() + { + LocalizationResourceType = typeof(PromotionsResource); + ObjectMapperContext = typeof(EShopPluginsPromotionsWebModule); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/_ViewImports.cshtml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/_ViewImports.cshtml new file mode 100644 index 00000000..c1da1f5f --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs new file mode 100644 index 00000000..8dcc71f2 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; + +namespace EasyAbp.EShop.Plugins.Promotions.Web; + +public class PromotionsWebAutoMapperProfile : Profile +{ + public PromotionsWebAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Properties/launchSettings.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Properties/launchSettings.json new file mode 100644 index 00000000..d23ed2ba --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "EasyAbp.EShop.Plugins.Promotions.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:50266;http://localhost:50267" + } + } +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj new file mode 100644 index 00000000..29ba9e55 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj @@ -0,0 +1,17 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestBase.cs new file mode 100644 index 00000000..430b4664 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestBase.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +/* Inherit from this class for your application layer tests. + * See SampleAppService_Tests for example. + */ +public abstract class PromotionsApplicationTestBase : PromotionsTestBase +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestModule.cs new file mode 100644 index 00000000..a5c4b05c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationModule), + typeof(PromotionsDomainTestModule) + )] +public class PromotionsApplicationTestModule : AbpModule +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj new file mode 100644 index 00000000..ac776ffb --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestBase.cs new file mode 100644 index 00000000..47cad980 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestBase.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +/* Inherit from this class for your domain layer tests. + * See SampleManager_Tests for example. + */ +public abstract class PromotionsDomainTestBase : PromotionsTestBase +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs new file mode 100644 index 00000000..757a8be7 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs @@ -0,0 +1,16 @@ +using EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions; + +/* Domain tests are configured to use the EF Core provider. + * You can switch to MongoDB, however your domain tests should be + * database independent anyway. + */ +[DependsOn( + typeof(PromotionsEntityFrameworkCoreTestModule) + )] +public class PromotionsDomainTestModule : AbpModule +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj new file mode 100644 index 00000000..eaaeb3b0 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,19 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestBase.cs new file mode 100644 index 00000000..4e2d0508 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestBase.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +/* This class can be used as a base class for EF Core integration tests, + * while SampleRepository_Tests uses a different approach. + */ +public abstract class PromotionsEntityFrameworkCoreTestBase : PromotionsTestBase +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestModule.cs new file mode 100644 index 00000000..3af583e5 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestModule.cs @@ -0,0 +1,45 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +[DependsOn( + typeof(PromotionsTestBaseModule), + typeof(EShopPluginsPromotionsEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] +public class PromotionsEntityFrameworkCoreTestModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysDisableUnitOfWorkTransaction(); + + var sqliteConnection = CreateDatabaseAndGetConnection(); + + Configure(options => + { + options.Configure(abpDbContextConfigurationContext => + { + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); + }); + }); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new SqliteConnection("Data Source=:memory:"); + connection.Open(); + + new PromotionsDbContext( + new DbContextOptionsBuilder().UseSqlite(connection).Options + ).GetService().CreateTables(); + + return connection; + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 00000000..b6054c55 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,143 @@ +using System; +using System.Net.Http; +using System.Threading.Tasks; +using IdentityModel.Client; +using Microsoft.Extensions.Configuration; +using Volo.Abp.DependencyInjection; +using Volo.Abp.IdentityModel; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public class ClientDemoService : ITransientDependency +{ + private readonly IIdentityModelAuthenticationService _authenticationService; + private readonly IConfiguration _configuration; + + public ClientDemoService( + IIdentityModelAuthenticationService authenticationService, + IConfiguration configuration) + { + _authenticationService = authenticationService; + _configuration = configuration; + } + + public async Task RunAsync() + { + await TestWithDynamicProxiesAsync(); + await TestWithHttpClientAndIdentityModelAuthenticationServiceAsync(); + await TestAllManuallyAsync(); + } + + /* Shows how to perform an HTTP request to the API using ABP's dynamic c# proxy + * feature. It is just simple as calling a local service method. + * Authorization and HTTP request details are handled by the ABP framework. + */ + private async Task TestWithDynamicProxiesAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestWithDynamicProxiesAsync)} *****"); + } + + /* Shows how to use HttpClient to perform a request to the HTTP API. + * It uses ABP's IIdentityModelAuthenticationService to simplify obtaining access tokens. + */ + private async Task TestWithHttpClientAndIdentityModelAuthenticationServiceAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestWithHttpClientAndIdentityModelAuthenticationServiceAsync)} *****"); + + //Get access token using ABP's IIdentityModelAuthenticationService + + var accessToken = await _authenticationService.GetAccessTokenAsync( + new IdentityClientConfiguration( + _configuration["IdentityClients:Default:Authority"], + _configuration["IdentityClients:Default:Scope"], + _configuration["IdentityClients:Default:ClientId"], + _configuration["IdentityClients:Default:ClientSecret"], + _configuration["IdentityClients:Default:GrantType"], + _configuration["IdentityClients:Default:UserName"], + _configuration["IdentityClients:Default:UserPassword"] + ) + ); + + //Perform the actual HTTP request + + using (var httpClient = new HttpClient()) + { + httpClient.SetBearerToken(accessToken); + + var url = _configuration["RemoteServices:Promotions:BaseUrl"] + + "api/Promotions/sample/authorized"; + + var responseMessage = await httpClient.GetAsync(url); + if (responseMessage.IsSuccessStatusCode) + { + var responseString = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine("Result: " + responseString); + } + else + { + throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); + } + } + } + + /* Shows how to use HttpClient to perform a request to the HTTP API. + */ + private async Task TestAllManuallyAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestAllManuallyAsync)} *****"); + + //Obtain access token from the IDS4 server + + // discover endpoints from metadata + var client = new HttpClient(); + var disco = await client.GetDiscoveryDocumentAsync(_configuration["IdentityClients:Default:Authority"]); + if (disco.IsError) + { + Console.WriteLine(disco.Error); + return; + } + + // request token + var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest + { + Address = disco.TokenEndpoint, + ClientId = _configuration["IdentityClients:Default:ClientId"], + ClientSecret = _configuration["IdentityClients:Default:ClientSecret"], + UserName = _configuration["IdentityClients:Default:UserName"], + Password = _configuration["IdentityClients:Default:UserPassword"], + Scope = _configuration["IdentityClients:Default:Scope"] + }); + + if (tokenResponse.IsError) + { + Console.WriteLine(tokenResponse.Error); + return; + } + + Console.WriteLine(tokenResponse.Json); + + //Perform the actual HTTP request + + using (var httpClient = new HttpClient()) + { + httpClient.SetBearerToken(tokenResponse.AccessToken); + + var url = _configuration["RemoteServices:Promotions:BaseUrl"] + + "api/Promotions/sample/authorized"; + + var responseMessage = await httpClient.GetAsync(url); + if (responseMessage.IsSuccessStatusCode) + { + var responseString = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine("Result: " + responseString); + } + else + { + throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); + } + } + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 00000000..153c17ae --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp; + +public class ConsoleTestAppHostedService : IHostedService +{ + private readonly IConfiguration _configuration; + + public ConsoleTestAppHostedService(IConfiguration configuration) + { + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + })) + { + await application.InitializeAsync(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + await application.ShutdownAsync(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 00000000..5d9cafbe --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,33 @@ + + + + Exe + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/Program.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 00000000..6c9cb6af --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp; + +class Program +{ + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/PromotionsConsoleApiClientModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/PromotionsConsoleApiClientModule.cs new file mode 100644 index 00000000..4f1daa5f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/PromotionsConsoleApiClientModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(EShopPluginsPromotionsHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] +public class PromotionsConsoleApiClientModule : AbpModule +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 00000000..00f523c4 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,21 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44332/" + }, + "Promotions": { + "BaseUrl": "https://localhost:44320/" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "Promotions_App", + "ClientSecret": "1q2w3e*", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44332/", + "Scope": "Promotions" + } + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj new file mode 100644 index 00000000..17c9b64f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj @@ -0,0 +1,18 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoDbFixture.cs new file mode 100644 index 00000000..9588c437 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoDbFixture.cs @@ -0,0 +1,21 @@ +using System; +using Mongo2Go; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +public class MongoDbFixture : IDisposable +{ + private static readonly MongoDbRunner MongoDbRunner; + public static readonly string ConnectionString; + + static MongoDbFixture() + { + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); + ConnectionString = MongoDbRunner.ConnectionString; + } + + public void Dispose() + { + MongoDbRunner?.Dispose(); + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoTestCollection.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoTestCollection.cs new file mode 100644 index 00000000..3df639ca --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoTestCollection.cs @@ -0,0 +1,9 @@ +using Xunit; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[CollectionDefinition(Name)] +public class MongoTestCollection : ICollectionFixture +{ + public const string Name = "MongoDB Collection"; +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestBase.cs new file mode 100644 index 00000000..6d7ff5c1 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestBase.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +/* This class can be used as a base class for MongoDB integration tests, + * while SampleRepository_Tests uses a different approach. + */ +public abstract class PromotionsMongoDbTestBase : PromotionsTestBase +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestModule.cs new file mode 100644 index 00000000..6a07872c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestModule.cs @@ -0,0 +1,26 @@ +using System; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[DependsOn( + typeof(PromotionsTestBaseModule), + typeof(EShopPluginsPromotionsMongoDbModule) + )] +public class PromotionsMongoDbTestModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; + + Configure(options => + { + options.ConnectionStrings.Default = connectionString; + }); + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.csproj new file mode 100644 index 00000000..e2d846fb --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.csproj @@ -0,0 +1,28 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsDataSeedContributor.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsDataSeedContributor.cs new file mode 100644 index 00000000..2148792a --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsDataSeedContributor.cs @@ -0,0 +1,32 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public class PromotionsDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IGuidGenerator _guidGenerator; + private readonly ICurrentTenant _currentTenant; + + public PromotionsDataSeedContributor( + IGuidGenerator guidGenerator, ICurrentTenant currentTenant) + { + _guidGenerator = guidGenerator; + _currentTenant = currentTenant; + } + + public Task SeedAsync(DataSeedContext context) + { + /* Instead of returning the Task.CompletedTask, you can insert your test data + * at this point! + */ + + using (_currentTenant.Change(context?.TenantId)) + { + return Task.CompletedTask; + } + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBase.cs new file mode 100644 index 00000000..d998f060 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBase.cs @@ -0,0 +1,59 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace EasyAbp.EShop.Plugins.Promotions; + +/* All test classes are derived from this class, directly or indirectly. */ +public abstract class PromotionsTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule +{ + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs new file mode 100644 index 00000000..318dbc6b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs @@ -0,0 +1,41 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(EShopPluginsPromotionsDomainModule) + )] +public class PromotionsTestBaseModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 00000000..f54f2d7a --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace EasyAbp.EShop.Plugins.Promotions.Security; + +[Dependency(ReplaceServices = true)] +public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal GetPrincipal() + { + return new ClaimsPrincipal(new ClaimsIdentity(new List + { + new Claim(AbpClaimTypes.UserId, "2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName, "admin"), + new Claim(AbpClaimTypes.Email, "admin@abp.io") + } + ) + ); + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj index d947e429..56750be0 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj @@ -14,6 +14,7 @@ + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj index 1429072d..337748a9 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj @@ -16,6 +16,7 @@ + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj index 22e80e65..1aa3282c 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj @@ -26,6 +26,7 @@ + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj index fc1961b0..456f192f 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj @@ -13,6 +13,7 @@ + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj index 176450ff..a0d6d80a 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj @@ -13,6 +13,7 @@ + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj index 8674fdc6..dff55491 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj @@ -14,6 +14,7 @@ + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj index 7298f474..313479e6 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj @@ -14,6 +14,7 @@ + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj index e9785dfc..26c0ff13 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj @@ -43,6 +43,7 @@ + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs index c69bd88f..f4a8ae32 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs @@ -57,6 +57,8 @@ using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; using EasyAbp.EShop.Plugins.FlashSales.Web; using EasyAbp.EShop.Plugins.FlashSales; +using EasyAbp.EShop.Plugins.Promotions; +using EasyAbp.EShop.Plugins.Promotions.Web; namespace EShopSample.Web { @@ -79,6 +81,7 @@ namespace EShopSample.Web typeof(EShopPluginsBookingWebModule), typeof(EShopPluginsCouponsWebModule), typeof(EShopPluginsFlashSalesWebModule), + typeof(EShopPluginsPromotionsWebModule), typeof(PaymentServiceWebModule), typeof(PaymentServiceWeChatPayWebModule), typeof(PaymentServicePrepaymentWebModule), @@ -227,6 +230,12 @@ namespace EShopSample.Web options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}FlashSales{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.FlashSales.Application.Contracts")); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}FlashSales{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.FlashSales.Application")); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}FlashSales{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.FlashSales.Web")); + + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Application")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Web")); }); } } diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Web/Pages/Index.cshtml b/samples/EShopSample/aspnet-core/src/EShopSample.Web/Pages/Index.cshtml index e120a0b4..488230d5 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/Pages/Index.cshtml +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/Pages/Index.cshtml @@ -1,6 +1,12 @@ @page @inherits EShopSample.Web.Pages.EShopSamplePage @using EasyAbp.EShop.Orders.Orders +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Blockquote +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers @model EShopSample.Web.Pages.IndexModel @section styles { From e289ac4d7b83ce23f50def2682adc06a51612732 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Sat, 15 Apr 2023 21:06:09 +0800 Subject: [PATCH 2/2] Complete the Promotions plugin module --- EShop.sln | 14 + ...ders.Plugins.Promotions.Domain.abppkg.json | 3 + ...op.Orders.Plugins.Promotions.Domain.csproj | 16 + ...ShopOrdersPluginsPromotionsDomainModule.cs | 12 + .../PromotionOrderDiscountProvider.cs | 34 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + ...ns.Promotions.Application.Contracts.csproj | 2 + ...insPromotionsApplicationContractsModule.cs | 11 +- ...opPluginsPromotionsRemoteServiceConsts.cs} | 2 +- .../PromotionsPermissionDefinitionProvider.cs | 6 + .../Permissions/PromotionsPermissions.cs | 9 + .../Promotions/Dtos/CreatePromotionDto.cs | 44 + .../Promotions/Dtos/DiscountOrderInputDto.cs | 19 + .../Promotions/Dtos/DiscountOrderOutputDto.cs | 19 + .../Dtos/DiscountProductInputDto.cs | 19 + .../Dtos/DiscountProductOutputDto.cs | 19 + .../Promotions/Dtos/PromotionDto.cs | 26 + .../Promotions/Dtos/PromotionGetListInput.cs | 23 + .../Promotions/Dtos/PromotionTypeDto.cs | 20 + .../Promotions/Dtos/UpdatePromotionDto.cs | 34 + .../Promotions/IPromotionAppService.cs | 18 + .../IPromotionIntegrationService.cs | 13 + ...Shop.Plugins.Promotions.Application.csproj | 1 + ...EShopPluginsPromotionsApplicationModule.cs | 8 +- .../Promotions/PromotionAppService.cs | 98 + .../Promotions/PromotionIntegrationService.cs | 82 + .../PromotionsApplicationAutoMapperProfile.cs | 5 +- .../Localization/PromotionsResource.cs | 2 +- .../Plugins/Promotions/Localization/en.json | 28 + .../Promotions/Localization/zh-Hans.json | 28 + .../Promotions/Localization/zh-Hant.json | 28 + .../Plugins/Promotions/PromotionsConsts.cs | 8 + .../Promotions/PromotionsErrorCodes.cs | 9 +- ...Abp.EShop.Plugins.Promotions.Domain.csproj | 6 +- .../EShopPluginsPromotionsDomainModule.cs | 11 +- .../Options/EShopPluginsPromotionsOptions.cs | 6 + .../Options/PromotionTypeConfigurations.cs | 30 + .../HasProductScopesExtensions.cs | 14 + .../PromotionTypes/IHasProductScopes.cs | 8 + .../PromotionTypes/IPromotionHandler.cs | 17 + .../MinQuantityOrderDiscountConfigurations.cs | 8 + .../MinQuantityOrderDiscountModel.cs | 35 + ...inQuantityOrderDiscountPromotionHandler.cs | 89 + ...ntPromotionTypeConfigurationsExtensions.cs | 13 + .../PromotionTypes/ProductScopeModel.cs | 35 + .../PromotionTypes/PromotionHandlerBase.cs | 50 + .../PromotionTypes/PromotionTypeDefinition.cs | 16 + .../SimpleProductDiscountConfigurations.cs | 8 + .../SimpleProductDiscountModel.cs | 27 + .../SimpleProductDiscountPromotionHandler.cs | 62 + ...ntPromotionTypeConfigurationsExtensions.cs | 13 + .../Promotions/IPromotionRepository.cs | 8 + .../Promotions/Promotions/Promotion.cs | 70 + .../Promotions/Promotions/PromotionManager.cs | 68 + ...ginsPromotionsEntityFrameworkCoreModule.cs | 4 +- .../IPromotionsDbContext.cs | 5 +- .../PromotionsDbContext.cs | 2 + ...motionsDbContextModelCreatingExtensions.cs | 14 +- .../PromotionEfCoreQuerableExtensions.cs | 19 + .../Promotions/PromotionRepository.cs | 20 + ...hopPluginsPromotionsHttpApiClientModule.cs | 2 +- .../Promotions/PromotionController.cs | 60 + ...bp.EShop.Plugins.Promotions.MongoDB.csproj | 6 +- .../EShopPluginsPromotionsWebModule.cs | 2 + ...asyAbp.EShop.Plugins.Promotions.Web.csproj | 2 + .../Menus/PromotionsMenuContributor.cs | 36 +- .../Menus/PromotionsMenus.cs | 7 +- .../Promotions/Promotion/CreateModal.cshtml | 18 + .../Promotion/CreateModal.cshtml.cs | 39 + .../Promotions/Promotion/EditModal.cshtml | 19 + .../Promotions/Promotion/EditModal.cshtml.cs | 40 + .../Promotions/Promotion/Index.cshtml | 71 + .../Promotions/Promotion/Index.cshtml.cs | 72 + .../Promotion/PromotionEntityPageModelBase.cs | 28 + .../ViewModels/CreatePromotionViewModel.cs | 44 + .../ViewModels/EditPromotionViewModel.cs | 35 + .../Promotions/Promotions/Promotion/index.css | 0 .../Promotions/Promotions/Promotion/index.js | 118 + .../PromotionsWebAutoMapperProfile.cs | 5 +- ...ucts.Plugins.Promotions.Domain.abppkg.json | 3 + ....Products.Plugins.Promotions.Domain.csproj | 16 + ...opProductsPluginsPromotionsDomainModule.cs | 12 + .../PromotionProductDiscountProvider.cs | 37 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../MinQuantityOrderDiscountTests.cs | 137 + .../SimpleProductDiscountTests.cs | 79 + .../Promotions/PromotionAppServiceTests.cs | 28 + ...hop.Plugins.Promotions.Domain.Tests.csproj | 2 + .../Promotions/PromotionDomainTests.cs | 24 + .../PromotionsDomainTestModule.cs | 10 +- .../Promotions/PromotionRepositoryTests.cs | 32 + .../PromotionsTestBaseModule.cs | 15 +- .../PromotionsTestConsts.cs | 8 + .../EShopSampleApplicationContractsModule.cs | 2 + .../EShopSampleApplicationModule.cs | 2 + .../EShopSampleDomainSharedModule.cs | 2 + .../EShopSample.Domain.csproj | 2 + .../EShopSampleDomainModule.cs | 34 +- .../EShopSampleDbContext.cs | 2 + .../EShopSampleEntityFrameworkCoreModule.cs | 2 + ...14132422_AddedPromotionsModule.Designer.cs | 6510 +++++++++++++++++ .../20230414132422_AddedPromotionsModule.cs | 52 + .../EShopSampleDbContextModelSnapshot.cs | 98 +- .../EShopSampleHttpApiClientModule.cs | 2 + .../EShopSampleHttpApiModule.cs | 2 + 107 files changed, 9047 insertions(+), 54 deletions(-) create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp.EShop.Orders.Plugins.Promotions.Domain.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp.EShop.Orders.Plugins.Promotions.Domain.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp/EShop/Orders/Plugins/Promotions/EShopOrdersPluginsPromotionsDomainModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp/EShop/Orders/Plugins/Promotions/PromotionOrderDiscountProvider.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/FodyWeavers.xsd rename plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/{PromotionsRemoteServiceConsts.cs => EShopPluginsPromotionsRemoteServiceConsts.cs} (78%) create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/CreatePromotionDto.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountOrderInputDto.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountOrderOutputDto.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountProductInputDto.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountProductOutputDto.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionDto.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionGetListInput.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionTypeDto.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/UpdatePromotionDto.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionAppService.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionIntegrationService.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionAppService.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionIntegrationService.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsConsts.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Options/EShopPluginsPromotionsOptions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Options/PromotionTypeConfigurations.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/HasProductScopesExtensions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/IHasProductScopes.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/IPromotionHandler.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountConfigurations.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountModel.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountPromotionHandler.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountPromotionTypeConfigurationsExtensions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/ProductScopeModel.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/PromotionHandlerBase.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/PromotionTypeDefinition.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountConfigurations.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountModel.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountPromotionHandler.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountPromotionTypeConfigurationsExtensions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionRepository.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/Promotion.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionManager.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionEfCoreQuerableExtensions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionRepository.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionController.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/CreateModal.cshtml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/CreateModal.cshtml.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/EditModal.cshtml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/EditModal.cshtml.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/Index.cshtml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/Index.cshtml.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/PromotionEntityPageModelBase.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/ViewModels/CreatePromotionViewModel.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/ViewModels/EditPromotionViewModel.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/index.css create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/index.js create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp.EShop.Products.Plugins.Promotions.Domain.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp.EShop.Products.Plugins.Promotions.Domain.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp/EShop/Products/Plugins/Promotions/EShopProductsPluginsPromotionsDomainModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp/EShop/Products/Plugins/Promotions/PromotionProductDiscountProvider.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionTypes/MinQuantityOrderDiscountTests.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionTypes/SimpleProductDiscountTests.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/Promotions/PromotionAppServiceTests.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/Promotions/PromotionDomainTests.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/Promotions/PromotionRepositoryTests.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestConsts.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230414132422_AddedPromotionsModule.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230414132422_AddedPromotionsModule.cs diff --git a/EShop.sln b/EShop.sln index a94fa146..fd6fd913 100644 --- a/EShop.sln +++ b/EShop.sln @@ -509,6 +509,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.TestBase", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.TestBase\EasyAbp.EShop.Plugins.Promotions.TestBase.csproj", "{E590820A-A125-4133-9E9C-DA47BCC8FCE6}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Products.Plugins.Promotions.Domain", "plugins\Promotions\src\EasyAbp.EShop.Products.Plugins.Promotions.Domain\EasyAbp.EShop.Products.Plugins.Promotions.Domain.csproj", "{7CF4BA61-4919-402A-A9B3-32309E2AB17E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Orders.Plugins.Promotions.Domain", "plugins\Promotions\src\EasyAbp.EShop.Orders.Plugins.Promotions.Domain\EasyAbp.EShop.Orders.Plugins.Promotions.Domain.csproj", "{341E0B8F-75CE-409D-94C2-9EB9D7113CC6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1335,6 +1339,14 @@ Global {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Debug|Any CPU.Build.0 = Debug|Any CPU {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Release|Any CPU.ActiveCfg = Release|Any CPU {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Release|Any CPU.Build.0 = Release|Any CPU + {7CF4BA61-4919-402A-A9B3-32309E2AB17E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7CF4BA61-4919-402A-A9B3-32309E2AB17E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7CF4BA61-4919-402A-A9B3-32309E2AB17E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7CF4BA61-4919-402A-A9B3-32309E2AB17E}.Release|Any CPU.Build.0 = Release|Any CPU + {341E0B8F-75CE-409D-94C2-9EB9D7113CC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {341E0B8F-75CE-409D-94C2-9EB9D7113CC6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {341E0B8F-75CE-409D-94C2-9EB9D7113CC6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {341E0B8F-75CE-409D-94C2-9EB9D7113CC6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1589,6 +1601,8 @@ Global {5F0FE595-625E-4657-ADF2-25F0803D4578} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} {B43EB182-F725-4DBD-891B-E576A5B8D2D2} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} {E590820A-A125-4133-9E9C-DA47BCC8FCE6} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {7CF4BA61-4919-402A-A9B3-32309E2AB17E} = {2661CE36-99D1-4D28-A956-6581552F8889} + {341E0B8F-75CE-409D-94C2-9EB9D7113CC6} = {2661CE36-99D1-4D28-A956-6581552F8889} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp.EShop.Orders.Plugins.Promotions.Domain.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp.EShop.Orders.Plugins.Promotions.Domain.abppkg.json new file mode 100644 index 00000000..1d574efe --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp.EShop.Orders.Plugins.Promotions.Domain.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.domain" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp.EShop.Orders.Plugins.Promotions.Domain.csproj b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp.EShop.Orders.Plugins.Promotions.Domain.csproj new file mode 100644 index 00000000..6746d303 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp.EShop.Orders.Plugins.Promotions.Domain.csproj @@ -0,0 +1,16 @@ + + + + + + net7.0 + enable + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp/EShop/Orders/Plugins/Promotions/EShopOrdersPluginsPromotionsDomainModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp/EShop/Orders/Plugins/Promotions/EShopOrdersPluginsPromotionsDomainModule.cs new file mode 100644 index 00000000..02f99c3f --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp/EShop/Orders/Plugins/Promotions/EShopOrdersPluginsPromotionsDomainModule.cs @@ -0,0 +1,12 @@ +using EasyAbp.EShop.Plugins.Promotions; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Orders.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(EShopOrdersDomainModule) +)] +public class EShopOrdersPluginsPromotionsDomainModule : AbpModule +{ +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp/EShop/Orders/Plugins/Promotions/PromotionOrderDiscountProvider.cs b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp/EShop/Orders/Plugins/Promotions/PromotionOrderDiscountProvider.cs new file mode 100644 index 00000000..9f8f9674 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/EasyAbp/EShop/Orders/Plugins/Promotions/PromotionOrderDiscountProvider.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using EasyAbp.EShop.Orders.Orders; +using Volo.Abp.DependencyInjection; + +namespace EasyAbp.EShop.Orders.Plugins.Promotions; + +public class PromotionOrderDiscountProvider : IOrderDiscountProvider, ITransientDependency +{ + public static int PromotionOrderDiscountEffectOrder { get; set; } = 5000; + + public int EffectOrder => PromotionOrderDiscountEffectOrder; + + protected IPromotionIntegrationService PromotionIntegrationService { get; } + + public PromotionOrderDiscountProvider(IPromotionIntegrationService promotionIntegrationService) + { + PromotionIntegrationService = promotionIntegrationService; + } + + public virtual async Task DiscountAsync(OrderDiscountContext context) + { + var dto = await PromotionIntegrationService.DiscountOrderAsync(new DiscountOrderInputDto(context)); + + if (dto.Context.Equals(context)) + { + return; + } + + context.CandidateDiscounts.Clear(); + context.CandidateDiscounts.AddRange(dto.Context.CandidateDiscounts); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Orders.Plugins.Promotions.Domain/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj index e24a4a33..67cbfed8 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj @@ -11,6 +11,8 @@ + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs index d1a2206b..7ae5d759 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs @@ -1,4 +1,6 @@ -using Volo.Abp.Application; +using EasyAbp.EShop.Orders; +using EasyAbp.EShop.Products; +using Volo.Abp.Application; using Volo.Abp.Modularity; using Volo.Abp.Authorization; @@ -6,10 +8,11 @@ namespace EasyAbp.EShop.Plugins.Promotions; [DependsOn( typeof(EShopPluginsPromotionsDomainSharedModule), + typeof(EShopProductsDomainSharedModule), + typeof(EShopOrdersDomainSharedModule), typeof(AbpDddApplicationContractsModule), typeof(AbpAuthorizationModule) - )] +)] public class EShopPluginsPromotionsApplicationContractsModule : AbpModule { - -} +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsRemoteServiceConsts.cs similarity index 78% rename from plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs rename to plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsRemoteServiceConsts.cs index f60fa78c..530f86f9 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsRemoteServiceConsts.cs @@ -1,6 +1,6 @@ namespace EasyAbp.EShop.Plugins.Promotions; -public class PromotionsRemoteServiceConsts +public class EShopPluginsPromotionsRemoteServiceConsts { public const string RemoteServiceName = "EasyAbpEShopPluginsPromotions"; diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs index 209ac19e..fdf665e8 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs @@ -9,6 +9,12 @@ public class PromotionsPermissionDefinitionProvider : PermissionDefinitionProvid public override void Define(IPermissionDefinitionContext context) { var myGroup = context.AddGroup(PromotionsPermissions.GroupName, L("Permission:Promotions")); + + var promotionPermission = myGroup.AddPermission(PromotionsPermissions.Promotion.Default, L("Permission:Promotion")); + promotionPermission.AddChild(PromotionsPermissions.Promotion.CrossStore, L("Permission:CrossStore")); + promotionPermission.AddChild(PromotionsPermissions.Promotion.Create, L("Permission:Create")); + promotionPermission.AddChild(PromotionsPermissions.Promotion.Update, L("Permission:Update")); + promotionPermission.AddChild(PromotionsPermissions.Promotion.Delete, L("Permission:Delete")); } private static LocalizableString L(string name) diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs index bbd17e43..59e2e8f6 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs @@ -10,4 +10,13 @@ public class PromotionsPermissions { return ReflectionHelper.GetPublicConstantsRecursively(typeof(PromotionsPermissions)); } + + public class Promotion + { + public const string Default = GroupName + ".Promotion"; + public const string CrossStore = Default + ".CrossStore"; + public const string Update = Default + ".Update"; + public const string Create = Default + ".Create"; + public const string Delete = Default + ".Delete"; + } } diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/CreatePromotionDto.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/CreatePromotionDto.cs new file mode 100644 index 00000000..88782234 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/CreatePromotionDto.cs @@ -0,0 +1,44 @@ +using System; +using EasyAbp.EShop.Stores.Stores; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; + +[Serializable] +public class CreatePromotionDto : IMultiStore +{ + public Guid StoreId { get; set; } + + public string PromotionType { get; set; } + + public string UniqueName { get; set; } + + public string DisplayName { get; set; } + + public string Configurations { get; set; } + + public DateTime? FromTime { get; set; } + + public DateTime? ToTime { get; set; } + + public bool Disabled { get; set; } + + public int Priority { get; set; } + + public CreatePromotionDto() + { + } + + public CreatePromotionDto(Guid storeId, string promotionType, string uniqueName, string displayName, + string configurations, DateTime? fromTime, DateTime? toTime, bool disabled, int priority) + { + StoreId = storeId; + PromotionType = promotionType; + UniqueName = uniqueName; + DisplayName = displayName; + Configurations = configurations; + FromTime = fromTime; + ToTime = toTime; + Disabled = disabled; + Priority = priority; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountOrderInputDto.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountOrderInputDto.cs new file mode 100644 index 00000000..c88eaf50 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountOrderInputDto.cs @@ -0,0 +1,19 @@ +using System; +using EasyAbp.EShop.Orders.Orders; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; + +[Serializable] +public class DiscountOrderInputDto +{ + public OrderDiscountContext Context { get; set; } + + public DiscountOrderInputDto() + { + } + + public DiscountOrderInputDto(OrderDiscountContext context) + { + Context = context; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountOrderOutputDto.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountOrderOutputDto.cs new file mode 100644 index 00000000..b51297fa --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountOrderOutputDto.cs @@ -0,0 +1,19 @@ +using System; +using EasyAbp.EShop.Orders.Orders; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; + +[Serializable] +public class DiscountOrderOutputDto +{ + public OrderDiscountContext Context { get; set; } + + public DiscountOrderOutputDto() + { + } + + public DiscountOrderOutputDto(OrderDiscountContext context) + { + Context = context; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountProductInputDto.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountProductInputDto.cs new file mode 100644 index 00000000..3870ff78 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountProductInputDto.cs @@ -0,0 +1,19 @@ +using System; +using EasyAbp.EShop.Products.Products; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; + +[Serializable] +public class DiscountProductInputDto +{ + public ProductDiscountContext Context { get; set; } + + public DiscountProductInputDto() + { + } + + public DiscountProductInputDto(ProductDiscountContext context) + { + Context = context; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountProductOutputDto.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountProductOutputDto.cs new file mode 100644 index 00000000..1ad889ae --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/DiscountProductOutputDto.cs @@ -0,0 +1,19 @@ +using System; +using EasyAbp.EShop.Products.Products; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; + +[Serializable] +public class DiscountProductOutputDto +{ + public ProductDiscountContext Context { get; set; } + + public DiscountProductOutputDto() + { + } + + public DiscountProductOutputDto(ProductDiscountContext context) + { + Context = context; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionDto.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionDto.cs new file mode 100644 index 00000000..403cc299 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionDto.cs @@ -0,0 +1,26 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; + +[Serializable] +public class PromotionDto : FullAuditedEntityDto +{ + public Guid StoreId { get; set; } + + public string PromotionType { get; set; } + + public string UniqueName { get; set; } + + public string DisplayName { get; set; } + + public string Configurations { get; set; } + + public DateTime? FromTime { get; set; } + + public DateTime? ToTime { get; set; } + + public bool Disabled { get; set; } + + public int Priority { get; set; } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionGetListInput.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionGetListInput.cs new file mode 100644 index 00000000..89f44167 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionGetListInput.cs @@ -0,0 +1,23 @@ +using System; +using System.ComponentModel; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; + +[Serializable] +public class PromotionGetListInput : PagedAndSortedResultRequestDto +{ + public Guid? StoreId { get; set; } + + public string? PromotionType { get; set; } + + public string? UniqueName { get; set; } + + public string? DisplayName { get; set; } + + public DateTime? FromTime { get; set; } + + public DateTime? ToTime { get; set; } + + public bool? Disabled { get; set; } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionTypeDto.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionTypeDto.cs new file mode 100644 index 00000000..15c9e17a --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/PromotionTypeDto.cs @@ -0,0 +1,20 @@ +using System; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; + +[Serializable] +public class PromotionTypeDto +{ + public string Name { get; set; } + + public string DisplayName { get; set; } + + public string ConfigurationsTemplate { get; set; } + + public PromotionTypeDto(string name, string displayName, string configurationsTemplate) + { + Name = name; + DisplayName = displayName; + ConfigurationsTemplate = configurationsTemplate; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/UpdatePromotionDto.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/UpdatePromotionDto.cs new file mode 100644 index 00000000..d4a57ee4 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/Dtos/UpdatePromotionDto.cs @@ -0,0 +1,34 @@ +using System; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; + +[Serializable] +public class UpdatePromotionDto +{ + public string DisplayName { get; set; } + + public string Configurations { get; set; } + + public DateTime? FromTime { get; set; } + + public DateTime? ToTime { get; set; } + + public bool Disabled { get; set; } + + public int Priority { get; set; } + + public UpdatePromotionDto() + { + } + + public UpdatePromotionDto(string displayName, string configurations, DateTime? fromTime, DateTime? toTime, + bool disabled, int priority) + { + DisplayName = displayName; + Configurations = configurations; + FromTime = fromTime; + ToTime = toTime; + Disabled = disabled; + Priority = priority; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionAppService.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionAppService.cs new file mode 100644 index 00000000..23894881 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionAppService.cs @@ -0,0 +1,18 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public interface IPromotionAppService : + ICrudAppService< + PromotionDto, + Guid, + PromotionGetListInput, + CreatePromotionDto, + UpdatePromotionDto> +{ + Task> GetPromotionTypesAsync(); +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionIntegrationService.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionIntegrationService.cs new file mode 100644 index 00000000..41999e81 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionIntegrationService.cs @@ -0,0 +1,13 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +[IntegrationService] +public interface IPromotionIntegrationService +{ + Task DiscountProductAsync(DiscountProductInputDto input); + + Task DiscountOrderAsync(DiscountOrderInputDto input); +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj index 303ab2bb..aac938dd 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj @@ -11,6 +11,7 @@ + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs index 65931d0a..15bfcbad 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using EasyAbp.EShop.Stores; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; using Volo.Abp.Application; @@ -8,9 +9,10 @@ namespace EasyAbp.EShop.Plugins.Promotions; [DependsOn( typeof(EShopPluginsPromotionsDomainModule), typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(EShopStoresApplicationSharedModule), typeof(AbpDddApplicationModule), typeof(AbpAutoMapperModule) - )] +)] public class EShopPluginsPromotionsApplicationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) @@ -21,4 +23,4 @@ public class EShopPluginsPromotionsApplicationModule : AbpModule options.AddMaps(validate: true); }); } -} +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionAppService.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionAppService.cs new file mode 100644 index 00000000..d5fee344 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionAppService.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Localization; +using EasyAbp.EShop.Plugins.Promotions.Options; +using EasyAbp.EShop.Plugins.Promotions.Permissions; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes; +using EasyAbp.EShop.Stores.Stores; +using Microsoft.Extensions.Options; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Json; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public class PromotionAppService : MultiStoreCrudAppService, IPromotionAppService +{ + protected override string GetPolicyName { get; set; } = PromotionsPermissions.Promotion.Default; + protected override string GetListPolicyName { get; set; } = PromotionsPermissions.Promotion.Default; + protected override string CreatePolicyName { get; set; } = PromotionsPermissions.Promotion.Create; + protected override string UpdatePolicyName { get; set; } = PromotionsPermissions.Promotion.Update; + protected override string DeletePolicyName { get; set; } = PromotionsPermissions.Promotion.Delete; + protected override string CrossStorePolicyName { get; set; } = PromotionsPermissions.Promotion.CrossStore; + + private readonly IPromotionRepository _repository; + + protected IJsonSerializer JsonSerializer { get; } + protected PromotionManager PromotionManager { get; } + protected EShopPluginsPromotionsOptions Options { get; } + + public PromotionAppService( + IJsonSerializer jsonSerializer, + IOptions options, + PromotionManager promotionManager, + IPromotionRepository repository) : base(repository) + { + JsonSerializer = jsonSerializer; + PromotionManager = promotionManager; + Options = options.Value; + _repository = repository; + + LocalizationResource = typeof(PromotionsResource); + ObjectMapperContext = typeof(EShopPluginsPromotionsApplicationModule); + } + + protected override async Task> CreateFilteredQueryAsync(PromotionGetListInput input) + { + // TODO: AbpHelper generated + return (await base.CreateFilteredQueryAsync(input)) + .WhereIf(input.StoreId != null, x => x.StoreId == input.StoreId) + .WhereIf(!input.PromotionType.IsNullOrWhiteSpace(), x => x.PromotionType.Contains(input.PromotionType!)) + .WhereIf(!input.UniqueName.IsNullOrWhiteSpace(), x => x.UniqueName.Contains(input.UniqueName!)) + .WhereIf(!input.DisplayName.IsNullOrWhiteSpace(), x => x.DisplayName.Contains(input.DisplayName!)) + .WhereIf(input.FromTime != null, x => x.FromTime == input.FromTime) + .WhereIf(input.ToTime != null, x => x.ToTime == input.ToTime) + .WhereIf(input.Disabled != null, x => x.Disabled == input.Disabled) + ; + } + + public virtual async Task> GetPromotionTypesAsync() + { + var promotionTypes = Options.PromotionTypes.GetAll(); + + var dtos = new List(); + + foreach (var promotionType in promotionTypes) + { + var handler = GetPromotionHandler(promotionType); + + var configurationsTemplate = await handler.CreateConfigurationsObjectOrNullAsync(); + + dtos.Add(new PromotionTypeDto(promotionType.Name, L[promotionType.Name], + configurationsTemplate is null ? "{}" : JsonSerializer.Serialize(configurationsTemplate))); + } + + return new ListResultDto(dtos); + } + + protected virtual IPromotionHandler GetPromotionHandler(PromotionTypeDefinition definition) + { + return (IPromotionHandler)LazyServiceProvider.LazyGetRequiredService(definition.PromotionHandlerType); + } + + protected override async Task MapToEntityAsync(CreatePromotionDto createInput) + { + return await PromotionManager.CreateAsync(createInput.StoreId, createInput.PromotionType, + createInput.UniqueName, createInput.DisplayName, createInput.Configurations, createInput.FromTime, + createInput.ToTime, createInput.Disabled, createInput.Priority); + } + + protected override async Task MapToEntityAsync(UpdatePromotionDto updateInput, Promotion entity) + { + await PromotionManager.UpdateAsync(entity, updateInput.DisplayName, updateInput.Configurations, + updateInput.FromTime, updateInput.ToTime, updateInput.Disabled, updateInput.Priority); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionIntegrationService.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionIntegrationService.cs new file mode 100644 index 00000000..ee17511b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionIntegrationService.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Options; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes; +using Microsoft.Extensions.Options; +using Volo.Abp; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public class PromotionIntegrationService : ApplicationService, IPromotionIntegrationService +{ + protected IPromotionRepository PromotionRepository { get; } + protected EShopPluginsPromotionsOptions Options { get; } + + public PromotionIntegrationService( + IPromotionRepository promotionRepository, + IOptions options) + { + PromotionRepository = promotionRepository; + Options = options.Value; + } + + public virtual async Task DiscountProductAsync(DiscountProductInputDto input) + { + var context = input.Context; + + var promotions = await GetUnexpiredPromotionsAsync(context.Product.StoreId, context.Now, true); + + foreach (var promotion in promotions.OrderByDescending(x => x.Priority)) + { + var promotionHandler = GetPromotionHandler(promotion.PromotionType); + + await promotionHandler.HandleProductAsync(context, promotion); + } + + return new DiscountProductOutputDto(context); + } + + public virtual async Task DiscountOrderAsync(DiscountOrderInputDto input) + { + var context = input.Context; + + var promotions = await GetUnexpiredPromotionsAsync(context.Order.StoreId, context.Now, false); + + foreach (var promotion in promotions.OrderByDescending(x => x.Priority)) + { + var promotionHandler = GetPromotionHandler(promotion.PromotionType); + + await promotionHandler.HandleOrderAsync(context, promotion); + } + + return new DiscountOrderOutputDto(context); + } + + protected virtual async Task> GetUnexpiredPromotionsAsync(Guid storeId, DateTime now, + bool includesNotStarted) + { + // skip the expired promotions. + var queryable = (await PromotionRepository.GetQueryableAsync()).Where(x => + x.StoreId == storeId && !x.Disabled && (!x.ToTime.HasValue || now <= x.ToTime)); + + queryable.WhereIf(!includesNotStarted, x => !x.FromTime.HasValue || now >= x.FromTime); + + return await AsyncExecuter.ToListAsync(queryable); + } + + protected virtual IPromotionHandler GetPromotionHandler(string promotionType) + { + var definition = Options.PromotionTypes.GetOrNull(promotionType); + + if (definition is null) + { + throw new BusinessException(PromotionsErrorCodes.InvalidPromotionType); + } + + return (IPromotionHandler)LazyServiceProvider.LazyGetRequiredService(definition.PromotionHandlerType); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs index 1ace252b..51155529 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs @@ -1,4 +1,6 @@ -using AutoMapper; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using AutoMapper; namespace EasyAbp.EShop.Plugins.Promotions; @@ -9,5 +11,6 @@ public class PromotionsApplicationAutoMapperProfile : Profile /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ + CreateMap(); } } diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs index 0ee6930a..9881e099 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs @@ -2,7 +2,7 @@ namespace EasyAbp.EShop.Plugins.Promotions.Localization; -[LocalizationResourceName("Promotions")] +[LocalizationResourceName("EasyAbpEShopPluginsPromotions")] public class PromotionsResource { diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json index 189662ee..f836f1f9 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json @@ -1,5 +1,33 @@ { "culture": "en", "texts": { + "SimpleProductDiscount": "Simple product discount", + "MinQuantityOrderDiscount": "Min-quantity based order discount", + "Permission:Promotion": "Promotion", + "Permission:CrossStore": "Cross-store", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:EasyAbpEShop": "EShop", + "Menu:PromotionManagement": "Promotion", + "Menu:Promotion": "Promotion", + "Promotion": "Promotion", + "PromotionStoreId": "Store ID", + "PromotionPromotionType": "Promotion type", + "PromotionUniqueName": "Unique name", + "PromotionDisplayName": "Display name", + "PromotionConfigurations": "Configurations", + "PromotionFromTime": "From time", + "PromotionToTime": "To time", + "PromotionDisabled": "Disabled", + "PromotionPriority": "Priority", + "CreatePromotion": "Create", + "EditPromotion": "Edit", + "PromotionDeletionConfirmationMessage": "Are you sure to delete the promotion {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "TableFilter": "Filter", + "EasyAbp.EShop.Plugins.Promotions:DuplicatePromotionUniqueName": "Duplicate promotion unique name", + "EasyAbp.EShop.Plugins.Promotions:InvalidPromotionType": "Invalid promotion type", + "EasyAbp.EShop.Plugins.Promotions:InvalidPromotionConfigurations": "Invalid promotion configurations" } } \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json index df772fa6..28b8eb04 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json @@ -1,5 +1,33 @@ { "culture": "zh-Hans", "texts": { + "SimpleProductDiscount": "简单商品折扣", + "MinQuantityOrderDiscount": "基于最小数量的订单折扣", + "Permission:Promotion": "优惠策略", + "Permission:CrossStore": "跨店管理", + "Permission:Create": "新建", + "Permission:Update": "更新", + "Permission:Delete": "删除", + "Menu:EasyAbpEShop": "EShop 商城", + "Menu:PromotionManagement": "优惠活动", + "Menu:Promotion": "优惠策略", + "Promotion": "优惠策略", + "PromotionStoreId": "店铺 ID", + "PromotionPromotionType": "优惠策略类型", + "PromotionUniqueName": "唯一编号", + "PromotionDisplayName": "显示名称", + "PromotionConfigurations": "配置", + "PromotionFromTime": "生效时间", + "PromotionToTime": "结束时间", + "PromotionDisabled": "停用", + "PromotionPriority": "优先度", + "CreatePromotion": "新建", + "EditPromotion": "编辑", + "PromotionDeletionConfirmationMessage": "确认删除优惠策略 {0}?", + "SuccessfullyDeleted": "删除成功", + "TableFilter": "筛选器", + "EasyAbp.EShop.Plugins.Promotions:DuplicatePromotionUniqueName": "重复的优惠策略唯一编号", + "EasyAbp.EShop.Plugins.Promotions:InvalidPromotionType": "不正确的优惠策略类型", + "EasyAbp.EShop.Plugins.Promotions:InvalidPromotionConfigurations": "不正确的优惠策略配置" } } \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json index 7de37982..2c5a8154 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json @@ -1,5 +1,33 @@ { "culture": "zh-Hant", "texts": { + "SimpleProductDiscount": "簡單商品折扣", + "MinQuantityOrderDiscount": "基於最小數量的訂單折扣", + "Permission:Promotion": "優惠策略", + "Permission:CrossStore": "跨店管理", + "Permission:Create": "新建", + "Permission:Update": "更新", + "Permission:Delete": "刪除", + "Menu:EasyAbpEShop": "EShop 商城", + "Menu:PromotionManagement": "優惠活動", + "Menu:Promotion": "優惠策略", + "Promotion": "優惠策略", + "PromotionStoreId": "店鋪 ID", + "PromotionPromotionType": "優惠策略類型", + "PromotionUniqueName": "唯一編號", + "PromotionDisplayName": "顯示名稱", + "PromotionConfigurations": "配置", + "PromotionFromTime": "生效時間", + "PromotionToTime": "結束時間", + "PromotionDisabled": "停用", + "PromotionPriority": "優先度", + "CreatePromotion": "新建", + "EditPromotion": "編輯", + "PromotionDeletionConfirmationMessage": "確認刪除優惠策略 {0}?", + "SuccessfullyDeleted": "刪除成功", + "TableFilter": "篩選器", + "EasyAbp.EShop.Plugins.Promotions:DuplicatePromotionUniqueName": "重複的優惠策略唯一編號", + "EasyAbp.EShop.Plugins.Promotions:InvalidPromotionType": "不正確的優惠策略類型", + "EasyAbp.EShop.Plugins.Promotions:InvalidPromotionConfigurations": "不正確的優惠策略配置" } } \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsConsts.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsConsts.cs new file mode 100644 index 00000000..5556d5b8 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsConsts.cs @@ -0,0 +1,8 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +public static class PromotionConsts +{ + public static string PromotionDiscountName { get; set; } = "Promotion"; + + public static string PromotionEffectGroup { get; set; } = "Promotion"; +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs index ec39ee5a..286388f3 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs @@ -2,5 +2,10 @@ public static class PromotionsErrorCodes { - //Add your business exception error codes here... -} + public const string DuplicatePromotionUniqueName = "EasyAbp.EShop.Plugins.Promotions:DuplicatePromotionUniqueName"; + + public const string InvalidPromotionType = "EasyAbp.EShop.Plugins.Promotions:InvalidPromotionType"; + + public const string InvalidPromotionConfigurations = + "EasyAbp.EShop.Plugins.Promotions:InvalidPromotionConfigurations"; +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj index 10cf83ed..5cb132de 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj @@ -3,13 +3,17 @@ - netstandard2.0 + net7.0 enable + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs index b380c9d0..14b3a4cd 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs @@ -1,13 +1,16 @@ -using Volo.Abp.Domain; +using EasyAbp.EShop.Orders; +using EasyAbp.EShop.Products; +using Volo.Abp.Domain; using Volo.Abp.Modularity; namespace EasyAbp.EShop.Plugins.Promotions; [DependsOn( typeof(AbpDddDomainModule), - typeof(EShopPluginsPromotionsDomainSharedModule) + typeof(EShopPluginsPromotionsDomainSharedModule), + typeof(EShopProductsDomainSharedModule), + typeof(EShopOrdersDomainSharedModule) )] public class EShopPluginsPromotionsDomainModule : AbpModule { - -} +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Options/EShopPluginsPromotionsOptions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Options/EShopPluginsPromotionsOptions.cs new file mode 100644 index 00000000..153dc119 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Options/EShopPluginsPromotionsOptions.cs @@ -0,0 +1,6 @@ +namespace EasyAbp.EShop.Plugins.Promotions.Options; + +public class EShopPluginsPromotionsOptions +{ + public PromotionTypeConfigurations PromotionTypes { get; set; } = new(); +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Options/PromotionTypeConfigurations.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Options/PromotionTypeConfigurations.cs new file mode 100644 index 00000000..2c2b6186 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Options/PromotionTypeConfigurations.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using System.Linq; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes; + +namespace EasyAbp.EShop.Plugins.Promotions.Options; + +public class PromotionTypeConfigurations +{ + private Dictionary PromotionTypes { get; } = new(); + + public List GetAll() + { + return PromotionTypes.Values.ToList(); + } + + public PromotionTypeDefinition? GetOrNull(string promotionTypeName) + { + return PromotionTypes.TryGetValue(promotionTypeName, out var type) ? type : null; + } + + public void AddOrUpdate(PromotionTypeDefinition definition) + { + PromotionTypes[definition.Name] = definition; + } + + public void Remove(string promotionTypeName) + { + PromotionTypes.Remove(promotionTypeName); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/HasProductScopesExtensions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/HasProductScopesExtensions.cs new file mode 100644 index 00000000..4d355746 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/HasProductScopesExtensions.cs @@ -0,0 +1,14 @@ +using System; +using System.Linq; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes; + +public static class HasProductScopesExtensions +{ + public static bool IsInScope(this IHasProductScopes scopes, string productGroupName, Guid productId, + Guid productSkuId) + { + return scopes.ProductScopes.Any(x => + x.ProductGroupName == productGroupName || x.ProductId == productId || x.ProductSkuId == productSkuId); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/IHasProductScopes.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/IHasProductScopes.cs new file mode 100644 index 00000000..35e08b89 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/IHasProductScopes.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes; + +public interface IHasProductScopes +{ + List ProductScopes { get; } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/IPromotionHandler.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/IPromotionHandler.cs new file mode 100644 index 00000000..603b73a9 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/IPromotionHandler.cs @@ -0,0 +1,17 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Products.Products; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes; + +public interface IPromotionHandler +{ + Task HandleProductAsync(ProductDiscountContext context, Promotion promotion); + + Task HandleOrderAsync(OrderDiscountContext context, Promotion promotion); + + Task CreateConfigurationsObjectOrNullAsync(); + + bool IsConfigurationValid(string configurations); +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountConfigurations.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountConfigurations.cs new file mode 100644 index 00000000..6f6348ae --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountConfigurations.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes.MinQuantityOrderDiscount; + +public class MinQuantityOrderDiscountConfigurations +{ + public List Discounts { get; set; } = new(); +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountModel.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountModel.cs new file mode 100644 index 00000000..7965f1d4 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountModel.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using EasyAbp.EShop.Products.Products; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes.MinQuantityOrderDiscount; + +public class MinQuantityOrderDiscountModel : IHasProductScopes, IHasDynamicDiscountAmount +{ + public List ProductScopes { get; set; } = new(); + + /// + /// This discount takes effect when the quantity of the order line equals to or greater than . + /// It's important to note that this promotion type only applies to one OrderLine. + /// The promotion will not apply if you have multiple OrderLines and the total quantity of all OrderLines meets the condition. + /// + public int MinQuantity { get; set; } + + public DynamicDiscountAmountModel DynamicDiscountAmount { get; set; } + + public MinQuantityOrderDiscountModel() + { + } + + public MinQuantityOrderDiscountModel(List productScopes, int minQuantity, + DynamicDiscountAmountModel dynamicDiscountAmount) + { + if (!productScopes.IsNullOrEmpty()) + { + ProductScopes = productScopes; + } + + MinQuantity = minQuantity; + DynamicDiscountAmount = Check.NotNull(dynamicDiscountAmount, nameof(dynamicDiscountAmount)); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountPromotionHandler.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountPromotionHandler.cs new file mode 100644 index 00000000..a853c812 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountPromotionHandler.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Products.Products; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Json; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes.MinQuantityOrderDiscount; + +public class MinQuantityOrderDiscountPromotionHandler : PromotionHandlerBase, IScopedDependency +{ + public static string MinQuantityOrderDiscountPromotionTypeName { get; set; } = "MinQuantityOrderDiscount"; + + public MinQuantityOrderDiscountPromotionHandler(IJsonSerializer jsonSerializer) : base(jsonSerializer) + { + } + + public override Task HandleProductAsync(ProductDiscountContext context, Promotion promotion) + { + foreach (var discountModel in GetConfigurations(promotion).Discounts) + { + if (!discountModel.IsInScope(context.Product.ProductGroupName, context.Product.Id, context.ProductSku.Id)) + { + continue; + } + + var newDiscount = new OrderDiscountPreviewInfoModel(PromotionConsts.PromotionEffectGroup, + PromotionConsts.PromotionDiscountName, promotion.UniqueName, promotion.DisplayName, promotion.FromTime, + promotion.ToTime); + + context.OrderDiscountPreviews.Add(newDiscount); + } + + return Task.CompletedTask; + } + + public override Task HandleOrderAsync(OrderDiscountContext context, Promotion promotion) + { + foreach (var discountModel in GetConfigurations(promotion).Discounts) + { + if (context.Order.Currency != discountModel.DynamicDiscountAmount.Currency) + { + continue; + } + + foreach (var orderLine in context.Order.OrderLines) + { + if (discountModel.MinQuantity > orderLine.Quantity) + { + continue; + } + + if (!discountModel.IsInScope(orderLine.ProductGroupName, orderLine.ProductId, orderLine.ProductSkuId)) + { + continue; + } + + var dynamicDiscountAmountModel = new DynamicDiscountAmountModel( + discountModel.DynamicDiscountAmount.Currency, + discountModel.DynamicDiscountAmount.DiscountAmount * orderLine.Quantity, + discountModel.DynamicDiscountAmount.DiscountRate, + discountModel.DynamicDiscountAmount.CalculatorName); + + context.CandidateDiscounts.Add(new OrderDiscountInfoModel(new List { orderLine.Id }, + PromotionConsts.PromotionEffectGroup, PromotionConsts.PromotionDiscountName, promotion.UniqueName, + promotion.DisplayName, dynamicDiscountAmountModel)); + } + } + + return Task.CompletedTask; + } + + public override Task CreateConfigurationsObjectOrNullAsync() + { + var configuration = new MinQuantityOrderDiscountConfigurations(); + + configuration.Discounts.Add(new MinQuantityOrderDiscountModel(new List { new() }, + 2, new DynamicDiscountAmountModel("USD", 0m, 0m, null))); + + return Task.FromResult(configuration); + } + + public override bool IsConfigurationValid(string configurations) + { + return JsonSerializer.Deserialize(configurations) is not null; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountPromotionTypeConfigurationsExtensions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountPromotionTypeConfigurationsExtensions.cs new file mode 100644 index 00000000..428fcbe9 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/MinQuantityOrderDiscount/MinQuantityOrderDiscountPromotionTypeConfigurationsExtensions.cs @@ -0,0 +1,13 @@ +using EasyAbp.EShop.Plugins.Promotions.Options; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes.MinQuantityOrderDiscount; + +public static class MinQuantityOrderDiscountPromotionTypeConfigurationsExtensions +{ + public static void AddMinQuantityOrderDiscountPromotionType(this PromotionTypeConfigurations configurations) + { + configurations.AddOrUpdate(new PromotionTypeDefinition( + MinQuantityOrderDiscountPromotionHandler.MinQuantityOrderDiscountPromotionTypeName, + typeof(MinQuantityOrderDiscountPromotionHandler))); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/ProductScopeModel.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/ProductScopeModel.cs new file mode 100644 index 00000000..a58601a9 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/ProductScopeModel.cs @@ -0,0 +1,35 @@ +using System; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes; + +public class ProductScopeModel +{ + /// + /// The specified product group is affected when this property is set. + /// + public string? ProductGroupName { get; set; } + + /// + /// The specified product (including all SKUs) is affected when this property is set. + /// + public Guid? ProductId { get; set; } + + /// + /// The specified product SKU is affected when this property is set. + /// + public Guid? ProductSkuId { get; set; } + + public string? CustomScope { get; set; } + + public ProductScopeModel() + { + } + + public ProductScopeModel(string? productGroupName, Guid? productId, Guid? productSkuId, string? customScope) + { + ProductGroupName = productGroupName; + ProductId = productId; + ProductSkuId = productSkuId; + CustomScope = customScope; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/PromotionHandlerBase.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/PromotionHandlerBase.cs new file mode 100644 index 00000000..e2207bf8 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/PromotionHandlerBase.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Products.Products; +using Volo.Abp.Json; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes; + +public abstract class PromotionHandlerBase : IPromotionHandler +{ + protected ConcurrentDictionary ConfigurationCaches { get; } = new(); + + protected IJsonSerializer JsonSerializer { get; } + + public PromotionHandlerBase(IJsonSerializer jsonSerializer) + { + JsonSerializer = jsonSerializer; + } + + public abstract Task HandleProductAsync(ProductDiscountContext context, Promotion promotion); + + public abstract Task HandleOrderAsync(OrderDiscountContext context, Promotion promotion); + + public abstract Task CreateConfigurationsObjectOrNullAsync(); + + public abstract bool IsConfigurationValid(string configurations); + + protected virtual TConfigurations GetConfigurations(Promotion promotion) + { + if (promotion.Configurations.IsNullOrWhiteSpace()) + { + return CreateEmptyConfigurations(); + } + + var cachedConfigurations = ConfigurationCaches.GetOrAdd(promotion.Configurations, + JsonSerializer.Deserialize(promotion.Configurations)); + + return cachedConfigurations is not null + ? (TConfigurations)cachedConfigurations + : CreateEmptyConfigurations(); + } + + protected virtual TConfigurations CreateEmptyConfigurations() + { + return JsonSerializer.Deserialize("{}"); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/PromotionTypeDefinition.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/PromotionTypeDefinition.cs new file mode 100644 index 00000000..19456aa3 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/PromotionTypeDefinition.cs @@ -0,0 +1,16 @@ +using System; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes; + +public class PromotionTypeDefinition +{ + public string Name { get; } + + public Type PromotionHandlerType { get; } + + public PromotionTypeDefinition(string name, Type promotionHandlerType) + { + Name = name; + PromotionHandlerType = promotionHandlerType; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountConfigurations.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountConfigurations.cs new file mode 100644 index 00000000..23c393d2 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountConfigurations.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes.SimpleProductDiscount; + +public class SimpleProductDiscountConfigurations +{ + public List Discounts { get; set; } = new(); +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountModel.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountModel.cs new file mode 100644 index 00000000..4fadf400 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountModel.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using EasyAbp.EShop.Products.Products; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes.SimpleProductDiscount; + +public class SimpleProductDiscountModel : IHasProductScopes, IHasDynamicDiscountAmount +{ + public List ProductScopes { get; set; } = new(); + + public DynamicDiscountAmountModel DynamicDiscountAmount { get; set; } + + public SimpleProductDiscountModel() + { + } + + public SimpleProductDiscountModel(List productScopes, + DynamicDiscountAmountModel dynamicDiscountAmount) + { + if (!productScopes.IsNullOrEmpty()) + { + ProductScopes = productScopes; + } + + DynamicDiscountAmount = Check.NotNull(dynamicDiscountAmount, nameof(dynamicDiscountAmount)); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountPromotionHandler.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountPromotionHandler.cs new file mode 100644 index 00000000..6d056109 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountPromotionHandler.cs @@ -0,0 +1,62 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Products.Products; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Json; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes.SimpleProductDiscount; + +public class SimpleProductDiscountPromotionHandler : PromotionHandlerBase, IScopedDependency +{ + public static string SimpleProductDiscountPromotionTypeName { get; set; } = "SimpleProductDiscount"; + + public SimpleProductDiscountPromotionHandler(IJsonSerializer jsonSerializer) : base(jsonSerializer) + { + } + + public override Task HandleProductAsync(ProductDiscountContext context, Promotion promotion) + { + foreach (var discountModel in GetConfigurations(promotion).Discounts) + { + if (context.ProductSku.Currency != discountModel.DynamicDiscountAmount.Currency) + { + continue; + } + + if (!discountModel.IsInScope(context.Product.ProductGroupName, context.Product.Id, context.ProductSku.Id)) + { + continue; + } + + var discount = new CandidateProductDiscountInfoModel(PromotionConsts.PromotionEffectGroup, + PromotionConsts.PromotionDiscountName, promotion.UniqueName, promotion.DisplayName, + discountModel.DynamicDiscountAmount, promotion.FromTime, promotion.ToTime); + + context.CandidateProductDiscounts.Add(discount); + } + + return Task.CompletedTask; + } + + public override Task HandleOrderAsync(OrderDiscountContext context, Promotion promotion) + { + return Task.CompletedTask; + } + + public override Task CreateConfigurationsObjectOrNullAsync() + { + var configuration = new SimpleProductDiscountConfigurations(); + + configuration.Discounts.Add(new SimpleProductDiscountModel(new List { new() }, + new DynamicDiscountAmountModel("USD", 0m, 0m, null))); + + return Task.FromResult(configuration); + } + + public override bool IsConfigurationValid(string configurations) + { + return JsonSerializer.Deserialize(configurations) is not null; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountPromotionTypeConfigurationsExtensions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountPromotionTypeConfigurationsExtensions.cs new file mode 100644 index 00000000..9dffa73a --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionTypes/SimpleProductDiscount/SimpleProductDiscountPromotionTypeConfigurationsExtensions.cs @@ -0,0 +1,13 @@ +using EasyAbp.EShop.Plugins.Promotions.Options; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes.SimpleProductDiscount; + +public static class SimpleProductDiscountPromotionTypeConfigurationsExtensions +{ + public static void AddSimpleProductDiscountPromotionType(this PromotionTypeConfigurations configurations) + { + configurations.AddOrUpdate(new PromotionTypeDefinition( + SimpleProductDiscountPromotionHandler.SimpleProductDiscountPromotionTypeName, + typeof(SimpleProductDiscountPromotionHandler))); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionRepository.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionRepository.cs new file mode 100644 index 00000000..570df9cc --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/IPromotionRepository.cs @@ -0,0 +1,8 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public interface IPromotionRepository : IRepository +{ +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/Promotion.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/Promotion.cs new file mode 100644 index 00000000..5d5735c7 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/Promotion.cs @@ -0,0 +1,70 @@ +using System; +using EasyAbp.EShop.Stores.Stores; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public class Promotion : FullAuditedAggregateRoot, IMultiTenant, IMultiStore +{ + public virtual Guid? TenantId { get; protected set; } + + public virtual Guid StoreId { get; protected set; } + + /// + /// Value of the promotion type name. It is used as the DiscountName (with EffectGroup == `Promotion`) + /// + /// SimpleProductDiscount + public virtual string PromotionType { get; protected set; } + + /// + /// An immutable and unique name for the promotion. It is used as the DiscountKey (with EffectGroup == `Promotion`). + /// + public virtual string UniqueName { get; protected set; } + + public virtual string DisplayName { get; protected set; } + + /// + /// The promotion type-specific serialized configurations value. + /// + public virtual string Configurations { get; protected set; } + + public virtual DateTime? FromTime { get; protected set; } + + public virtual DateTime? ToTime { get; protected set; } + + public virtual bool Disabled { get; protected set; } + + public virtual int Priority { get; protected set; } + + protected Promotion() + { + } + + internal Promotion(Guid id, Guid? tenantId, Guid storeId, string promotionType, string uniqueName, + string displayName, string configurations, DateTime? fromTime, DateTime? toTime, bool disabled, + int priority) : base(id) + { + TenantId = tenantId; + StoreId = storeId; + PromotionType = promotionType; + UniqueName = uniqueName; + DisplayName = displayName; + Configurations = configurations; + FromTime = fromTime; + ToTime = toTime; + Disabled = disabled; + Priority = priority; + } + + internal void Update(string displayName, string configurations, DateTime? fromTime, DateTime? toTime, bool disabled, + int priority) + { + DisplayName = displayName; + Configurations = configurations; + FromTime = fromTime; + ToTime = toTime; + Disabled = disabled; + Priority = priority; + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionManager.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionManager.cs new file mode 100644 index 00000000..53328fc9 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionManager.cs @@ -0,0 +1,68 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Options; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes; +using Microsoft.Extensions.Options; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Volo.Abp; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Domain.Services; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public class PromotionManager : DomainService +{ + protected IPromotionRepository Repository => LazyServiceProvider.LazyGetRequiredService(); + + protected EShopPluginsPromotionsOptions Options => + LazyServiceProvider.LazyGetRequiredService>().Value; + + [UnitOfWork] + public virtual async Task CreateAsync(Guid storeId, string promotionType, string uniqueName, + string displayName, string configurations, DateTime? fromTime, DateTime? toTime, bool disabled, int priority) + { + if (await Repository.AnyAsync(x => x.StoreId == storeId && x.UniqueName == uniqueName)) + { + throw new BusinessException(PromotionsErrorCodes.DuplicatePromotionUniqueName); + } + + return new Promotion(GuidGenerator.Create(), CurrentTenant.Id, storeId, promotionType, uniqueName, displayName, + VerifyAndMinifyConfigurations(promotionType, configurations), fromTime, toTime, disabled, priority); + } + + public virtual Task UpdateAsync(Promotion promotion, string displayName, string configurations, + DateTime? fromTime, DateTime? toTime, bool disabled, int priority) + { + promotion.Update(displayName, configurations, fromTime, toTime, disabled, priority); + + return Task.CompletedTask; + } + + protected virtual string VerifyAndMinifyConfigurations(string promotionType, string inputConfigurations) + { + var promotionTypeDefinition = Options.PromotionTypes.GetOrNull(promotionType); + + if (promotionTypeDefinition is null) + { + throw new BusinessException(PromotionsErrorCodes.InvalidPromotionType); + } + + var handler = GetPromotionHandler(promotionTypeDefinition); + + var formattedJson = JToken.Parse(inputConfigurations).ToString(Formatting.None); + + if (!handler.IsConfigurationValid(formattedJson)) + { + throw new BusinessException(PromotionsErrorCodes.InvalidPromotionConfigurations); + } + + return formattedJson; + } + + protected virtual IPromotionHandler GetPromotionHandler(PromotionTypeDefinition definition) + { + return (IPromotionHandler)LazyServiceProvider.LazyGetRequiredService(definition.PromotionHandlerType); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs index cf2dcebb..3d554d79 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Modularity; @@ -17,6 +18,7 @@ public class EShopPluginsPromotionsEntityFrameworkCoreModule : AbpModule /* Add custom repositories here. Example: * options.AddRepository(); */ + options.AddRepository(); }); } } diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs index 848c9467..0d3f6fa3 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs @@ -1,5 +1,7 @@ -using Volo.Abp.Data; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using EasyAbp.EShop.Plugins.Promotions.Promotions; namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; @@ -9,4 +11,5 @@ public interface IPromotionsDbContext : IEfCoreDbContext /* Add DbSet for each Aggregate Root here. Example: * DbSet Questions { get; } */ + DbSet Promotions { get; set; } } diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs index e3b282a6..86dfb14c 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using EasyAbp.EShop.Plugins.Promotions.Promotions; namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; @@ -10,6 +11,7 @@ public class PromotionsDbContext : AbpDbContext, IPromotion /* Add DbSet for each Aggregate Root here. Example: * public DbSet Questions { get; set; } */ + public DbSet Promotions { get; set; } public PromotionsDbContext(DbContextOptions options) : base(options) diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs index 4dad1816..14b79412 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs @@ -1,5 +1,7 @@ -using Microsoft.EntityFrameworkCore; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using Microsoft.EntityFrameworkCore; using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; @@ -29,5 +31,15 @@ public static class PromotionsDbContextModelCreatingExtensions b.HasIndex(q => q.CreationTime); }); */ + + + builder.Entity(b => + { + b.ToTable(PromotionsDbProperties.DbTablePrefix + "Promotions", PromotionsDbProperties.DbSchema); + b.ConfigureByConvention(); + + + /* Configure more properties here */ + }); } } diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionEfCoreQuerableExtensions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionEfCoreQuerableExtensions.cs new file mode 100644 index 00000000..715b03ee --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionEfCoreQuerableExtensions.cs @@ -0,0 +1,19 @@ +using System.Linq; +using Microsoft.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public static class PromotionEfCoreQueryableExtensions +{ + public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) + { + if (!include) + { + return queryable; + } + + return queryable + // .Include(x => x.xxx) // TODO: AbpHelper generated + ; + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionRepository.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionRepository.cs new file mode 100644 index 00000000..decaa54e --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionRepository.cs @@ -0,0 +1,20 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public class PromotionRepository : EfCoreRepository, IPromotionRepository +{ + public PromotionRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public override async Task> WithDetailsAsync() + { + return (await GetQueryableAsync()).IncludeDetails(); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs index b347384e..507d323f 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs @@ -14,7 +14,7 @@ public class EShopPluginsPromotionsHttpApiClientModule : AbpModule { context.Services.AddHttpClientProxies( typeof(EShopPluginsPromotionsApplicationContractsModule).Assembly, - PromotionsRemoteServiceConsts.RemoteServiceName + EShopPluginsPromotionsRemoteServiceConsts.RemoteServiceName ); Configure(options => diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionController.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionController.cs new file mode 100644 index 00000000..61889714 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/Promotions/PromotionController.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +[RemoteService(Name = EShopPluginsPromotionsRemoteServiceConsts.RemoteServiceName)] +[Route("/api/e-shop/plugins/promotions/promotion")] +public class PromotionController : PromotionsController, IPromotionAppService +{ + private readonly IPromotionAppService _service; + + public PromotionController(IPromotionAppService service) + { + _service = service; + } + + [HttpGet] + [Route("{id}")] + public virtual Task GetAsync(Guid id) + { + return _service.GetAsync(id); + } + + [HttpGet] + public virtual Task> GetListAsync(PromotionGetListInput input) + { + return _service.GetListAsync(input); + } + + [HttpPost] + public virtual Task CreateAsync(CreatePromotionDto input) + { + return _service.CreateAsync(input); + } + + [HttpPut] + [Route("{id}")] + public virtual Task UpdateAsync(Guid id, UpdatePromotionDto input) + { + return _service.UpdateAsync(id, input); + } + + [HttpDelete] + [Route("{id}")] + public virtual Task DeleteAsync(Guid id) + { + return _service.DeleteAsync(id); + } + + [HttpGet] + [Route("promotion-types")] + public virtual Task> GetPromotionTypesAsync() + { + return _service.GetPromotionTypesAsync(); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj index 565089bd..201536c1 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj @@ -3,7 +3,7 @@ - netstandard2.0 + net7.0 enable @@ -13,8 +13,4 @@ - - - - diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs index e3a5f917..c57c13ab 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs @@ -9,11 +9,13 @@ using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; using EasyAbp.EShop.Plugins.Promotions.Permissions; +using EasyAbp.EShop.Stores; namespace EasyAbp.EShop.Plugins.Promotions.Web; [DependsOn( typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(EShopStoresWebSharedModule), typeof(AbpAspNetCoreMvcUiThemeSharedModule), typeof(AbpAutoMapperModule) )] diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj index 8c4ef6e9..f6d757c2 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj @@ -13,11 +13,13 @@ + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs index 545921a6..3ea25399 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs @@ -1,4 +1,9 @@ -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Localization; +using EasyAbp.EShop.Plugins.Promotions.Permissions; +using EasyAbp.EShop.Stores.Stores; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.UI.Navigation; namespace EasyAbp.EShop.Plugins.Promotions.Web.Menus; @@ -13,10 +18,31 @@ public class PromotionsMenuContributor : IMenuContributor } } - private Task ConfigureMainMenuAsync(MenuConfigurationContext context) + private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { - //Add main menu items. + var l = context.GetLocalizer(); - return Task.CompletedTask; + var promotionMenuItem = new ApplicationMenuItem(PromotionsMenus.Prefix, l["Menu:PromotionManagement"]); + + var uiDefaultStoreProvider = context.ServiceProvider.GetRequiredService(); + + var defaultStore = (await uiDefaultStoreProvider.GetAsync())?.Id; + + if (await context.IsGrantedAsync(PromotionsPermissions.Promotion.Default)) + { + promotionMenuItem.AddItem( + new ApplicationMenuItem(PromotionsMenus.Promotion, l["Menu:Promotion"], + "/EShop/Plugins/Promotions/Promotions/Promotion?storeId=" + defaultStore) + ); + } + + if (!promotionMenuItem.Items.IsNullOrEmpty()) + { + var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == PromotionsMenus.ModuleGroupPrefix, + () => new ApplicationMenuItem(PromotionsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"], + icon: "fa fa-badge-percent")); + + eShopMenuItem.Items.Add(promotionMenuItem); + } } -} +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs index df493461..d47aea74 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs @@ -2,9 +2,12 @@ public class PromotionsMenus { - public const string Prefix = "EasyAbp.EShop.Plugins.Promotions"; + public const string ModuleGroupPrefix = "EasyAbp.EShop"; + + public const string Prefix = ModuleGroupPrefix + ".Plugins.Promotions"; //Add your menu items here... //public const string Home = Prefix + ".MyNewMenuItem"; -} + public const string Promotion = Prefix + ".Promotion"; +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/CreateModal.cshtml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/CreateModal.cshtml new file mode 100644 index 00000000..ee93d31b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/CreateModal.cshtml @@ -0,0 +1,18 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@using EasyAbp.EShop.Plugins.Promotions.Localization +@inject IHtmlLocalizer L +@model EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/CreateModal.cshtml.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/CreateModal.cshtml.cs new file mode 100644 index 00000000..10c31914 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/CreateModal.cshtml.cs @@ -0,0 +1,39 @@ +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion.ViewModels; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion; + +public class CreateModalModel : PromotionEntityPageModelBase +{ + [BindProperty(SupportsGet = true)] + public CreatePromotionViewModel ViewModel { get; set; } + + protected override async Task InternalOnGetAsync() + { + PromotionTypes = (await Service.GetPromotionTypesAsync()).Items.ToDictionary(x => x.Name); + + PromotionTypeSelectListItems = + PromotionTypes.Values.Select(x => new SelectListItem(x.DisplayName, x.Name)).ToList(); + + var beautifiedConfigurations = JToken.Parse(PromotionTypes[ViewModel.PromotionType].ConfigurationsTemplate) + .ToString(Formatting.Indented); + + ViewModel.Configurations = beautifiedConfigurations; + } + + public virtual async Task OnPostAsync() + { + var dto = new CreatePromotionDto(ViewModel.StoreId, ViewModel.PromotionType, ViewModel.UniqueName, + ViewModel.DisplayName, ViewModel.Configurations, ViewModel.FromTime, ViewModel.ToTime, ViewModel.Disabled, + ViewModel.Priority); + + await Service.CreateAsync(dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/EditModal.cshtml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/EditModal.cshtml new file mode 100644 index 00000000..35855cb1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/EditModal.cshtml @@ -0,0 +1,19 @@ +@page +@using EasyAbp.EShop.Plugins.Promotions.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/EditModal.cshtml.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/EditModal.cshtml.cs new file mode 100644 index 00000000..477a4352 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/EditModal.cshtml.cs @@ -0,0 +1,40 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion.ViewModels; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion; + +public class EditModalModel : PromotionEntityPageModelBase +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public EditPromotionViewModel ViewModel { get; set; } + + protected override async Task InternalOnGetAsync() + { + var dto = await Service.GetAsync(Id); + + ViewModel = ObjectMapper.Map(dto); + + var beautifiedConfigurations = JToken.Parse(ViewModel.Configurations).ToString(Formatting.Indented); + + ViewModel.Configurations = beautifiedConfigurations; + } + + public virtual async Task OnPostAsync() + { + var dto = new UpdatePromotionDto(ViewModel.DisplayName, ViewModel.Configurations, ViewModel.FromTime, + ViewModel.ToTime, ViewModel.Disabled, ViewModel.Priority); + + await Service.UpdateAsync(Id, dto); + + return NoContent(); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/Index.cshtml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/Index.cshtml new file mode 100644 index 00000000..401a29a1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/Index.cshtml @@ -0,0 +1,71 @@ +@page +@using EasyAbp.EShop.Plugins.Promotions.Permissions +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using EasyAbp.EShop.Plugins.Promotions.Localization +@using EasyAbp.EShop.Plugins.Promotions.Web.Menus +@model EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion.IndexModel +@inject IPageLayout PageLayout +@inject IHtmlLocalizer L +@inject IAuthorizationService Authorization +@{ + PageLayout.Content.Title = L["Promotion"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:Promotion"].Value); + PageLayout.Content.MenuItemName = PromotionsMenus.Promotion; + + var cardTitle = L["Promotion"].Value; + + if (Model.StoreName != null) + { + cardTitle += $" - {Model.StoreName}"; + } +} + +@section scripts +{ + +} + +@section styles +{ + +} + + + + + + + + @cardTitle + + + @if (await Authorization.IsGrantedAsync(PromotionsPermissions.Promotion.Create)) + { + + + + @foreach (var promotionType in Model.PromotionTypes.Values) + { + @promotionType.DisplayName + } + + + } + + + + + + @L["TableFilter"] + + + +
+
+ +
+
\ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/Index.cshtml.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/Index.cshtml.cs new file mode 100644 index 00000000..27bfac9a --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/Index.cshtml.cs @@ -0,0 +1,72 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Stores; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion; + +public class IndexModel : PromotionEntityPageModelBase +{ + public PromotionFilterInput? PromotionFilter { get; set; } + + [BindProperty(SupportsGet = true)] + public Guid? StoreId { get; set; } + + private readonly IStoreAppService _storeAppService; + + public string? StoreName { get; set; } + + public IndexModel(IStoreAppService storeAppService) + { + _storeAppService = storeAppService; + } + + protected override async Task InternalOnGetAsync() + { + if (StoreId.HasValue) + { + StoreName = (await _storeAppService.GetAsync(StoreId.Value)).Name; + } + + PromotionTypes = (await Service.GetPromotionTypesAsync()).Items.ToDictionary(x => x.Name); + + PromotionTypeSelectListItems = + PromotionTypes.Values.Select(x => new SelectListItem(x.DisplayName, x.Name)).ToList(); + } +} + +public class PromotionFilterInput +{ + [FormControlSize(AbpFormControlSize.Small)] + [Display(Name = "PromotionStoreId")] + public Guid? StoreId { get; set; } + + [SelectItems(nameof(PromotionEntityPageModelBase.PromotionTypeSelectListItems))] + [FormControlSize(AbpFormControlSize.Small)] + [Display(Name = "PromotionPromotionType")] + public string? PromotionType { get; set; } + + [FormControlSize(AbpFormControlSize.Small)] + [Display(Name = "PromotionUniqueName")] + public string? UniqueName { get; set; } + + [FormControlSize(AbpFormControlSize.Small)] + [Display(Name = "PromotionDisplayName")] + public string? DisplayName { get; set; } + + [FormControlSize(AbpFormControlSize.Small)] + [Display(Name = "PromotionFromTime")] + public DateTime? FromTime { get; set; } + + [FormControlSize(AbpFormControlSize.Small)] + [Display(Name = "PromotionToTime")] + public DateTime? ToTime { get; set; } + + [FormControlSize(AbpFormControlSize.Small)] + [Display(Name = "PromotionDisabled")] + public bool? Disabled { get; set; } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/PromotionEntityPageModelBase.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/PromotionEntityPageModelBase.cs new file mode 100644 index 00000000..5a3bd255 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/PromotionEntityPageModelBase.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using Microsoft.AspNetCore.Mvc.Rendering; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion; + +public abstract class PromotionEntityPageModelBase : PromotionsPageModel +{ + public List PromotionTypeSelectListItems { get; set; } + public Dictionary PromotionTypes { get; set; } + + protected IPromotionAppService Service => LazyServiceProvider.LazyGetRequiredService(); + + public virtual async Task OnGetAsync() + { + PromotionTypes = (await Service.GetPromotionTypesAsync()).Items.ToDictionary(x => x.Name); + + PromotionTypeSelectListItems = + PromotionTypes.Values.Select(x => new SelectListItem(x.DisplayName, x.Name)).ToList(); + + await InternalOnGetAsync(); + } + + protected abstract Task InternalOnGetAsync(); +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/ViewModels/CreatePromotionViewModel.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/ViewModels/CreatePromotionViewModel.cs new file mode 100644 index 00000000..56d7a4d5 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/ViewModels/CreatePromotionViewModel.cs @@ -0,0 +1,44 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion.ViewModels; + +public class CreatePromotionViewModel +{ + [HiddenInput] + [Display(Name = "PromotionStoreId")] + public Guid StoreId { get; set; } + + [Required] + [ReadOnlyInput] + [Display(Name = "PromotionPromotionType")] + [SelectItems(nameof(PromotionEntityPageModelBase.PromotionTypeSelectListItems))] + public string PromotionType { get; set; } + + [Required] + [Display(Name = "PromotionUniqueName")] + public string UniqueName { get; set; } + + [Required] + [Display(Name = "PromotionDisplayName")] + public string DisplayName { get; set; } + + [Required] + [Display(Name = "PromotionConfigurations")] + [TextArea(Rows = 5)] + public string Configurations { get; set; } + + [Display(Name = "PromotionFromTime")] + public DateTime? FromTime { get; set; } + + [Display(Name = "PromotionToTime")] + public DateTime? ToTime { get; set; } + + [Display(Name = "PromotionDisabled")] + public bool Disabled { get; set; } + + [Display(Name = "PromotionPriority")] + public int Priority { get; set; } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/ViewModels/EditPromotionViewModel.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/ViewModels/EditPromotionViewModel.cs new file mode 100644 index 00000000..e88d8a58 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/ViewModels/EditPromotionViewModel.cs @@ -0,0 +1,35 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion.ViewModels; + +public class EditPromotionViewModel +{ + [Required] + [ReadOnlyInput] + [Display(Name = "PromotionPromotionType")] + [SelectItems(nameof(PromotionEntityPageModelBase.PromotionTypeSelectListItems))] + public string PromotionType { get; set; } + + [Required] + [Display(Name = "PromotionDisplayName")] + public string DisplayName { get; set; } + + [Required] + [Display(Name = "PromotionConfigurations")] + [TextArea(Rows = 5)] + public string Configurations { get; set; } + + [Display(Name = "PromotionFromTime")] + public DateTime? FromTime { get; set; } + + [Display(Name = "PromotionToTime")] + public DateTime? ToTime { get; set; } + + [Display(Name = "PromotionDisabled")] + public bool Disabled { get; set; } + + [Display(Name = "PromotionPriority")] + public int Priority { get; set; } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/index.css b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/index.css new file mode 100644 index 00000000..e69de29b diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/index.js b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/index.js new file mode 100644 index 00000000..8deb325f --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/EShop/Plugins/Promotions/Promotions/Promotion/index.js @@ -0,0 +1,118 @@ +$(function () { + + $("#PromotionFilter :input").on('input', function () { + dataTable.ajax.reload(); + }); + + $('#PromotionFilter div').addClass('col-sm-3').parent().addClass('row'); + + var getFilter = function () { + var input = {}; + $("#PromotionFilter") + .serializeArray() + .forEach(function (data) { + if (data.value != '') { + input[abp.utils.toCamelCase(data.name.replace(/PromotionFilter./g, ''))] = data.value; + } + }) + return input; + }; + + var l = abp.localization.getResource('EasyAbpEShopPluginsPromotions'); + + var service = easyAbp.eShop.plugins.promotions.promotions.promotion; + var createModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Promotions/Promotions/Promotion/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Promotions/Promotions/Promotion/EditModal'); + + var dataTable = $('#PromotionTable').DataTable(abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: true, + searching: false,//disable default searchbox + autoWidth: false, + scrollCollapse: true, + order: [[0, "asc"]], + ajax: abp.libs.datatables.createAjax(service.getList, function () { + return { storeId: storeId } + }), + columnDefs: [ + { + rowAction: { + items: + [ + { + text: l('Edit'), + visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Promotions.Promotion.Update'), + action: function (data) { + editModal.open({id: data.record.id}); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Promotions.Promotion.Delete'), + confirmMessage: function (data) { + return l('PromotionDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + title: l('PromotionStoreId'), + data: "storeId" + }, + { + title: l('PromotionPromotionType'), + data: "promotionType" + }, + { + title: l('PromotionUniqueName'), + data: "uniqueName" + }, + { + title: l('PromotionDisplayName'), + data: "displayName" + }, + { + title: l('PromotionFromTime'), + data: "fromTime" + }, + { + title: l('PromotionToTime'), + data: "toTime" + }, + { + title: l('PromotionDisabled'), + data: "disabled" + }, + { + title: l('PromotionPriority'), + data: "priority" + }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewPromotionButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); + $('.NewPromotionButton').click(function (e) { + e.preventDefault(); + createModal.open({"ViewModel.storeId": storeId, "ViewModel.promotionType": $(this).attr('promotion-type')}); + }); +}); diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs index 8dcc71f2..ad234751 100644 --- a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs @@ -1,4 +1,6 @@ -using AutoMapper; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using AutoMapper; +using EasyAbp.EShop.Plugins.Promotions.Web.Pages.EShop.Plugins.Promotions.Promotions.Promotion.ViewModels; namespace EasyAbp.EShop.Plugins.Promotions.Web; @@ -9,5 +11,6 @@ public class PromotionsWebAutoMapperProfile : Profile /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ + CreateMap(); } } diff --git a/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp.EShop.Products.Plugins.Promotions.Domain.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp.EShop.Products.Plugins.Promotions.Domain.abppkg.json new file mode 100644 index 00000000..1d574efe --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp.EShop.Products.Plugins.Promotions.Domain.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.domain" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp.EShop.Products.Plugins.Promotions.Domain.csproj b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp.EShop.Products.Plugins.Promotions.Domain.csproj new file mode 100644 index 00000000..88b5c2f5 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp.EShop.Products.Plugins.Promotions.Domain.csproj @@ -0,0 +1,16 @@ + + + + + + net7.0 + enable + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp/EShop/Products/Plugins/Promotions/EShopProductsPluginsPromotionsDomainModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp/EShop/Products/Plugins/Promotions/EShopProductsPluginsPromotionsDomainModule.cs new file mode 100644 index 00000000..f94ebb84 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp/EShop/Products/Plugins/Promotions/EShopProductsPluginsPromotionsDomainModule.cs @@ -0,0 +1,12 @@ +using EasyAbp.EShop.Plugins.Promotions; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Products.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(EShopProductsDomainModule) +)] +public class EShopProductsPluginsPromotionsDomainModule : AbpModule +{ +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp/EShop/Products/Plugins/Promotions/PromotionProductDiscountProvider.cs b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp/EShop/Products/Plugins/Promotions/PromotionProductDiscountProvider.cs new file mode 100644 index 00000000..6f72997d --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/EasyAbp/EShop/Products/Plugins/Promotions/PromotionProductDiscountProvider.cs @@ -0,0 +1,37 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Plugins.Promotions.Promotions.Dtos; +using EasyAbp.EShop.Products.Products; +using Volo.Abp.DependencyInjection; + +namespace EasyAbp.EShop.Products.Plugins.Promotions; + +public class PromotionProductDiscountProvider : IProductDiscountProvider, ITransientDependency +{ + public static int PromotionProductDiscountEffectOrder { get; set; } = 5000; + + public int EffectOrder => PromotionProductDiscountEffectOrder; + + protected IPromotionIntegrationService PromotionIntegrationService { get; } + + public PromotionProductDiscountProvider(IPromotionIntegrationService promotionIntegrationService) + { + PromotionIntegrationService = promotionIntegrationService; + } + + public virtual async Task DiscountAsync(ProductDiscountContext context) + { + var dto = await PromotionIntegrationService.DiscountProductAsync(new DiscountProductInputDto(context)); + + if (dto.Context.Equals(context)) + { + return; + } + + context.CandidateProductDiscounts.Clear(); + context.CandidateProductDiscounts.AddRange(dto.Context.CandidateProductDiscounts); + + context.OrderDiscountPreviews.Clear(); + context.OrderDiscountPreviews.AddRange(dto.Context.OrderDiscountPreviews); + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Products.Plugins.Promotions.Domain/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionTypes/MinQuantityOrderDiscountTests.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionTypes/MinQuantityOrderDiscountTests.cs new file mode 100644 index 00000000..5d1745f7 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionTypes/MinQuantityOrderDiscountTests.cs @@ -0,0 +1,137 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes.MinQuantityOrderDiscount; +using EasyAbp.EShop.Products.Products; +using Shouldly; +using Volo.Abp.Json; +using Xunit; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes; + +public class MinQuantityOrderDiscountTests : PromotionsApplicationTestBase +{ + private IJsonSerializer JsonSerializer { get; } + private PromotionManager PromotionManager { get; } + private IPromotionRepository PromotionRepository { get; } + private IOrderDiscountResolver OrderDiscountResolver { get; } + private MinQuantityOrderDiscountPromotionHandler Handler { get; } + + public MinQuantityOrderDiscountTests() + { + JsonSerializer = GetRequiredService(); + PromotionManager = GetRequiredService(); + PromotionRepository = GetRequiredService(); + OrderDiscountResolver = GetRequiredService(); + Handler = GetRequiredService(); + } + + [Fact] + public async Task Should_Add_Order_Candidate_Discount_Preview() + { + var promotion = await CreatePromotionAsync(); + + var product = new ProductEto + { + ProductGroupName = "MyProductGroup", + ProductSkus = new List + { + new() + } + }; + + var context = new ProductDiscountContext(DateTime.Now, product, product.ProductSkus.First(), 1.00m); + + await Handler.HandleProductAsync(context, promotion); + + context.OrderDiscountPreviews.Count.ShouldBe(1); + + var orderDiscount = context.OrderDiscountPreviews.First(); + orderDiscount.ShouldNotBeNull(); + orderDiscount.EffectGroup.ShouldBe(PromotionConsts.PromotionEffectGroup); + orderDiscount.DisplayName.ShouldBe("test"); + orderDiscount.FromTime.ShouldBeNull(); + orderDiscount.ToTime.ShouldBeNull(); + } + + [Fact] + public async Task Should_Discount_OrderLine_If_Quantity_Is_2() + { + var promotion = await CreatePromotionAsync(); + + var order = new Order(Guid.NewGuid(), null, PromotionsTestConsts.StoreId, Guid.NewGuid(), "USD", 2.00m, 0m, + 2.00m, 2.00m, null, null); + + order.OrderLines.Add(new OrderLine(order.Id, Guid.NewGuid(), Guid.NewGuid(), null, DateTime.Now, DateTime.Now, + "MyProductGroup", "MyProductGroup", null, "Test", InventoryStrategy.NoNeed, null, null, null, "USD", 1.00m, + 2.00m, 0.00m, 2.00m, 2)); + + var context = new OrderDiscountContext(DateTime.Now, order, new Dictionary()); + + await Handler.HandleOrderAsync(context, promotion); + + context.CandidateDiscounts.Count.ShouldBe(1); + context.CandidateDiscounts[0].EffectGroup.ShouldBe(PromotionConsts.PromotionEffectGroup); + context.CandidateDiscounts[0].Name.ShouldBe(PromotionConsts.PromotionDiscountName); + context.CandidateDiscounts[0].Key.ShouldBe(promotion.UniqueName); + context.CandidateDiscounts[0].DisplayName.ShouldBe(promotion.DisplayName); + context.CandidateDiscounts[0].AffectedOrderLineIds.Count.ShouldBe(1); + context.CandidateDiscounts[0].AffectedOrderLineIds.ShouldContain(order.OrderLines[0].Id); + + var distributionModels = await OrderDiscountResolver.ResolveAsync(order, new Dictionary()); + + distributionModels.Count.ShouldBe(1); + distributionModels[0].DiscountInfoModel.Name.ShouldBe(PromotionConsts.PromotionDiscountName); + distributionModels[0].DiscountInfoModel.Key.ShouldBe(promotion.UniqueName); + distributionModels[0].Distributions.Count.ShouldBe(1); + distributionModels[0].Distributions.First().Value.ShouldBe(0.02m); + } + + [Fact] + public async Task Should_Not_Discount_OrderLine_If_Quantity_Is_1() + { + var promotion = await CreatePromotionAsync(); + + var order = new OrderEto + { + OrderLines = new List + { + new() + { + ProductGroupName = "MyProductGroup", + Currency = "USD", + UnitPrice = 1.00m, + TotalPrice = 1.00m, + TotalDiscount = 0m, + ActualTotalPrice = 1.00m, + Quantity = 1, + } + } + }; + + var context = new OrderDiscountContext(DateTime.Now, order, new Dictionary()); + + await Handler.HandleOrderAsync(context, promotion); + + context.CandidateDiscounts.ShouldBeEmpty(); + } + + private async Task CreatePromotionAsync() + { + return await PromotionRepository.InsertAsync(await PromotionManager.CreateAsync(PromotionsTestConsts.StoreId, + MinQuantityOrderDiscountPromotionHandler.MinQuantityOrderDiscountPromotionTypeName, "test", "test", + JsonSerializer.Serialize(new MinQuantityOrderDiscountConfigurations + { + Discounts = new List + { + new(new List + { + new("MyProductGroup", null, null, null) + }, 2, new DynamicDiscountAmountModel("USD", 0.01m, 0m, null)) + } + }), null, null, false, 10000), true); + } +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionTypes/SimpleProductDiscountTests.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionTypes/SimpleProductDiscountTests.cs new file mode 100644 index 00000000..005f657c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionTypes/SimpleProductDiscountTests.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes.MinQuantityOrderDiscount; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes.SimpleProductDiscount; +using EasyAbp.EShop.Products.Products; +using Shouldly; +using Volo.Abp.Json; +using Xunit; + +namespace EasyAbp.EShop.Plugins.Promotions.PromotionTypes; + +public class SimpleProductDiscountTests : PromotionsApplicationTestBase +{ + private IJsonSerializer JsonSerializer { get; } + private PromotionManager PromotionManager { get; } + private SimpleProductDiscountPromotionHandler Handler { get; } + + public SimpleProductDiscountTests() + { + JsonSerializer = GetRequiredService(); + PromotionManager = GetRequiredService(); + Handler = GetRequiredService(); + } + + [Fact] + public async Task Should_Add_Candidate_Product_Discount() + { + var promotion = await CreatePromotionAsync(); + + var product = new ProductEto + { + ProductGroupName = "MyProductGroup", + ProductSkus = new List + { + new() + { + Currency = "USD", + Price = 1.00m, + } + } + }; + + var context = new ProductDiscountContext(DateTime.Now, product, product.ProductSkus.First(), 1.00m); + + await Handler.HandleProductAsync(context, promotion); + + context.CandidateProductDiscounts.Count.ShouldBe(1); + + var productDiscount = context.CandidateProductDiscounts.First(); + productDiscount.ShouldNotBeNull(); + productDiscount.EffectGroup.ShouldBe(PromotionConsts.PromotionEffectGroup); + productDiscount.DisplayName.ShouldBe("test"); + productDiscount.DynamicDiscountAmount.DiscountAmount.ShouldBe(0.01m); + productDiscount.DynamicDiscountAmount.DiscountRate.ShouldBe(0m); + productDiscount.DynamicDiscountAmount.CalculatorName.ShouldBeNull(); + productDiscount.FromTime.ShouldBeNull(); + productDiscount.ToTime.ShouldBeNull(); + } + + private async Task CreatePromotionAsync() + { + return await PromotionManager.CreateAsync(Guid.NewGuid(), + MinQuantityOrderDiscountPromotionHandler.MinQuantityOrderDiscountPromotionTypeName, "test", "test", + JsonSerializer.Serialize(new SimpleProductDiscountConfigurations + { + Discounts = new List + { + new(new List + { + new("MyProductGroup", null, null, null) + }, new DynamicDiscountAmountModel("USD", 0.01m, 0m, null)) + } + }), null, null, false, 10000); + } +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/Promotions/PromotionAppServiceTests.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/Promotions/PromotionAppServiceTests.cs new file mode 100644 index 00000000..20b514b1 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/Promotions/PromotionAppServiceTests.cs @@ -0,0 +1,28 @@ +using Shouldly; +using System.Threading.Tasks; +using Xunit; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public class PromotionAppServiceTests : PromotionsApplicationTestBase +{ + private readonly IPromotionAppService _promotionAppService; + + public PromotionAppServiceTests() + { + _promotionAppService = GetRequiredService(); + } + + /* + [Fact] + public async Task Test1() + { + // Arrange + + // Act + + // Assert + } + */ +} + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj index ac776ffb..c59b5293 100644 --- a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj @@ -10,6 +10,8 @@ + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/Promotions/PromotionDomainTests.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/Promotions/PromotionDomainTests.cs new file mode 100644 index 00000000..afdaf27a --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/Promotions/PromotionDomainTests.cs @@ -0,0 +1,24 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace EasyAbp.EShop.Plugins.Promotions.Promotions; + +public class PromotionDomainTests : PromotionsDomainTestBase +{ + public PromotionDomainTests() + { + } + + /* + [Fact] + public async Task Test1() + { + // Arrange + + // Assert + + // Assert + } + */ +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs index 757a8be7..54a8820c 100644 --- a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs @@ -1,4 +1,6 @@ -using EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; +using EasyAbp.EShop.Orders.Plugins.Promotions; +using EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; +using EasyAbp.EShop.Products.Plugins.Promotions; using Volo.Abp.Modularity; namespace EasyAbp.EShop.Plugins.Promotions; @@ -8,8 +10,10 @@ namespace EasyAbp.EShop.Plugins.Promotions; * database independent anyway. */ [DependsOn( - typeof(PromotionsEntityFrameworkCoreTestModule) - )] + typeof(PromotionsEntityFrameworkCoreTestModule), + typeof(EShopProductsPluginsPromotionsDomainModule), + typeof(EShopOrdersPluginsPromotionsDomainModule) +)] public class PromotionsDomainTestModule : AbpModule { diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/Promotions/PromotionRepositoryTests.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/Promotions/PromotionRepositoryTests.cs new file mode 100644 index 00000000..c49bf183 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/Promotions/PromotionRepositoryTests.cs @@ -0,0 +1,32 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Promotions.Promotions; +using Volo.Abp.Domain.Repositories; +using Xunit; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Promotions; + +public class PromotionRepositoryTests : PromotionsEntityFrameworkCoreTestBase +{ + private readonly IPromotionRepository _promotionRepository; + + public PromotionRepositoryTests() + { + _promotionRepository = GetRequiredService(); + } + + /* + [Fact] + public async Task Test1() + { + await WithUnitOfWorkAsync(async () => + { + // Arrange + + // Act + + //Assert + }); + } + */ +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs index 318dbc6b..6b830ee1 100644 --- a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs @@ -1,4 +1,7 @@ -using Microsoft.Extensions.DependencyInjection; +using EasyAbp.EShop.Plugins.Promotions.Options; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes.MinQuantityOrderDiscount; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes.SimpleProductDiscount; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp; using Volo.Abp.Authorization; using Volo.Abp.Autofac; @@ -13,12 +16,18 @@ namespace EasyAbp.EShop.Plugins.Promotions; typeof(AbpTestBaseModule), typeof(AbpAuthorizationModule), typeof(EShopPluginsPromotionsDomainModule) - )] +)] public class PromotionsTestBaseModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAlwaysAllowAuthorization(); + + context.Services.Configure(options => + { + options.PromotionTypes.AddSimpleProductDiscountPromotionType(); + options.PromotionTypes.AddMinQuantityOrderDiscountPromotionType(); + }); } public override void OnApplicationInitialization(ApplicationInitializationContext context) @@ -38,4 +47,4 @@ public class PromotionsTestBaseModule : AbpModule } }); } -} +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestConsts.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestConsts.cs new file mode 100644 index 00000000..28fce803 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestConsts.cs @@ -0,0 +1,8 @@ +using System; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public static class PromotionsTestConsts +{ + public static Guid StoreId = Guid.NewGuid(); +} \ No newline at end of file diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs index 973038f4..6703a424 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs @@ -4,6 +4,7 @@ using EasyAbp.EShop.Plugins.Baskets; using EasyAbp.EShop.Plugins.Booking; using EasyAbp.EShop.Plugins.Coupons; using EasyAbp.EShop.Plugins.FlashSales; +using EasyAbp.EShop.Plugins.Promotions; using EasyAbp.EShop.Products.Plugins.FlashSales; using EasyAbp.PaymentService; using EasyAbp.PaymentService.Prepayment; @@ -31,6 +32,7 @@ namespace EShopSample typeof(EShopPluginsBookingApplicationContractsModule), typeof(EShopPluginsCouponsApplicationContractsModule), typeof(EShopPluginsFlashSalesApplicationContractsModule), + typeof(EShopPluginsPromotionsApplicationContractsModule), typeof(EShopProductsPluginsFlashSalesApplicationContractsModule), typeof(PaymentServiceApplicationContractsModule), typeof(PaymentServiceWeChatPayApplicationContractsModule), diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs index 76d72423..da346f0e 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs @@ -6,6 +6,7 @@ using EasyAbp.EShop.Plugins.Baskets; using EasyAbp.EShop.Plugins.Booking; using EasyAbp.EShop.Plugins.Coupons; using EasyAbp.EShop.Plugins.FlashSales; +using EasyAbp.EShop.Plugins.Promotions; using EasyAbp.EShop.Products.Plugins.FlashSales; using EasyAbp.PaymentService; using EasyAbp.PaymentService.Prepayment; @@ -34,6 +35,7 @@ namespace EShopSample typeof(EShopPluginsCouponsApplicationModule), typeof(EShopOrdersPluginsCouponsModule), typeof(EShopPluginsFlashSalesApplicationModule), + typeof(EShopPluginsPromotionsApplicationModule), typeof(EShopOrdersPluginsFlashSalesApplicationModule), typeof(EShopProductsPluginsFlashSalesApplicationModule), typeof(PaymentServiceApplicationModule), diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs index 33840764..f9d46d77 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs @@ -4,6 +4,7 @@ using EasyAbp.EShop.Plugins.Baskets; using EasyAbp.EShop.Plugins.Booking; using EasyAbp.EShop.Plugins.Coupons; using EasyAbp.EShop.Plugins.FlashSales; +using EasyAbp.EShop.Plugins.Promotions; using EasyAbp.PaymentService; using EasyAbp.PaymentService.Prepayment; using EasyAbp.PaymentService.WeChatPay; @@ -37,6 +38,7 @@ namespace EShopSample typeof(EShopPluginsBookingDomainSharedModule), typeof(EShopPluginsCouponsDomainSharedModule), typeof(EShopPluginsFlashSalesDomainSharedModule), + typeof(EShopPluginsPromotionsDomainSharedModule), typeof(PaymentServiceDomainSharedModule), typeof(PaymentServiceWeChatPayDomainSharedModule), typeof(PaymentServicePrepaymentDomainSharedModule), diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj index 456f192f..caa3ed15 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj @@ -13,7 +13,9 @@ + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs index 8f5bab64..0c59ce5e 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs @@ -1,9 +1,15 @@ using EasyAbp.BookingService; using EasyAbp.EShop; +using EasyAbp.EShop.Orders.Plugins.Promotions; using EasyAbp.EShop.Plugins.Baskets; using EasyAbp.EShop.Plugins.Booking; using EasyAbp.EShop.Plugins.Coupons; using EasyAbp.EShop.Plugins.FlashSales; +using EasyAbp.EShop.Plugins.Promotions; +using EasyAbp.EShop.Plugins.Promotions.Options; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes.MinQuantityOrderDiscount; +using EasyAbp.EShop.Plugins.Promotions.PromotionTypes.SimpleProductDiscount; +using EasyAbp.EShop.Products.Plugins.Promotions; using EasyAbp.PaymentService; using EasyAbp.PaymentService.Options; using EasyAbp.PaymentService.Payments; @@ -45,6 +51,9 @@ namespace EShopSample typeof(EShopPluginsBookingDomainModule), typeof(EShopPluginsCouponsDomainModule), typeof(EShopPluginsFlashSalesDomainModule), + typeof(EShopPluginsPromotionsDomainModule), + typeof(EShopProductsPluginsPromotionsDomainModule), + typeof(EShopOrdersPluginsPromotionsDomainModule), typeof(PaymentServiceDomainModule), typeof(PaymentServiceWeChatPayDomainModule), typeof(PaymentServicePrepaymentDomainModule), @@ -59,13 +68,11 @@ namespace EShopSample public override void ConfigureServices(ServiceConfigurationContext context) { - Configure(options => - { - options.IsEnabled = MultiTenancyConsts.IsEnabled; - }); + Configure(options => { options.IsEnabled = MultiTenancyConsts.IsEnabled; }); ConfigurePaymentService(); ConfigurePaymentServicePrepayment(); + ConfigureEShopPromotions(); } private void ConfigurePaymentService() @@ -73,11 +80,13 @@ namespace EShopSample Configure(options => { options.Providers.Configure(FreePaymentServiceProvider.PaymentMethod); - options.Providers.Configure(WeChatPayPaymentServiceProvider.PaymentMethod); - options.Providers.Configure(PrepaymentPaymentServiceProvider.PaymentMethod); + options.Providers.Configure(WeChatPayPaymentServiceProvider + .PaymentMethod); + options.Providers.Configure(PrepaymentPaymentServiceProvider + .PaymentMethod); }); } - + private void ConfigurePaymentServicePrepayment() { Configure(options => @@ -88,5 +97,14 @@ namespace EShopSample }); }); } + + private void ConfigureEShopPromotions() + { + Configure(options => + { + options.PromotionTypes.AddSimpleProductDiscountPromotionType(); + options.PromotionTypes.AddMinQuantityOrderDiscountPromotionType(); + }); + } } -} +} \ No newline at end of file diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleDbContext.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleDbContext.cs index 7afda756..49f00298 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleDbContext.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleDbContext.cs @@ -4,6 +4,7 @@ using EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore; using EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore; using EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore; using EasyAbp.EShop.Plugins.FlashSales.EntityFrameworkCore; +using EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; using EasyAbp.PaymentService.EntityFrameworkCore; using EasyAbp.PaymentService.Prepayment.EntityFrameworkCore; using EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore; @@ -86,6 +87,7 @@ namespace EShopSample.EntityFrameworkCore builder.ConfigureEShopPluginsBooking(); builder.ConfigureEShopPluginsCoupons(); builder.ConfigureEShopPluginsFlashSales(); + builder.ConfigureEShopPluginsPromotions(); builder.ConfigurePaymentService(); builder.ConfigurePaymentServiceWeChatPay(); builder.ConfigurePaymentServicePrepayment(); diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs index eea9ddaa..40577ea0 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs @@ -4,6 +4,7 @@ using EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore; using EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore; using EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore; using EasyAbp.EShop.Plugins.FlashSales.EntityFrameworkCore; +using EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; using EasyAbp.PaymentService.EntityFrameworkCore; using EasyAbp.PaymentService.Prepayment.EntityFrameworkCore; using EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore; @@ -38,6 +39,7 @@ namespace EShopSample.EntityFrameworkCore typeof(EShopPluginsBookingEntityFrameworkCoreModule), typeof(EShopPluginsCouponsEntityFrameworkCoreModule), typeof(EShopPluginsFlashSalesEntityFrameworkCoreModule), + typeof(EShopPluginsPromotionsEntityFrameworkCoreModule), typeof(PaymentServiceEntityFrameworkCoreModule), typeof(PaymentServiceWeChatPayEntityFrameworkCoreModule), typeof(PaymentServicePrepaymentEntityFrameworkCoreModule), diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230414132422_AddedPromotionsModule.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230414132422_AddedPromotionsModule.Designer.cs new file mode 100644 index 00000000..34700440 --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230414132422_AddedPromotionsModule.Designer.cs @@ -0,0 +1,6510 @@ +// +using System; +using EShopSample.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace EShopSample.Migrations +{ + [DbContext(typeof(EShopSampleDbContext))] + [Migration("20230414132422_AddedPromotionsModule")] + partial class AddedPromotionsModule + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "7.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("EasyAbp.BookingService.AssetCategories.AssetCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetDefinitionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DefaultPeriodUsable") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Disabled") + .HasColumnType("bit"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("EasyAbpBookingServiceAssetCategories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetOccupancies.AssetOccupancy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Asset") + .HasColumnType("nvarchar(max)"); + + b.Property("AssetDefinitionName") + .HasColumnType("nvarchar(max)"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("Duration") + .HasColumnType("time"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("OccupierName") + .HasColumnType("nvarchar(max)"); + + b.Property("OccupierUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartingTime") + .HasColumnType("time"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Volume") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Date", "OccupierUserId"); + + b.HasIndex("Date", "AssetId", "StartingTime", "Duration"); + + b.ToTable("EasyAbpBookingServiceAssetOccupancies", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetOccupancyCounts.AssetOccupancyCount", b => + { + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartingTime") + .HasColumnType("time"); + + b.Property("Duration") + .HasColumnType("time"); + + b.Property("Asset") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Volume") + .HasColumnType("int"); + + b.HasKey("Date", "AssetId", "StartingTime", "Duration"); + + b.ToTable("EasyAbpBookingServiceAssetOccupancyCounts", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetPeriodSchemes.AssetPeriodScheme", b => + { + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Date", "AssetId"); + + b.ToTable("EasyAbpBookingServiceAssetPeriodSchemes", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetSchedules.AssetSchedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PeriodId") + .HasColumnType("uniqueidentifier"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("PeriodUsable") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Date", "AssetId", "PeriodSchemeId"); + + b.ToTable("EasyAbpBookingServiceAssetSchedules", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.Assets.Asset", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("AssetDefinitionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DefaultPeriodUsable") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Disabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Volume") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpBookingServiceAssets", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.PeriodSchemes.Period", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Duration") + .HasColumnType("time"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartingTime") + .HasColumnType("time"); + + b.HasKey("Id"); + + b.HasIndex("PeriodSchemeId"); + + b.ToTable("EasyAbpBookingServicePeriods", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.PeriodSchemes.PeriodScheme", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpBookingServicePeriodSchemes", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CancellationReason") + .HasColumnType("nvarchar(max)"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("PaidTime") + .HasColumnType("datetime2"); + + b.Property("PaymentExpiration") + .HasColumnType("datetime2"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("ReducedInventoryAfterPaymentTime") + .HasColumnType("datetime2"); + + b.Property("ReducedInventoryAfterPlacingTime") + .HasColumnType("datetime2"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique() + .HasFilter("[OrderNumber] IS NOT NULL"); + + b.ToTable("EasyAbpEShopOrdersOrders", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderDiscount", b => + { + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Key") + .HasColumnType("nvarchar(450)"); + + b.Property("DiscountedAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("EffectGroup") + .HasColumnType("nvarchar(max)"); + + b.HasKey("OrderId", "OrderLineId", "Name", "Key"); + + b.ToTable("EasyAbpEShopOrdersOrderDiscounts", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderExtraFee", b => + { + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Key") + .HasColumnType("nvarchar(450)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("Fee") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.HasKey("OrderId", "Name", "Key"); + + b.ToTable("EasyAbpEShopOrdersOrderExtraFees", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductInventoryStrategy") + .HasColumnType("int"); + + b.Property("ProductModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("EasyAbpEShopOrdersOrderLines", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsPayments", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpEShopPaymentsPaymentItems", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsRefunds", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItems", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderExtraFee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundItemId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RefundItemId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItemOrderExtraFees", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RefundItemId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItemOrderLines", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.BasketItems.BasketItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BasketName") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsInvalid") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderDiscountPreviews") + .HasColumnType("nvarchar(max)"); + + b.Property("PriceWithoutDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductDiscounts") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalPriceWithoutDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpEShopPluginsBasketsBasketItems", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.ProductUpdates.ProductUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopPluginsBasketsProductUpdates", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.GrantedStores.GrantedStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowAll") + .HasColumnType("bit"); + + b.Property("AssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsBookingGrantedStores", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FromTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToTime") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsBookingProductAssetCategories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("PeriodId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductAssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAssetCategoryId"); + + b.ToTable("EasyAbpEShopPluginsBookingProductAssetCategoryPeriods", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAsset", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FromTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToTime") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsBookingProductAssets", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("PeriodId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductAssetId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAssetId"); + + b.ToTable("EasyAbpEShopPluginsBookingProductAssetPeriods", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConditionAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CouponType") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsUnscoped") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("UsableBeginTime") + .HasColumnType("datetime2"); + + b.Property("UsableDuration") + .HasColumnType("time"); + + b.Property("UsableEndTime") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsCouponsCouponTemplates", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplateScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CouponTemplateId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CouponTemplateId"); + + b.ToTable("EasyAbpEShopPluginsCouponsCouponTemplateScopes", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.Coupons.Coupon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CouponTemplateId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiscountedAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("ExpirationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UsedTime") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsCouponsCoupons", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.FlashSales.FlashSalePlans.FlashSalePlan", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsFlashSalesFlashSalePlans", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.FlashSales.FlashSaleResults.FlashSaleResult", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("Reason") + .HasColumnType("nvarchar(max)"); + + b.Property("ReducedInventoryTime") + .HasColumnType("datetime2"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsFlashSalesFlashSaleResults", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Promotions.Promotions.Promotion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Configurations") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Disabled") + .HasColumnType("bit"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FromTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PromotionType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToTime") + .HasColumnType("datetime2"); + + b.Property("UniqueName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsPromotionsPromotions", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("EasyAbpEShopProductsCategories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductCategories.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductCategories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetailHistories.ProductDetailHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductDetailId"); + + b.ToTable("EasyAbpEShopProductsProductDetailHistories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetails.ProductDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductDetails", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductHistories.ProductHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductHistories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductInventories.ProductInventory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopProductsProductInventories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InventoryProviderName") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("Overview") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentExpireIn") + .HasColumnType("time"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName"); + + b.ToTable("EasyAbpEShopProductsProducts", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductAttributes", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductAttributeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("EasyAbpEShopProductsProductAttributeOptions", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderMaxQuantity") + .HasColumnType("int"); + + b.Property("OrderMinQuantity") + .HasColumnType("int"); + + b.Property("OriginalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentExpireIn") + .HasColumnType("time"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductSkus", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductView", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InventoryProviderName") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("MaximumPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("MaximumPriceWithoutDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("MinimumPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("MinimumPriceWithoutDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("OrderDiscountPreviews") + .HasColumnType("nvarchar(max)"); + + b.Property("Overview") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentExpireIn") + .HasColumnType("time"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDiscounts") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName"); + + b.ToTable("EasyAbpEShopProductsProductViews", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.StoreOwners.StoreOwner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OwnerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("OwnerUserId", "StoreId") + .IsUnique(); + + b.ToTable("EasyAbpEShopStoresStoreOwners", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresStores", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresTransactions", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePayments", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServicePaymentItems", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Accounts.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("Balance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PendingTopUpPaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingWithdrawalAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PendingWithdrawalRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentAccounts", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("OriginalBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("AccountUserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentTransactions", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.WithdrawalRecords.WithdrawalRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("CancellationTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ResultErrorCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ResultErrorMessage") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("WithdrawalMethod") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePrepaymentWithdrawalRecords", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.WithdrawalRequests.WithdrawalRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsApproved") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ReviewTime") + .HasColumnType("datetime2"); + + b.Property("ReviewerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePrepaymentWithdrawalRequests", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServiceRefunds", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpPaymentServiceRefundItems", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.PaymentRecords.PaymentRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("Attach") + .HasColumnType("nvarchar(max)"); + + b.Property("BankType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CouponCount") + .HasColumnType("int"); + + b.Property("CouponFee") + .HasColumnType("int"); + + b.Property("CouponFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeviceInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCodeDes") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSubscribe") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("Openid") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResultCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TimeEnd") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TradeType") + .HasColumnType("nvarchar(max)"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayPaymentRecords", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.RefundRecords.RefundRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashRefundFee") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponRefundCount") + .HasColumnType("int"); + + b.Property("CouponRefundFee") + .HasColumnType("int"); + + b.Property("CouponRefundFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("OutRefundNo") + .HasColumnType("nvarchar(450)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundFee") + .HasColumnType("int"); + + b.Property("RefundId") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRecvAccout") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRequestSource") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementRefundFee") + .HasColumnType("int"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("SuccessTime") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("OutRefundNo"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayRefundRecords", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("nvarchar(max)"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime2") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("nvarchar(max)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("RequireRequestObject") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[TenantId] IS NOT NULL"); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetCategories.AssetCategory", b => + { + b.HasOne("EasyAbp.BookingService.AssetCategories.AssetCategory", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + { + b1.Property("AssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b1.Property("MaxDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MaxTimespanInAdvance") + .HasColumnType("time"); + + b1.Property("MinDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MinTimespanInAdvance") + .HasColumnType("time"); + + b1.HasKey("AssetCategoryId"); + + b1.ToTable("EasyAbpBookingServiceAssetCategories"); + + b1.WithOwner() + .HasForeignKey("AssetCategoryId"); + }); + + b.Navigation("Parent"); + + b.Navigation("TimeInAdvance"); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetSchedules.AssetSchedule", b => + { + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + { + b1.Property("AssetScheduleId") + .HasColumnType("uniqueidentifier"); + + b1.Property("MaxDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MaxTimespanInAdvance") + .HasColumnType("time"); + + b1.Property("MinDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MinTimespanInAdvance") + .HasColumnType("time"); + + b1.HasKey("AssetScheduleId"); + + b1.ToTable("EasyAbpBookingServiceAssetSchedules"); + + b1.WithOwner() + .HasForeignKey("AssetScheduleId"); + }); + + b.Navigation("TimeInAdvance"); + }); + + modelBuilder.Entity("EasyAbp.BookingService.Assets.Asset", b => + { + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + { + b1.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b1.Property("MaxDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MaxTimespanInAdvance") + .HasColumnType("time"); + + b1.Property("MinDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MinTimespanInAdvance") + .HasColumnType("time"); + + b1.HasKey("AssetId"); + + b1.ToTable("EasyAbpBookingServiceAssets"); + + b1.WithOwner() + .HasForeignKey("AssetId"); + }); + + b.Navigation("TimeInAdvance"); + }); + + modelBuilder.Entity("EasyAbp.BookingService.PeriodSchemes.Period", b => + { + b.HasOne("EasyAbp.BookingService.PeriodSchemes.PeriodScheme", null) + .WithMany("Periods") + .HasForeignKey("PeriodSchemeId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderDiscount", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderDiscounts") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderExtraFee", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderExtraFees") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderLines") + .HasForeignKey("OrderId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderExtraFee", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("OrderExtraFees") + .HasForeignKey("RefundItemId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("OrderLines") + .HasForeignKey("RefundItemId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod", b => + { + b.HasOne("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory", null) + .WithMany("Periods") + .HasForeignKey("ProductAssetCategoryId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod", b => + { + b.HasOne("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAsset", null) + .WithMany("Periods") + .HasForeignKey("ProductAssetId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplateScope", b => + { + b.HasOne("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplate", null) + .WithMany("Scopes") + .HasForeignKey("CouponTemplateId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.HasOne("EasyAbp.EShop.Products.Categories.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductAttributes") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.ProductAttribute", null) + .WithMany("ProductAttributeOptions") + .HasForeignKey("ProductAttributeId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductSkus") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.PaymentService.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.PaymentService.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetCategories.AssetCategory", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("EasyAbp.BookingService.PeriodSchemes.PeriodScheme", b => + { + b.Navigation("Periods"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Navigation("OrderDiscounts"); + + b.Navigation("OrderExtraFees"); + + b.Navigation("OrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Navigation("PaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Navigation("RefundItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Navigation("OrderExtraFees"); + + b.Navigation("OrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory", b => + { + b.Navigation("Periods"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAsset", b => + { + b.Navigation("Periods"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplate", b => + { + b.Navigation("Scopes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Navigation("ProductAttributes"); + + b.Navigation("ProductSkus"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Navigation("ProductAttributeOptions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Navigation("PaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Navigation("RefundItems"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230414132422_AddedPromotionsModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230414132422_AddedPromotionsModule.cs new file mode 100644 index 00000000..dfd0b965 --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230414132422_AddedPromotionsModule.cs @@ -0,0 +1,52 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EShopSample.Migrations +{ + /// + public partial class AddedPromotionsModule : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "EasyAbpEShopPluginsPromotionsPromotions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + StoreId = table.Column(type: "uniqueidentifier", nullable: false), + PromotionType = table.Column(type: "nvarchar(max)", nullable: false), + UniqueName = table.Column(type: "nvarchar(max)", nullable: false), + DisplayName = table.Column(type: "nvarchar(max)", nullable: false), + Configurations = table.Column(type: "nvarchar(max)", nullable: false), + FromTime = table.Column(type: "datetime2", nullable: true), + ToTime = table.Column(type: "datetime2", nullable: true), + Disabled = table.Column(type: "bit", nullable: false), + Priority = table.Column(type: "int", nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EasyAbpEShopPluginsPromotionsPromotions", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EasyAbpEShopPluginsPromotionsPromotions"); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs index 49c58399..c636f3fb 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs @@ -1914,6 +1914,92 @@ namespace EShopSample.Migrations b.ToTable("EasyAbpEShopPluginsFlashSalesFlashSaleResults", (string)null); }); + modelBuilder.Entity("EasyAbp.EShop.Plugins.Promotions.Promotions.Promotion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Configurations") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Disabled") + .HasColumnType("bit"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FromTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PromotionType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToTime") + .HasColumnType("datetime2"); + + b.Property("UniqueName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsPromotionsPromotions", (string)null); + }); + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => { b.Property("Id") @@ -5760,7 +5846,7 @@ namespace EShopSample.Migrations .WithMany("Children") .HasForeignKey("ParentId"); - b.OwnsOne("EasyAbp.BookingService.AssetCategories.AssetCategory.TimeInAdvance#EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => { b1.Property("AssetCategoryId") .HasColumnType("uniqueidentifier"); @@ -5779,7 +5865,7 @@ namespace EShopSample.Migrations b1.HasKey("AssetCategoryId"); - b1.ToTable("EasyAbpBookingServiceAssetCategories", (string)null); + b1.ToTable("EasyAbpBookingServiceAssetCategories"); b1.WithOwner() .HasForeignKey("AssetCategoryId"); @@ -5792,7 +5878,7 @@ namespace EShopSample.Migrations modelBuilder.Entity("EasyAbp.BookingService.AssetSchedules.AssetSchedule", b => { - b.OwnsOne("EasyAbp.BookingService.AssetSchedules.AssetSchedule.TimeInAdvance#EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => { b1.Property("AssetScheduleId") .HasColumnType("uniqueidentifier"); @@ -5811,7 +5897,7 @@ namespace EShopSample.Migrations b1.HasKey("AssetScheduleId"); - b1.ToTable("EasyAbpBookingServiceAssetSchedules", (string)null); + b1.ToTable("EasyAbpBookingServiceAssetSchedules"); b1.WithOwner() .HasForeignKey("AssetScheduleId"); @@ -5822,7 +5908,7 @@ namespace EShopSample.Migrations modelBuilder.Entity("EasyAbp.BookingService.Assets.Asset", b => { - b.OwnsOne("EasyAbp.BookingService.Assets.Asset.TimeInAdvance#EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => { b1.Property("AssetId") .HasColumnType("uniqueidentifier"); @@ -5841,7 +5927,7 @@ namespace EShopSample.Migrations b1.HasKey("AssetId"); - b1.ToTable("EasyAbpBookingServiceAssets", (string)null); + b1.ToTable("EasyAbpBookingServiceAssets"); b1.WithOwner() .HasForeignKey("AssetId"); diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs index b0909aa3..cb773079 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs @@ -4,6 +4,7 @@ using EasyAbp.EShop.Plugins.Baskets; using EasyAbp.EShop.Plugins.Booking; using EasyAbp.EShop.Plugins.Coupons; using EasyAbp.EShop.Plugins.FlashSales; +using EasyAbp.EShop.Plugins.Promotions; using EasyAbp.EShop.Products.Plugins.FlashSales; using EasyAbp.PaymentService; using EasyAbp.PaymentService.Prepayment; @@ -32,6 +33,7 @@ namespace EShopSample typeof(EShopPluginsCouponsHttpApiClientModule), typeof(EShopPluginsFlashSalesHttpApiClientModule), typeof(EShopProductsPluginsFlashSalesHttpApiClientModule), + typeof(EShopPluginsPromotionsHttpApiClientModule), typeof(PaymentServiceHttpApiClientModule), typeof(PaymentServiceWeChatPayHttpApiClientModule), typeof(PaymentServicePrepaymentHttpApiClientModule), diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs index 8ff8fc33..f173a1b1 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs @@ -4,6 +4,7 @@ using EasyAbp.EShop.Plugins.Baskets; using EasyAbp.EShop.Plugins.Booking; using EasyAbp.EShop.Plugins.Coupons; using EasyAbp.EShop.Plugins.FlashSales; +using EasyAbp.EShop.Plugins.Promotions; using EasyAbp.EShop.Products.Plugins.FlashSales; using EasyAbp.PaymentService; using EasyAbp.PaymentService.Prepayment; @@ -30,6 +31,7 @@ namespace EShopSample typeof(EShopPluginsCouponsHttpApiModule), typeof(EShopPluginsFlashSalesHttpApiModule), typeof(EShopProductsPluginsFlashSalesHttpApiModule), + typeof(EShopPluginsPromotionsHttpApiModule), typeof(PaymentServiceHttpApiModule), typeof(PaymentServiceWeChatPayHttpApiModule), typeof(PaymentServicePrepaymentHttpApiModule),