From 77b813e0df21cead12b321544ecac930a2617c54 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Sun, 27 Sep 2020 20:47:00 +0800 Subject: [PATCH] Implement the coupon feature --- .../Orders/Orders/IOrderDiscountProvider.cs | 12 + .../EShop/Orders/Orders/OrderAppService.cs | 11 +- .../Orders/DiscountAmountOverflowException.cs | 12 + .../Orders/Orders/IOrderDiscountProvider.cs | 10 - .../EShop/Orders/Orders/IOrderManager.cs | 2 - .../EasyAbp/EShop/Orders/Orders/Order.cs | 13 +- .../EasyAbp/EShop/Orders/Orders/OrderLine.cs | 15 +- .../EShop/Orders/Orders/OrderManager.cs | 13 +- .../Products/Localization/Products/cs.json | 3 + .../Products/Localization/Products/en.json | 3 + .../Products/Localization/Products/pl.json | 3 + .../Products/Localization/Products/pt-BR.json | 3 + .../Products/Localization/Products/sl.json | 3 + .../Products/Localization/Products/tr.json | 3 + .../Products/Localization/Products/vi.json | 3 + .../EShop/Stores/Localization/Stores/cs.json | 3 + .../EShop/Stores/Localization/Stores/en.json | 3 + .../EShop/Stores/Localization/Stores/pl.json | 3 + .../Stores/Localization/Stores/pt-BR.json | 3 + .../EShop/Stores/Localization/Stores/sl.json | 3 + .../EShop/Stores/Localization/Stores/tr.json | 3 + .../EShop/Stores/Localization/Stores/vi.json | 3 + ...asyAbp.EShop.Orders.Plugins.Coupons.csproj | 2 +- ...CouponOrderCreationAuthorizationHandler.cs | 100 - .../EShopOrdersPluginsCouponsModule.cs | 9 +- .../CouponNotFoundOrHasExpiredException.cs | 12 + .../CouponOrderDiscountProvider.cs | 151 +- ...nTemplateNotFoundOrUnavailableException.cs | 12 + ...oesNotMeetCouponUsageConditionException.cs | 12 + .../CouponTemplates/Dtos/CouponTemplateDto.cs | 2 - .../Dtos/CreateUpdateCouponTemplateDto.cs | 27 +- .../Coupons/CouponHasBeenOccupiedException.cs | 11 + ...eUpdateCouponDto.cs => CreateCouponDto.cs} | 2 +- .../Coupons/Dtos/GetCouponListInput.cs | 13 + .../Coupons/Coupons/Dtos/OccupyCouponInput.cs | 10 + .../Coupons/Coupons/Dtos/UpdateCouponDto.cs | 9 + .../Coupons/Coupons/ICouponAppService.cs | 9 +- .../CouponsPermissionDefinitionProvider.cs | 2 + .../Coupons/Permissions/CouponsPermissions.cs | 2 + .../CouponTemplateAppService.cs | 12 +- .../Coupons/Coupons/CouponAppService.cs | 54 +- .../CouponsApplicationAutoMapperProfile.cs | 3 +- .../CouponTemplates/CouponTemplateData.cs | 6 +- .../Coupons/CouponTemplates/CouponType.cs | 5 +- .../CouponTemplates/ICouponTemplate.cs | 2 - .../Plugins/Coupons/Coupons/CouponData.cs | 4 + .../Coupons/Coupons/ICouponLookupService.cs | 2 +- .../Plugins/Coupons/Localization/cs.json | 57 +- .../Plugins/Coupons/Localization/en.json | 57 +- .../Plugins/Coupons/Localization/pl-PL.json | 56 +- .../Plugins/Coupons/Localization/pt-BR.json | 56 +- .../Plugins/Coupons/Localization/sl.json | 57 +- .../Plugins/Coupons/Localization/tr.json | 57 +- .../Plugins/Coupons/Localization/vi.json | 56 +- .../Plugins/Coupons/Localization/zh-Hans.json | 71 +- .../Plugins/Coupons/Localization/zh-Hant.json | 71 +- ...asyAbp.EShop.Plugins.Coupons.Domain.csproj | 1 + .../Coupons/CouponTemplates/CouponTemplate.cs | 8 - .../EShop/Plugins/Coupons/Coupons/Coupon.cs | 7 +- .../CouponOrderCanceledEventHandler.cs | 37 + .../Coupons/CouponOrderCreatedEventHandler.cs | 49 + .../Coupons/Coupons/ICouponRepository.cs | 3 + .../Coupons/InvalidCouponOrderIdException.cs | 13 + .../Coupons/RepositoryCouponLookupService.cs | 9 +- .../EShopPluginsCouponsDomainModule.cs | 6 +- .../CouponTemplateRepository.cs | 7 + .../Coupons/Coupons/CouponRepository.cs | 16 + .../Coupons/HttpClientCouponLookupService.cs | 9 +- .../Coupons/Coupons/CouponController.cs | 13 +- .../CouponsWebAutoMapperProfile.cs | 5 +- .../CouponTemplate/Index.cshtml | 2 - .../CreateEditCouponTemplateViewModel.cs | 3 - .../CouponTemplates/CouponTemplate/index.js | 1 - .../Coupons/Coupon/CreateModal.cshtml.cs | 4 +- .../Coupons/Coupon/EditModal.cshtml.cs | 6 +- ...nViewModel.cs => CreateCouponViewModel.cs} | 3 +- .../Coupon/ViewModels/EditCouponViewModel.cs | 11 + ...7_RemovedIsCrossProductAllowed.Designer.cs | 4556 +++++++++++++++++ ...0927094647_RemovedIsCrossProductAllowed.cs | 24 + ...pSampleMigrationsDbContextModelSnapshot.cs | 3 - .../EShopSample.Web/EShopSampleWebModule.cs | 7 + 81 files changed, 5470 insertions(+), 474 deletions(-) create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DiscountAmountOverflowException.cs delete mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs delete mode 100644 plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/Authorization/CouponOrderCreationAuthorizationHandler.cs create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponNotFoundOrHasExpiredException.cs create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponTemplateNotFoundOrUnavailableException.cs create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/OrderDoesNotMeetCouponUsageConditionException.cs create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponHasBeenOccupiedException.cs rename plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/{CreateUpdateCouponDto.cs => CreateCouponDto.cs} (82%) create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/GetCouponListInput.cs create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/OccupyCouponInput.cs create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/UpdateCouponDto.cs create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponOrderCanceledEventHandler.cs create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponOrderCreatedEventHandler.cs create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/InvalidCouponOrderIdException.cs rename plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/{CreateEditCouponViewModel.cs => CreateCouponViewModel.cs} (88%) create mode 100644 plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/EditCouponViewModel.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200927094647_RemovedIsCrossProductAllowed.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200927094647_RemovedIsCrossProductAllowed.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs new file mode 100644 index 00000000..3de5c09f --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using EasyAbp.EShop.Products.Products.Dtos; + +namespace EasyAbp.EShop.Orders.Orders +{ + public interface IOrderDiscountProvider + { + Task DiscountAsync(Order order, Dictionary productDict); + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs index f29f5cd7..50b1d097 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs @@ -8,6 +8,7 @@ using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; using EasyAbp.EShop.Stores.Stores; using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Users; @@ -99,12 +100,20 @@ namespace EasyAbp.EShop.Orders.Orders var order = await _newOrderGenerator.GenerateAsync(CurrentUser.GetId(), input, productDict); - await _orderManager.DiscountAsync(order); + await DiscountOrderAsync(order, productDict); await Repository.InsertAsync(order, autoSave: true); return await MapToGetOutputDtoAsync(order); } + + protected virtual async Task DiscountOrderAsync(Order order, Dictionary productDict) + { + foreach (var provider in ServiceProvider.GetServices()) + { + await provider.DiscountAsync(order, productDict); + } + } protected virtual async Task> GetProductDictionaryAsync( IEnumerable productIds, Guid storeId) diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DiscountAmountOverflowException.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DiscountAmountOverflowException.cs new file mode 100644 index 00000000..69c0dce4 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DiscountAmountOverflowException.cs @@ -0,0 +1,12 @@ +using Volo.Abp; + +namespace EasyAbp.EShop.Orders.Orders +{ + public class DiscountAmountOverflowException : BusinessException + { + public DiscountAmountOverflowException() + : base("DiscountAmountOverflow", $"The discount amount overflow.") + { + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs deleted file mode 100644 index 2fd6dd4b..00000000 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace EasyAbp.EShop.Orders.Orders -{ - public interface IOrderDiscountProvider - { - Task DiscountAsync(Order order); - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs index c5c31a81..6f4bfc61 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs @@ -6,8 +6,6 @@ namespace EasyAbp.EShop.Orders.Orders { public interface IOrderManager : IDomainService { - Task DiscountAsync(Order order); - Task CompleteAsync(Order order); Task CancelAsync(Order order, string cancellationReason); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs index ee070791..95fef675 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs @@ -165,16 +165,19 @@ namespace EasyAbp.EShop.Orders.Orders return !(!PaymentId.HasValue || PaidTime.HasValue); } - public decimal AddDiscountGetRealDiscountedAmount(Guid orderLineId, decimal expectedDiscountAmount) + public void AddDiscount(Guid orderLineId, decimal expectedDiscountAmount) { var orderLine = OrderLines.Single(x => x.Id == orderLineId); - var realDiscountedAmount = orderLine.AddDiscountGetRealDiscountedAmount(expectedDiscountAmount); + orderLine.AddDiscount(expectedDiscountAmount); - TotalDiscount += realDiscountedAmount; - ActualTotalPrice -= realDiscountedAmount; + TotalDiscount += expectedDiscountAmount; + ActualTotalPrice -= expectedDiscountAmount; - return realDiscountedAmount; + if (ActualTotalPrice < decimal.Zero) + { + throw new DiscountAmountOverflowException(); + } } } } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs index b1606bdc..f0c14b96 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs @@ -113,16 +113,15 @@ namespace EasyAbp.EShop.Orders.Orders RefundAmount += amount; } - internal decimal AddDiscountGetRealDiscountedAmount(decimal expectedDiscountAmount) + internal void AddDiscount(decimal expectedDiscountAmount) { - var realDiscountedAmount = ActualTotalPrice - expectedDiscountAmount >= decimal.Zero - ? ActualTotalPrice - expectedDiscountAmount - : ActualTotalPrice; - - TotalDiscount += realDiscountedAmount; - ActualTotalPrice -= realDiscountedAmount; + TotalDiscount += expectedDiscountAmount; + ActualTotalPrice -= expectedDiscountAmount; - return realDiscountedAmount; + if (ActualTotalPrice < decimal.Zero) + { + throw new DiscountAmountOverflowException(); + } } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs index 55f90f7d..b85436eb 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Domain.Services; using Volo.Abp.EventBus.Distributed; @@ -30,16 +29,6 @@ namespace EasyAbp.EShop.Orders.Orders _unitOfWorkManager = unitOfWorkManager; _orderRepository = orderRepository; } - - public virtual async Task DiscountAsync(Order order) - { - foreach (var provider in ServiceProvider.GetServices()) - { - await provider.DiscountAsync(order); - } - - return order; - } public virtual async Task CompleteAsync(Order order) { diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json index 87c49eb4..ef362132 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json @@ -56,6 +56,9 @@ "EditProduct": "Edit", "ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Menu:Category": "Category", "Category": "Category", "CategoryUniqueName": "Unique name", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json index 7a0c77ab..0fed0784 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json @@ -57,6 +57,9 @@ "EditProduct": "Edit", "ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Menu:Category": "Category", "Category": "Category", "CategoryUniqueName": "Unique name", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json index d1f6d2a4..689e1db5 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json @@ -56,6 +56,9 @@ "EditProduct": "Edit", "ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Menu:Category": "Category", "Category": "Category", "CategoryUniqueName": "Unique name", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json index 2fa6a43c..8fe31f51 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json @@ -56,6 +56,9 @@ "EditProduct": "Edit", "ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Menu:Category": "Category", "Category": "Category", "CategoryUniqueName": "Unique name", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json index 9aa6ab43..6cf4f29a 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json @@ -57,6 +57,9 @@ "EditProduct": "Edit", "ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Menu:Category": "Category", "Category": "Category", "CategoryUniqueName": "Unique name", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json index f2b66af6..e824d6e9 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json @@ -57,6 +57,9 @@ "EditProduct": "Edit", "ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Menu:Category": "Category", "Category": "Category", "CategoryUniqueName": "Unique name", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json index 1cc6d40a..e0f7702c 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json @@ -56,6 +56,9 @@ "EditProduct": "Edit", "ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Menu:Category": "Category", "Category": "Category", "CategoryUniqueName": "Unique name", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json index dacd0566..f95e23b5 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json @@ -10,6 +10,9 @@ "EditStore": "Edit", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "StoreOwner": "Store owner", "Menu:StoreOwner": "Store owner", "StoreOwnerUserName": "Username", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json index 02b98fec..32ad83e4 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json @@ -11,6 +11,9 @@ "EditStore": "Edit", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "StoreOwner": "Store owner", "Menu:StoreOwner": "Store owner", "StoreOwnerUserName": "Username", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json index 4cead9d3..d74ad4df 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json @@ -10,6 +10,9 @@ "EditStore": "Edit", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "StoreOwner": "Store owner", "Menu:StoreOwner": "Store owner", "StoreOwnerUserName": "Username", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json index 8183c93b..b9b6ce42 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json @@ -10,6 +10,9 @@ "EditStore": "Edit", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "StoreOwner": "Store owner", "Menu:StoreOwner": "Store owner", "StoreOwnerUserName": "Username", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json index 06567774..d68b8312 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json @@ -11,6 +11,9 @@ "EditStore": "Edit", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "StoreOwner": "Store owner", "Menu:StoreOwner": "Store owner", "StoreOwnerUserName": "Username", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json index 6ed7c674..b423993c 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json @@ -11,6 +11,9 @@ "EditStore": "Edit", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "StoreOwner": "Store owner", "Menu:StoreOwner": "Store owner", "StoreOwnerUserName": "Username", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json index f71cd014..2e54950b 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json @@ -10,6 +10,9 @@ "EditStore": "Edit", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "StoreOwner": "Store owner", "Menu:StoreOwner": "Store owner", "StoreOwnerUserName": "Username", diff --git a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp.EShop.Orders.Plugins.Coupons.csproj b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp.EShop.Orders.Plugins.Coupons.csproj index 628d2c56..9d3eb74f 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp.EShop.Orders.Plugins.Coupons.csproj +++ b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp.EShop.Orders.Plugins.Coupons.csproj @@ -9,7 +9,7 @@ - + diff --git a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/Authorization/CouponOrderCreationAuthorizationHandler.cs b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/Authorization/CouponOrderCreationAuthorizationHandler.cs deleted file mode 100644 index e013ee67..00000000 --- a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/Authorization/CouponOrderCreationAuthorizationHandler.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using EasyAbp.EShop.Orders.Orders; -using EasyAbp.EShop.Orders.Orders.Dtos; -using EasyAbp.EShop.Plugins.Coupons; -using EasyAbp.EShop.Plugins.Coupons.Coupons; -using EasyAbp.EShop.Plugins.Coupons.CouponTemplates; -using Microsoft.AspNetCore.Authorization; -using Volo.Abp.Data; -using Volo.Abp.Timing; - -namespace EasyAbp.EShop.Orders.Plugins.Coupons.Authorization -{ - public class CouponOrderCreationAuthorizationHandler : OrderCreationAuthorizationHandler - { - private readonly IClock _clock; - private readonly ICouponLookupService _couponLookupService; - private readonly ICouponTemplateLookupService _couponTemplateLookupService; - - public CouponOrderCreationAuthorizationHandler( - IClock clock, - ICouponLookupService couponLookupService, - ICouponTemplateLookupService couponTemplateLookupService) - { - _clock = clock; - _couponLookupService = couponLookupService; - _couponTemplateLookupService = couponTemplateLookupService; - } - - protected override async Task HandleOrderCreationAsync(AuthorizationHandlerContext context, - OrderOperationAuthorizationRequirement requirement, OrderCreationResource resource) - { - if (!Guid.TryParse(resource.Input.GetProperty(CouponsConsts.OrderCouponIdPropertyName), - out var couponId)) - { - return; - } - - var now = _clock.Now; - - var coupon = await _couponLookupService.FindByIdAsync(couponId); - - if (coupon == null || coupon.ExpirationTime < now) - { - context.Fail(); - return; - } - - var couponTemplate = await _couponTemplateLookupService.FindByIdAsync(coupon.CouponTemplateId); - - if (couponTemplate == null || - !IsInUsableTime(couponTemplate, now) || - !IsOrderInScope(couponTemplate, resource)) - { - context.Fail(); - return; - } - } - - protected virtual bool IsOrderInScope(CouponTemplateData couponTemplate, OrderCreationResource resource) - { - if (couponTemplate.IsUnscoped) - { - return true; - } - - var expectedOrderLines = new List(); - - foreach (var scope in couponTemplate.Scopes) - { - expectedOrderLines.AddRange(resource.Input.OrderLines - .WhereIf(scope.ProductGroupName != null, - x => resource.ProductDictionary[x.ProductId].ProductGroupName == scope.ProductGroupName) - .WhereIf(scope.ProductId.HasValue, x => x.ProductId == scope.ProductId) - .WhereIf(scope.ProductSkuId.HasValue, x => x.ProductSkuId == scope.ProductSkuId)); - } - - if (couponTemplate.IsCrossProductAllowed) - { - return expectedOrderLines.Sum(x => GetOrderLineProductPrice(x, resource) * x.Quantity) >= - couponTemplate.ConditionAmount; - } - - return expectedOrderLines.Any(orderLine => - GetOrderLineProductPrice(orderLine, resource) >= couponTemplate.ConditionAmount); - } - - protected virtual decimal GetOrderLineProductPrice(CreateOrderLineDto createOrderLineDto, OrderCreationResource resource) - { - return resource.ProductDictionary[createOrderLineDto.ProductId].GetSkuById(createOrderLineDto.ProductSkuId).Price; - } - - protected virtual bool IsInUsableTime(ICouponTemplate couponTemplate, DateTime now) - { - return couponTemplate.UsableBeginTime <= now && couponTemplate.UsableEndTime > now; - } - } -} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/EShopOrdersPluginsCouponsModule.cs b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/EShopOrdersPluginsCouponsModule.cs index dd5e980e..c854d999 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/EShopOrdersPluginsCouponsModule.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/EShopOrdersPluginsCouponsModule.cs @@ -1,23 +1,18 @@ -using EasyAbp.EShop.Orders.Plugins.Coupons.Authorization; -using EasyAbp.EShop.Orders.Plugins.Coupons.ObjectExtending; +using EasyAbp.EShop.Orders.Plugins.Coupons.ObjectExtending; using EasyAbp.EShop.Plugins.Coupons; -using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; namespace EasyAbp.EShop.Orders.Plugins.Coupons { [DependsOn( typeof(EShopOrdersDomainModule), - typeof(EShopPluginsCouponsDomainSharedModule) + typeof(EShopPluginsCouponsApplicationContractsModule) )] public class EShopOrdersPluginsCouponsModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { EShopOrdersPluginsCouponsObjectExtensions.Configure(); - - context.Services.AddSingleton(); } } } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponNotFoundOrHasExpiredException.cs b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponNotFoundOrHasExpiredException.cs new file mode 100644 index 00000000..d59921d6 --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponNotFoundOrHasExpiredException.cs @@ -0,0 +1,12 @@ +using Volo.Abp; + +namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount +{ + public class CouponNotFoundOrHasExpiredException : BusinessException + { + public CouponNotFoundOrHasExpiredException() : base("CouponNotFoundOrHasExpired", + "Coupon not found or has expired.") + { + } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponOrderDiscountProvider.cs b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponOrderDiscountProvider.cs index 7da1b357..2b60bfaf 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponOrderDiscountProvider.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponOrderDiscountProvider.cs @@ -1,31 +1,39 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Orders.Orders; using EasyAbp.EShop.Plugins.Coupons; using EasyAbp.EShop.Plugins.Coupons.Coupons; +using EasyAbp.EShop.Plugins.Coupons.Coupons.Dtos; using EasyAbp.EShop.Plugins.Coupons.CouponTemplates; +using EasyAbp.EShop.Products.Products.Dtos; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; +using Volo.Abp.Timing; namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount { public class CouponOrderDiscountProvider : IOrderDiscountProvider, ITransientDependency { - private readonly IOrderRepository _orderRepository; + private readonly IClock _clock; + private readonly ICouponAppService _couponAppService; private readonly ICouponLookupService _couponLookupService; private readonly ICouponTemplateLookupService _couponTemplateLookupService; public CouponOrderDiscountProvider( - IOrderRepository orderRepository, + IClock clock, + ICouponAppService couponAppService, ICouponLookupService couponLookupService, ICouponTemplateLookupService couponTemplateLookupService) { - _orderRepository = orderRepository; + _clock = clock; + _couponAppService = couponAppService; _couponLookupService = couponLookupService; _couponTemplateLookupService = couponTemplateLookupService; } - public virtual async Task DiscountAsync(Order order) + public virtual async Task DiscountAsync(Order order, Dictionary productDict) { if (!Guid.TryParse(order.GetProperty(CouponsConsts.OrderCouponIdPropertyName), out var couponId)) @@ -33,20 +41,143 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount return order; } + var now = _clock.Now; + var coupon = await _couponLookupService.FindByIdAsync(couponId); - var couponTemplate = await _couponTemplateLookupService.FindByIdAsync(coupon.CouponTemplateId); + if (coupon == null || coupon.ExpirationTime < now) + { + throw new CouponNotFoundOrHasExpiredException(); + } - // Todo: consume the coupon!!! + if (coupon.OrderId.HasValue) + { + throw new CouponHasBeenOccupiedException(); + } - // Todo: get discounted order lines - var discountedAmount = order.AddDiscountGetRealDiscountedAmount(couponTemplate.DiscountAmount); + var couponTemplate = await _couponTemplateLookupService.FindByIdAsync(coupon.CouponTemplateId); - order.SetProperty(CouponsConsts.OrderCouponDiscountAmountPropertyName, discountedAmount); + if (couponTemplate == null || + !IsInUsableTime(couponTemplate, now)) + { + throw new CouponTemplateNotFoundOrUnavailableException(); + } + + var orderLinesInScope = GetOrderLinesInScope(couponTemplate, order, productDict); - await _orderRepository.UpdateAsync(order, true); + DiscountOrderLines(couponTemplate, order, orderLinesInScope); + + await _couponAppService.OccupyAsync(coupon.Id, new OccupyCouponInput {OrderId = order.Id}); return order; } + + protected virtual void DiscountOrderLines(CouponTemplateData couponTemplate, Order order, + List orderLinesInScope) + { + // Todo: support Custom coupon. + if (couponTemplate.CouponType == CouponType.Custom) + { + throw new NotSupportedException(); + } + + var totalOrderLineActualTotalPrice = orderLinesInScope.Sum(x => x.ActualTotalPrice); + + var totalDiscountedAmount = couponTemplate.CouponType == CouponType.PerMeet + ? couponTemplate.DiscountAmount * + Math.Floor(totalOrderLineActualTotalPrice / couponTemplate.ConditionAmount) + : couponTemplate.DiscountAmount; + + if (totalDiscountedAmount > totalOrderLineActualTotalPrice) + { + totalDiscountedAmount = totalOrderLineActualTotalPrice; + } + + var remainingDiscountedAmount = totalDiscountedAmount; + + // Todo: https://github.com/EasyAbp/EShop/issues/104 + const int accuracy = 2; + + foreach (var orderLine in orderLinesInScope) + { + var maxDiscountAmount = + Math.Round(orderLine.ActualTotalPrice / totalOrderLineActualTotalPrice * totalDiscountedAmount, + accuracy, MidpointRounding.ToZero); + + var discountAmount = maxDiscountAmount > orderLine.ActualTotalPrice + ? orderLine.ActualTotalPrice + : maxDiscountAmount; + + order.AddDiscount(orderLine.Id, discountAmount); + + remainingDiscountedAmount -= discountAmount; + } + + foreach (var orderLine in orderLinesInScope.OrderByDescending(x => x.ActualTotalPrice)) + { + if (remainingDiscountedAmount == decimal.Zero) + { + break; + } + + var discountAmount = remainingDiscountedAmount > orderLine.ActualTotalPrice + ? orderLine.ActualTotalPrice + : remainingDiscountedAmount; + + order.AddDiscount(orderLine.Id, discountAmount); + + remainingDiscountedAmount -= discountAmount; + } + + if (remainingDiscountedAmount != decimal.Zero) + { + throw new ApplicationException(); + } + + order.SetProperty(CouponsConsts.OrderCouponDiscountAmountPropertyName, totalDiscountedAmount); + } + + protected virtual List GetOrderLinesInScope(CouponTemplateData couponTemplate, Order order, + Dictionary productDict) + { + if (couponTemplate.IsUnscoped) + { + return order.OrderLines; + } + + var expectedOrderLines = new List(); + + foreach (var scope in couponTemplate.Scopes.Where(scope => scope.StoreId == order.StoreId)) + { + expectedOrderLines.AddRange(order.OrderLines + .WhereIf(scope.ProductGroupName != null, + x => productDict[x.ProductId].ProductGroupName == scope.ProductGroupName) + .WhereIf(scope.ProductId.HasValue, x => x.ProductId == scope.ProductId) + .WhereIf(scope.ProductSkuId.HasValue, x => x.ProductSkuId == scope.ProductSkuId)); + } + + if (expectedOrderLines.IsNullOrEmpty()) + { + throw new OrderDoesNotMeetCouponUsageConditionException(); + } + + if (expectedOrderLines.Sum(x => GetOrderLineProductPrice(x, productDict) * x.Quantity) < + couponTemplate.ConditionAmount) + { + throw new OrderDoesNotMeetCouponUsageConditionException(); + } + + return expectedOrderLines; + } + + protected virtual decimal GetOrderLineProductPrice(OrderLine orderLine, Dictionary productDict) + { + return productDict[orderLine.ProductId].GetSkuById(orderLine.ProductSkuId).Price; + } + + protected virtual bool IsInUsableTime(ICouponTemplate couponTemplate, DateTime now) + { + return couponTemplate.UsableBeginTime <= now && couponTemplate.UsableEndTime > now; + } } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponTemplateNotFoundOrUnavailableException.cs b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponTemplateNotFoundOrUnavailableException.cs new file mode 100644 index 00000000..22765152 --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/CouponTemplateNotFoundOrUnavailableException.cs @@ -0,0 +1,12 @@ +using Volo.Abp; + +namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount +{ + public class CouponTemplateNotFoundOrUnavailableException : BusinessException + { + public CouponTemplateNotFoundOrUnavailableException() : base("CouponTemplateNotFoundOrUnavailable", + "Coupon template not found or unavailable.") + { + } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/OrderDoesNotMeetCouponUsageConditionException.cs b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/OrderDoesNotMeetCouponUsageConditionException.cs new file mode 100644 index 00000000..6afaf0b4 --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Orders.Plugins.Coupons/EasyAbp/EShop/Orders/Plugins/Coupons/OrderDiscount/OrderDoesNotMeetCouponUsageConditionException.cs @@ -0,0 +1,12 @@ +using Volo.Abp; + +namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount +{ + public class OrderDoesNotMeetCouponUsageConditionException : BusinessException + { + public OrderDoesNotMeetCouponUsageConditionException() : base("OrderDoesNotMeetCouponUsageCondition", + "Order does not meet the coupon usage condition.") + { + } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CouponTemplateDto.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CouponTemplateDto.cs index fb03e486..5a3d30c2 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CouponTemplateDto.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CouponTemplateDto.cs @@ -27,8 +27,6 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates.Dtos public decimal DiscountAmount { get; set; } - public bool IsCrossProductAllowed { get; set; } - public bool IsUnscoped { get; set; } public List Scopes { get; set; } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CreateUpdateCouponTemplateDto.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CreateUpdateCouponTemplateDto.cs index 6686b731..69fbf962 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CreateUpdateCouponTemplateDto.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/Dtos/CreateUpdateCouponTemplateDto.cs @@ -1,10 +1,12 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates.Dtos { [Serializable] - public class CreateUpdateCouponTemplateDto + public class CreateUpdateCouponTemplateDto : IValidatableObject { public Guid? StoreId { get; set; } @@ -26,10 +28,27 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates.Dtos public decimal DiscountAmount { get; set; } - public bool IsCrossProductAllowed { get; set; } - public bool IsUnscoped { get; set; } - public List Scopes { get; set; } + public List Scopes { get; set; } = new List(); + + public IEnumerable Validate(ValidationContext validationContext) + { + if (DiscountAmount > ConditionAmount) + { + yield return new ValidationResult( + "DiscountAmount should not be greater than ConditionAmount!", + new[] { nameof(DiscountAmount) } + ); + } + + if (CouponType == CouponType.PerMeet && ConditionAmount == decimal.Zero) + { + yield return new ValidationResult( + "ConditionAmount should be greater than zero if the CouponType is PerMeet!", + new[] { nameof(ConditionAmount) } + ); + } + } } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponHasBeenOccupiedException.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponHasBeenOccupiedException.cs new file mode 100644 index 00000000..939b7887 --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponHasBeenOccupiedException.cs @@ -0,0 +1,11 @@ +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.Coupons.Coupons +{ + public class CouponHasBeenOccupiedException : BusinessException + { + public CouponHasBeenOccupiedException() : base("CouponHasBeenOccupied", "Coupon has been occupied.") + { + } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/CreateUpdateCouponDto.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/CreateCouponDto.cs similarity index 82% rename from plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/CreateUpdateCouponDto.cs rename to plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/CreateCouponDto.cs index 57a61400..bb5c3510 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/CreateUpdateCouponDto.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/CreateCouponDto.cs @@ -2,7 +2,7 @@ using System; namespace EasyAbp.EShop.Plugins.Coupons.Coupons.Dtos { [Serializable] - public class CreateUpdateCouponDto + public class CreateCouponDto { public Guid CouponTemplateId { get; set; } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/GetCouponListInput.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/GetCouponListInput.cs new file mode 100644 index 00000000..58748592 --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/GetCouponListInput.cs @@ -0,0 +1,13 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.Coupons.Coupons.Dtos +{ + [Serializable] + public class GetCouponListInput : PagedAndSortedResultRequestDto + { + public bool AvailableOnly { get; set; } + + public Guid? UserId { get; set; } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/OccupyCouponInput.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/OccupyCouponInput.cs new file mode 100644 index 00000000..a6dec610 --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/OccupyCouponInput.cs @@ -0,0 +1,10 @@ +using System; + +namespace EasyAbp.EShop.Plugins.Coupons.Coupons.Dtos +{ + [Serializable] + public class OccupyCouponInput + { + public Guid OrderId { get; set; } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/UpdateCouponDto.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/UpdateCouponDto.cs new file mode 100644 index 00000000..9cc24bee --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/Dtos/UpdateCouponDto.cs @@ -0,0 +1,9 @@ +using System; +namespace EasyAbp.EShop.Plugins.Coupons.Coupons.Dtos +{ + [Serializable] + public class UpdateCouponDto + { + public DateTime? ExpirationTime { get; set; } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponAppService.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponAppService.cs index 1c0a2f99..c5e9b6cd 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponAppService.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponAppService.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using EasyAbp.EShop.Plugins.Coupons.Coupons.Dtos; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -9,10 +10,10 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons ICrudAppService< CouponDto, Guid, - PagedAndSortedResultRequestDto, - CreateUpdateCouponDto, - CreateUpdateCouponDto> + GetCouponListInput, + CreateCouponDto, + UpdateCouponDto> { - + Task OccupyAsync(Guid id, OccupyCouponInput input); } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Permissions/CouponsPermissionDefinitionProvider.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Permissions/CouponsPermissionDefinitionProvider.cs index 71d31ba1..a762b909 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Permissions/CouponsPermissionDefinitionProvider.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Permissions/CouponsPermissionDefinitionProvider.cs @@ -16,6 +16,8 @@ namespace EasyAbp.EShop.Plugins.Coupons.Permissions couponTemplatePermission.AddChild(CouponsPermissions.CouponTemplate.Delete, L("Permission:Delete")); var couponPermission = myGroup.AddPermission(CouponsPermissions.Coupon.Default, L("Permission:Coupon")); + couponPermission.AddChild(CouponsPermissions.Coupon.Use, L("Permission:Use")); + couponPermission.AddChild(CouponsPermissions.Coupon.Manage, L("Permission:Manage")); couponPermission.AddChild(CouponsPermissions.Coupon.Create, L("Permission:Create")); couponPermission.AddChild(CouponsPermissions.Coupon.Update, L("Permission:Update")); couponPermission.AddChild(CouponsPermissions.Coupon.Delete, L("Permission:Delete")); diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Permissions/CouponsPermissions.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Permissions/CouponsPermissions.cs index e0362c17..64f3b58f 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Permissions/CouponsPermissions.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application.Contracts/EasyAbp/EShop/Plugins/Coupons/Permissions/CouponsPermissions.cs @@ -22,6 +22,8 @@ namespace EasyAbp.EShop.Plugins.Coupons.Permissions public class Coupon { public const string Default = GroupName + ".Coupon"; + public const string Use = Default + ".Use"; + public const string Manage = Default + ".Manage"; public const string Update = Default + ".Update"; public const string Create = Default + ".Create"; public const string Delete = Default + ".Delete"; diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateAppService.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateAppService.cs index 5981d256..22e513a6 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateAppService.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateAppService.cs @@ -26,6 +26,11 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates _repository = repository; } + protected override IQueryable CreateFilteredQuery(PagedAndSortedResultRequestDto input) + { + return _repository.WithDetails(); + } + public override async Task CreateAsync(CreateUpdateCouponTemplateDto input) { await CheckCreatePolicyAsync(); @@ -59,11 +64,8 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates inputScoreDto.ProductGroupName, inputScoreDto.ProductId, inputScoreDto.ProductSkuId)); } - foreach (var scope in entity.Scopes.Where(scope => !ExistScope(input.Scopes, scope))) - { - entity.Scopes.Remove(scope); - } - + entity.Scopes.RemoveAll(scope => !ExistScope(input.Scopes, scope)); + await Repository.UpdateAsync(entity, autoSave: true); return await MapToGetOutputDtoAsync(entity); diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponAppService.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponAppService.cs index 47661ce1..e59a39a5 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponAppService.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponAppService.cs @@ -1,14 +1,17 @@ using System; +using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Plugins.Coupons.Permissions; using EasyAbp.EShop.Plugins.Coupons.Coupons.Dtos; using EasyAbp.EShop.Plugins.Coupons.CouponTemplates; +using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Users; namespace EasyAbp.EShop.Plugins.Coupons.Coupons { - public class CouponAppService : CrudAppService, + public class CouponAppService : CrudAppService, ICouponAppService { protected override string GetPolicyName { get; set; } = CouponsPermissions.Coupon.Default; @@ -28,7 +31,37 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons _repository = repository; } - public override async Task CreateAsync(CreateUpdateCouponDto input) + protected override IQueryable CreateFilteredQuery(GetCouponListInput input) + { + return input.AvailableOnly ? _repository.GetAvailableCouponQueryable(Clock) : _repository.AsQueryable() + .WhereIf(input.UserId.HasValue, x => x.UserId == input.UserId.Value); + } + + public override async Task GetAsync(Guid id) + { + await CheckGetPolicyAsync(); + + var entity = await GetEntityByIdAsync(id); + + if (entity.UserId != CurrentUser.GetId()) + { + await AuthorizationService.CheckAsync(CouponsPermissions.Coupon.Manage); + } + + return await MapToGetOutputDtoAsync(entity); + } + + public override async Task> GetListAsync(GetCouponListInput input) + { + if (input.UserId != CurrentUser.GetId()) + { + await AuthorizationService.CheckAsync(CouponsPermissions.Coupon.Manage); + } + + return await base.GetListAsync(input); + } + + public override async Task CreateAsync(CreateCouponDto input) { await CheckCreatePolicyAsync(); @@ -44,5 +77,22 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons return await MapToGetOutputDtoAsync(entity); } + + [Authorize(CouponsPermissions.Coupon.Use)] + public virtual async Task OccupyAsync(Guid id, OccupyCouponInput input) + { + var coupon = await GetEntityByIdAsync(id); + + if (coupon.OrderId.HasValue) + { + throw new CouponHasBeenOccupiedException(); + } + + coupon.SetOrderId(input.OrderId); + + await _repository.UpdateAsync(coupon, true); + + return ObjectMapper.Map(coupon); + } } } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/CouponsApplicationAutoMapperProfile.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/CouponsApplicationAutoMapperProfile.cs index 9eb5f09e..aa64e59c 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/CouponsApplicationAutoMapperProfile.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Application/EasyAbp/EShop/Plugins/Coupons/CouponsApplicationAutoMapperProfile.cs @@ -22,7 +22,8 @@ namespace EasyAbp.EShop.Plugins.Coupons CreateMap(MemberList.Source); CreateMap(); - CreateMap(MemberList.Source); + CreateMap(MemberList.Source); + CreateMap(MemberList.Source); } } } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateData.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateData.cs index dbe70771..75709bd4 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateData.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateData.cs @@ -5,6 +5,10 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates { public class CouponTemplateData : ICouponTemplate, IHasCouponTemplateScopes { + public Guid Id { get; set; } + + public Guid? TenantId { get; set; } + public Guid? StoreId { get; set; } public CouponType CouponType { get; set; } @@ -25,8 +29,6 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates public decimal DiscountAmount { get; set; } - public bool IsCrossProductAllowed { get; set; } - public bool IsUnscoped { get; set; } public List Scopes { get; set; } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponType.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponType.cs index f40574d2..56103768 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponType.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponType.cs @@ -1,5 +1,8 @@ -namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates +using System; + +namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates { + [Flags] public enum CouponType { /// diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/ICouponTemplate.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/ICouponTemplate.cs index ab640f21..d35069b3 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/ICouponTemplate.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/ICouponTemplate.cs @@ -29,8 +29,6 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates decimal DiscountAmount { get; } - bool IsCrossProductAllowed { get; } - bool IsUnscoped { get; } } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponData.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponData.cs index 73611f66..d29298e6 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponData.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponData.cs @@ -6,6 +6,10 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons { public class CouponData : ICoupon { + public Guid Id { get; set; } + + public Guid? TenantId { get; set; } + public Guid CouponTemplateId { get; set; } public Guid UserId { get; set; } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponLookupService.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponLookupService.cs index 1784a262..66feca05 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponLookupService.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponLookupService.cs @@ -6,6 +6,6 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons { public interface ICouponLookupService { - Task FindByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task FindByIdAsync(Guid id, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/cs.json b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/cs.json index a350212f..bd160d9d 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/cs.json +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/cs.json @@ -3,39 +3,42 @@ "texts": { "ManageYourProfile": "Spravovat profil", "SamplePageMessage": "Ukázková stránka pro modul Coupons", - "Permission:CouponTemplate": "CouponTemplate", + "Menu:CouponManagement": "Coupons", + "Permission:CouponTemplate": "Coupon template", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", - "Menu:CouponTemplate": "MenuCouponTemplate", - "CouponTemplate": "CouponTemplate", - "CouponTemplateStoreId": "CouponTemplateStoreId", - "CouponTemplateCouponType": "CouponTemplateCouponType", - "CouponTemplateUniqueName": "CouponTemplateUniqueName", - "CouponTemplateDisplayName": "CouponTemplateDisplayName", - "CouponTemplateDescription": "CouponTemplateDescription", - "CouponTemplateUsableDuration": "CouponTemplateUsableDuration", - "CouponTemplateUsableBeginTime": "CouponTemplateUsableBeginTime", - "CouponTemplateUsableEndTime": "CouponTemplateUsableEndTime", - "CouponTemplateConditionAmount": "CouponTemplateConditionAmount", - "CouponTemplateDiscountAmount": "CouponTemplateDiscountAmount", - "CouponTemplateIsCrossProductAllowed": "CouponTemplateIsCrossProductAllowed", - "CouponTemplateIsUnscoped": "CouponTemplateIsUnscoped", - "CreateCouponTemplate": "CreateCouponTemplate", - "EditCouponTemplate": "EditCouponTemplate", - "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the couponTemplate {0}?", + "Menu:CouponTemplate": "Coupon template", + "CouponTemplate": "Coupon template", + "CouponTemplateStoreId": "Store ID", + "CouponTemplateCouponType": "Coupon type", + "CouponTemplateUniqueName": "Unique name", + "CouponTemplateDisplayName": "Display name", + "CouponTemplateDescription": "Description", + "CouponTemplateUsableDuration": "Usable duration", + "CouponTemplateUsableBeginTime": "Usable begin time", + "CouponTemplateUsableEndTime": "Usable end time", + "CouponTemplateConditionAmount": "Condition amount", + "CouponTemplateDiscountAmount": "Discount amount", + "CouponTemplateIsUnscoped": "Unscoped", + "CreateCouponTemplate": "New", + "EditCouponTemplate": "Edit", + "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the coupon template {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Permission:Coupon": "Coupon", - "Menu:Coupon": "MenuCoupon", + "Menu:Coupon": "Coupon", "Coupon": "Coupon", - "CouponCouponTemplateId": "CouponCouponTemplateId", - "CouponUserId": "CouponUserId", - "CouponOrderId": "CouponOrderId", - "CouponExpirationTime": "CouponExpirationTime", - "CouponUsedTime": "CouponUsedTime", - "CouponDiscountedAmount": "CouponDiscountedAmount", - "CreateCoupon": "CreateCoupon", - "EditCoupon": "EditCoupon", + "CouponCouponTemplateId": "Coupon template ID", + "CouponUserId": "User ID", + "CouponOrderId": "Order ID", + "CouponExpirationTime": "Expiration time", + "CouponUsedTime": "Used time", + "CouponDiscountedAmount": "Discounted amount", + "CreateCoupon": "New", + "EditCoupon": "Edit", "CouponDeletionConfirmationMessage": "Are you sure to delete the coupon {0}?" } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/en.json b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/en.json index 04ef7b4f..c6e86914 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/en.json +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/en.json @@ -3,39 +3,42 @@ "texts": { "ManageYourProfile": "Manage your profile", "SamplePageMessage": "A sample page for the Coupons module", - "Permission:CouponTemplate": "CouponTemplate", + "Menu:CouponManagement": "Coupons", + "Permission:CouponTemplate": "Coupon template", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", - "Menu:CouponTemplate": "MenuCouponTemplate", - "CouponTemplate": "CouponTemplate", - "CouponTemplateStoreId": "CouponTemplateStoreId", - "CouponTemplateCouponType": "CouponTemplateCouponType", - "CouponTemplateUniqueName": "CouponTemplateUniqueName", - "CouponTemplateDisplayName": "CouponTemplateDisplayName", - "CouponTemplateDescription": "CouponTemplateDescription", - "CouponTemplateUsableDuration": "CouponTemplateUsableDuration", - "CouponTemplateUsableBeginTime": "CouponTemplateUsableBeginTime", - "CouponTemplateUsableEndTime": "CouponTemplateUsableEndTime", - "CouponTemplateConditionAmount": "CouponTemplateConditionAmount", - "CouponTemplateDiscountAmount": "CouponTemplateDiscountAmount", - "CouponTemplateIsCrossProductAllowed": "CouponTemplateIsCrossProductAllowed", - "CouponTemplateIsUnscoped": "CouponTemplateIsUnscoped", - "CreateCouponTemplate": "CreateCouponTemplate", - "EditCouponTemplate": "EditCouponTemplate", - "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the couponTemplate {0}?", + "Menu:CouponTemplate": "Coupon template", + "CouponTemplate": "Coupon template", + "CouponTemplateStoreId": "Store ID", + "CouponTemplateCouponType": "Coupon type", + "CouponTemplateUniqueName": "Unique name", + "CouponTemplateDisplayName": "Display name", + "CouponTemplateDescription": "Description", + "CouponTemplateUsableDuration": "Usable duration", + "CouponTemplateUsableBeginTime": "Usable begin time", + "CouponTemplateUsableEndTime": "Usable end time", + "CouponTemplateConditionAmount": "Condition amount", + "CouponTemplateDiscountAmount": "Discount amount", + "CouponTemplateIsUnscoped": "Unscoped", + "CreateCouponTemplate": "New", + "EditCouponTemplate": "Edit", + "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the coupon template {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Permission:Coupon": "Coupon", - "Menu:Coupon": "MenuCoupon", + "Menu:Coupon": "Coupon", "Coupon": "Coupon", - "CouponCouponTemplateId": "CouponCouponTemplateId", - "CouponUserId": "CouponUserId", - "CouponOrderId": "CouponOrderId", - "CouponExpirationTime": "CouponExpirationTime", - "CouponUsedTime": "CouponUsedTime", - "CouponDiscountedAmount": "CouponDiscountedAmount", - "CreateCoupon": "CreateCoupon", - "EditCoupon": "EditCoupon", + "CouponCouponTemplateId": "Coupon template ID", + "CouponUserId": "User ID", + "CouponOrderId": "Order ID", + "CouponExpirationTime": "Expiration time", + "CouponUsedTime": "Used time", + "CouponDiscountedAmount": "Discounted amount", + "CreateCoupon": "New", + "EditCoupon": "Edit", "CouponDeletionConfirmationMessage": "Are you sure to delete the coupon {0}?" } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/pl-PL.json b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/pl-PL.json index 1b5d2e90..2d6952a8 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/pl-PL.json +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/pl-PL.json @@ -1,39 +1,41 @@ { "culture": "pl-PL", "texts": { - "Permission:CouponTemplate": "CouponTemplate", + "Permission:CouponTemplate": "Coupon template", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", - "Menu:CouponTemplate": "MenuCouponTemplate", - "CouponTemplate": "CouponTemplate", - "CouponTemplateStoreId": "CouponTemplateStoreId", - "CouponTemplateCouponType": "CouponTemplateCouponType", - "CouponTemplateUniqueName": "CouponTemplateUniqueName", - "CouponTemplateDisplayName": "CouponTemplateDisplayName", - "CouponTemplateDescription": "CouponTemplateDescription", - "CouponTemplateUsableDuration": "CouponTemplateUsableDuration", - "CouponTemplateUsableBeginTime": "CouponTemplateUsableBeginTime", - "CouponTemplateUsableEndTime": "CouponTemplateUsableEndTime", - "CouponTemplateConditionAmount": "CouponTemplateConditionAmount", - "CouponTemplateDiscountAmount": "CouponTemplateDiscountAmount", - "CouponTemplateIsCrossProductAllowed": "CouponTemplateIsCrossProductAllowed", - "CouponTemplateIsUnscoped": "CouponTemplateIsUnscoped", - "CreateCouponTemplate": "CreateCouponTemplate", - "EditCouponTemplate": "EditCouponTemplate", - "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the couponTemplate {0}?", + "Menu:CouponTemplate": "Coupon template", + "CouponTemplate": "Coupon template", + "CouponTemplateStoreId": "Store ID", + "CouponTemplateCouponType": "Coupon type", + "CouponTemplateUniqueName": "Unique name", + "CouponTemplateDisplayName": "Display name", + "CouponTemplateDescription": "Description", + "CouponTemplateUsableDuration": "Usable duration", + "CouponTemplateUsableBeginTime": "Usable begin time", + "CouponTemplateUsableEndTime": "Usable end time", + "CouponTemplateConditionAmount": "Condition amount", + "CouponTemplateDiscountAmount": "Discount amount", + "CouponTemplateIsUnscoped": "Unscoped", + "CreateCouponTemplate": "New", + "EditCouponTemplate": "Edit", + "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the coupon template {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Permission:Coupon": "Coupon", - "Menu:Coupon": "MenuCoupon", + "Menu:Coupon": "Coupon", "Coupon": "Coupon", - "CouponCouponTemplateId": "CouponCouponTemplateId", - "CouponUserId": "CouponUserId", - "CouponOrderId": "CouponOrderId", - "CouponExpirationTime": "CouponExpirationTime", - "CouponUsedTime": "CouponUsedTime", - "CouponDiscountedAmount": "CouponDiscountedAmount", - "CreateCoupon": "CreateCoupon", - "EditCoupon": "EditCoupon", + "CouponCouponTemplateId": "Coupon template ID", + "CouponUserId": "User ID", + "CouponOrderId": "Order ID", + "CouponExpirationTime": "Expiration time", + "CouponUsedTime": "Used time", + "CouponDiscountedAmount": "Discounted amount", + "CreateCoupon": "New", + "EditCoupon": "Edit", "CouponDeletionConfirmationMessage": "Are you sure to delete the coupon {0}?" } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/pt-BR.json b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/pt-BR.json index bac2dfdd..cf3c0c22 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/pt-BR.json +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/pt-BR.json @@ -1,39 +1,41 @@ { "culture": "pt-BR", "texts": { - "Permission:CouponTemplate": "CouponTemplate", + "Permission:CouponTemplate": "Coupon template", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", - "Menu:CouponTemplate": "MenuCouponTemplate", - "CouponTemplate": "CouponTemplate", - "CouponTemplateStoreId": "CouponTemplateStoreId", - "CouponTemplateCouponType": "CouponTemplateCouponType", - "CouponTemplateUniqueName": "CouponTemplateUniqueName", - "CouponTemplateDisplayName": "CouponTemplateDisplayName", - "CouponTemplateDescription": "CouponTemplateDescription", - "CouponTemplateUsableDuration": "CouponTemplateUsableDuration", - "CouponTemplateUsableBeginTime": "CouponTemplateUsableBeginTime", - "CouponTemplateUsableEndTime": "CouponTemplateUsableEndTime", - "CouponTemplateConditionAmount": "CouponTemplateConditionAmount", - "CouponTemplateDiscountAmount": "CouponTemplateDiscountAmount", - "CouponTemplateIsCrossProductAllowed": "CouponTemplateIsCrossProductAllowed", - "CouponTemplateIsUnscoped": "CouponTemplateIsUnscoped", - "CreateCouponTemplate": "CreateCouponTemplate", - "EditCouponTemplate": "EditCouponTemplate", - "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the couponTemplate {0}?", + "Menu:CouponTemplate": "Coupon template", + "CouponTemplate": "Coupon template", + "CouponTemplateStoreId": "Store ID", + "CouponTemplateCouponType": "Coupon type", + "CouponTemplateUniqueName": "Unique name", + "CouponTemplateDisplayName": "Display name", + "CouponTemplateDescription": "Description", + "CouponTemplateUsableDuration": "Usable duration", + "CouponTemplateUsableBeginTime": "Usable begin time", + "CouponTemplateUsableEndTime": "Usable end time", + "CouponTemplateConditionAmount": "Condition amount", + "CouponTemplateDiscountAmount": "Discount amount", + "CouponTemplateIsUnscoped": "Unscoped", + "CreateCouponTemplate": "New", + "EditCouponTemplate": "Edit", + "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the coupon template {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Permission:Coupon": "Coupon", - "Menu:Coupon": "MenuCoupon", + "Menu:Coupon": "Coupon", "Coupon": "Coupon", - "CouponCouponTemplateId": "CouponCouponTemplateId", - "CouponUserId": "CouponUserId", - "CouponOrderId": "CouponOrderId", - "CouponExpirationTime": "CouponExpirationTime", - "CouponUsedTime": "CouponUsedTime", - "CouponDiscountedAmount": "CouponDiscountedAmount", - "CreateCoupon": "CreateCoupon", - "EditCoupon": "EditCoupon", + "CouponCouponTemplateId": "Coupon template ID", + "CouponUserId": "User ID", + "CouponOrderId": "Order ID", + "CouponExpirationTime": "Expiration time", + "CouponUsedTime": "Used time", + "CouponDiscountedAmount": "Discounted amount", + "CreateCoupon": "New", + "EditCoupon": "Edit", "CouponDeletionConfirmationMessage": "Are you sure to delete the coupon {0}?" } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/sl.json b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/sl.json index bdf49286..7df02afc 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/sl.json +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/sl.json @@ -2,39 +2,42 @@ "culture": "sl", "texts": { "ManageYourProfile": "Upravljajte svojim profilom", - "Permission:CouponTemplate": "CouponTemplate", + "Menu:CouponManagement": "Coupons", + "Permission:CouponTemplate": "Coupon template", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", - "Menu:CouponTemplate": "MenuCouponTemplate", - "CouponTemplate": "CouponTemplate", - "CouponTemplateStoreId": "CouponTemplateStoreId", - "CouponTemplateCouponType": "CouponTemplateCouponType", - "CouponTemplateUniqueName": "CouponTemplateUniqueName", - "CouponTemplateDisplayName": "CouponTemplateDisplayName", - "CouponTemplateDescription": "CouponTemplateDescription", - "CouponTemplateUsableDuration": "CouponTemplateUsableDuration", - "CouponTemplateUsableBeginTime": "CouponTemplateUsableBeginTime", - "CouponTemplateUsableEndTime": "CouponTemplateUsableEndTime", - "CouponTemplateConditionAmount": "CouponTemplateConditionAmount", - "CouponTemplateDiscountAmount": "CouponTemplateDiscountAmount", - "CouponTemplateIsCrossProductAllowed": "CouponTemplateIsCrossProductAllowed", - "CouponTemplateIsUnscoped": "CouponTemplateIsUnscoped", - "CreateCouponTemplate": "CreateCouponTemplate", - "EditCouponTemplate": "EditCouponTemplate", - "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the couponTemplate {0}?", + "Menu:CouponTemplate": "Coupon template", + "CouponTemplate": "Coupon template", + "CouponTemplateStoreId": "Store ID", + "CouponTemplateCouponType": "Coupon type", + "CouponTemplateUniqueName": "Unique name", + "CouponTemplateDisplayName": "Display name", + "CouponTemplateDescription": "Description", + "CouponTemplateUsableDuration": "Usable duration", + "CouponTemplateUsableBeginTime": "Usable begin time", + "CouponTemplateUsableEndTime": "Usable end time", + "CouponTemplateConditionAmount": "Condition amount", + "CouponTemplateDiscountAmount": "Discount amount", + "CouponTemplateIsUnscoped": "Unscoped", + "CreateCouponTemplate": "New", + "EditCouponTemplate": "Edit", + "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the coupon template {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Permission:Coupon": "Coupon", - "Menu:Coupon": "MenuCoupon", + "Menu:Coupon": "Coupon", "Coupon": "Coupon", - "CouponCouponTemplateId": "CouponCouponTemplateId", - "CouponUserId": "CouponUserId", - "CouponOrderId": "CouponOrderId", - "CouponExpirationTime": "CouponExpirationTime", - "CouponUsedTime": "CouponUsedTime", - "CouponDiscountedAmount": "CouponDiscountedAmount", - "CreateCoupon": "CreateCoupon", - "EditCoupon": "EditCoupon", + "CouponCouponTemplateId": "Coupon template ID", + "CouponUserId": "User ID", + "CouponOrderId": "Order ID", + "CouponExpirationTime": "Expiration time", + "CouponUsedTime": "Used time", + "CouponDiscountedAmount": "Discounted amount", + "CreateCoupon": "New", + "EditCoupon": "Edit", "CouponDeletionConfirmationMessage": "Are you sure to delete the coupon {0}?" } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/tr.json b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/tr.json index 9c8d6a22..a6c936ce 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/tr.json +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/tr.json @@ -3,39 +3,42 @@ "texts": { "ManageYourProfile": "Profil yönetimi", "SamplePageMessage": "Coupons modulünden örnek bir sayfa", - "Permission:CouponTemplate": "CouponTemplate", + "Menu:CouponManagement": "Coupons", + "Permission:CouponTemplate": "Coupon template", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", - "Menu:CouponTemplate": "MenuCouponTemplate", - "CouponTemplate": "CouponTemplate", - "CouponTemplateStoreId": "CouponTemplateStoreId", - "CouponTemplateCouponType": "CouponTemplateCouponType", - "CouponTemplateUniqueName": "CouponTemplateUniqueName", - "CouponTemplateDisplayName": "CouponTemplateDisplayName", - "CouponTemplateDescription": "CouponTemplateDescription", - "CouponTemplateUsableDuration": "CouponTemplateUsableDuration", - "CouponTemplateUsableBeginTime": "CouponTemplateUsableBeginTime", - "CouponTemplateUsableEndTime": "CouponTemplateUsableEndTime", - "CouponTemplateConditionAmount": "CouponTemplateConditionAmount", - "CouponTemplateDiscountAmount": "CouponTemplateDiscountAmount", - "CouponTemplateIsCrossProductAllowed": "CouponTemplateIsCrossProductAllowed", - "CouponTemplateIsUnscoped": "CouponTemplateIsUnscoped", - "CreateCouponTemplate": "CreateCouponTemplate", - "EditCouponTemplate": "EditCouponTemplate", - "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the couponTemplate {0}?", + "Menu:CouponTemplate": "Coupon template", + "CouponTemplate": "Coupon template", + "CouponTemplateStoreId": "Store ID", + "CouponTemplateCouponType": "Coupon type", + "CouponTemplateUniqueName": "Unique name", + "CouponTemplateDisplayName": "Display name", + "CouponTemplateDescription": "Description", + "CouponTemplateUsableDuration": "Usable duration", + "CouponTemplateUsableBeginTime": "Usable begin time", + "CouponTemplateUsableEndTime": "Usable end time", + "CouponTemplateConditionAmount": "Condition amount", + "CouponTemplateDiscountAmount": "Discount amount", + "CouponTemplateIsUnscoped": "Unscoped", + "CreateCouponTemplate": "New", + "EditCouponTemplate": "Edit", + "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the coupon template {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Permission:Coupon": "Coupon", - "Menu:Coupon": "MenuCoupon", + "Menu:Coupon": "Coupon", "Coupon": "Coupon", - "CouponCouponTemplateId": "CouponCouponTemplateId", - "CouponUserId": "CouponUserId", - "CouponOrderId": "CouponOrderId", - "CouponExpirationTime": "CouponExpirationTime", - "CouponUsedTime": "CouponUsedTime", - "CouponDiscountedAmount": "CouponDiscountedAmount", - "CreateCoupon": "CreateCoupon", - "EditCoupon": "EditCoupon", + "CouponCouponTemplateId": "Coupon template ID", + "CouponUserId": "User ID", + "CouponOrderId": "Order ID", + "CouponExpirationTime": "Expiration time", + "CouponUsedTime": "Used time", + "CouponDiscountedAmount": "Discounted amount", + "CreateCoupon": "New", + "EditCoupon": "Edit", "CouponDeletionConfirmationMessage": "Are you sure to delete the coupon {0}?" } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/vi.json b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/vi.json index 33426d57..aa6dd038 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/vi.json +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/vi.json @@ -1,39 +1,41 @@ { "culture": "vi", "texts": { - "Permission:CouponTemplate": "CouponTemplate", + "Permission:CouponTemplate": "Coupon template", "Permission:Create": "Create", "Permission:Update": "Update", "Permission:Delete": "Delete", - "Menu:CouponTemplate": "MenuCouponTemplate", - "CouponTemplate": "CouponTemplate", - "CouponTemplateStoreId": "CouponTemplateStoreId", - "CouponTemplateCouponType": "CouponTemplateCouponType", - "CouponTemplateUniqueName": "CouponTemplateUniqueName", - "CouponTemplateDisplayName": "CouponTemplateDisplayName", - "CouponTemplateDescription": "CouponTemplateDescription", - "CouponTemplateUsableDuration": "CouponTemplateUsableDuration", - "CouponTemplateUsableBeginTime": "CouponTemplateUsableBeginTime", - "CouponTemplateUsableEndTime": "CouponTemplateUsableEndTime", - "CouponTemplateConditionAmount": "CouponTemplateConditionAmount", - "CouponTemplateDiscountAmount": "CouponTemplateDiscountAmount", - "CouponTemplateIsCrossProductAllowed": "CouponTemplateIsCrossProductAllowed", - "CouponTemplateIsUnscoped": "CouponTemplateIsUnscoped", - "CreateCouponTemplate": "CreateCouponTemplate", - "EditCouponTemplate": "EditCouponTemplate", - "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the couponTemplate {0}?", + "Menu:CouponTemplate": "Coupon template", + "CouponTemplate": "Coupon template", + "CouponTemplateStoreId": "Store ID", + "CouponTemplateCouponType": "Coupon type", + "CouponTemplateUniqueName": "Unique name", + "CouponTemplateDisplayName": "Display name", + "CouponTemplateDescription": "Description", + "CouponTemplateUsableDuration": "Usable duration", + "CouponTemplateUsableBeginTime": "Usable begin time", + "CouponTemplateUsableEndTime": "Usable end time", + "CouponTemplateConditionAmount": "Condition amount", + "CouponTemplateDiscountAmount": "Discount amount", + "CouponTemplateIsUnscoped": "Unscoped", + "CreateCouponTemplate": "New", + "EditCouponTemplate": "Edit", + "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the coupon template {0}?", "SuccessfullyDeleted": "Successfully deleted", + "CouponType.Normal": "X discount", + "CouponType.PerMeet": "X discount for every Y", + "CouponType.Custom": "Custom", "Permission:Coupon": "Coupon", - "Menu:Coupon": "MenuCoupon", + "Menu:Coupon": "Coupon", "Coupon": "Coupon", - "CouponCouponTemplateId": "CouponCouponTemplateId", - "CouponUserId": "CouponUserId", - "CouponOrderId": "CouponOrderId", - "CouponExpirationTime": "CouponExpirationTime", - "CouponUsedTime": "CouponUsedTime", - "CouponDiscountedAmount": "CouponDiscountedAmount", - "CreateCoupon": "CreateCoupon", - "EditCoupon": "EditCoupon", + "CouponCouponTemplateId": "Coupon template ID", + "CouponUserId": "User ID", + "CouponOrderId": "Order ID", + "CouponExpirationTime": "Expiration time", + "CouponUsedTime": "Used time", + "CouponDiscountedAmount": "Discounted amount", + "CreateCoupon": "New", + "EditCoupon": "Edit", "CouponDeletionConfirmationMessage": "Are you sure to delete the coupon {0}?" } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/zh-Hans.json b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/zh-Hans.json index 1e0919c2..c9874dc5 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/zh-Hans.json +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/zh-Hans.json @@ -2,39 +2,42 @@ "culture": "zh-Hans", "texts": { "ManageYourProfile": "管理个人资料", - "Permission:CouponTemplate": "CouponTemplate", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:CouponTemplate": "MenuCouponTemplate", - "CouponTemplate": "CouponTemplate", - "CouponTemplateStoreId": "CouponTemplateStoreId", - "CouponTemplateCouponType": "CouponTemplateCouponType", - "CouponTemplateUniqueName": "CouponTemplateUniqueName", - "CouponTemplateDisplayName": "CouponTemplateDisplayName", - "CouponTemplateDescription": "CouponTemplateDescription", - "CouponTemplateUsableDuration": "CouponTemplateUsableDuration", - "CouponTemplateUsableBeginTime": "CouponTemplateUsableBeginTime", - "CouponTemplateUsableEndTime": "CouponTemplateUsableEndTime", - "CouponTemplateConditionAmount": "CouponTemplateConditionAmount", - "CouponTemplateDiscountAmount": "CouponTemplateDiscountAmount", - "CouponTemplateIsCrossProductAllowed": "CouponTemplateIsCrossProductAllowed", - "CouponTemplateIsUnscoped": "CouponTemplateIsUnscoped", - "CreateCouponTemplate": "CreateCouponTemplate", - "EditCouponTemplate": "EditCouponTemplate", - "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the couponTemplate {0}?", - "SuccessfullyDeleted": "Successfully deleted", - "Permission:Coupon": "Coupon", - "Menu:Coupon": "MenuCoupon", - "Coupon": "Coupon", - "CouponCouponTemplateId": "CouponCouponTemplateId", - "CouponUserId": "CouponUserId", - "CouponOrderId": "CouponOrderId", - "CouponExpirationTime": "CouponExpirationTime", - "CouponUsedTime": "CouponUsedTime", - "CouponDiscountedAmount": "CouponDiscountedAmount", - "CreateCoupon": "CreateCoupon", - "EditCoupon": "EditCoupon", - "CouponDeletionConfirmationMessage": "Are you sure to delete the coupon {0}?" + "Menu:CouponManagement": "优惠券", + "Permission:CouponTemplate": "优惠券模板", + "Permission:Create": "新建", + "Permission:Update": "更新", + "Permission:Delete": "删除", + "Menu:CouponTemplate": "优惠券模板", + "CouponTemplate": "优惠券模板", + "CouponTemplateStoreId": "店铺 ID", + "CouponTemplateCouponType": "类型", + "CouponTemplateUniqueName": "编号", + "CouponTemplateDisplayName": "名称", + "CouponTemplateDescription": "描述", + "CouponTemplateUsableDuration": "领取后有效时长", + "CouponTemplateUsableBeginTime": "可用开始时间", + "CouponTemplateUsableEndTime": "可用截止时间", + "CouponTemplateConditionAmount": "条件金额", + "CouponTemplateDiscountAmount": "减免金额", + "CouponTemplateIsUnscoped": "不限使用范围", + "CreateCouponTemplate": "新建", + "EditCouponTemplate": "编辑", + "CouponTemplateDeletionConfirmationMessage": "确认删除优惠券模板 {0}?", + "SuccessfullyDeleted": "删除成功", + "CouponType.Normal": "代金券(满 X 减 Y)", + "CouponType.PerMeet": "满减券(每满 X 减 Y)", + "CouponType.Custom": "自定义", + "Permission:Coupon": "优惠券", + "Menu:Coupon": "优惠券", + "Coupon": "优惠券", + "CouponCouponTemplateId": "优惠券模板 ID", + "CouponUserId": "用户 ID", + "CouponOrderId": "订单 ID", + "CouponExpirationTime": "有效期至", + "CouponUsedTime": "使用时间", + "CouponDiscountedAmount": "实际抵扣金额", + "CreateCoupon": "新建", + "EditCoupon": "编辑", + "CouponDeletionConfirmationMessage": "确认删除优惠券 {0}?" } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/zh-Hant.json b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/zh-Hant.json index 5f4b2c48..eaf96766 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/zh-Hant.json +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Localization/zh-Hant.json @@ -2,39 +2,42 @@ "culture": "zh-Hant", "texts": { "ManageYourProfile": "管理個人資料", - "Permission:CouponTemplate": "CouponTemplate", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:CouponTemplate": "MenuCouponTemplate", - "CouponTemplate": "CouponTemplate", - "CouponTemplateStoreId": "CouponTemplateStoreId", - "CouponTemplateCouponType": "CouponTemplateCouponType", - "CouponTemplateUniqueName": "CouponTemplateUniqueName", - "CouponTemplateDisplayName": "CouponTemplateDisplayName", - "CouponTemplateDescription": "CouponTemplateDescription", - "CouponTemplateUsableDuration": "CouponTemplateUsableDuration", - "CouponTemplateUsableBeginTime": "CouponTemplateUsableBeginTime", - "CouponTemplateUsableEndTime": "CouponTemplateUsableEndTime", - "CouponTemplateConditionAmount": "CouponTemplateConditionAmount", - "CouponTemplateDiscountAmount": "CouponTemplateDiscountAmount", - "CouponTemplateIsCrossProductAllowed": "CouponTemplateIsCrossProductAllowed", - "CouponTemplateIsUnscoped": "CouponTemplateIsUnscoped", - "CreateCouponTemplate": "CreateCouponTemplate", - "EditCouponTemplate": "EditCouponTemplate", - "CouponTemplateDeletionConfirmationMessage": "Are you sure to delete the couponTemplate {0}?", - "SuccessfullyDeleted": "Successfully deleted", - "Permission:Coupon": "Coupon", - "Menu:Coupon": "MenuCoupon", - "Coupon": "Coupon", - "CouponCouponTemplateId": "CouponCouponTemplateId", - "CouponUserId": "CouponUserId", - "CouponOrderId": "CouponOrderId", - "CouponExpirationTime": "CouponExpirationTime", - "CouponUsedTime": "CouponUsedTime", - "CouponDiscountedAmount": "CouponDiscountedAmount", - "CreateCoupon": "CreateCoupon", - "EditCoupon": "EditCoupon", - "CouponDeletionConfirmationMessage": "Are you sure to delete the coupon {0}?" + "Menu:CouponManagement": "優惠券", + "Permission:CouponTemplate": "優惠券模板", + "Permission:Create": "新建", + "Permission:Update": "更新", + "Permission:Delete": "刪除", + "Menu:CouponTemplate": "優惠券模板", + "CouponTemplate": "優惠券模板", + "CouponTemplateStoreId": "店鋪 ID", + "CouponTemplateCouponType": "類型", + "CouponTemplateUniqueName": "編號", + "CouponTemplateDisplayName": "名稱", + "CouponTemplateDescription": "描述", + "CouponTemplateUsableDuration": "領取後有效時長", + "CouponTemplateUsableBeginTime": "可用開始時間", + "CouponTemplateUsableEndTime": "可用截止時間", + "CouponTemplateConditionAmount": "條件金額", + "CouponTemplateDiscountAmount": "減免金額", + "CouponTemplateIsUnscoped": "不限使用範圍", + "CreateCouponTemplate": "新建", + "EditCouponTemplate": "編輯", + "CouponTemplateDeletionConfirmationMessage": "確認刪除優惠券模板 {0}?", + "SuccessfullyDeleted": "刪除成功", + "CouponType.Normal": "代金券(滿 X 減 Y)", + "CouponType.PerMeet": "滿減券(每滿 X 減 Y)", + "CouponType.Custom": "自定義", + "Permission:Coupon": "優惠券", + "Menu:Coupon": "優惠券", + "Coupon": "優惠券", + "CouponCouponTemplateId": "優惠券模板 ID", + "CouponUserId": "用戶 ID", + "CouponOrderId": "訂單 ID", + "CouponExpirationTime": "有效期至", + "CouponUsedTime": "使用時間", + "CouponDiscountedAmount": "實際抵扣金額", + "CreateCoupon": "新建", + "EditCoupon": "編輯", + "CouponDeletionConfirmationMessage": "確認刪除優惠券 {0}?" } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp.EShop.Plugins.Coupons.Domain.csproj b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp.EShop.Plugins.Coupons.Domain.csproj index b6cf3cec..fd78d9f6 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp.EShop.Plugins.Coupons.Domain.csproj +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp.EShop.Plugins.Coupons.Domain.csproj @@ -10,6 +10,7 @@ + diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate.cs index 1b14507b..d31e9718 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate.cs @@ -43,12 +43,6 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates public virtual decimal ConditionAmount { get; protected set; } public virtual decimal DiscountAmount { get; protected set; } - - /// - /// If it is set to true, the coupon can be used when the total price of all the order lines in the order - /// with products in scope is greater than or equal to ConditionAmount. - /// - public virtual bool IsCrossProductAllowed { get; protected set; } /// /// The coupon can be used for any product of any store if this property is set to true. @@ -75,7 +69,6 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates DateTime? usableEndTime, decimal conditionAmount, decimal discountAmount, - bool isCrossProductAllowed, bool isUnscoped, List scopes ) : base(id) @@ -91,7 +84,6 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates UsableEndTime = usableEndTime; ConditionAmount = conditionAmount; DiscountAmount = discountAmount; - IsCrossProductAllowed = isCrossProductAllowed; IsUnscoped = isUnscoped; Scopes = scopes ?? new List(); } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/Coupon.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/Coupon.cs index 4b0ce7cd..4dc89d48 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/Coupon.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/Coupon.cs @@ -39,12 +39,17 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons ExpirationTime = expirationTime; } + public void SetOrderId(Guid? orderId) + { + OrderId = orderId; + } + public void SetExpirationTime(DateTime? expirationTime) { ExpirationTime = expirationTime; } - public void Use(DateTime? usedTime, decimal? discountedAmount) + public void SetUsed(DateTime? usedTime, decimal? discountedAmount) { UsedTime = usedTime; DiscountedAmount = discountedAmount; diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponOrderCanceledEventHandler.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponOrderCanceledEventHandler.cs new file mode 100644 index 00000000..29f2d53f --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponOrderCanceledEventHandler.cs @@ -0,0 +1,37 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Plugins.Coupons.Coupons +{ + public class CouponOrderCanceledEventHandler : IDistributedEventHandler, ITransientDependency + { + private readonly ICouponRepository _couponRepository; + + public CouponOrderCanceledEventHandler(ICouponRepository couponRepository) + { + _couponRepository = couponRepository; + } + + [UnitOfWork(true)] + public virtual async Task HandleEventAsync(OrderCanceledEto eventData) + { + if (!Guid.TryParse(eventData.Order.GetProperty(CouponsConsts.OrderCouponIdPropertyName), + out var couponId)) + { + return; + } + + var coupon = await _couponRepository.GetAsync(couponId); + + coupon.SetOrderId(null); + coupon.SetUsed(null, null); + + await _couponRepository.UpdateAsync(coupon, true); + } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponOrderCreatedEventHandler.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponOrderCreatedEventHandler.cs new file mode 100644 index 00000000..b5776574 --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponOrderCreatedEventHandler.cs @@ -0,0 +1,49 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Timing; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Plugins.Coupons.Coupons +{ + public class CouponOrderCreatedEventHandler : IDistributedEventHandler>, ITransientDependency + { + private readonly IClock _clock; + private readonly ICouponRepository _couponRepository; + + public CouponOrderCreatedEventHandler( + IClock clock, + ICouponRepository couponRepository) + { + _clock = clock; + _couponRepository = couponRepository; + } + + [UnitOfWork(true)] + public virtual async Task HandleEventAsync(EntityCreatedEto eventData) + { + if (!Guid.TryParse(eventData.Entity.GetProperty(CouponsConsts.OrderCouponIdPropertyName), + out var couponId)) + { + return; + } + + var discountAmount = eventData.Entity.GetProperty(CouponsConsts.OrderCouponDiscountAmountPropertyName); + + var coupon = await _couponRepository.GetAsync(couponId); + + if (coupon.OrderId != eventData.Entity.Id) + { + throw new InvalidCouponOrderIdException(eventData.Entity.Id, coupon.OrderId); + } + + coupon.SetUsed(_clock.Now, discountAmount); + + await _couponRepository.UpdateAsync(coupon, true); + } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponRepository.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponRepository.cs index efd845f5..825bef1b 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponRepository.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/ICouponRepository.cs @@ -1,9 +1,12 @@ using System; +using System.Linq; using Volo.Abp.Domain.Repositories; +using Volo.Abp.Timing; namespace EasyAbp.EShop.Plugins.Coupons.Coupons { public interface ICouponRepository : IRepository { + IQueryable GetAvailableCouponQueryable(IClock clock); } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/InvalidCouponOrderIdException.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/InvalidCouponOrderIdException.cs new file mode 100644 index 00000000..f607eb9f --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/InvalidCouponOrderIdException.cs @@ -0,0 +1,13 @@ +using System; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.Coupons.Coupons +{ + public class InvalidCouponOrderIdException : BusinessException + { + public InvalidCouponOrderIdException(Guid expectedOrderId, Guid? actualOrderId) : base("InvalidCouponOrderId", + $"The expected order ID is {expectedOrderId}, but the actual order ID is {actualOrderId}.") + { + } + } +} \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/RepositoryCouponLookupService.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/RepositoryCouponLookupService.cs index 0935df44..6c3ce6ac 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/RepositoryCouponLookupService.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/Coupons/RepositoryCouponLookupService.cs @@ -2,22 +2,27 @@ using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; +using Volo.Abp.ObjectMapping; namespace EasyAbp.EShop.Plugins.Coupons.Coupons { public class RepositoryCouponLookupService : ICouponLookupService, ITransientDependency { + private readonly IObjectMapper _objectMapper; private readonly ICouponRepository _couponRepository; public RepositoryCouponLookupService( + IObjectMapper objectMapper, ICouponRepository couponRepository) { + _objectMapper = objectMapper; _couponRepository = couponRepository; } - public virtual async Task FindByIdAsync(Guid id, CancellationToken cancellationToken = default) + public virtual async Task FindByIdAsync(Guid id, CancellationToken cancellationToken = default) { - return await _couponRepository.FindAsync(id, true, cancellationToken); + return _objectMapper.Map( + await _couponRepository.FindAsync(id, true, cancellationToken)); } } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/EShopPluginsCouponsDomainModule.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/EShopPluginsCouponsDomainModule.cs index 6197fa1a..d7746f48 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/EShopPluginsCouponsDomainModule.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain/EasyAbp/EShop/Plugins/Coupons/EShopPluginsCouponsDomainModule.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using EasyAbp.EShop.Orders; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; using Volo.Abp.Domain; using Volo.Abp.Modularity; @@ -8,7 +9,8 @@ namespace EasyAbp.EShop.Plugins.Coupons [DependsOn( typeof(AbpAutoMapperModule), typeof(AbpDddDomainModule), - typeof(EShopPluginsCouponsDomainSharedModule) + typeof(EShopPluginsCouponsDomainSharedModule), + typeof(EShopOrdersDomainSharedModule) )] public class EShopPluginsCouponsDomainModule : AbpModule { diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateRepository.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateRepository.cs index 17102d57..233cfcb5 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateRepository.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore/EasyAbp/EShop/Plugins/Coupons/CouponTemplates/CouponTemplateRepository.cs @@ -1,5 +1,7 @@ using System; +using System.Linq; using EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -10,5 +12,10 @@ namespace EasyAbp.EShop.Plugins.Coupons.CouponTemplates public CouponTemplateRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } + + public override IQueryable WithDetails() + { + return base.WithDetails().Include(x => x.Scopes); + } } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponRepository.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponRepository.cs index 88e8063a..a05e3ea7 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponRepository.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponRepository.cs @@ -1,7 +1,9 @@ using System; +using System.Linq; using EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Timing; namespace EasyAbp.EShop.Plugins.Coupons.Coupons { @@ -10,5 +12,19 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons public CouponRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } + + public virtual IQueryable GetAvailableCouponQueryable(IClock clock) + { + var now = clock.Now; + + return DbSet + .Where(x => x.ExpirationTime > now) + .Join( + DbContext.CouponTemplates.Where(x => x.UsableBeginTime <= now), + coupon => coupon.CouponTemplateId, + couponTemplate => couponTemplate.Id, + (coupon, couponTemplate) => coupon + ); + } } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.HttpApi.Client/EasyAbp/EShop/Plugins/Coupons/Coupons/HttpClientCouponLookupService.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.HttpApi.Client/EasyAbp/EShop/Plugins/Coupons/Coupons/HttpClientCouponLookupService.cs index 07489406..82aa0aed 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.HttpApi.Client/EasyAbp/EShop/Plugins/Coupons/Coupons/HttpClientCouponLookupService.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.HttpApi.Client/EasyAbp/EShop/Plugins/Coupons/Coupons/HttpClientCouponLookupService.cs @@ -1,24 +1,29 @@ using System; using System.Threading; using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Coupons.Coupons.Dtos; using Volo.Abp.DependencyInjection; +using Volo.Abp.ObjectMapping; namespace EasyAbp.EShop.Plugins.Coupons.Coupons { [Dependency(TryRegister = true)] public class HttpClientCouponLookupService : ICouponLookupService, ITransientDependency { + private readonly IObjectMapper _objectMapper; private readonly ICouponAppService _couponAppService; public HttpClientCouponLookupService( + IObjectMapper objectMapper, ICouponAppService couponAppService) { + _objectMapper = objectMapper; _couponAppService = couponAppService; } - public virtual async Task FindByIdAsync(Guid id, CancellationToken cancellationToken = default) + public virtual async Task FindByIdAsync(Guid id, CancellationToken cancellationToken = default) { - return await _couponAppService.GetAsync(id); + return _objectMapper.Map(await _couponAppService.GetAsync(id)); } } } \ No newline at end of file diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.HttpApi/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponController.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.HttpApi/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponController.cs index d3189792..a79389cc 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.HttpApi/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponController.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.HttpApi/EasyAbp/EShop/Plugins/Coupons/Coupons/CouponController.cs @@ -20,14 +20,14 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons } [HttpPost] - public virtual Task CreateAsync(CreateUpdateCouponDto input) + public virtual Task CreateAsync(CreateCouponDto input) { return _service.CreateAsync(input); } [HttpPut] [Route("{id}")] - public virtual Task UpdateAsync(Guid id, CreateUpdateCouponDto input) + public virtual Task UpdateAsync(Guid id, UpdateCouponDto input) { return _service.UpdateAsync(id, input); } @@ -39,6 +39,13 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons return _service.DeleteAsync(id); } + [HttpPost] + [Route("{id}/occupy")] + public Task OccupyAsync(Guid id, OccupyCouponInput input) + { + return _service.OccupyAsync(id, input); + } + [HttpGet] [Route("{id}")] public virtual Task GetAsync(Guid id) @@ -47,7 +54,7 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons } [HttpGet] - public virtual Task> GetListAsync(PagedAndSortedResultRequestDto input) + public virtual Task> GetListAsync(GetCouponListInput input) { return _service.GetListAsync(input); } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/CouponsWebAutoMapperProfile.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/CouponsWebAutoMapperProfile.cs index 4e2cbfef..34c88060 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/CouponsWebAutoMapperProfile.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/CouponsWebAutoMapperProfile.cs @@ -17,8 +17,9 @@ namespace EasyAbp.EShop.Plugins.Coupons.Web CreateMap(); CreateMap() .Ignore(x => x.Scopes); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); } } } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/Index.cshtml b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/Index.cshtml index ffc19a38..42a98441 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/Index.cshtml +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/Index.cshtml @@ -57,9 +57,7 @@ @L["CouponTemplateUsableEndTime"] @L["CouponTemplateConditionAmount"] @L["CouponTemplateDiscountAmount"] - @L["CouponTemplateIsCrossProductAllowed"] @L["CouponTemplateIsUnscoped"] - @L["CouponTemplateScopes"] diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/ViewModels/CreateEditCouponTemplateViewModel.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/ViewModels/CreateEditCouponTemplateViewModel.cs index 38305ddd..5d11872f 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/ViewModels/CreateEditCouponTemplateViewModel.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/ViewModels/CreateEditCouponTemplateViewModel.cs @@ -37,9 +37,6 @@ namespace EasyAbp.EShop.Plugins.Coupons.Web.Pages.EShop.Plugins.Coupons.CouponTe [Display(Name = "CouponTemplateDiscountAmount")] public decimal DiscountAmount { get; set; } - [Display(Name = "CouponTemplateIsCrossProductAllowed")] - public bool IsCrossProductAllowed { get; set; } - [Display(Name = "CouponTemplateIsUnscoped")] public bool IsUnscoped { get; set; } } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/index.js b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/index.js index aa293c65..0d24fa76 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/index.js +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/CouponTemplates/CouponTemplate/index.js @@ -54,7 +54,6 @@ $(function () { { data: "usableEndTime" }, { data: "conditionAmount" }, { data: "discountAmount" }, - { data: "isCrossProductAllowed" }, { data: "isUnscoped" }, ] })); diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/CreateModal.cshtml.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/CreateModal.cshtml.cs index 772dd478..cfdfdfc9 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/CreateModal.cshtml.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/CreateModal.cshtml.cs @@ -9,7 +9,7 @@ namespace EasyAbp.EShop.Plugins.Coupons.Web.Pages.EShop.Plugins.Coupons.Coupons. public class CreateModalModel : CouponsPageModel { [BindProperty] - public CreateEditCouponViewModel ViewModel { get; set; } + public CreateCouponViewModel ViewModel { get; set; } private readonly ICouponAppService _service; @@ -20,7 +20,7 @@ namespace EasyAbp.EShop.Plugins.Coupons.Web.Pages.EShop.Plugins.Coupons.Coupons. public virtual async Task OnPostAsync() { - var dto = ObjectMapper.Map(ViewModel); + var dto = ObjectMapper.Map(ViewModel); await _service.CreateAsync(dto); return NoContent(); } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/EditModal.cshtml.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/EditModal.cshtml.cs index c7b2192f..5f992289 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/EditModal.cshtml.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/EditModal.cshtml.cs @@ -14,7 +14,7 @@ namespace EasyAbp.EShop.Plugins.Coupons.Web.Pages.EShop.Plugins.Coupons.Coupons. public Guid Id { get; set; } [BindProperty] - public CreateEditCouponViewModel ViewModel { get; set; } + public EditCouponViewModel ViewModel { get; set; } private readonly ICouponAppService _service; @@ -26,12 +26,12 @@ namespace EasyAbp.EShop.Plugins.Coupons.Web.Pages.EShop.Plugins.Coupons.Coupons. public virtual async Task OnGetAsync() { var dto = await _service.GetAsync(Id); - ViewModel = ObjectMapper.Map(dto); + ViewModel = ObjectMapper.Map(dto); } public virtual async Task OnPostAsync() { - var dto = ObjectMapper.Map(ViewModel); + var dto = ObjectMapper.Map(ViewModel); await _service.UpdateAsync(Id, dto); return NoContent(); } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/CreateEditCouponViewModel.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/CreateCouponViewModel.cs similarity index 88% rename from plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/CreateEditCouponViewModel.cs rename to plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/CreateCouponViewModel.cs index 56a84214..32de1a01 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/CreateEditCouponViewModel.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/CreateCouponViewModel.cs @@ -1,10 +1,9 @@ using System; - using System.ComponentModel.DataAnnotations; namespace EasyAbp.EShop.Plugins.Coupons.Web.Pages.EShop.Plugins.Coupons.Coupons.Coupon.ViewModels { - public class CreateEditCouponViewModel + public class CreateCouponViewModel { [Display(Name = "CouponCouponTemplateId")] public Guid CouponTemplateId { get; set; } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/EditCouponViewModel.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/EditCouponViewModel.cs new file mode 100644 index 00000000..191e80eb --- /dev/null +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Web/Pages/EShop/Plugins/Coupons/Coupons/Coupon/ViewModels/EditCouponViewModel.cs @@ -0,0 +1,11 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace EasyAbp.EShop.Plugins.Coupons.Web.Pages.EShop.Plugins.Coupons.Coupons.Coupon.ViewModels +{ + public class EditCouponViewModel + { + [Display(Name = "CouponExpirationTime")] + public DateTime? ExpirationTime { get; set; } + } +} \ No newline at end of file diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200927094647_RemovedIsCrossProductAllowed.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200927094647_RemovedIsCrossProductAllowed.Designer.cs new file mode 100644 index 00000000..0f8dc0c7 --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200927094647_RemovedIsCrossProductAllowed.Designer.cs @@ -0,0 +1,4556 @@ +// +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; + +namespace EShopSample.Migrations +{ + [DbContext(typeof(EShopSampleMigrationsDbContext))] + [Migration("20200927094647_RemovedIsCrossProductAllowed")] + partial class RemovedIsCrossProductAllowed + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "3.1.6") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("PaidTime") + .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") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + 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"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .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("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"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + 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") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsPayments"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + 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"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + 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("EasyAbpEShopPaymentsRefunds"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + 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"); + }); + + 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"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsInvalid") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .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") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpEShopPluginsBasketsBasketItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.ProductUpdates.ProductUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopPluginsBasketsProductUpdates"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ConditionAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CouponType") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsUnscoped") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + 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"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplateScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CouponTemplateId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + 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"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.Coupons.Coupon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponTemplateId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DiscountedAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("ExpirationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UsedTime") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsCouponsCoupons"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductCategories.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetailHistories.ProductDetailHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductDetailId"); + + b.ToTable("EasyAbpEShopProductsProductDetailHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetails.ProductDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductDetails"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductHistories.ProductHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductInventories.ProductInventory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopProductsProductInventories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductStores.ProductStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsOwner") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsProducts"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductAttributes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductAttributeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("EasyAbpEShopProductsProductAttributeOptions"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + 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("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedAttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductSkus"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.StoreOwners.StoreOwner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OwnerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OwnerUserId", "StoreId") + .IsUnique(); + + b.ToTable("EasyAbpEShopStoresStoreOwners"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresStores"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresTransactions"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + 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"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + 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"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentAccounts"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("AccountUserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentTransactions"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + 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"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .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.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpPaymentServiceRefundItems"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + 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") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeviceInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCodeDes") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + 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") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + 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"); + }); + + 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() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + 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") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("OutRefundNo") + .HasColumnType("nvarchar(max)"); + + 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") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayRefundRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Comments") + .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CorrelationId") + .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Exceptions") + .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("HttpMethod") + .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("HttpStatusCode") + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); + + b.Property("ImpersonatorTenantId") + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("ImpersonatorUserId") + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnName("Url") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("UserId") + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MethodName") + .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Parameters") + .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ServiceName") + .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeTime") + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityId") + .IsRequired() + .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .IsRequired() + .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(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"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("Description") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Regex") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnName("IsDefault") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnName("IsPublic") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnName("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Identity") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .IsRequired() + .HasColumnName("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnName("IsExternal") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnName("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(196)") + .HasMaxLength(196); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasColumnName("Code") + .HasColumnType("nvarchar(95)") + .HasMaxLength(95); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnName("DisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + 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("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(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("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + 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.RefundItemOrderLine", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("RefundItemOrderLines") + .HasForeignKey("RefundItemId"); + }); + + 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"); + }); + + 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.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .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.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .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(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200927094647_RemovedIsCrossProductAllowed.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200927094647_RemovedIsCrossProductAllowed.cs new file mode 100644 index 00000000..c798ed42 --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200927094647_RemovedIsCrossProductAllowed.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace EShopSample.Migrations +{ + public partial class RemovedIsCrossProductAllowed : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "IsCrossProductAllowed", + table: "EasyAbpEShopPluginsCouponsCouponTemplates"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "IsCrossProductAllowed", + table: "EasyAbpEShopPluginsCouponsCouponTemplates", + type: "bit", + nullable: false, + defaultValue: false); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs index 8b4886ba..3fafcb7a 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs @@ -783,9 +783,6 @@ namespace EShopSample.Migrations .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); - b.Property("IsCrossProductAllowed") - .HasColumnType("bit"); - b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs index dba4bca9..a627a66a 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs @@ -9,6 +9,7 @@ using EasyAbp.EShop.Payments; using EasyAbp.EShop.Payments.Web; using EasyAbp.EShop.Plugins.Baskets; using EasyAbp.EShop.Plugins.Baskets.Web; +using EasyAbp.EShop.Plugins.Coupons; using EasyAbp.EShop.Plugins.Coupons.Web; using EasyAbp.EShop.Products; using EasyAbp.EShop.Products.Web; @@ -189,6 +190,12 @@ namespace EShopSample.Web options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Baskets{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Baskets.Application.Contracts")); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Baskets{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Baskets.Application")); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Baskets{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Baskets.Web")); + + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Coupons{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Coupons.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Coupons{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Coupons.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Coupons{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Coupons.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Coupons{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Coupons.Application")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Coupons{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Coupons.Web")); }); } }