From e289ac4d7b83ce23f50def2682adc06a51612732 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Sat, 15 Apr 2023 21:06:09 +0800 Subject: [PATCH] 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),