From 4524c3349811e68c8e52de62a7495f6ebb9edadd Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Wed, 29 Mar 2023 20:27:07 +0800 Subject: [PATCH] Refactor Order aggregate and move business to domain layer --- .../Orders/Orders/Dtos/CreateOrderDto.cs | 18 +- .../Orders/Orders/Dtos/CreateOrderLineDto.cs | 8 +- .../Orders/Orders/Dtos/OrderDiscountDto.cs | 16 + .../Orders/Orders/Dtos/OrderExtraFeeDto.cs | 6 +- .../BasicOrderCreationAuthorizationHandler.cs | 4 +- .../EShop/Orders/Orders/INewOrderGenerator.cs | 15 - .../Orders/Orders/IOrderLinePriceOverrider.cs | 12 - .../EShop/Orders/Orders/OrderAppService.cs | 43 +- .../Orders/Orders/OrderCreationResource.cs | 3 +- .../OrdersApplicationAutoMapperProfile.cs | 1 + .../EShop/Orders/Localization/Orders/en.json | 21 +- .../Orders/Localization/Orders/zh-Hans.json | 17 + .../Orders/Localization/Orders/zh-Hant.json | 17 + .../Orders/Orders/CreateOrderInfoModel.cs | 27 + .../Orders/Orders/CreateOrderLineInfoModel.cs | 25 + .../EShop/Orders/Orders/ICreateOrderInfo.cs | 12 + .../Orders/Orders/ICreateOrderLineInfo.cs | 13 + .../EasyAbp/EShop/Orders/Orders/IOrder.cs | 2 + .../EShop/Orders/Orders/IOrderExtraFee.cs | 11 +- .../EasyAbp/EShop/Orders/Orders/IOrderLine.cs | 7 +- .../EShop/Orders/Orders/OrderExtraFeeEto.cs | 2 + .../EasyAbp/EShop/Orders/OrdersErrorCodes.cs | 3 + .../Orders/DuplicateOrderDiscountException.cs | 16 + .../EShop/Orders/Orders/INewOrderGenerator.cs | 13 + .../Orders/Orders/IOrderDiscountProvider.cs | 4 +- .../Orders/Orders/IOrderExtraFeeProvider.cs | 7 +- .../Orders/Orders/IOrderLinePriceOverrider.cs | 11 + .../EShop/Orders/Orders/NewOrderGenerator.cs | 104 +- .../EasyAbp/EShop/Orders/Orders/Order.cs | 76 +- .../EShop/Orders/Orders/OrderDiscount.cs | 48 + .../Orders/Orders/OrderDiscountInfoModel.cs | 34 + .../EShop/Orders/Orders/OrderExtraFee.cs | 5 + .../Orders/Orders/OrderExtraFeeInfoModel.cs | 9 +- .../OrderLineInvalidQuantityException.cs | 0 .../ProductInventoryReductionEventHandler.cs | 1 + .../Orders/UnexpectedCurrencyException.cs | 0 .../EntityFrameworkCore/OrdersDbContext.cs | 1 + .../OrdersDbContextModelCreatingExtensions.cs | 9 + ...yAbp.EShop.Orders.Application.Tests.csproj | 2 +- .../Orders/OrderAppServiceTests.cs | 26 +- .../Orders/TestOrderLinePriceOverrider.cs | 9 +- .../Orders/DemoOrderDiscountProvider.cs | 19 + .../Orders/InventoryReductionResultTests.cs | 2 + .../Orders/OrderDiscountTests.cs | 65 + .../Orders/OrderDomainTests.cs | 1 + ...op.Orders.EntityFrameworkCore.Tests.csproj | 2 +- ...rders.HttpApi.Client.ConsoleTestApp.csproj | 2 +- .../EasyAbp.EShop.Orders.MongoDB.Tests.csproj | 2 +- .../EasyAbp.EShop.Orders.TestBase.csproj | 2 +- .../Refunds/OrderExtraFeeRefundInfoModel.cs | 6 +- .../Refunds/RefundItemOrderExtraFeeEto.cs | 6 +- .../Refunds/RefundItemOrderExtraFee.cs | 14 +- .../Payments/Refunds/RefundSynchronizer.cs | 2 +- .../Refunds/RefundOrderEventHandlerTests.cs | 2 + .../Products/Products/Dtos/ProductDto.cs | 20 +- .../Products/Products/Dtos/ProductViewDto.cs | 4 +- ...asyAbp.EShop.Products.Domain.Shared.csproj | 1 + .../EShopProductsDomainSharedModule.cs | 2 + .../Products/IHasProductGroupDisplayName.cs | 9 + .../Products/Products/IProductAttribute.cs | 5 +- .../Products/IProductAttributeOption.cs | 5 +- .../EShop/Products/Products/IProductBase.cs | 12 + .../EShop/Products/Products/IProductSku.cs | 4 + .../IProductSkuDescriptionProvider.cs | 3 +- .../EShop/Products/Products/ProductEto.cs | 2 + .../Products/Products/ProductExtensions.cs | 24 + .../Products/ProductSkuDescriptionProvider.cs | 7 +- .../EShop/Products/Products/ProductSkuEto.cs | 2 + .../Options/ProductGroups/IProductGroup.cs | 7 - .../EShop/Products/Products/Product.cs | 8 - .../EShop/Products/Products/ProductView.cs | 7 +- .../BasicBasketItemProductInfoUpdater.cs | 2 +- ...ookingOrderCreationAuthorizationHandler.cs | 10 +- .../Booking/BookingOrderLinePriceOverrider.cs | 13 +- ...ns.cs => CreateOrderLineInfoExtensions.cs} | 35 +- .../CouponOrderDiscountProvider.cs | 85 +- .../EShop/Plugins/Coupons/Coupons/ICoupon.cs | 10 +- .../CreateFlashSaleOrderEventHandler.cs | 48 +- .../FlashSalePlans/FlashSalePlanAppService.cs | 2 +- .../FlashSalePlanAppServiceTests.cs | 6 +- ...03_RefactordOrderAndSomeOthers.Designer.cs | 6406 +++++++++++++++++ ...30329111403_RefactordOrderAndSomeOthers.cs | 74 + .../EShopSampleDbContextModelSnapshot.cs | 57 +- 83 files changed, 7321 insertions(+), 332 deletions(-) create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDiscountDto.cs delete mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs delete mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderLinePriceOverrider.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/CreateOrderInfoModel.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/CreateOrderLineInfoModel.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/ICreateOrderInfo.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/ICreateOrderLineInfo.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DuplicateOrderDiscountException.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs rename modules/EasyAbp.EShop.Orders/src/{EasyAbp.EShop.Orders.Application => EasyAbp.EShop.Orders.Domain}/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs (54%) rename modules/EasyAbp.EShop.Orders/src/{EasyAbp.EShop.Orders.Application => EasyAbp.EShop.Orders.Domain}/EasyAbp/EShop/Orders/Orders/IOrderExtraFeeProvider.cs (56%) create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderLinePriceOverrider.cs rename modules/EasyAbp.EShop.Orders/src/{EasyAbp.EShop.Orders.Application => EasyAbp.EShop.Orders.Domain}/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs (67%) create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscount.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscountInfoModel.cs rename modules/EasyAbp.EShop.Orders/src/{EasyAbp.EShop.Orders.Application => EasyAbp.EShop.Orders.Domain}/EasyAbp/EShop/Orders/Orders/OrderExtraFeeInfoModel.cs (77%) rename modules/EasyAbp.EShop.Orders/src/{EasyAbp.EShop.Orders.Application => EasyAbp.EShop.Orders.Domain}/EasyAbp/EShop/Orders/Orders/OrderLineInvalidQuantityException.cs (100%) rename modules/EasyAbp.EShop.Orders/src/{EasyAbp.EShop.Orders.Application => EasyAbp.EShop.Orders.Domain}/EasyAbp/EShop/Orders/Orders/UnexpectedCurrencyException.cs (100%) create mode 100644 modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/DemoOrderDiscountProvider.cs create mode 100644 modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDiscountTests.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IHasProductGroupDisplayName.cs rename modules/EasyAbp.EShop.Products/src/{EasyAbp.EShop.Products.Application.Contracts => EasyAbp.EShop.Products.Domain.Shared}/EasyAbp/EShop/Products/Products/IProductSkuDescriptionProvider.cs (51%) create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductExtensions.cs rename modules/EasyAbp.EShop.Products/src/{EasyAbp.EShop.Products.Application.Contracts => EasyAbp.EShop.Products.Domain.Shared}/EasyAbp/EShop/Products/Products/ProductSkuDescriptionProvider.cs (75%) delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroup.cs rename plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/{CreateOrderLineDtoExtensions.cs => CreateOrderLineInfoExtensions.cs} (59%) create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230329111403_RefactordOrderAndSomeOthers.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230329111403_RefactordOrderAndSomeOthers.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs index 7e51f46e..e07bada8 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs @@ -3,13 +3,16 @@ using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; +using EasyAbp.EShop.Orders.Localization; using EasyAbp.EShop.Stores.Stores; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Localization; using Volo.Abp.ObjectExtending; namespace EasyAbp.EShop.Orders.Orders.Dtos { [Serializable] - public class CreateOrderDto : ExtensibleObject, IMultiStore + public class CreateOrderDto : ExtensibleObject, ICreateOrderInfo { [DisplayName("OrderStoreId")] public Guid StoreId { get; set; } @@ -17,6 +20,8 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos [DisplayName("OrderCustomerRemark")] public string CustomerRemark { get; set; } + IEnumerable ICreateOrderInfo.OrderLines => OrderLines; + [DisplayName("OrderLine")] public List OrderLines { get; set; } @@ -26,19 +31,20 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos { yield return result; } - + + var localizer = validationContext.GetRequiredService>(); if (OrderLines.Count == 0) { yield return new ValidationResult( - "OrderLines should not be empty.", + localizer[OrdersErrorCodes.OrderLinesShouldNotBeEmpty], new[] { "OrderLines" } ); } - - if (OrderLines.Any(orderLine => orderLine.Quantity <= 0)) + + if (OrderLines.Any(orderLine => orderLine.Quantity < 1)) { yield return new ValidationResult( - "Quantity should be greater than 0.", + localizer[OrdersErrorCodes.QuantityShouldBeGreaterThanZero], new[] { "OrderLines" } ); } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderLineDto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderLineDto.cs index a92e4c63..a1d8e25b 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderLineDto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderLineDto.cs @@ -6,17 +6,17 @@ using Volo.Abp.ObjectExtending; namespace EasyAbp.EShop.Orders.Orders.Dtos { [Serializable] - public class CreateOrderLineDto : ExtensibleObject + public class CreateOrderLineDto : ExtensibleObject, ICreateOrderLineInfo { public const int MinimumQuantity = 1; public const int MaximumQuantity = int.MaxValue; - + [DisplayName("OrderLineProductId")] public Guid ProductId { get; set; } - + [DisplayName("OrderLineProductSkuId")] public Guid ProductSkuId { get; set; } - + [DisplayName("OrderLineQuantity")] [Range(MinimumQuantity, MaximumQuantity)] public int Quantity { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDiscountDto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDiscountDto.cs new file mode 100644 index 00000000..5da4e150 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDiscountDto.cs @@ -0,0 +1,16 @@ +using System; + +namespace EasyAbp.EShop.Orders.Orders.Dtos; + +public class OrderDiscountDto +{ + public Guid OrderLineId { get; set; } + + public string Name { get; set; } + + public string Key { get; set; } + + public string DisplayName { get; set; } + + public decimal DiscountedAmount { get; set; } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderExtraFeeDto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderExtraFeeDto.cs index 3eab5fad..25ac14d5 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderExtraFeeDto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderExtraFeeDto.cs @@ -4,14 +4,16 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos { public class OrderExtraFeeDto : IOrderExtraFee { - public Guid OrderId { get; } + public Guid OrderId { get; set; } public string Name { get; set; } public string Key { get; set; } + public string DisplayName { get; set; } + public decimal Fee { get; set; } - public decimal RefundAmount { get; } + public decimal RefundAmount { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicOrderCreationAuthorizationHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicOrderCreationAuthorizationHandler.cs index bb857ce5..627f295a 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicOrderCreationAuthorizationHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicOrderCreationAuthorizationHandler.cs @@ -44,7 +44,7 @@ namespace EasyAbp.EShop.Orders.Orders context.Succeed(requirement); } - protected virtual Task IsProductsPublishedAsync(CreateOrderDto input, + protected virtual Task IsProductsPublishedAsync(ICreateOrderInfo input, Dictionary productDictionary) { return Task.FromResult( @@ -53,7 +53,7 @@ namespace EasyAbp.EShop.Orders.Orders ); } - protected virtual Task IsInventoriesSufficientAsync(CreateOrderDto input, + protected virtual Task IsInventoriesSufficientAsync(ICreateOrderInfo input, Dictionary productDictionary) { return Task.FromResult( diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs deleted file mode 100644 index 1d7cd9ad..00000000 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using EasyAbp.EShop.Orders.Orders.Dtos; -using EasyAbp.EShop.Products.ProductDetails.Dtos; -using EasyAbp.EShop.Products.Products.Dtos; - -namespace EasyAbp.EShop.Orders.Orders -{ - public interface INewOrderGenerator - { - Task GenerateAsync(Guid customerUserId, CreateOrderDto input, Dictionary productDict, - Dictionary productDetailDict); - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderLinePriceOverrider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderLinePriceOverrider.cs deleted file mode 100644 index a1440d63..00000000 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderLinePriceOverrider.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; -using EasyAbp.EShop.Orders.Orders.Dtos; -using EasyAbp.EShop.Products.Products.Dtos; -using NodaMoney; - -namespace EasyAbp.EShop.Orders.Orders; - -public interface IOrderLinePriceOverrider -{ - Task GetUnitPriceOrNullAsync(CreateOrderDto input, CreateOrderLineDto inputOrderLine, ProductDto product, - ProductSkuDto productSku, Currency effectiveCurrency); -} \ 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 06c5d04d..06d7ba4a 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 @@ -5,7 +5,6 @@ using System.Threading.Tasks; using EasyAbp.EShop.Orders.Authorization; using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Products.ProductDetails; -using EasyAbp.EShop.Products.ProductDetails.Dtos; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; using EasyAbp.EShop.Stores.Stores; @@ -102,21 +101,12 @@ namespace EasyAbp.EShop.Orders.Orders new OrderOperationAuthorizationRequirement(OrderOperation.Creation) ); - var productDetailIds = input.OrderLines - .Select(dto => - productDict[dto.ProductId].GetSkuById(dto.ProductSkuId).ProductDetailId ?? - productDict[dto.ProductId].ProductDetailId) - .Where(x => x.HasValue) - .Select(x => x.Value) - .ToList(); - - var productDetailDict = await GetProductDetailDictionaryAsync(productDetailIds); + var productDetailModificationTimeDict = + await GetProductDetailModificationTimeDictionaryAsync(input, productDict); // Todo: Can we use IProductDataScopedCache/IProductDetailDataScopedCache instead of productDict/productDetailDict? - var order = await _newOrderGenerator.GenerateAsync(CurrentUser.GetId(), input, productDict, - productDetailDict); - - await DiscountOrderAsync(order, productDict); + var order = await _newOrderGenerator.GenerateAsync(CurrentUser.GetId(), input, + productDict.ToDictionary(x => x.Key, x => (IProduct)x.Value), productDetailModificationTimeDict); await Repository.InsertAsync(order, autoSave: true); @@ -131,14 +121,6 @@ namespace EasyAbp.EShop.Orders.Orders } } - protected virtual async Task DiscountOrderAsync(Order order, Dictionary productDict) - { - foreach (var provider in LazyServiceProvider.LazyGetService>()) - { - await provider.DiscountAsync(order, productDict); - } - } - protected virtual async Task> GetProductDictionaryAsync( IEnumerable productIds) { @@ -152,14 +134,23 @@ namespace EasyAbp.EShop.Orders.Orders return dict; } - protected virtual async Task> GetProductDetailDictionaryAsync( - IEnumerable productDetailIds) + protected virtual async Task> GetProductDetailModificationTimeDictionaryAsync( + ICreateOrderInfo input, Dictionary productDict) { - var dict = new Dictionary(); + var productDetailIds = input.OrderLines + .Select(dto => + productDict[dto.ProductId].GetSkuById(dto.ProductSkuId).ProductDetailId ?? + productDict[dto.ProductId].ProductDetailId) + .Where(x => x.HasValue) + .Select(x => x.Value) + .ToList(); + + var dict = new Dictionary(); foreach (var productDetailId in productDetailIds.Distinct()) { - dict.Add(productDetailId, await _productDetailAppService.GetAsync(productDetailId)); + var product = await _productDetailAppService.GetAsync(productDetailId); + dict.Add(productDetailId, product.LastModificationTime ?? product.CreationTime); } return dict; diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderCreationResource.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderCreationResource.cs index b71e1fe0..2fe90b2a 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderCreationResource.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderCreationResource.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; -using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Products.Products.Dtos; namespace EasyAbp.EShop.Orders.Orders { public class OrderCreationResource { - public CreateOrderDto Input { get; set; } + public ICreateOrderInfo Input { get; set; } public Dictionary ProductDictionary { get; set; } } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs index 4bdbb7fb..f7427807 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs @@ -14,6 +14,7 @@ namespace EasyAbp.EShop.Orders * into multiple profile classes for a better organization. */ CreateMap(); CreateMap(); + CreateMap(MemberList.Destination); CreateMap(MemberList.Destination); } } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json index 6240dc00..75fe3af4 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json @@ -45,16 +45,33 @@ "OrderLineTotalDiscount": "Total discount", "OrderLineActualTotalPrice": "Actual total price", "OrderLineQuantity": "Quantity", + "OrderDiscount": "Order discount", + "OrderDiscountOrderId": "Order ID", + "OrderDiscountOrderLineId": "Order line ID", + "OrderDiscountName": "Name", + "OrderDiscountKey": "Key", + "OrderDiscountDisplayName": "Display name", + "OrderDiscountDiscountedAmount": "Discounted amount", + "OrderExtraFee": "Order extra fee", + "OrderExtraFeeOrderId": "Order ID", + "OrderExtraFeeName": "Extra fee name", + "OrderExtraFeeKey": "Extra fee key", + "OrderExtraFeeDisplayName": "Display name", + "OrderExtraFeeFee": "Fee", + "OrderExtraFeeRefundAmount": "Refund amount", "EasyAbp.EShop.Orders:UnexpectedCurrency": "Only the specified currency {expectedCurrency} is allowed.", "EasyAbp.EShop.Orders:OrderLineInvalidQuantity": "Invalid quantity {quantity} for product {productId} (SKU: {productSkuId}).", "EasyAbp.EShop.Orders:DiscountAmountOverflow": "The discount amount overflow.", - "EasyAbp.EShop.Orders:DuplicateOrderExtraFee": "The extra fee {extraFeeName} (key: {extraFeeKey}) is existed.", + "EasyAbp.EShop.Orders:DuplicateOrderDiscount": "The discount {discountName} (key: {discountKey}) of order line {orderLineId} already exists.", + "EasyAbp.EShop.Orders:DuplicateOrderExtraFee": "The extra fee {extraFeeName} (key: {extraFeeKey}) already exists.", "EasyAbp.EShop.Orders:InvalidOrderExtraFee": "The extra fee {extraFee} is invalid.", "EasyAbp.EShop.Orders:InvalidPayment": "The payment {paymentId} has invalid configurations for the order {orderId}.", "EasyAbp.EShop.Orders:InvalidRefundAmount": "The refund amount ({amount}) is invalid.", "EasyAbp.EShop.Orders:InvalidRefundQuantity": "The refund quantity ({quantity}) is invalid.", "EasyAbp.EShop.Orders:OrderIsInWrongStage": "The order {orderId} is in the wrong stage.", - "EasyAbp.EShop.Orders:ExistFlashSalesProduct": "Exist unexpected flash-sales product", + "EasyAbp.EShop.Orders:ExistFlashSalesProduct": "Exist unexpected flash-sales product.", + "EasyAbp.EShop.Orders:OrderLinesShouldNotBeEmpty": "OrderLines should not be empty.", + "EasyAbp.EShop.Orders:QuantityShouldBeGreaterThanZero": "Quantity should be greater than 0.", "DisplayName:EasyAbp.EShop.Orders.CurrencyCode": "Currency code", "Description:EasyAbp.EShop.Orders.CurrencyCode": "ISO 4217 code (see https://en.wikipedia.org/wiki/ISO_4217)" } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json index a4f962f4..a4c3217a 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json @@ -45,9 +45,24 @@ "OrderLineTotalDiscount": "总折扣", "OrderLineActualTotalPrice": "折后总价", "OrderLineQuantity": "数量", + "OrderDiscount": "订单折扣项", + "OrderDiscountOrderId": "订单 ID", + "OrderDiscountOrderLineId": "订单项 ID", + "OrderDiscountName": "折扣项名称", + "OrderDiscountKey": "折扣项 Key", + "OrderDiscountDisplayName": "显示名称", + "OrderDiscountDiscountedAmount": "折扣金额", + "OrderExtraFee": "订单额外费用", + "OrderExtraFeeOrderId": "订单 ID", + "OrderExtraFeeName": "额外费用名称", + "OrderExtraFeeKey": "额外费用 Key", + "OrderExtraFeeDisplayName": "显示名称", + "OrderExtraFeeFee": "金额", + "OrderExtraFeeRefundAmount": "已退款金额", "EasyAbp.EShop.Orders:UnexpectedCurrency": "只允许指定的{expectedCurrency}货币", "EasyAbp.EShop.Orders:OrderLineInvalidQuantity": "产品{productId}(SKU: {productSkuId})的{quantity}数量无效", "EasyAbp.EShop.Orders:DiscountAmountOverflow": "折扣金额溢出", + "EasyAbp.EShop.Orders:DuplicateOrderDiscount": "订单项{orderLineId}的折扣项{discountName}(key: {discountKey})已经存在", "EasyAbp.EShop.Orders:DuplicateOrderExtraFee": "额外费用{extraFeeName}(key: {extraFeeKey})已经存在", "EasyAbp.EShop.Orders:InvalidOrderExtraFee": "额外费用{extraFee}无效", "EasyAbp.EShop.Orders:InvalidPayment": "付款{paymentId}有无效的订单配置{orderId}", @@ -55,6 +70,8 @@ "EasyAbp.EShop.Orders:InvalidRefundQuantity": "退款数量({quantity})无效", "EasyAbp.EShop.Orders:OrderIsInWrongStage": "订单{orderId}处于错误的阶段", "EasyAbp.EShop.Orders:ExistFlashSalesProduct": "清单中不允许存在闪购产品", + "EasyAbp.EShop.Orders:OrderLinesShouldNotBeEmpty": "订单项不可为空", + "EasyAbp.EShop.Orders:QuantityShouldBeGreaterThanZero": "购买数量应大于0", "DisplayName:EasyAbp.EShop.Orders.CurrencyCode": "货币代码", "Description:EasyAbp.EShop.Orders.CurrencyCode": "ISO 4217 货币代码 (详见 https://en.wikipedia.org/wiki/ISO_4217)" } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json index 7db41b9f..b3aabc95 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json @@ -45,9 +45,24 @@ "OrderLineTotalDiscount": "總折扣", "OrderLineActualTotalPrice": "折後總價", "OrderLineQuantity": "數量", + "OrderDiscount": "訂單折扣項", + "OrderDiscountOrderId": "訂單 ID", + "OrderDiscountOrderLineId": "訂單項 ID", + "OrderDiscountName": "折扣項名稱", + "OrderDiscountKey": "折扣項 Key", + "OrderDiscountDisplayName": "顯示名稱", + "OrderDiscountDiscountedAmount": "折扣金額", + "OrderExtraFee": "訂單額外費用", + "OrderExtraFeeOrderId": "訂單 ID", + "OrderExtraFeeName": "額外費用名稱", + "OrderExtraFeeKey": "額外費用 Key", + "OrderExtraFeeDisplayName": "顯示名稱", + "OrderExtraFeeFee": "金額", + "OrderExtraFeeRefundAmount": "已退款金額", "EasyAbp.EShop.Orders:UnexpectedCurrency": "只允許指定的{expectedCurrency}貨幣", "EasyAbp.EShop.Orders:OrderLineInvalidQuantity": "產品{productId}(SKU: {productSkuId})的{quantity}數量無效", "EasyAbp.EShop.Orders:DiscountAmountOverflow": "折扣金額溢出", + "EasyAbp.EShop.Orders:DuplicateOrderDiscount": "訂單項{orderLineId}的折扣項{discountName}(key: {discountKey})已經存在", "EasyAbp.EShop.Orders:DuplicateOrderExtraFee": "額外費用{extraFeeName}(key: {extraFeeKey})已經存在", "EasyAbp.EShop.Orders:InvalidOrderExtraFee": "額外費用{extraFee}無效", "EasyAbp.EShop.Orders:InvalidPayment": "付款{paymentId}有無效的訂單配置{orderId}", @@ -55,6 +70,8 @@ "EasyAbp.EShop.Orders:InvalidRefundQuantity": "退款數量({quantity})無效", "EasyAbp.EShop.Orders:OrderIsInWrongStage": "訂單{orderId}處於錯誤的階段", "EasyAbp.EShop.Orders:ExistFlashSalesProduct": "清單中不允許存在閃購產品", + "EasyAbp.EShop.Orders:OrderLinesShouldNotBeEmpty": "訂單項不可為空", + "EasyAbp.EShop.Orders:QuantityShouldBeGreaterThanZero": "購買數量應大於0", "DisplayName:EasyAbp.EShop.Orders.CurrencyCode": "貨幣代碼", "Description:EasyAbp.EShop.Orders.CurrencyCode": "ISO 4217 貨幣代碼 (詳見 https://en.wikipedia.org/wiki/ISO_4217)" } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/CreateOrderInfoModel.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/CreateOrderInfoModel.cs new file mode 100644 index 00000000..14552436 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/CreateOrderInfoModel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.EShop.Orders.Orders; + +[Serializable] +public class CreateOrderInfoModel : ExtensibleObject, ICreateOrderInfo +{ + public Guid StoreId { get; set; } + + public string CustomerRemark { get; set; } + + IEnumerable ICreateOrderInfo.OrderLines => OrderLines; + public List OrderLines { get; set; } + + public CreateOrderInfoModel() + { + } + + public CreateOrderInfoModel(Guid storeId, string customerRemark, List orderLines) + { + StoreId = storeId; + CustomerRemark = customerRemark; + OrderLines = orderLines; + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/CreateOrderLineInfoModel.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/CreateOrderLineInfoModel.cs new file mode 100644 index 00000000..dae46aed --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/CreateOrderLineInfoModel.cs @@ -0,0 +1,25 @@ +using System; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.EShop.Orders.Orders; + +[Serializable] +public class CreateOrderLineInfoModel : ExtensibleObject, ICreateOrderLineInfo +{ + public Guid ProductId { get; set; } + + public Guid ProductSkuId { get; set; } + + public int Quantity { get; set; } + + public CreateOrderLineInfoModel() + { + } + + public CreateOrderLineInfoModel(Guid productId, Guid productSkuId, int quantity) + { + ProductId = productId; + ProductSkuId = productSkuId; + Quantity = quantity; + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/ICreateOrderInfo.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/ICreateOrderInfo.cs new file mode 100644 index 00000000..4b772389 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/ICreateOrderInfo.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using EasyAbp.EShop.Stores.Stores; +using Volo.Abp.Data; + +namespace EasyAbp.EShop.Orders.Orders; + +public interface ICreateOrderInfo : IMultiStore, IHasExtraProperties +{ + string CustomerRemark { get; } + + IEnumerable OrderLines { get; } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/ICreateOrderLineInfo.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/ICreateOrderLineInfo.cs new file mode 100644 index 00000000..b3220046 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/ICreateOrderLineInfo.cs @@ -0,0 +1,13 @@ +using System; +using Volo.Abp.Data; + +namespace EasyAbp.EShop.Orders.Orders; + +public interface ICreateOrderLineInfo : IHasExtraProperties +{ + Guid ProductId { get; } + + Guid ProductSkuId { get; } + + int Quantity { get; } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs index ee3d6581..4b3ed8bf 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs @@ -8,6 +8,8 @@ namespace EasyAbp.EShop.Orders.Orders { public interface IOrder : IMultiStore, IHasExtraProperties { + Guid Id { get; } + [NotNull] string OrderNumber { get; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderExtraFee.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderExtraFee.cs index 6d6a82ed..f09f5546 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderExtraFee.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderExtraFee.cs @@ -6,15 +6,18 @@ namespace EasyAbp.EShop.Orders.Orders public interface IOrderExtraFee { Guid OrderId { get; } - + [NotNull] string Name { get; } - + [CanBeNull] string Key { get; } - + + [CanBeNull] + string DisplayName { get; } + decimal Fee { get; } - + decimal RefundAmount { get; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs index 88baf0e7..b807d1fb 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs @@ -5,8 +5,10 @@ using Volo.Abp.Data; namespace EasyAbp.EShop.Orders.Orders { - public interface IOrderLine : IHasExtraProperties + public interface IOrderLine : IHasExtraProperties, IHasProductGroupDisplayName { + Guid Id { get; } + Guid ProductId { get; } Guid ProductSkuId { get; } @@ -20,9 +22,6 @@ namespace EasyAbp.EShop.Orders.Orders [NotNull] string ProductGroupName { get; } - [NotNull] - string ProductGroupDisplayName { get; } - [CanBeNull] string ProductUniqueName { get; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderExtraFeeEto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderExtraFeeEto.cs index 7453999e..148a30cd 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderExtraFeeEto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderExtraFeeEto.cs @@ -11,6 +11,8 @@ namespace EasyAbp.EShop.Orders.Orders public string Key { get; set; } + public string DisplayName { get; set; } + public decimal Fee { get; set; } public decimal RefundAmount { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/OrdersErrorCodes.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/OrdersErrorCodes.cs index d87dd982..84cdfe3f 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/OrdersErrorCodes.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/OrdersErrorCodes.cs @@ -6,11 +6,14 @@ public const string OrderLineInvalidQuantity = "EasyAbp.EShop.Orders:OrderLineInvalidQuantity"; public const string DiscountAmountOverflow = "EasyAbp.EShop.Orders:DiscountAmountOverflow"; public const string DuplicateOrderExtraFee = "EasyAbp.EShop.Orders:DuplicateOrderExtraFee"; + public const string DuplicateOrderDiscount = "EasyAbp.EShop.Orders:DuplicateOrderDiscount"; public const string InvalidOrderExtraFee = "EasyAbp.EShop.Orders:InvalidOrderExtraFee"; public const string InvalidPayment = "EasyAbp.EShop.Orders:InvalidPayment"; public const string InvalidRefundAmount = "EasyAbp.EShop.Orders:InvalidRefundAmount"; public const string InvalidRefundQuantity = "EasyAbp.EShop.Orders:InvalidRefundQuantity"; public const string OrderIsInWrongStage = "EasyAbp.EShop.Orders:OrderIsInWrongStage"; public const string ExistFlashSalesProduct = "EasyAbp.EShop.Orders:ExistFlashSalesProduct"; + public const string OrderLinesShouldNotBeEmpty = "EasyAbp.EShop.Orders:OrderLinesShouldNotBeEmpty"; + public const string QuantityShouldBeGreaterThanZero = "EasyAbp.EShop.Orders:QuantityShouldBeGreaterThanZero"; } } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DuplicateOrderDiscountException.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DuplicateOrderDiscountException.cs new file mode 100644 index 00000000..77a7e34b --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DuplicateOrderDiscountException.cs @@ -0,0 +1,16 @@ +using System; +using Volo.Abp; + +namespace EasyAbp.EShop.Orders.Orders +{ + public class DuplicateOrderDiscountException : BusinessException + { + public DuplicateOrderDiscountException(Guid orderLineId, string discountName, string discountKey) : base( + OrdersErrorCodes.DuplicateOrderDiscount) + { + WithData(nameof(orderLineId), orderLineId); + WithData(nameof(discountName), discountName); + WithData(nameof(discountKey), discountKey); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs new file mode 100644 index 00000000..90ff7d0e --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using EasyAbp.EShop.Products.Products; + +namespace EasyAbp.EShop.Orders.Orders +{ + public interface INewOrderGenerator + { + Task GenerateAsync(Guid customerUserId, ICreateOrderInfo input, Dictionary productDict, + Dictionary productDetailModificationTimeDict); + } +} \ No newline at end of file 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.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs similarity index 54% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs index 3de5c09f..f817308c 100644 --- 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.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using EasyAbp.EShop.Products.Products.Dtos; +using EasyAbp.EShop.Products.Products; namespace EasyAbp.EShop.Orders.Orders { public interface IOrderDiscountProvider { - Task DiscountAsync(Order order, Dictionary productDict); + Task> GetAllAsync(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/IOrderExtraFeeProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderExtraFeeProvider.cs similarity index 56% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderExtraFeeProvider.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderExtraFeeProvider.cs index 9cd5ba9d..848d32c1 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IOrderExtraFeeProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderExtraFeeProvider.cs @@ -1,15 +1,14 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using EasyAbp.EShop.Orders.Orders.Dtos; -using EasyAbp.EShop.Products.Products.Dtos; +using EasyAbp.EShop.Products.Products; using NodaMoney; namespace EasyAbp.EShop.Orders.Orders { public interface IOrderExtraFeeProvider { - Task> GetListAsync(Guid customerUserId, CreateOrderDto input, - Dictionary productDict, Currency effectiveCurrency); + Task> GetListAsync(Guid customerUserId, ICreateOrderInfo input, + Dictionary productDict, Currency effectiveCurrency); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderLinePriceOverrider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderLinePriceOverrider.cs new file mode 100644 index 00000000..73f86e44 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderLinePriceOverrider.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Products.Products; +using NodaMoney; + +namespace EasyAbp.EShop.Orders.Orders; + +public interface IOrderLinePriceOverrider +{ + Task GetUnitPriceOrNullAsync(ICreateOrderInfo input, ICreateOrderLineInfo inputOrderLine, + IProduct product, IProductSku productSku, Currency effectiveCurrency); +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs similarity index 67% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs index fa253029..859d09b6 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs @@ -2,57 +2,42 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Orders.Settings; -using EasyAbp.EShop.Products.ProductDetails.Dtos; using EasyAbp.EShop.Products.Products; -using EasyAbp.EShop.Products.Products.Dtos; -using Microsoft.Extensions.DependencyInjection; using NodaMoney; using Volo.Abp; +using Volo.Abp.Auditing; using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; -using Volo.Abp.MultiTenancy; +using Volo.Abp.Domain.Services; using Volo.Abp.ObjectExtending; using Volo.Abp.Settings; -using Volo.Abp.Timing; namespace EasyAbp.EShop.Orders.Orders { - public class NewOrderGenerator : INewOrderGenerator, ITransientDependency + public class NewOrderGenerator : DomainService, INewOrderGenerator, ITransientDependency { - private readonly IClock _clock; - private readonly IGuidGenerator _guidGenerator; - private readonly ICurrentTenant _currentTenant; private readonly ISettingProvider _settingProvider; - private readonly IServiceProvider _serviceProvider; private readonly IOrderNumberGenerator _orderNumberGenerator; private readonly IProductSkuDescriptionProvider _productSkuDescriptionProvider; private readonly IEnumerable _orderLinePriceOverriders; public NewOrderGenerator( - IClock clock, - IGuidGenerator guidGenerator, - ICurrentTenant currentTenant, ISettingProvider settingProvider, - IServiceProvider serviceProvider, IOrderNumberGenerator orderNumberGenerator, IProductSkuDescriptionProvider productSkuDescriptionProvider, IEnumerable orderLinePriceOverriders) { - _clock = clock; - _guidGenerator = guidGenerator; - _currentTenant = currentTenant; _settingProvider = settingProvider; - _serviceProvider = serviceProvider; _orderNumberGenerator = orderNumberGenerator; _productSkuDescriptionProvider = productSkuDescriptionProvider; _orderLinePriceOverriders = orderLinePriceOverriders; } - public virtual async Task GenerateAsync(Guid customerUserId, CreateOrderDto input, - Dictionary productDict, Dictionary productDetailDict) + public virtual async Task GenerateAsync(Guid customerUserId, ICreateOrderInfo input, + Dictionary productDict, Dictionary productDetailModificationTimeDict) { + await ValidateInputAsync(input); + var effectiveCurrency = await GetEffectiveCurrencyAsync(); var orderLines = new List(); @@ -60,7 +45,7 @@ namespace EasyAbp.EShop.Orders.Orders foreach (var inputOrderLine in input.OrderLines) { orderLines.Add(await GenerateOrderLineAsync( - input, inputOrderLine, productDict, productDetailDict, effectiveCurrency)); + input, inputOrderLine, productDict, productDetailModificationTimeDict, effectiveCurrency)); } var productTotalPrice = orderLines.Select(x => x.TotalPrice).Sum(); @@ -72,8 +57,8 @@ namespace EasyAbp.EShop.Orders.Orders var totalDiscount = orderLines.Select(x => x.TotalDiscount).Sum(); var order = new Order( - id: _guidGenerator.Create(), - tenantId: _currentTenant.Id, + id: GuidGenerator.Create(), + tenantId: CurrentTenant.Id, storeId: input.StoreId, customerUserId: customerUserId, currency: effectiveCurrency.Code, @@ -82,7 +67,7 @@ namespace EasyAbp.EShop.Orders.Orders totalPrice: totalPrice, actualTotalPrice: totalPrice - totalDiscount, customerRemark: input.CustomerRemark, - paymentExpiration: paymentExpireIn.HasValue ? _clock.Now.Add(paymentExpireIn.Value) : null + paymentExpiration: paymentExpireIn.HasValue ? Clock.Now.Add(paymentExpireIn.Value) : null ); input.MapExtraPropertiesTo(order, MappingPropertyDefinitionChecks.Destination); @@ -97,16 +82,47 @@ namespace EasyAbp.EShop.Orders.Orders // see https://github.com/EasyAbp/EShop/issues/214 if (order.OrderLines.All(x => x.ProductInventoryStrategy != InventoryStrategy.ReduceAfterPlacing)) { - order.SetReducedInventoryAfterPlacingTime(_clock.Now); + order.SetReducedInventoryAfterPlacingTime(Clock.Now); } + await DiscountOrderAsync(order, productDict); + return order; } + protected virtual Task ValidateInputAsync(ICreateOrderInfo info) + { + if (!info.OrderLines.Any()) + { + throw new BusinessException(OrdersErrorCodes.OrderLinesShouldNotBeEmpty); + } + + if (info.OrderLines.Any(orderLine => orderLine.Quantity < 1)) + { + throw new BusinessException(OrdersErrorCodes.QuantityShouldBeGreaterThanZero); + } + + return Task.CompletedTask; + } + + protected virtual async Task DiscountOrderAsync(Order order, Dictionary productDict) + { + foreach (var provider in LazyServiceProvider.LazyGetService>()) + { + var discounts = await provider.GetAllAsync(order, productDict); + + foreach (var discount in discounts) + { + order.AddDiscount(discount.OrderLineId, discount.Name, discount.Key, discount.DisplayName, + discount.DiscountedAmount); + } + } + } + protected virtual async Task AddOrderExtraFeesAsync(Order order, Guid customerUserId, - CreateOrderDto input, Dictionary productDict, Currency effectiveCurrency) + ICreateOrderInfo input, Dictionary productDict, Currency effectiveCurrency) { - var providers = _serviceProvider.GetServices(); + var providers = LazyServiceProvider.LazyGetService>(); foreach (var provider in providers) { @@ -115,25 +131,27 @@ namespace EasyAbp.EShop.Orders.Orders foreach (var infoModel in infoModels) { var fee = new Money(infoModel.Fee, effectiveCurrency); - order.AddOrderExtraFee(fee.Amount, infoModel.Name, infoModel.Key); + order.AddOrderExtraFee(fee.Amount, infoModel.Name, infoModel.Key, infoModel.DisplayName); } } } - protected virtual async Task GenerateOrderLineAsync(CreateOrderDto input, - CreateOrderLineDto inputOrderLine, Dictionary productDict, - Dictionary productDetailDict, Currency effectiveCurrency) + protected virtual async Task GenerateOrderLineAsync(ICreateOrderInfo input, + ICreateOrderLineInfo inputOrderLine, Dictionary productDict, + Dictionary productDetailModificationTimeDict, Currency effectiveCurrency) { var product = productDict[inputOrderLine.ProductId]; var productSku = product.GetSkuById(inputOrderLine.ProductSkuId); - + if (productSku.Currency != effectiveCurrency.Code) { throw new UnexpectedCurrencyException(effectiveCurrency.Code); } var productDetailId = productSku.ProductDetailId ?? product.ProductDetailId; - var productDetail = productDetailId.HasValue ? productDetailDict[productDetailId.Value] : null; + var productDetailModificationTime = productDetailId.HasValue + ? productDetailModificationTimeDict[productDetailId.Value] + : (DateTime?)null; if (!inputOrderLine.Quantity.IsBetween(productSku.OrderMinQuantity, productSku.OrderMaxQuantity)) { @@ -145,14 +163,18 @@ namespace EasyAbp.EShop.Orders.Orders var totalPrice = unitPrice * inputOrderLine.Quantity; var orderLine = new OrderLine( - id: _guidGenerator.Create(), + id: GuidGenerator.Create(), productId: product.Id, productSkuId: productSku.Id, productDetailId: productDetailId, - productModificationTime: product.LastModificationTime ?? product.CreationTime, - productDetailModificationTime: productDetail?.LastModificationTime ?? productDetail?.CreationTime, + productModificationTime: product is IAuditedObject auditedProduct + ? auditedProduct.LastModificationTime ?? auditedProduct.CreationTime + : Clock.Now, + productDetailModificationTime: productDetailModificationTime, productGroupName: product.ProductGroupName, - productGroupDisplayName: product.ProductGroupDisplayName, + productGroupDisplayName: product is IHasProductGroupDisplayName hasProductGroupDisplayName + ? hasProductGroupDisplayName.ProductGroupDisplayName + : product.ProductGroupName, productUniqueName: product.UniqueName, productDisplayName: product.DisplayName, productInventoryStrategy: product.InventoryStrategy, @@ -172,8 +194,8 @@ namespace EasyAbp.EShop.Orders.Orders return orderLine; } - protected virtual async Task GetUnitPriceAsync(CreateOrderDto input, CreateOrderLineDto inputOrderLine, - ProductDto product, ProductSkuDto productSku, Currency effectiveCurrency) + protected virtual async Task GetUnitPriceAsync(ICreateOrderInfo input, + ICreateOrderLineInfo inputOrderLine, IProduct product, IProductSku productSku, Currency effectiveCurrency) { foreach (var overrider in _orderLinePriceOverriders) { 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 9903d736..d583482b 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 @@ -10,51 +10,54 @@ namespace EasyAbp.EShop.Orders.Orders public class Order : FullAuditedAggregateRoot, IOrder, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - + public virtual Guid StoreId { get; protected set; } - + public virtual string OrderNumber { get; protected set; } - + public virtual Guid CustomerUserId { get; protected set; } - + public virtual OrderStatus OrderStatus { get; protected set; } public virtual string Currency { get; protected set; } - + public virtual decimal ProductTotalPrice { get; protected set; } - + public virtual decimal TotalDiscount { get; protected set; } - + public virtual decimal TotalPrice { get; protected set; } - + public virtual decimal ActualTotalPrice { get; protected set; } public virtual decimal RefundAmount { get; protected set; } - + public virtual string CustomerRemark { get; protected set; } - + public virtual string StaffRemark { get; protected set; } - + public virtual Guid? PaymentId { get; protected set; } - + public virtual DateTime? PaidTime { get; protected set; } - + public virtual DateTime? CompletionTime { get; protected set; } - + public virtual DateTime? CanceledTime { get; protected set; } - + public virtual string CancellationReason { get; protected set; } public virtual DateTime? ReducedInventoryAfterPlacingTime { get; protected set; } - + public virtual DateTime? ReducedInventoryAfterPaymentTime { get; protected set; } - + public virtual DateTime? PaymentExpiration { get; protected set; } IEnumerable IOrder.OrderLines => OrderLines; public virtual List OrderLines { get; protected set; } - + IEnumerable IOrder.OrderExtraFees => OrderExtraFees; + + public virtual List OrderDiscounts { get; protected set; } + public virtual List OrderExtraFees { get; protected set; } protected Order() @@ -87,9 +90,10 @@ namespace EasyAbp.EShop.Orders.Orders PaymentExpiration = paymentExpiration; RefundAmount = 0; - + OrderStatus = OrderStatus.Pending; OrderLines = new List(); + OrderDiscounts = new List(); OrderExtraFees = new List(); } @@ -182,35 +186,47 @@ namespace EasyAbp.EShop.Orders.Orders return !(!PaymentId.HasValue || PaidTime.HasValue); } - public void AddDiscount(Guid orderLineId, decimal expectedDiscountAmount) + public void AddDiscount(Guid orderLineId, [NotNull] string discountName, [CanBeNull] string discountKey, + [CanBeNull] string discountDisplayName, decimal discountedAmount) { var orderLine = OrderLines.Single(x => x.Id == orderLineId); - orderLine.AddDiscount(expectedDiscountAmount); - - TotalDiscount += expectedDiscountAmount; - ActualTotalPrice -= expectedDiscountAmount; + orderLine.AddDiscount(discountedAmount); + + TotalDiscount += discountedAmount; + ActualTotalPrice -= discountedAmount; if (ActualTotalPrice < decimal.Zero) { throw new DiscountAmountOverflowException(); } + + if (OrderDiscounts.Any(x => x.OrderLineId == orderLineId && x.Name == discountName && x.Key == discountKey)) + { + throw new DuplicateOrderDiscountException(orderLineId, discountName, discountKey); + } + + var orderDiscount = new OrderDiscount( + Id, orderLineId, discountName, discountKey, discountDisplayName, discountedAmount); + + OrderDiscounts.Add(orderDiscount); } - public void AddOrderExtraFee(decimal extraFee, [NotNull] string extraFeeName, [CanBeNull] string extraFeeKey) + public void AddOrderExtraFee(decimal extraFee, [NotNull] string extraFeeName, [CanBeNull] string extraFeeKey, + [CanBeNull] string extraFeeDisplayName) { if (extraFee <= decimal.Zero) { throw new InvalidOrderExtraFeeException(extraFee); } - - var orderExtraFee = new OrderExtraFee(Id, extraFeeName, extraFeeKey, extraFee); - if (OrderExtraFees.Any(x => x.EntityEquals(orderExtraFee))) + if (OrderExtraFees.Any(x => x.Name == extraFeeName && x.Key == extraFeeKey)) { throw new DuplicateOrderExtraFeeException(extraFeeName, extraFeeKey); } - + + var orderExtraFee = new OrderExtraFee(Id, extraFeeName, extraFeeKey, extraFeeDisplayName, extraFee); + OrderExtraFees.Add(orderExtraFee); TotalPrice += extraFee; @@ -228,4 +244,4 @@ namespace EasyAbp.EShop.Orders.Orders PaidTime.HasValue && !ReducedInventoryAfterPaymentTime.HasValue; } } -} +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscount.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscount.cs new file mode 100644 index 00000000..7c8f46d0 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscount.cs @@ -0,0 +1,48 @@ +using System; +using JetBrains.Annotations; +using Volo.Abp.Domain.Entities; + +namespace EasyAbp.EShop.Orders.Orders; + +public class OrderDiscount : Entity +{ + public virtual Guid OrderId { get; protected set; } + + public virtual Guid OrderLineId { get; protected set; } + + [NotNull] + public virtual string Name { get; protected set; } + + [CanBeNull] + public virtual string Key { get; protected set; } + + [CanBeNull] + public virtual string DisplayName { get; protected set; } + + public virtual decimal DiscountedAmount { get; protected set; } + + protected OrderDiscount() + { + } + + public OrderDiscount( + Guid orderId, + Guid orderLineId, + [NotNull] string name, + [CanBeNull] string key, + [CanBeNull] string displayName, + decimal discountedAmount) + { + OrderId = orderId; + OrderLineId = orderLineId; + Name = name; + Key = key; + DisplayName = displayName; + DiscountedAmount = discountedAmount; + } + + public override object[] GetKeys() + { + return new object[] { OrderId, OrderLineId, Name, Key }; + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscountInfoModel.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscountInfoModel.cs new file mode 100644 index 00000000..0e0aec48 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscountInfoModel.cs @@ -0,0 +1,34 @@ +using System; +using JetBrains.Annotations; + +namespace EasyAbp.EShop.Orders.Orders; + +public class OrderDiscountInfoModel +{ + public Guid OrderLineId { get; set; } + + [NotNull] + public string Name { get; set; } + + [CanBeNull] + public string Key { get; set; } + + [CanBeNull] + public string DisplayName { get; set; } + + public decimal DiscountedAmount { get; set; } + + public OrderDiscountInfoModel( + Guid orderLineId, + [NotNull] string name, + [CanBeNull] string key, + [CanBeNull] string displayName, + decimal discountedAmount) + { + OrderLineId = orderLineId; + Name = name; + Key = key ?? string.Empty; + DisplayName = displayName; + DiscountedAmount = discountedAmount; + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderExtraFee.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderExtraFee.cs index c6a62379..e6474281 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderExtraFee.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderExtraFee.cs @@ -13,6 +13,9 @@ namespace EasyAbp.EShop.Orders.Orders [CanBeNull] public virtual string Key { get; protected set; } + + [CanBeNull] + public virtual string DisplayName { get; protected set; } public virtual decimal Fee { get; protected set; } @@ -26,11 +29,13 @@ namespace EasyAbp.EShop.Orders.Orders Guid orderId, [NotNull] string name, [CanBeNull] string key, + [CanBeNull] string displayName, decimal fee) { OrderId = orderId; Name = name; Key = key; + DisplayName = displayName; Fee = fee; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderExtraFeeInfoModel.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderExtraFeeInfoModel.cs similarity index 77% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderExtraFeeInfoModel.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderExtraFeeInfoModel.cs index cdd7bc2e..15cba7ec 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderExtraFeeInfoModel.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderExtraFeeInfoModel.cs @@ -6,18 +6,23 @@ namespace EasyAbp.EShop.Orders.Orders { [NotNull] public string Name { get; set; } - + [CanBeNull] public string Key { get; set; } - + + [CanBeNull] + public string DisplayName { get; set; } + public decimal Fee { get; set; } public OrderExtraFeeInfoModel( [NotNull] string name, [CanBeNull] string key, + [CanBeNull] string displayName, decimal fee) { Name = name; + DisplayName = displayName; Key = key ?? string.Empty; Fee = fee; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderLineInvalidQuantityException.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLineInvalidQuantityException.cs similarity index 100% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderLineInvalidQuantityException.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLineInvalidQuantityException.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ProductInventoryReductionEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ProductInventoryReductionEventHandler.cs index 4098a3bd..6a4f2b86 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ProductInventoryReductionEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ProductInventoryReductionEventHandler.cs @@ -121,6 +121,7 @@ namespace EasyAbp.EShop.Orders.Orders { Name = x.Name, Key = x.Key, + DisplayName = x.DisplayName, TotalAmount = x.Fee - x.RefundAmount })); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/UnexpectedCurrencyException.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/UnexpectedCurrencyException.cs similarity index 100% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/UnexpectedCurrencyException.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/UnexpectedCurrencyException.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContext.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContext.cs index d0918f12..6f127574 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContext.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContext.cs @@ -13,6 +13,7 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore */ public DbSet Orders { get; set; } public DbSet OrderLines { get; set; } + public DbSet OrderDiscounts { get; set; } public DbSet OrderExtraFees { get; set; } public OrdersDbContext(DbContextOptions options) diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs index 04b060dc..a9c65c4e 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs @@ -66,6 +66,15 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore b.Property(x => x.RefundAmount).HasColumnType("decimal(20,8)"); }); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "OrderDiscounts", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + b.Property(x => x.DiscountedAmount).HasColumnType("decimal(20,8)"); + b.HasKey(x => new {x.OrderId, x.OrderLineId, x.Name, x.Key}); + }); + builder.Entity(b => { b.ToTable(options.TablePrefix + "OrderExtraFees", options.Schema); diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/EasyAbp.EShop.Orders.Application.Tests.csproj b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/EasyAbp.EShop.Orders.Application.Tests.csproj index bc1875b2..12c6f5d8 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/EasyAbp.EShop.Orders.Application.Tests.csproj +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/EasyAbp.EShop.Orders.Application.Tests.csproj @@ -2,7 +2,7 @@ net7.0 - + EasyAbp.EShop.Orders diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs index 7ca763f0..b8e5adba 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs @@ -119,10 +119,7 @@ namespace EasyAbp.EShop.Orders.Orders { var orderRepository = ServiceProvider.GetRequiredService(); var orderCount = 0; - await WithUnitOfWorkAsync(async () => - { - orderCount = await orderRepository.CountAsync(); - }); + await WithUnitOfWorkAsync(async () => { orderCount = await orderRepository.CountAsync(); }); // Arrange var checkCreateOrderInput = new CheckCreateOrderInput @@ -131,7 +128,7 @@ namespace EasyAbp.EShop.Orders.Orders StoreId = OrderTestData.Store1Id, OrderLines = new List { - new CreateOrderLineDto + new() { ProductId = OrderTestData.Product1Id, ProductSkuId = OrderTestData.ProductSku1Id, @@ -160,10 +157,7 @@ namespace EasyAbp.EShop.Orders.Orders { var orderRepository = ServiceProvider.GetRequiredService(); var orderCount = 0; - await WithUnitOfWorkAsync(async () => - { - orderCount = await orderRepository.CountAsync(); - }); + await WithUnitOfWorkAsync(async () => { orderCount = await orderRepository.CountAsync(); }); // Arrange var checkCreateOrderInput = new CheckCreateOrderInput @@ -172,7 +166,7 @@ namespace EasyAbp.EShop.Orders.Orders StoreId = OrderTestData.Store1Id, OrderLines = new List { - new CreateOrderLineDto + new() { ProductId = OrderTestData.Product1Id, ProductSkuId = OrderTestData.ProductSku1Id, @@ -206,13 +200,13 @@ namespace EasyAbp.EShop.Orders.Orders StoreId = OrderTestData.Store1Id, OrderLines = new List { - new CreateOrderLineDto + new() { ProductId = OrderTestData.Product1Id, ProductSkuId = OrderTestData.ProductSku1Id, Quantity = 10 }, - new CreateOrderLineDto + new() { ProductId = OrderTestData.Product1Id, ProductSkuId = OrderTestData.ProductSku2Id, @@ -684,13 +678,13 @@ namespace EasyAbp.EShop.Orders.Orders StoreId = OrderTestData.Store1Id, OrderLines = new List { - new CreateOrderLineDto + new() { ProductId = OrderTestData.Product1Id, ProductSkuId = OrderTestData.ProductSku1Id, Quantity = 10 }, - new CreateOrderLineDto + new() { ProductId = OrderTestData.Product1Id, ProductSkuId = OrderTestData.ProductSku2Id, @@ -725,13 +719,13 @@ namespace EasyAbp.EShop.Orders.Orders StoreId = OrderTestData.Store1Id, OrderLines = new List { - new CreateOrderLineDto + new() { ProductId = OrderTestData.Product1Id, ProductSkuId = OrderTestData.ProductSku1Id, Quantity = 10 }, - new CreateOrderLineDto + new() { ProductId = OrderTestData.Product1Id, ProductSkuId = OrderTestData.ProductSku2Id, diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/TestOrderLinePriceOverrider.cs b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/TestOrderLinePriceOverrider.cs index 10d61c50..68062a7a 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/TestOrderLinePriceOverrider.cs +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/TestOrderLinePriceOverrider.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; -using EasyAbp.EShop.Orders.Orders.Dtos; -using EasyAbp.EShop.Products.Products.Dtos; +using EasyAbp.EShop.Products.Products; using NodaMoney; using Volo.Abp.DependencyInjection; @@ -9,9 +8,9 @@ namespace EasyAbp.EShop.Orders.Orders; public class TestOrderLinePriceOverrider : IOrderLinePriceOverrider, ITransientDependency { public static decimal Sku3UnitPrice { get; set; } = 100m; - - public async Task GetUnitPriceOrNullAsync(CreateOrderDto input, CreateOrderLineDto inputOrderLine, - ProductDto product, ProductSkuDto productSku, Currency effectiveCurrency) + + public async Task GetUnitPriceOrNullAsync(ICreateOrderInfo input, ICreateOrderLineInfo inputOrderLine, + IProduct product, IProductSku productSku, Currency effectiveCurrency) { if (inputOrderLine.ProductSkuId == OrderTestData.ProductSku3Id) { diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/DemoOrderDiscountProvider.cs b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/DemoOrderDiscountProvider.cs new file mode 100644 index 00000000..bbdb9875 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/DemoOrderDiscountProvider.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Products.Products; + +namespace EasyAbp.EShop.Orders.Orders; + +public class DemoOrderDiscountProvider : IOrderDiscountProvider +{ + public Task> GetAllAsync(Order order, Dictionary productDict) + { + return Task.FromResult(new List + { + new(order.OrderLines.First().Id, "DemoDiscount1", "1", "Demo Discount 1", 0.01m), + new(order.OrderLines.First().Id, "DemoDiscount2", "2", "Demo Discount 2", 0.1m), + }); + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/InventoryReductionResultTests.cs b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/InventoryReductionResultTests.cs index 13806a0e..4990055d 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/InventoryReductionResultTests.cs +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/InventoryReductionResultTests.cs @@ -53,6 +53,7 @@ public class InventoryReductionResultTests : OrdersDomainTestBase OrderTestData.Order1Id, "Name", "Key", + "DisplayName", 0.3m )); @@ -153,6 +154,7 @@ public class InventoryReductionResultTests : OrdersDomainTestBase var orderExtraFee = eventData.OrderExtraFees[0]; orderExtraFee.Name.ShouldBe("Name"); orderExtraFee.Key.ShouldBe("Key"); + orderExtraFee.DisplayName.ShouldBe("DisplayName"); orderExtraFee.TotalAmount.ShouldBe(0.3m); Order1.CanceledTime.ShouldNotBeNull(); diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDiscountTests.cs b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDiscountTests.cs new file mode 100644 index 00000000..3d7491df --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDiscountTests.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Products.Products; +using Microsoft.Extensions.DependencyInjection; +using Shouldly; +using Xunit; + +namespace EasyAbp.EShop.Orders.Orders; + +public class OrderDiscountTests : OrdersDomainTestBase +{ + protected override void AfterAddApplication(IServiceCollection services) + { + services.AddTransient(); + base.AfterAddApplication(services); + } + + [Fact] + public async Task Should_Create_Order_With_Discount() + { + var orderGenerator = GetRequiredService(); + + var createOrderInfoModel = new CreateOrderInfoModel(OrderTestData.Store1Id, null, + new List + { + new(OrderTestData.Product1Id, OrderTestData.ProductSku1Id, 2) + } + ); + + var order = await orderGenerator.GenerateAsync(Guid.NewGuid(), createOrderInfoModel, + new Dictionary + { + { + OrderTestData.Product1Id, new ProductEto + { + Id = OrderTestData.Product1Id, + ProductSkus = new List + { + new() + { + Id = OrderTestData.ProductSku1Id, + AttributeOptionIds = new List(), + Price = 1m, + Currency = "USD", + OrderMinQuantity = 1, + OrderMaxQuantity = 100, + } + } + } + } + }, new Dictionary()); + + order.ActualTotalPrice.ShouldBe(1.89m); + order.TotalDiscount.ShouldBe(0.11m); + order.OrderDiscounts.Count.ShouldBe(2); + order.OrderDiscounts.ShouldContain(x => + x.OrderId == order.Id && x.OrderLineId == order.OrderLines.First().Id && x.Name == "DemoDiscount1" && + x.Key == "1" && x.DisplayName == "Demo Discount 1" && x.DiscountedAmount == 0.01m); + order.OrderDiscounts.ShouldContain(x => + x.OrderId == order.Id && x.OrderLineId == order.OrderLines.First().Id && x.Name == "DemoDiscount2" && + x.Key == "2" && x.DisplayName == "Demo Discount 2" && x.DiscountedAmount == 0.1m); + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDomainTests.cs b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDomainTests.cs index 6836ab02..202ccb7a 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDomainTests.cs +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDomainTests.cs @@ -62,6 +62,7 @@ namespace EasyAbp.EShop.Orders.Orders OrderTestData.Order1Id, "Name", "Key", + "DisplayName", 0.3m )); diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests.csproj b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests.csproj index 6fbfd82d..78869d99 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests.csproj +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests.csproj @@ -2,7 +2,7 @@ net7.0 - + EasyAbp.EShop.Orders diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj index 7565243b..f2cfb7dd 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj @@ -3,7 +3,7 @@ Exe net7.0 - + EasyAbp.EShop.Orders diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.MongoDB.Tests/EasyAbp.EShop.Orders.MongoDB.Tests.csproj b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.MongoDB.Tests/EasyAbp.EShop.Orders.MongoDB.Tests.csproj index 3ff4596b..ffb2e253 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.MongoDB.Tests/EasyAbp.EShop.Orders.MongoDB.Tests.csproj +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.MongoDB.Tests/EasyAbp.EShop.Orders.MongoDB.Tests.csproj @@ -2,7 +2,7 @@ net7.0 - + EasyAbp.EShop.Orders diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj index 93e2e271..f45059f1 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj @@ -2,7 +2,7 @@ net7.0 - + EasyAbp.EShop.Orders diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderExtraFeeRefundInfoModel.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderExtraFeeRefundInfoModel.cs index e0062f51..4bda640c 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderExtraFeeRefundInfoModel.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderExtraFeeRefundInfoModel.cs @@ -6,9 +6,11 @@ namespace EasyAbp.EShop.Payments.Refunds public class OrderExtraFeeRefundInfoModel { public string Name { get; set; } - + public string Key { get; set; } - + + public string DisplayName { get; set; } + public decimal TotalAmount { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/RefundItemOrderExtraFeeEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/RefundItemOrderExtraFeeEto.cs index 4aa7d73c..e2575c72 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/RefundItemOrderExtraFeeEto.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/RefundItemOrderExtraFeeEto.cs @@ -6,9 +6,11 @@ namespace EasyAbp.EShop.Payments.Refunds public class RefundItemOrderExtraFeeEto { public string Name { get; set; } - + public string Key { get; set; } - + + public string DisplayName { get; set; } + public decimal RefundAmount { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundItemOrderExtraFee.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundItemOrderExtraFee.cs index ac11ebdc..8f6d4482 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundItemOrderExtraFee.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundItemOrderExtraFee.cs @@ -10,21 +10,29 @@ namespace EasyAbp.EShop.Payments.Refunds { [NotNull] public virtual string Name { get; protected set; } - + [CanBeNull] public virtual string Key { get; protected set; } - + + [CanBeNull] + public virtual string DisplayName { get; protected set; } + public virtual decimal RefundAmount { get; protected set; } protected RefundItemOrderExtraFee() { } - public RefundItemOrderExtraFee(Guid id, [NotNull] string name, [CanBeNull] string key, + public RefundItemOrderExtraFee( + Guid id, + [NotNull] string name, + [CanBeNull] string key, + [CanBeNull] string displayName, decimal refundAmount) : base(id) { Name = name; Key = key; + DisplayName = displayName; RefundAmount = refundAmount; } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs index 68828507..cbc28946 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs @@ -195,7 +195,7 @@ namespace EasyAbp.EShop.Payments.Refunds { refundItemOrderExtraFeeEntity = new RefundItemOrderExtraFee(_guidGenerator.Create(), orderExtraFeeInfoModel.Name, orderExtraFeeInfoModel.Key, - orderExtraFeeInfoModel.TotalAmount); + orderExtraFeeInfoModel.DisplayName, orderExtraFeeInfoModel.TotalAmount); refundItem.OrderExtraFees.Add(refundItemOrderExtraFeeEntity); } diff --git a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundOrderEventHandlerTests.cs b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundOrderEventHandlerTests.cs index 6694ac75..7dd18d6e 100644 --- a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundOrderEventHandlerTests.cs +++ b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundOrderEventHandlerTests.cs @@ -82,6 +82,7 @@ public class RefundOrderEventHandlerTests : PaymentsDomainTestBase { Name = "Name", Key = "Key", + DisplayName = "DisplayName", TotalAmount = 0.6m }); @@ -111,6 +112,7 @@ public class RefundOrderEventHandlerTests : PaymentsDomainTestBase orderExtraFees.Count.ShouldBe(1); orderExtraFees[0].Name.ShouldBe("Name"); orderExtraFees[0].Key.ShouldBe("Key"); + orderExtraFees[0].DisplayName.ShouldBe("DisplayName"); orderExtraFees[0].TotalAmount.ShouldBe(0.6m); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs index ba66ba3d..dc4a9948 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; -using System.Linq; using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Products.Products.Dtos { [Serializable] - public class ProductDto : ExtensibleFullAuditedEntityDto, IProduct + public class ProductDto : ExtensibleFullAuditedEntityDto, IProduct, IHasProductGroupDisplayName { public Guid StoreId { get; set; } @@ -49,22 +48,5 @@ namespace EasyAbp.EShop.Products.Products.Dtos IEnumerable IProduct.ProductSkus => ProductSkus; public List ProductSkus { get; set; } - - public ProductSkuDto GetSkuById(Guid skuId) - { - return ProductSkus.Single(x => x.Id == skuId); - } - - public ProductSkuDto FindSkuById(Guid skuId) - { - return ProductSkus.FirstOrDefault(x => x.Id == skuId); - } - - public TimeSpan? GetSkuPaymentExpireIn(Guid skuId) - { - var sku = GetSkuById(skuId); - - return sku.PaymentExpireIn ?? PaymentExpireIn; - } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductViewDto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductViewDto.cs index a05e6691..6de98b2e 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductViewDto.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductViewDto.cs @@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Products.Products.Dtos { [Serializable] - public class ProductViewDto : ExtensibleCreationAuditedEntityDto, IProductBase + public class ProductViewDto : ExtensibleCreationAuditedEntityDto, IProductBase, IHasProductGroupDisplayName { public Guid StoreId { get; set; } @@ -32,6 +32,8 @@ namespace EasyAbp.EShop.Products.Products.Dtos public bool IsHidden { get; set; } + public TimeSpan? PaymentExpireIn { get; set; } + public decimal? MinimumPrice { get; set; } public decimal? MaximumPrice { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj index a303b860..4c0064eb 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj @@ -11,6 +11,7 @@ + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/EShopProductsDomainSharedModule.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/EShopProductsDomainSharedModule.cs index 578678bb..ee44bb6f 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/EShopProductsDomainSharedModule.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/EShopProductsDomainSharedModule.cs @@ -3,6 +3,7 @@ using Volo.Abp.Modularity; using Volo.Abp.Localization; using EasyAbp.EShop.Products.Localization; using EasyAbp.EShop.Stores; +using Volo.Abp.Json; using Volo.Abp.Localization.ExceptionHandling; using Volo.Abp.Validation; using Volo.Abp.Validation.Localization; @@ -12,6 +13,7 @@ namespace EasyAbp.EShop.Products { [DependsOn( typeof(AbpValidationModule), + typeof(AbpJsonAbstractionsModule), typeof(AbpTreesDomainSharedModule), typeof(EShopStoresDomainSharedModule) )] diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IHasProductGroupDisplayName.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IHasProductGroupDisplayName.cs new file mode 100644 index 00000000..85fbc6bc --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IHasProductGroupDisplayName.cs @@ -0,0 +1,9 @@ +using JetBrains.Annotations; + +namespace EasyAbp.EShop.Products.Products; + +public interface IHasProductGroupDisplayName +{ + [NotNull] + string ProductGroupDisplayName { get; } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductAttribute.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductAttribute.cs index f33cdccc..6f76ed65 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductAttribute.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductAttribute.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using JetBrains.Annotations; using Volo.Abp.Data; @@ -6,6 +7,8 @@ namespace EasyAbp.EShop.Products.Products { public interface IProductAttribute : IHasExtraProperties { + Guid Id { get; } + [NotNull] string DisplayName { get; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductAttributeOption.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductAttributeOption.cs index ba8d5aa2..d11e9cf3 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductAttributeOption.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductAttributeOption.cs @@ -1,10 +1,13 @@ -using JetBrains.Annotations; +using System; +using JetBrains.Annotations; using Volo.Abp.Data; namespace EasyAbp.EShop.Products.Products { public interface IProductAttributeOption : IHasExtraProperties { + Guid Id { get; } + [NotNull] string DisplayName { get; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductBase.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductBase.cs index 2ab9b77d..974dce17 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductBase.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductBase.cs @@ -7,14 +7,23 @@ namespace EasyAbp.EShop.Products.Products { public interface IProductBase : IHasExtraProperties, IMultiStore { + Guid Id { get; } + + [NotNull] string ProductGroupName { get; } Guid? ProductDetailId { get; } + [CanBeNull] string UniqueName { get; } + [NotNull] string DisplayName { get; } + /// + /// Tell your customer what the product is. It is usually shown in the product list. + /// + [CanBeNull] string Overview { get; } InventoryStrategy InventoryStrategy { get; } @@ -22,6 +31,7 @@ namespace EasyAbp.EShop.Products.Products [CanBeNull] string InventoryProviderName { get; } + [CanBeNull] string MediaResources { get; } int DisplayOrder { get; } @@ -31,5 +41,7 @@ namespace EasyAbp.EShop.Products.Products bool IsStatic { get; } bool IsHidden { get; } + + TimeSpan? PaymentExpireIn { get; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs index 40d17f33..c1d78ef7 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs @@ -6,6 +6,8 @@ namespace EasyAbp.EShop.Products.Products { public interface IProductSku : IHasAttributeOptionIds, IHasExtraProperties { + Guid Id { get; } + [CanBeNull] string Name { get; } @@ -20,6 +22,8 @@ namespace EasyAbp.EShop.Products.Products int OrderMaxQuantity { get; } + TimeSpan? PaymentExpireIn { get; } + [CanBeNull] string MediaResources { get; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductSkuDescriptionProvider.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSkuDescriptionProvider.cs similarity index 51% rename from modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductSkuDescriptionProvider.cs rename to modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSkuDescriptionProvider.cs index acfcc18e..697544b1 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductSkuDescriptionProvider.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSkuDescriptionProvider.cs @@ -1,10 +1,9 @@ using System.Threading.Tasks; -using EasyAbp.EShop.Products.Products.Dtos; namespace EasyAbp.EShop.Products.Products { public interface IProductSkuDescriptionProvider { - Task GenerateAsync(ProductDto productDto, ProductSkuDto productSkuDto); + Task GenerateAsync(IProduct product, IProductSku productSku); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductEto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductEto.cs index 19835352..8cd5ae19 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductEto.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductEto.cs @@ -37,6 +37,8 @@ namespace EasyAbp.EShop.Products.Products public bool IsHidden { get; set; } + public TimeSpan? PaymentExpireIn { get; set; } + IEnumerable IProduct.ProductAttributes => ProductAttributes; public List ProductAttributes { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductExtensions.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductExtensions.cs new file mode 100644 index 00000000..618a6acc --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductExtensions.cs @@ -0,0 +1,24 @@ +using System; +using System.Linq; + +namespace EasyAbp.EShop.Products.Products; + +public static class ProductExtensions +{ + public static IProductSku GetSkuById(this IProduct product, Guid skuId) + { + return product.ProductSkus.Single(x => x.Id == skuId); + } + + public static IProductSku FindSkuById(this IProduct product, Guid skuId) + { + return product.ProductSkus.FirstOrDefault(x => x.Id == skuId); + } + + public static TimeSpan? GetSkuPaymentExpireIn(this IProduct product, Guid skuId) + { + var sku = product.GetSkuById(skuId); + + return sku.PaymentExpireIn ?? product.PaymentExpireIn; + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductSkuDescriptionProvider.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductSkuDescriptionProvider.cs similarity index 75% rename from modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductSkuDescriptionProvider.cs rename to modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductSkuDescriptionProvider.cs index d8a6ae04..704955b6 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductSkuDescriptionProvider.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductSkuDescriptionProvider.cs @@ -1,7 +1,6 @@ using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; -using EasyAbp.EShop.Products.Products.Dtos; using Volo.Abp.DependencyInjection; using Volo.Abp.Json; @@ -16,13 +15,13 @@ namespace EasyAbp.EShop.Products.Products _jsonSerializer = jsonSerializer; } - public virtual Task GenerateAsync(ProductDto productDto, ProductSkuDto productSkuDto) + public virtual Task GenerateAsync(IProduct product, IProductSku productSku) { var names = new Collection(); - foreach (var attributeOptionId in productSkuDto.AttributeOptionIds) + foreach (var attributeOptionId in productSku.AttributeOptionIds) { - names.Add(productDto.ProductAttributes.SelectMany( + names.Add(product.ProductAttributes.SelectMany( attribute => attribute.ProductAttributeOptions.Where(option => option.Id == attributeOptionId), (attribute, option) => new [] {attribute.DisplayName, option.DisplayName}).Single()); } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductSkuEto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductSkuEto.cs index 60699fed..8c05d00f 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductSkuEto.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductSkuEto.cs @@ -23,6 +23,8 @@ namespace EasyAbp.EShop.Products.Products public int OrderMaxQuantity { get; set; } + public TimeSpan? PaymentExpireIn { get; } + public string MediaResources { get; set; } public Guid? ProductDetailId { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroup.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroup.cs deleted file mode 100644 index 17c95391..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroup.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace EasyAbp.EShop.Products.Options.ProductGroups -{ - public interface IProductGroup - { - - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs index 3fd415c9..643f34d7 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs @@ -14,21 +14,14 @@ namespace EasyAbp.EShop.Products.Products public virtual Guid StoreId { get; protected set; } - [NotNull] public virtual string ProductGroupName { get; protected set; } public virtual Guid? ProductDetailId { get; protected set; } - [CanBeNull] public virtual string UniqueName { get; protected set; } - [NotNull] public virtual string DisplayName { get; protected set; } - /// - /// Tell your customer what the product is. It is usually shown in the product list. - /// - [CanBeNull] public virtual string Overview { get; protected set; } public virtual InventoryStrategy InventoryStrategy { get; protected set; } @@ -39,7 +32,6 @@ namespace EasyAbp.EShop.Products.Products /// public virtual string InventoryProviderName { get; protected set; } - [CanBeNull] public virtual string MediaResources { get; protected set; } public virtual int DisplayOrder { get; protected set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductView.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductView.cs index ffc3e020..37b7fd54 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductView.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductView.cs @@ -4,7 +4,8 @@ using Volo.Abp.MultiTenancy; namespace EasyAbp.EShop.Products.Products { - public class ProductView : CreationAuditedAggregateRoot, IProductBase, IMultiTenant + public class ProductView : CreationAuditedAggregateRoot, + IProductBase, IHasProductGroupDisplayName, IMultiTenant { public virtual Guid? TenantId { get; protected set; } @@ -36,6 +37,8 @@ namespace EasyAbp.EShop.Products.Products public virtual bool IsHidden { get; protected set; } + public virtual TimeSpan? PaymentExpireIn { get; protected set; } + #endregion public virtual string ProductGroupDisplayName { get; protected set; } @@ -64,6 +67,7 @@ namespace EasyAbp.EShop.Products.Products bool isPublished, bool isStatic, bool isHidden, + TimeSpan? paymentExpireIn, string mediaResources, int displayOrder, string productGroupDisplayName, @@ -84,6 +88,7 @@ namespace EasyAbp.EShop.Products.Products IsPublished = isPublished; IsStatic = isStatic; IsHidden = isHidden; + PaymentExpireIn = paymentExpireIn; MediaResources = mediaResources; DisplayOrder = displayOrder; diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application/EasyAbp/EShop/Plugins/Baskets/BasketItems/BasicBasketItemProductInfoUpdater.cs b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application/EasyAbp/EShop/Plugins/Baskets/BasketItems/BasicBasketItemProductInfoUpdater.cs index 83cbaa78..7b257ac0 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application/EasyAbp/EShop/Plugins/Baskets/BasketItems/BasicBasketItemProductInfoUpdater.cs +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application/EasyAbp/EShop/Plugins/Baskets/BasketItems/BasicBasketItemProductInfoUpdater.cs @@ -27,7 +27,7 @@ public class BasicBasketItemProductInfoUpdater : IBasketItemProductInfoUpdater, protected virtual async Task InternalUpdateAsync(int targetQuantity, IBasketItem item, ProductDto productDto) { - var productSkuDto = productDto.FindSkuById(item.ProductSkuId); + var productSkuDto = (ProductSkuDto)productDto.FindSkuById(item.ProductSkuId); if (productSkuDto == null) { diff --git a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/Authorization/BookingOrderCreationAuthorizationHandler.cs b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/Authorization/BookingOrderCreationAuthorizationHandler.cs index 7e698468..9396bd76 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/Authorization/BookingOrderCreationAuthorizationHandler.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/Authorization/BookingOrderCreationAuthorizationHandler.cs @@ -116,7 +116,7 @@ namespace EasyAbp.EShop.Orders.Booking.Authorization } } - protected virtual OccupyAssetInfoModel CreateOccupyAssetInfoModel(Guid assetId, CreateOrderLineDto orderLine) + protected virtual OccupyAssetInfoModel CreateOccupyAssetInfoModel(Guid assetId, ICreateOrderLineInfo orderLine) { return new OccupyAssetInfoModel( assetId, @@ -128,7 +128,7 @@ namespace EasyAbp.EShop.Orders.Booking.Authorization } protected virtual OccupyAssetByCategoryInfoModel CreateOccupyAssetByCategoryInfoModel(Guid assetCategoryId, - CreateOrderLineDto orderLine) + ICreateOrderLineInfo orderLine) { return new OccupyAssetByCategoryInfoModel( assetCategoryId, @@ -140,7 +140,7 @@ namespace EasyAbp.EShop.Orders.Booking.Authorization ); } - protected virtual async Task IsAssetInfoValidAsync(CreateOrderLineDto orderLine, + protected virtual async Task IsAssetInfoValidAsync(ICreateOrderLineInfo orderLine, OrderCreationResource resource) { var mapping = (await _grantedStoreAppService.GetListAsync(new GetGrantedStoreListDto @@ -179,7 +179,7 @@ namespace EasyAbp.EShop.Orders.Booking.Authorization return productAsset is not null; } - protected virtual async Task IsAssetCategoryInfoValidAsync(CreateOrderLineDto orderLine, + protected virtual async Task IsAssetCategoryInfoValidAsync(ICreateOrderLineInfo orderLine, OrderCreationResource resource) { var mapping = (await _grantedStoreAppService.GetListAsync(new GetGrantedStoreListDto @@ -218,7 +218,7 @@ namespace EasyAbp.EShop.Orders.Booking.Authorization return productAssetCategory is not null; } - protected virtual async Task IsPeriodInfoValidAsync(CreateOrderLineDto orderLine) + protected virtual async Task IsPeriodInfoValidAsync(ICreateOrderLineInfo orderLine) { var periodSchemeId = orderLine.GetBookingPeriodSchemeId(); var periodId = orderLine.GetBookingPeriodId(); diff --git a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/BookingOrderLinePriceOverrider.cs b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/BookingOrderLinePriceOverrider.cs index 49af4375..20d160e2 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/BookingOrderLinePriceOverrider.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/BookingOrderLinePriceOverrider.cs @@ -6,6 +6,7 @@ using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; using EasyAbp.EShop.Plugins.Booking.ProductAssets; using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; +using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; using NodaMoney; using Volo.Abp.DependencyInjection; @@ -25,8 +26,8 @@ public class BookingOrderLinePriceOverrider : IOrderLinePriceOverrider, ITransie _productAssetCategoryAppService = productAssetCategoryAppService; } - public virtual async Task GetUnitPriceOrNullAsync(CreateOrderDto input, CreateOrderLineDto inputOrderLine, - ProductDto product, ProductSkuDto productSku, Currency effectiveCurrency) + public virtual async Task GetUnitPriceOrNullAsync(ICreateOrderInfo input, + ICreateOrderLineInfo inputOrderLine, IProduct product, IProductSku productSku, Currency effectiveCurrency) { if (inputOrderLine.FindBookingAssetId() is not null) { @@ -41,8 +42,8 @@ public class BookingOrderLinePriceOverrider : IOrderLinePriceOverrider, ITransie return null; } - public virtual async Task GetAssetBookingUnitPriceAsync(CreateOrderDto input, - CreateOrderLineDto inputOrderLine, Currency effectiveCurrency) + public virtual async Task GetAssetBookingUnitPriceAsync(ICreateOrderInfo input, + ICreateOrderLineInfo inputOrderLine, Currency effectiveCurrency) { var productAsset = (await _productAssetAppService.GetListAsync( new GetProductAssetListDto @@ -76,8 +77,8 @@ public class BookingOrderLinePriceOverrider : IOrderLinePriceOverrider, ITransie return null; } - public virtual async Task GetAssetCategoryBookingUnitPriceAsync(CreateOrderDto input, - CreateOrderLineDto inputOrderLine, Currency effectiveCurrency) + public virtual async Task GetAssetCategoryBookingUnitPriceAsync(ICreateOrderInfo input, + ICreateOrderLineInfo inputOrderLine, Currency effectiveCurrency) { var productAssetCategory = (await _productAssetCategoryAppService.GetListAsync( new GetProductAssetCategoryListDto diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/CreateOrderLineDtoExtensions.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/CreateOrderLineInfoExtensions.cs similarity index 59% rename from plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/CreateOrderLineDtoExtensions.cs rename to plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/CreateOrderLineInfoExtensions.cs index 1840702b..1c49e375 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/CreateOrderLineDtoExtensions.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/CreateOrderLineInfoExtensions.cs @@ -1,94 +1,95 @@ using System; +using EasyAbp.EShop.Orders.Orders; using EasyAbp.EShop.Orders.Orders.Dtos; using Volo.Abp; using Volo.Abp.Data; namespace EasyAbp.EShop.Orders; -public static class CreateOrderLineDtoExtensions +public static class CreateOrderLineInfoExtensions { - public static Guid? FindBookingAssetId(this CreateOrderLineDto orderLine) + public static Guid? FindBookingAssetId(this ICreateOrderLineInfo orderLine) { return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingAssetId); } - public static Guid GetBookingAssetId(this CreateOrderLineDto orderLine) + public static Guid GetBookingAssetId(this ICreateOrderLineInfo orderLine) { return Check.NotNull(FindBookingAssetId(orderLine), BookingOrderProperties.OrderLineBookingAssetId)!.Value; } - public static Guid? FindBookingAssetCategoryId(this CreateOrderLineDto orderLine) + public static Guid? FindBookingAssetCategoryId(this ICreateOrderLineInfo orderLine) { return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingAssetCategoryId); } - public static Guid GetBookingAssetCategoryId(this CreateOrderLineDto orderLine) + public static Guid GetBookingAssetCategoryId(this ICreateOrderLineInfo orderLine) { return Check.NotNull(FindBookingAssetCategoryId(orderLine), BookingOrderProperties.OrderLineBookingAssetCategoryId)!.Value; } - public static Guid? FindBookingPeriodSchemeId(this CreateOrderLineDto orderLine) + public static Guid? FindBookingPeriodSchemeId(this ICreateOrderLineInfo orderLine) { return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId); } - public static Guid GetBookingPeriodSchemeId(this CreateOrderLineDto orderLine) + public static Guid GetBookingPeriodSchemeId(this ICreateOrderLineInfo orderLine) { return Check.NotNull(FindBookingPeriodSchemeId(orderLine), BookingOrderProperties.OrderLineBookingPeriodSchemeId)!.Value; } - public static Guid? FindBookingPeriodId(this CreateOrderLineDto orderLine) + public static Guid? FindBookingPeriodId(this ICreateOrderLineInfo orderLine) { return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingPeriodId); } - public static Guid GetBookingPeriodId(this CreateOrderLineDto orderLine) + public static Guid GetBookingPeriodId(this ICreateOrderLineInfo orderLine) { return Check.NotNull(FindBookingPeriodId(orderLine), BookingOrderProperties.OrderLineBookingPeriodId)!.Value; } - public static int? FindBookingVolume(this CreateOrderLineDto orderLine) + public static int? FindBookingVolume(this ICreateOrderLineInfo orderLine) { return orderLine.Quantity; } - public static int GetBookingVolume(this CreateOrderLineDto orderLine) + public static int GetBookingVolume(this ICreateOrderLineInfo orderLine) { return FindBookingVolume(orderLine)!.Value; } - public static DateTime? FindBookingDate(this CreateOrderLineDto orderLine) + public static DateTime? FindBookingDate(this ICreateOrderLineInfo orderLine) { return orderLine.FindDateTimeProperty(BookingOrderProperties.OrderLineBookingDate); } - public static DateTime GetBookingDate(this CreateOrderLineDto orderLine) + public static DateTime GetBookingDate(this ICreateOrderLineInfo orderLine) { return Check.NotNull(FindBookingDate(orderLine), BookingOrderProperties.OrderLineBookingDate)!.Value; } - public static TimeSpan? FindBookingStartingTime(this CreateOrderLineDto orderLine) + public static TimeSpan? FindBookingStartingTime(this ICreateOrderLineInfo orderLine) { return orderLine.FindTimeSpanProperty(BookingOrderProperties.OrderLineBookingStartingTime); } - public static TimeSpan GetBookingStartingTime(this CreateOrderLineDto orderLine) + public static TimeSpan GetBookingStartingTime(this ICreateOrderLineInfo orderLine) { return Check.NotNull(FindBookingStartingTime(orderLine), BookingOrderProperties.OrderLineBookingStartingTime)!.Value; } - public static TimeSpan? FindBookingDuration(this CreateOrderLineDto orderLine) + public static TimeSpan? FindBookingDuration(this ICreateOrderLineInfo orderLine) { return orderLine.FindTimeSpanProperty(BookingOrderProperties.OrderLineBookingDuration); } - public static TimeSpan GetBookingDuration(this CreateOrderLineDto orderLine) + public static TimeSpan GetBookingDuration(this ICreateOrderLineInfo orderLine) { return Check.NotNull(FindBookingDuration(orderLine), BookingOrderProperties.OrderLineBookingDuration)!.Value; 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 7f3d640f..c55e486f 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 @@ -7,7 +7,8 @@ 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 EasyAbp.EShop.Products.Products; +using NodaMoney; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Timing; @@ -16,6 +17,8 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount { public class CouponOrderDiscountProvider : IOrderDiscountProvider, ITransientDependency { + public static string OrderDiscountName { get; set; } = "Coupon"; + private readonly IClock _clock; private readonly ICouponAppService _couponAppService; private readonly ICouponLookupService _couponLookupService; @@ -32,13 +35,14 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount _couponLookupService = couponLookupService; _couponTemplateLookupService = couponTemplateLookupService; } - - public virtual async Task DiscountAsync(Order order, Dictionary productDict) + + public virtual async Task> GetAllAsync(Order order, + Dictionary productDict) { var couponId = order.GetProperty(CouponsConsts.OrderCouponIdPropertyName); if (couponId is null) { - return order; + return new List(); } var now = _clock.Now; @@ -54,7 +58,7 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount { throw new CouponHasBeenOccupiedException(); } - + var couponTemplate = await _couponTemplateLookupService.FindByIdAsync(coupon.CouponTemplateId); if (couponTemplate == null || @@ -65,12 +69,12 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount } var orderLinesInScope = GetOrderLinesInScope(couponTemplate, order, productDict); - - DiscountOrderLines(couponTemplate, order, orderLinesInScope); - - await _couponAppService.OccupyAsync(coupon.Id, new OccupyCouponInput {OrderId = order.Id}); - return order; + var models = await DiscountOrderLinesAsync(couponTemplate, coupon, order, orderLinesInScope); + + await _couponAppService.OccupyAsync(coupon.Id, new OccupyCouponInput { OrderId = order.Id }); + + return models; } protected virtual bool IsCurrencyExpected(CouponTemplateData couponTemplate, Order order) @@ -78,21 +82,25 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount return couponTemplate.Currency == order.Currency; } - protected virtual void DiscountOrderLines(CouponTemplateData couponTemplate, Order order, - List orderLinesInScope) + protected virtual Task> DiscountOrderLinesAsync(CouponTemplateData couponTemplate, + CouponData coupon, 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; + var nodaCurrency = Currency.FromCode(order.Currency); + var totalOrderLineActualTotalPrice = + new Money(orderLinesInScope.Sum(x => x.ActualTotalPrice), nodaCurrency); + + var totalDiscountedAmount = new Money( + couponTemplate.CouponType == CouponType.PerMeet + ? couponTemplate.DiscountAmount * + Math.Floor(totalOrderLineActualTotalPrice.Amount / couponTemplate.ConditionAmount) + : couponTemplate.DiscountAmount, + nodaCurrency); if (totalDiscountedAmount > totalOrderLineActualTotalPrice) { @@ -101,21 +109,21 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount var remainingDiscountedAmount = totalDiscountedAmount; - // Todo: https://github.com/EasyAbp/EShop/issues/104 - const int accuracy = 2; - + var orderLineDiscounts = new Dictionary(); + foreach (var orderLine in orderLinesInScope) { + var orderLineActualTotalPrice = new Money(orderLine.ActualTotalPrice, nodaCurrency); var maxDiscountAmount = - Math.Round(orderLine.ActualTotalPrice / totalOrderLineActualTotalPrice * totalDiscountedAmount, - accuracy, MidpointRounding.ToZero); + new Money( + orderLineActualTotalPrice.Amount / totalOrderLineActualTotalPrice.Amount * + totalDiscountedAmount.Amount, nodaCurrency, MidpointRounding.ToZero); - var discountAmount = maxDiscountAmount > orderLine.ActualTotalPrice - ? orderLine.ActualTotalPrice + var discountAmount = maxDiscountAmount > totalOrderLineActualTotalPrice + ? orderLineActualTotalPrice : maxDiscountAmount; - order.AddDiscount(orderLine.Id, discountAmount); - + orderLineDiscounts[orderLine] = discountAmount; remainingDiscountedAmount -= discountAmount; } @@ -125,13 +133,12 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount { break; } - - var discountAmount = remainingDiscountedAmount > orderLine.ActualTotalPrice - ? orderLine.ActualTotalPrice + + var discountAmount = remainingDiscountedAmount > totalOrderLineActualTotalPrice + ? totalOrderLineActualTotalPrice : remainingDiscountedAmount; - - order.AddDiscount(orderLine.Id, discountAmount); + orderLineDiscounts[orderLine] += discountAmount; remainingDiscountedAmount -= discountAmount; } @@ -139,12 +146,19 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount { throw new ApplicationException(); } - + order.SetProperty(CouponsConsts.OrderCouponDiscountAmountPropertyName, totalDiscountedAmount); + + var models = orderLinesInScope.Select(orderLine => + new OrderDiscountInfoModel(orderLine.Id, OrderDiscountName, coupon.Id.ToString(), + couponTemplate.DisplayName, orderLineDiscounts[orderLine].Amount) + ).ToList(); + + return Task.FromResult(models); } protected virtual List GetOrderLinesInScope(CouponTemplateData couponTemplate, Order order, - Dictionary productDict) + Dictionary productDict) { if (couponTemplate.IsUnscoped) { @@ -176,7 +190,8 @@ namespace EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount return expectedOrderLines; } - protected virtual decimal GetOrderLineProductPrice(OrderLine orderLine, Dictionary productDict) + protected virtual decimal GetOrderLineProductPrice(OrderLine orderLine, + Dictionary productDict) { return productDict[orderLine.ProductId].GetSkuById(orderLine.ProductSkuId).Price; } diff --git a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/ICoupon.cs b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/ICoupon.cs index 699a2a3f..394bc162 100644 --- a/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/ICoupon.cs +++ b/plugins/Coupons/src/EasyAbp.EShop.Plugins.Coupons.Domain.Shared/EasyAbp/EShop/Plugins/Coupons/Coupons/ICoupon.cs @@ -4,16 +4,18 @@ namespace EasyAbp.EShop.Plugins.Coupons.Coupons { public interface ICoupon { + Guid Id { get; } + Guid CouponTemplateId { get; } - + Guid UserId { get; } - + Guid? OrderId { get; } DateTime? ExpirationTime { get; } - + DateTime? UsedTime { get; } - + decimal? DiscountedAmount { get; } } } \ No newline at end of file diff --git a/plugins/FlashSales/src/EasyAbp.EShop.Orders.Plugins.FlashSales.Application/EasyAbp/EShop/Orders/Orders/CreateFlashSaleOrderEventHandler.cs b/plugins/FlashSales/src/EasyAbp.EShop.Orders.Plugins.FlashSales.Application/EasyAbp/EShop/Orders/Orders/CreateFlashSaleOrderEventHandler.cs index 9c0c7ddb..7e779e8b 100644 --- a/plugins/FlashSales/src/EasyAbp.EShop.Orders.Plugins.FlashSales.Application/EasyAbp/EShop/Orders/Orders/CreateFlashSaleOrderEventHandler.cs +++ b/plugins/FlashSales/src/EasyAbp.EShop.Orders.Plugins.FlashSales.Application/EasyAbp/EShop/Orders/Orders/CreateFlashSaleOrderEventHandler.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Plugins.FlashSales.FlashSalePlans; @@ -58,7 +59,7 @@ public class CreateFlashSaleOrderEventHandler : IDistributedEventHandler> GetProductDictionaryAsync(ProductDto product) + protected virtual Task> GetProductDictionaryAsync(ProductDto product) { - var productDict = new Dictionary() - { - {product.Id, product} - }; + var productDict = new Dictionary() { { product.Id, product } }; return Task.FromResult(productDict); } - protected virtual async Task> GetProductDetailDictionaryAsync(ProductDto product, ProductSkuDto productSku) + protected virtual async Task> GetProductDetailModificationTimeDictionaryAsync( + ICreateOrderInfo input, Dictionary productDict) { - var dict = new Dictionary(); + var productDetailIds = input.OrderLines + .Select(dto => + productDict[dto.ProductId].GetSkuById(dto.ProductSkuId).ProductDetailId ?? + productDict[dto.ProductId].ProductDetailId) + .Where(x => x.HasValue) + .Select(x => x.Value) + .ToList(); - var productDetailId = productSku.ProductDetailId ?? product.ProductDetailId; + var dict = new Dictionary(); - if (productDetailId.HasValue) + foreach (var productDetailId in productDetailIds.Distinct()) { - dict.Add(productDetailId.Value, await ProductDetailAppService.GetAsync(productDetailId.Value)); + var product = await ProductDetailAppService.GetAsync(productDetailId); + dict.Add(productDetailId, product.LastModificationTime ?? product.CreationTime); } return dict; @@ -133,13 +141,13 @@ public class CreateFlashSaleOrderEventHandler : IDistributedEventHandler ConvertToCreateOrderDtoAsync(CreateFlashSaleOrderEto eventData) { - var input = new CreateOrderDto() + var input = new CreateOrderDto { StoreId = eventData.Plan.StoreId, CustomerRemark = eventData.CustomerRemark, - OrderLines = new List() + OrderLines = new List { - new CreateOrderLineDto() + new() { ProductId = eventData.Plan.ProductId, ProductSkuId = eventData.Plan.ProductSkuId, @@ -153,10 +161,12 @@ public class CreateFlashSaleOrderEventHandler : IDistributedEventHandler ValidateHashTokenAsync(FlashSalePlanEto plan, ProductDto product, ProductSkuDto productSku, string originHashToken) + protected virtual async Task ValidateHashTokenAsync(FlashSalePlanEto plan, ProductDto product, + ProductSkuDto productSku, string originHashToken) { - var hashToken = await FlashSalePlanHasher.HashAsync(plan.LastModificationTime, product.LastModificationTime, productSku.LastModificationTime); + var hashToken = await FlashSalePlanHasher.HashAsync(plan.LastModificationTime, product.LastModificationTime, + productSku.LastModificationTime); return string.Equals(hashToken, originHashToken, StringComparison.InvariantCulture); } -} +} \ No newline at end of file diff --git a/plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppService.cs b/plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppService.cs index f9944833..3d9c4ebf 100644 --- a/plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppService.cs +++ b/plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppService.cs @@ -207,7 +207,7 @@ public class FlashSalePlanAppService : var plan = await GetFlashSalePlanCacheAsync(id); var product = await ProductCache.GetAsync(plan.ProductId); - var productSku = product.GetSkuById(plan.ProductSkuId); + var productSku = (ProductSkuDto)product.GetSkuById(plan.ProductSkuId); var expiresTime = DateTimeOffset.Now.Add(Options.PreOrderExpires); await ValidatePreOrderAsync(plan, product, productSku); diff --git a/plugins/FlashSales/test/EasyAbp.EShop.Plugins.FlashSales.Application.Tests/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppServiceTests.cs b/plugins/FlashSales/test/EasyAbp.EShop.Plugins.FlashSales.Application.Tests/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppServiceTests.cs index fdcc950b..4b35aac9 100644 --- a/plugins/FlashSales/test/EasyAbp.EShop.Plugins.FlashSales.Application.Tests/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppServiceTests.cs +++ b/plugins/FlashSales/test/EasyAbp.EShop.Plugins.FlashSales.Application.Tests/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppServiceTests.cs @@ -309,7 +309,8 @@ public class FlashSalePlanAppServiceTests : FlashSalesApplicationTestBase var plan = await CreateFlashSalePlanAsync(); var preOrderCacheKey = string.Format(FlashSalePlanAppService.PreOrderCacheKeyFormat, plan.Id, CurrentUser.Id); var hashToken = await GetRequiredService() - .HashAsync(plan.LastModificationTime, Product1.LastModificationTime, Product1.GetSkuById(plan.ProductSkuId).LastModificationTime); + .HashAsync(plan.LastModificationTime, Product1.LastModificationTime, + ((ProductSkuDto)Product1.GetSkuById(plan.ProductSkuId)).LastModificationTime); var dto = await AppService.PreOrderAsync(plan.Id); @@ -358,7 +359,8 @@ public class FlashSalePlanAppServiceTests : FlashSalesApplicationTestBase { var plan = await CreateFlashSalePlanAsync(); var hashToken = await GetRequiredService() - .HashAsync(plan.LastModificationTime, Product1.LastModificationTime, Product1.GetSkuById(plan.ProductSkuId).LastModificationTime); + .HashAsync(plan.LastModificationTime, Product1.LastModificationTime, + ((ProductSkuDto)Product1.GetSkuById(plan.ProductSkuId)).LastModificationTime); var orderFlashSalePlanInput = new OrderFlashSalePlanInput { CustomerRemark = "remark1" diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230329111403_RefactordOrderAndSomeOthers.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230329111403_RefactordOrderAndSomeOthers.Designer.cs new file mode 100644 index 00000000..00b269bb --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230329111403_RefactordOrderAndSomeOthers.Designer.cs @@ -0,0 +1,6406 @@ +// +using System; +using EShopSample.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace EShopSample.Migrations +{ + [DbContext(typeof(EShopSampleDbContext))] + [Migration("20230329111403_RefactordOrderAndSomeOthers")] + partial class RefactordOrderAndSomeOthers + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "7.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("EasyAbp.BookingService.AssetCategories.AssetCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetDefinitionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DefaultPeriodUsable") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Disabled") + .HasColumnType("bit"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("EasyAbpBookingServiceAssetCategories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetOccupancies.AssetOccupancy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Asset") + .HasColumnType("nvarchar(max)"); + + b.Property("AssetDefinitionName") + .HasColumnType("nvarchar(max)"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("Duration") + .HasColumnType("time"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("OccupierName") + .HasColumnType("nvarchar(max)"); + + b.Property("OccupierUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartingTime") + .HasColumnType("time"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Volume") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Date", "OccupierUserId"); + + b.HasIndex("Date", "AssetId", "StartingTime", "Duration"); + + b.ToTable("EasyAbpBookingServiceAssetOccupancies", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetOccupancyCounts.AssetOccupancyCount", b => + { + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartingTime") + .HasColumnType("time"); + + b.Property("Duration") + .HasColumnType("time"); + + b.Property("Asset") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Volume") + .HasColumnType("int"); + + b.HasKey("Date", "AssetId", "StartingTime", "Duration"); + + b.ToTable("EasyAbpBookingServiceAssetOccupancyCounts", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetPeriodSchemes.AssetPeriodScheme", b => + { + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Date", "AssetId"); + + b.ToTable("EasyAbpBookingServiceAssetPeriodSchemes", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetSchedules.AssetSchedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PeriodId") + .HasColumnType("uniqueidentifier"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("PeriodUsable") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Date", "AssetId", "PeriodSchemeId"); + + b.ToTable("EasyAbpBookingServiceAssetSchedules", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.Assets.Asset", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("AssetDefinitionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DefaultPeriodUsable") + .HasColumnType("int"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Disabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Volume") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpBookingServiceAssets", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.PeriodSchemes.Period", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Duration") + .HasColumnType("time"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartingTime") + .HasColumnType("time"); + + b.HasKey("Id"); + + b.HasIndex("PeriodSchemeId"); + + b.ToTable("EasyAbpBookingServicePeriods", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.PeriodSchemes.PeriodScheme", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpBookingServicePeriodSchemes", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CancellationReason") + .HasColumnType("nvarchar(max)"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("PaidTime") + .HasColumnType("datetime2"); + + b.Property("PaymentExpiration") + .HasColumnType("datetime2"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("ReducedInventoryAfterPaymentTime") + .HasColumnType("datetime2"); + + b.Property("ReducedInventoryAfterPlacingTime") + .HasColumnType("datetime2"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique() + .HasFilter("[OrderNumber] IS NOT NULL"); + + b.ToTable("EasyAbpEShopOrdersOrders", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderDiscount", b => + { + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Key") + .HasColumnType("nvarchar(450)"); + + b.Property("DiscountedAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("OrderId", "OrderLineId", "Name", "Key"); + + b.ToTable("EasyAbpEShopOrdersOrderDiscounts", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderExtraFee", b => + { + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Key") + .HasColumnType("nvarchar(450)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("Fee") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.HasKey("OrderId", "Name", "Key"); + + b.ToTable("EasyAbpEShopOrdersOrderExtraFees", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductInventoryStrategy") + .HasColumnType("int"); + + b.Property("ProductModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("EasyAbpEShopOrdersOrderLines", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsPayments", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpEShopPaymentsPaymentItems", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsRefunds", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItems", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderExtraFee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundItemId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RefundItemId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItemOrderExtraFees", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RefundItemId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItemOrderLines", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.BasketItems.BasketItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BasketName") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsInvalid") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("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", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.ProductUpdates.ProductUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopPluginsBasketsProductUpdates", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.GrantedStores.GrantedStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowAll") + .HasColumnType("bit"); + + b.Property("AssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsBookingGrantedStores", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FromTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToTime") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsBookingProductAssetCategories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("PeriodId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductAssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAssetCategoryId"); + + b.ToTable("EasyAbpEShopPluginsBookingProductAssetCategoryPeriods", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAsset", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FromTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PeriodSchemeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToTime") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsBookingProductAssets", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("PeriodId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductAssetId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAssetId"); + + b.ToTable("EasyAbpEShopPluginsBookingProductAssetPeriods", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConditionAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CouponType") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsUnscoped") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("UsableBeginTime") + .HasColumnType("datetime2"); + + b.Property("UsableDuration") + .HasColumnType("time"); + + b.Property("UsableEndTime") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsCouponsCouponTemplates", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplateScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CouponTemplateId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CouponTemplateId"); + + b.ToTable("EasyAbpEShopPluginsCouponsCouponTemplateScopes", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.Coupons.Coupon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CouponTemplateId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiscountedAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("ExpirationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UsedTime") + .HasColumnType("datetime2"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsCouponsCoupons", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.FlashSales.FlashSalePlans.FlashSalePlan", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsFlashSalesFlashSalePlans", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.FlashSales.FlashSaleResults.FlashSaleResult", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("Reason") + .HasColumnType("nvarchar(max)"); + + b.Property("ReducedInventoryTime") + .HasColumnType("datetime2"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPluginsFlashSalesFlashSaleResults", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("EasyAbpEShopProductsCategories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductCategories.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductCategories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetailHistories.ProductDetailHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductDetailId"); + + b.ToTable("EasyAbpEShopProductsProductDetailHistories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetails.ProductDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductDetails", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductHistories.ProductHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductHistories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductInventories.ProductInventory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopProductsProductInventories", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InventoryProviderName") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("Overview") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentExpireIn") + .HasColumnType("time"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName"); + + b.ToTable("EasyAbpEShopProductsProducts", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductAttributes", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ProductAttributeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("EasyAbpEShopProductsProductAttributeOptions", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderMaxQuantity") + .HasColumnType("int"); + + b.Property("OrderMinQuantity") + .HasColumnType("int"); + + b.Property("OriginalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentExpireIn") + .HasColumnType("time"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductSkus", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductView", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InventoryProviderName") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("MaximumPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("MinimumPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("Overview") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentExpireIn") + .HasColumnType("time"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductGroupDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName"); + + b.ToTable("EasyAbpEShopProductsProductViews", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.StoreOwners.StoreOwner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OwnerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("OwnerUserId", "StoreId") + .IsUnique(); + + b.ToTable("EasyAbpEShopStoresStoreOwners", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresStores", (string)null); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresTransactions", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePayments", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServicePaymentItems", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Accounts.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("Balance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PendingTopUpPaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingWithdrawalAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PendingWithdrawalRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentAccounts", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("OriginalBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("AccountUserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentTransactions", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.WithdrawalRecords.WithdrawalRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("CancellationTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ResultErrorCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ResultErrorMessage") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("WithdrawalMethod") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePrepaymentWithdrawalRecords", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.WithdrawalRequests.WithdrawalRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsApproved") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ReviewTime") + .HasColumnType("datetime2"); + + b.Property("ReviewerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePrepaymentWithdrawalRequests", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServiceRefunds", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpPaymentServiceRefundItems", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.PaymentRecords.PaymentRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("Attach") + .HasColumnType("nvarchar(max)"); + + b.Property("BankType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CouponCount") + .HasColumnType("int"); + + b.Property("CouponFee") + .HasColumnType("int"); + + b.Property("CouponFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeviceInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCodeDes") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSubscribe") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("Openid") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResultCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TimeEnd") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TradeType") + .HasColumnType("nvarchar(max)"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayPaymentRecords", (string)null); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.RefundRecords.RefundRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashRefundFee") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponRefundCount") + .HasColumnType("int"); + + b.Property("CouponRefundFee") + .HasColumnType("int"); + + b.Property("CouponRefundFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("OutRefundNo") + .HasColumnType("nvarchar(450)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundFee") + .HasColumnType("int"); + + b.Property("RefundId") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRecvAccout") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRequestSource") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementRefundFee") + .HasColumnType("int"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("SuccessTime") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("OutRefundNo"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayRefundRecords", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("nvarchar(max)"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime2") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("nvarchar(max)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("RequireRequestObject") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[TenantId] IS NOT NULL"); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetCategories.AssetCategory", b => + { + b.HasOne("EasyAbp.BookingService.AssetCategories.AssetCategory", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + { + b1.Property("AssetCategoryId") + .HasColumnType("uniqueidentifier"); + + b1.Property("MaxDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MaxTimespanInAdvance") + .HasColumnType("time"); + + b1.Property("MinDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MinTimespanInAdvance") + .HasColumnType("time"); + + b1.HasKey("AssetCategoryId"); + + b1.ToTable("EasyAbpBookingServiceAssetCategories"); + + b1.WithOwner() + .HasForeignKey("AssetCategoryId"); + }); + + b.Navigation("Parent"); + + b.Navigation("TimeInAdvance"); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetSchedules.AssetSchedule", b => + { + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + { + b1.Property("AssetScheduleId") + .HasColumnType("uniqueidentifier"); + + b1.Property("MaxDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MaxTimespanInAdvance") + .HasColumnType("time"); + + b1.Property("MinDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MinTimespanInAdvance") + .HasColumnType("time"); + + b1.HasKey("AssetScheduleId"); + + b1.ToTable("EasyAbpBookingServiceAssetSchedules"); + + b1.WithOwner() + .HasForeignKey("AssetScheduleId"); + }); + + b.Navigation("TimeInAdvance"); + }); + + modelBuilder.Entity("EasyAbp.BookingService.Assets.Asset", b => + { + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + { + b1.Property("AssetId") + .HasColumnType("uniqueidentifier"); + + b1.Property("MaxDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MaxTimespanInAdvance") + .HasColumnType("time"); + + b1.Property("MinDaysInAdvance") + .HasColumnType("int"); + + b1.Property("MinTimespanInAdvance") + .HasColumnType("time"); + + b1.HasKey("AssetId"); + + b1.ToTable("EasyAbpBookingServiceAssets"); + + b1.WithOwner() + .HasForeignKey("AssetId"); + }); + + b.Navigation("TimeInAdvance"); + }); + + modelBuilder.Entity("EasyAbp.BookingService.PeriodSchemes.Period", b => + { + b.HasOne("EasyAbp.BookingService.PeriodSchemes.PeriodScheme", null) + .WithMany("Periods") + .HasForeignKey("PeriodSchemeId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderDiscount", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderDiscounts") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderExtraFee", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderExtraFees") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderLines") + .HasForeignKey("OrderId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderExtraFee", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("OrderExtraFees") + .HasForeignKey("RefundItemId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("OrderLines") + .HasForeignKey("RefundItemId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod", b => + { + b.HasOne("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory", null) + .WithMany("Periods") + .HasForeignKey("ProductAssetCategoryId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod", b => + { + b.HasOne("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAsset", null) + .WithMany("Periods") + .HasForeignKey("ProductAssetId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplateScope", b => + { + b.HasOne("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplate", null) + .WithMany("Scopes") + .HasForeignKey("CouponTemplateId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.HasOne("EasyAbp.EShop.Products.Categories.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductAttributes") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.ProductAttribute", null) + .WithMany("ProductAttributeOptions") + .HasForeignKey("ProductAttributeId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductSkus") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.PaymentService.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.PaymentService.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("EasyAbp.BookingService.AssetCategories.AssetCategory", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("EasyAbp.BookingService.PeriodSchemes.PeriodScheme", b => + { + b.Navigation("Periods"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Navigation("OrderDiscounts"); + + b.Navigation("OrderExtraFees"); + + b.Navigation("OrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Navigation("PaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Navigation("RefundItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Navigation("OrderExtraFees"); + + b.Navigation("OrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory", b => + { + b.Navigation("Periods"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Booking.ProductAssets.ProductAsset", b => + { + b.Navigation("Periods"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Coupons.CouponTemplates.CouponTemplate", b => + { + b.Navigation("Scopes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Navigation("ProductAttributes"); + + b.Navigation("ProductSkus"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Navigation("ProductAttributeOptions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Navigation("PaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Navigation("RefundItems"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230329111403_RefactordOrderAndSomeOthers.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230329111403_RefactordOrderAndSomeOthers.cs new file mode 100644 index 00000000..0dd60851 --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20230329111403_RefactordOrderAndSomeOthers.cs @@ -0,0 +1,74 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EShopSample.Migrations +{ + /// + public partial class RefactordOrderAndSomeOthers : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "PaymentExpireIn", + table: "EasyAbpEShopProductsProductViews", + type: "time", + nullable: true); + + migrationBuilder.AddColumn( + name: "DisplayName", + table: "EasyAbpEShopPaymentsRefundItemOrderExtraFees", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "DisplayName", + table: "EasyAbpEShopOrdersOrderExtraFees", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.CreateTable( + name: "EasyAbpEShopOrdersOrderDiscounts", + columns: table => new + { + OrderId = table.Column(type: "uniqueidentifier", nullable: false), + OrderLineId = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(450)", nullable: false), + Key = table.Column(type: "nvarchar(450)", nullable: false), + DisplayName = table.Column(type: "nvarchar(max)", nullable: true), + DiscountedAmount = table.Column(type: "decimal(20,8)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EasyAbpEShopOrdersOrderDiscounts", x => new { x.OrderId, x.OrderLineId, x.Name, x.Key }); + table.ForeignKey( + name: "FK_EasyAbpEShopOrdersOrderDiscounts_EasyAbpEShopOrdersOrders_OrderId", + column: x => x.OrderId, + principalTable: "EasyAbpEShopOrdersOrders", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EasyAbpEShopOrdersOrderDiscounts"); + + migrationBuilder.DropColumn( + name: "PaymentExpireIn", + table: "EasyAbpEShopProductsProductViews"); + + migrationBuilder.DropColumn( + name: "DisplayName", + table: "EasyAbpEShopPaymentsRefundItemOrderExtraFees"); + + migrationBuilder.DropColumn( + name: "DisplayName", + table: "EasyAbpEShopOrdersOrderExtraFees"); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs index c934b060..16fa461f 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs @@ -607,6 +607,31 @@ namespace EShopSample.Migrations b.ToTable("EasyAbpEShopOrdersOrders", (string)null); }); + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderDiscount", b => + { + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Key") + .HasColumnType("nvarchar(450)"); + + b.Property("DiscountedAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("OrderId", "OrderLineId", "Name", "Key"); + + b.ToTable("EasyAbpEShopOrdersOrderDiscounts", (string)null); + }); + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderExtraFee", b => { b.Property("OrderId") @@ -618,6 +643,9 @@ namespace EShopSample.Migrations b.Property("Key") .HasColumnType("nvarchar(450)"); + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + b.Property("Fee") .HasColumnType("decimal(20,8)"); @@ -1066,6 +1094,9 @@ namespace EShopSample.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + b.Property("Key") .HasColumnType("nvarchar(max)"); @@ -2568,6 +2599,9 @@ namespace EShopSample.Migrations b.Property("Overview") .HasColumnType("nvarchar(max)"); + b.Property("PaymentExpireIn") + .HasColumnType("time"); + b.Property("ProductDetailId") .HasColumnType("uniqueidentifier"); @@ -5708,7 +5742,7 @@ namespace EShopSample.Migrations .WithMany("Children") .HasForeignKey("ParentId"); - b.OwnsOne("EasyAbp.BookingService.AssetCategories.AssetCategory.TimeInAdvance#EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => { b1.Property("AssetCategoryId") .HasColumnType("uniqueidentifier"); @@ -5727,7 +5761,7 @@ namespace EShopSample.Migrations b1.HasKey("AssetCategoryId"); - b1.ToTable("EasyAbpBookingServiceAssetCategories", (string)null); + b1.ToTable("EasyAbpBookingServiceAssetCategories"); b1.WithOwner() .HasForeignKey("AssetCategoryId"); @@ -5740,7 +5774,7 @@ namespace EShopSample.Migrations modelBuilder.Entity("EasyAbp.BookingService.AssetSchedules.AssetSchedule", b => { - b.OwnsOne("EasyAbp.BookingService.AssetSchedules.AssetSchedule.TimeInAdvance#EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => { b1.Property("AssetScheduleId") .HasColumnType("uniqueidentifier"); @@ -5759,7 +5793,7 @@ namespace EShopSample.Migrations b1.HasKey("AssetScheduleId"); - b1.ToTable("EasyAbpBookingServiceAssetSchedules", (string)null); + b1.ToTable("EasyAbpBookingServiceAssetSchedules"); b1.WithOwner() .HasForeignKey("AssetScheduleId"); @@ -5770,7 +5804,7 @@ namespace EShopSample.Migrations modelBuilder.Entity("EasyAbp.BookingService.Assets.Asset", b => { - b.OwnsOne("EasyAbp.BookingService.Assets.Asset.TimeInAdvance#EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => + b.OwnsOne("EasyAbp.BookingService.TimeInAdvance", "TimeInAdvance", b1 => { b1.Property("AssetId") .HasColumnType("uniqueidentifier"); @@ -5789,7 +5823,7 @@ namespace EShopSample.Migrations b1.HasKey("AssetId"); - b1.ToTable("EasyAbpBookingServiceAssets", (string)null); + b1.ToTable("EasyAbpBookingServiceAssets"); b1.WithOwner() .HasForeignKey("AssetId"); @@ -5805,6 +5839,15 @@ namespace EShopSample.Migrations .HasForeignKey("PeriodSchemeId"); }); + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderDiscount", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderDiscounts") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderExtraFee", b => { b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) @@ -6203,6 +6246,8 @@ namespace EShopSample.Migrations modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => { + b.Navigation("OrderDiscounts"); + b.Navigation("OrderExtraFees"); b.Navigation("OrderLines");