From 7cb5fed27988214dc14be6b498fdbd05adb41ec9 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Sat, 4 Jun 2022 20:04:48 +0800 Subject: [PATCH] Multi-store, basic CRUD and authorization handlers. --- .../ProductDetails/ProductDetailAppService.cs | 2 +- .../Products/Products/ProductAppService.cs | 11 +- .../MultiStoreAbstractKeyCrudAppService.cs | 7 +- .../Stores/Stores/MultiStoreCrudAppService.cs | 4 +- ...bp.EShop.Orders.Booking.Application.csproj | 1 + ...ookingOrderCreationAuthorizationHandler.cs | 153 +- .../EShopOrdersBookingApplicationModule.cs | 6 +- ...hopOrdersPluginsBookingObjectExtensions.cs | 2 + ....EShop.Payments.Booking.Application.csproj | 1 + ...kingPaymentCreationAuthorizationHandler.cs | 179 +- .../EShopPaymentsBookingApplicationModule.cs | 6 +- .../EShop/Orders/BookingOrderProperties.cs | 4 + .../Orders/CreateOrderLineDtoExtensions.cs | 10 + .../EShop/Orders/OrderLineExtensions.cs | 10 + .../BookingPermissionDefinitionProvider.cs | 2 + .../Booking/Permissions/BookingPermissions.cs | 2 + .../Dtos/CreateProductAssetCategoryDto.cs | 5 +- .../Dtos/GetProductAssetCategoryDto.cs | 18 + .../Dtos/ProductAssetCategoryDto.cs | 2 + .../IProductAssetCategoryAppService.cs | 3 +- .../Dtos/CreateProductAssetDto.cs | 5 +- .../ProductAssets/Dtos/GetProductAssetDto.cs | 18 + .../ProductAssets/Dtos/ProductAssetDto.cs | 2 + .../ProductAssets/IProductAssetAppService.cs | 2 +- ...p.EShop.Plugins.Booking.Application.csproj | 3 + .../BookingApplicationAutoMapperProfile.cs | 4 - .../EShopPluginsBookingApplicationModule.cs | 8 +- .../ProductAssetCategoryAppService.cs | 152 +- .../ProductAssets/ProductAssetAppService.cs | 130 +- .../Plugins/Booking/BookingErrorCodes.cs | 3 + .../Plugins/Booking/Localization/en.json | 5 + .../Plugins/Booking/Localization/zh-Hans.json | 5 + .../Plugins/Booking/Localization/zh-Hant.json | 5 + ...asyAbp.EShop.Plugins.Booking.Domain.csproj | 1 + .../EShopPluginsBookingDomainModule.cs | 4 +- .../IProductAssetCategoryRepository.cs | 6 + .../ProductAssetCategory.cs | 15 +- .../ProductAssetManager.cs | 43 + .../ProductAssets/IProductAssetRepository.cs | 6 + .../Booking/ProductAssets/ProductAsset.cs | 16 +- .../ProductAssets/ProductAssetManager.cs | 43 + .../ProductAssetCategoryRepository.cs | 33 + .../ProductAssets/ProductAssetRepository.cs | 38 +- ...reAssetCategoryEfCoreQuerableExtensions.cs | 4 +- .../ProductAssetCategoryController.cs | 3 +- .../ProductAssets/ProductAssetController.cs | 2 +- .../EasyAbp.EShop.Plugins.Booking.Web.csproj | 12 - .../CreateModal.cshtml.cs | 2 +- .../ProductAssetCategory/Index.cshtml | 69 +- .../ProductAssetCategory/Index.cshtml.cs | 5 + .../CreateProductAssetCategoryViewModel.cs | 5 + ...ProductAssetCategoryListFilterViewModel.cs | 19 + .../ProductAssetCategory/index.js | 13 +- .../ProductAsset/CreateModal.cshtml.cs | 2 +- .../ProductAssets/ProductAsset/Index.cshtml | 69 +- .../ProductAsset/Index.cshtml.cs | 5 + .../ViewModels/CreateProductAssetViewModel.cs | 6 +- .../ProductAssetListFilterViewModel.cs | 20 + .../ProductAssets/ProductAsset/index.js | 13 +- ...ctAssetAndProductAssetCategory.Designer.cs | 5416 +++++++++++++++++ ...IdInProductAssetAndProductAssetCategory.cs | 38 + .../EShopSampleDbContextModelSnapshot.cs | 6 + 62 files changed, 6521 insertions(+), 163 deletions(-) create mode 100644 plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/GetProductAssetCategoryDto.cs create mode 100644 plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/GetProductAssetDto.cs create mode 100644 plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetManager.cs create mode 100644 plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetManager.cs create mode 100644 plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/ProductAssetCategoryListFilterViewModel.cs create mode 100644 plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/ProductAssetListFilterViewModel.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220603163430_AddedStoreIdInProductAssetAndProductAssetCategory.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220603163430_AddedStoreIdInProductAssetAndProductAssetCategory.cs diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductDetails/ProductDetailAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductDetails/ProductDetailAppService.cs index f4f8604a..47266633 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductDetails/ProductDetailAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductDetails/ProductDetailAppService.cs @@ -83,7 +83,7 @@ namespace EasyAbp.EShop.Products.ProductDetails ProductsPermissions.Products.CrossStore); } - MapToEntity(input, detail); + await MapToEntityAsync(input, detail); await Repository.UpdateAsync(detail, autoSave: true); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs index fe7ce521..0898ac8a 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs @@ -61,16 +61,9 @@ namespace EasyAbp.EShop.Products.Products .WhereIf(!input.ShowUnpublished, x => x.IsPublished); } - protected override Product MapToEntity(CreateUpdateProductDto createInput) - { - var product = base.MapToEntity(createInput); - - return product; - } - public override async Task CreateAsync(CreateUpdateProductDto input) { - var product = MapToEntity(input); + var product = await MapToEntityAsync(input); await CheckMultiStorePolicyAsync(product.StoreId, CreatePolicyName); @@ -111,7 +104,7 @@ namespace EasyAbp.EShop.Products.Products CheckProductIsNotStatic(product); - MapToEntity(input, product); + await MapToEntityAsync(input, product); await UpdateProductAttributesAsync(product, input); diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs index a34c202c..a7d0ad8b 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs @@ -62,7 +62,7 @@ namespace EasyAbp.EShop.Stores.Stores where TEntity : class, IEntity, IMultiStore where TCreateInput : IMultiStore { - protected virtual string CrossStorePolicyName { get; set; } + protected abstract string CrossStorePolicyName { get; set; } protected MultiStoreAbstractKeyCrudAppService(IRepository repository) : base(repository) @@ -82,7 +82,7 @@ namespace EasyAbp.EShop.Stores.Stores { await CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName); - var entity = MapToEntity(input); + var entity = await MapToEntityAsync(input); TryToSetTenantId(entity); @@ -96,7 +96,7 @@ namespace EasyAbp.EShop.Stores.Stores var entity = await GetEntityByIdAsync(id); await CheckMultiStorePolicyAsync(entity.StoreId, UpdatePolicyName); - MapToEntity(input, entity); + await MapToEntityAsync(input, entity); await Repository.UpdateAsync(entity, autoSave: true); return await MapToGetOutputDtoAsync(entity); @@ -110,7 +110,6 @@ namespace EasyAbp.EShop.Stores.Stores await DeleteByIdAsync(id); } - protected virtual async Task CheckMultiStorePolicyAsync(Guid? storeId, string policyName, bool crossStoreAllowed = true) { if (crossStoreAllowed) diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs index 352579f3..6f505821 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs @@ -79,14 +79,14 @@ namespace EasyAbp.EShop.Stores.Stores return await Repository.GetAsync(id); } - protected override void MapToEntity(TUpdateInput updateInput, TEntity entity) + protected override Task MapToEntityAsync(TUpdateInput updateInput, TEntity entity) { if (updateInput is IEntityDto entityDto) { entityDto.Id = entity.Id; } - base.MapToEntity(updateInput, entity); + return base.MapToEntityAsync(updateInput, entity); } protected override IQueryable ApplyDefaultSorting(IQueryable query) diff --git a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp.EShop.Orders.Booking.Application.csproj b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp.EShop.Orders.Booking.Application.csproj index d7558e4d..7cf1f65c 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp.EShop.Orders.Booking.Application.csproj +++ b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp.EShop.Orders.Booking.Application.csproj @@ -8,6 +8,7 @@ + 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 6b82aebb..582e2637 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 @@ -1,21 +1,45 @@ -using System.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Principal; using System.Threading.Tasks; +using EasyAbp.BookingService.AssetOccupancies; +using EasyAbp.BookingService.AssetOccupancies.Dtos; +using EasyAbp.BookingService.PeriodSchemes; using EasyAbp.EShop.Orders.Orders; +using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Plugins.Booking.BookingProductGroupDefinitions; +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 Microsoft.AspNetCore.Authorization; +using Volo.Abp; namespace EasyAbp.EShop.Orders.Booking.Authorization { public class BookingOrderCreationAuthorizationHandler : OrderCreationAuthorizationHandler { + private readonly IPeriodSchemeAppService _periodSchemeAppService; + private readonly IProductAssetAppService _productAssetAppService; + private readonly IProductAssetCategoryAppService _productAssetCategoryAppService; + private readonly IAssetOccupancyAppService _assetOccupancyAppService; private readonly IBookingProductGroupDefinitionAppService _definitionAppService; public BookingOrderCreationAuthorizationHandler( + IPeriodSchemeAppService periodSchemeAppService, + IProductAssetAppService productAssetAppService, + IProductAssetCategoryAppService productAssetCategoryAppService, + IAssetOccupancyAppService assetOccupancyAppService, IBookingProductGroupDefinitionAppService definitionAppService) { + _periodSchemeAppService = periodSchemeAppService; + _productAssetAppService = productAssetAppService; + _productAssetCategoryAppService = productAssetCategoryAppService; + _assetOccupancyAppService = assetOccupancyAppService; _definitionAppService = definitionAppService; } - + protected override async Task HandleOrderCreationAsync(AuthorizationHandlerContext context, OrderOperationAuthorizationRequirement requirement, OrderCreationResource resource) { @@ -29,26 +53,133 @@ namespace EasyAbp.EShop.Orders.Booking.Authorization return; } + var models = new List(); + var byCategoryModels = new List(); + foreach (var orderLine in bookingOrderLines) { + if (!await IsPeriodInfoValidAsync(orderLine)) + { + context.Fail(); + return; + } + var assetId = orderLine.FindBookingAssetId(); + var assetCategoryId = orderLine.FindBookingAssetCategoryId(); + if (assetId is not null) { - // Todo: Invoke IProductAssetAppService to check the mapping. - } - else + if (!await IsAssetInfoValidAsync(orderLine, resource)) + { + context.Fail(); + return; + } + + var bookingDate = + Check.NotNull(orderLine.FindBookingDate(), BookingOrderProperties.OrderLineBookingDate)!.Value; + + var bookingStartingTime = Check.NotNull(orderLine.FindBookingStartingTime(), + BookingOrderProperties.OrderLineBookingStartingTime)!.Value; + + var bookingDuration = Check.NotNull(orderLine.FindBookingDuration(), + BookingOrderProperties.OrderLineBookingDuration)!.Value; + + models.Add(new OccupyAssetInfoModel( + assetId.Value, bookingDate, bookingStartingTime, bookingDuration)); + } + else if (assetCategoryId is not null) { - var assetCategoryId = orderLine.FindBookingAssetCategoryId(); - if (assetCategoryId is null) + if (!await IsAssetCategoryInfoValidAsync(orderLine, resource)) { context.Fail(); return; } - // Todo: Invoke IProductAssetCategoryAppService to check the mapping. + + var bookingDate = + Check.NotNull(orderLine.FindBookingDate(), BookingOrderProperties.OrderLineBookingDate)!.Value; + + var bookingStartingTime = Check.NotNull(orderLine.FindBookingStartingTime(), + BookingOrderProperties.OrderLineBookingStartingTime)!.Value; + + var bookingDuration = Check.NotNull(orderLine.FindBookingDuration(), + BookingOrderProperties.OrderLineBookingDuration)!.Value; + + byCategoryModels.Add(new OccupyAssetByCategoryInfoModel( + assetCategoryId.Value, bookingDate, bookingStartingTime, bookingDuration)); + } + else + { + context.Fail(); + return; } - - // Todo: Invoke IAssetOccupancyAppService (in EasyAbp.EShop.Plugins.Booking, not EasyAbp.BookingService) to check the booking info. } + + try + { + await _assetOccupancyAppService.CheckBulkCreateAsync(new BulkCreateAssetOccupancyDto + { + OccupierUserId = Check.NotNull(context.User.FindUserId(), "CurrentUserId"), + Models = models, + ByCategoryModels = byCategoryModels + }); + } + catch + { + context.Fail(); + return; + } + } + + protected virtual async Task IsAssetInfoValidAsync(CreateOrderLineDto orderLine, + OrderCreationResource resource) + { + var productAsset = (await _productAssetAppService.GetListAsync( + new GetProductAssetDto + { + MaxResultCount = 1, + StoreId = resource.Input.StoreId, + ProductId = orderLine.ProductId, + ProductSkuId = orderLine.ProductSkuId, + AssetId = orderLine.FindBookingAssetId(), + PeriodSchemeId = orderLine.FindBookingPeriodSchemeId() + } + )).Items.FirstOrDefault(); + + return productAsset is not null; + } + + protected virtual async Task IsAssetCategoryInfoValidAsync(CreateOrderLineDto orderLine, + OrderCreationResource resource) + { + var productAssetCategory = (await _productAssetCategoryAppService.GetListAsync( + new GetProductAssetCategoryDto + { + MaxResultCount = 1, + StoreId = resource.Input.StoreId, + ProductId = orderLine.ProductId, + ProductSkuId = orderLine.ProductSkuId, + AssetCategoryId = orderLine.FindBookingAssetCategoryId(), + PeriodSchemeId = orderLine.FindBookingPeriodSchemeId() + } + )).Items.FirstOrDefault(); + + return productAssetCategory is not null; + } + + protected virtual async Task IsPeriodInfoValidAsync(CreateOrderLineDto orderLine) + { + var periodSchemeId = orderLine.FindBookingPeriodSchemeId(); + var periodId = orderLine.FindBookingPeriodId(); + + if (periodSchemeId is null || periodId is null) + { + return false; + } + + var periodScheme = await _periodSchemeAppService.GetAsync(periodSchemeId.Value); + var period = periodScheme.Periods.Find(x => x.Id == periodId); + + return period is not null; } } -} \ No newline at end of file +} diff --git a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/EShopOrdersBookingApplicationModule.cs b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/EShopOrdersBookingApplicationModule.cs index b593f9ab..837b599e 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/EShopOrdersBookingApplicationModule.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/EShopOrdersBookingApplicationModule.cs @@ -1,11 +1,13 @@ -using EasyAbp.EShop.Orders.Booking.ObjectExtending; +using EasyAbp.BookingService; +using EasyAbp.EShop.Orders.Booking.ObjectExtending; using Volo.Abp.Modularity; namespace EasyAbp.EShop.Orders.Booking { [DependsOn( typeof(EShopOrdersApplicationModule), - typeof(EShopOrdersApplicationContractsModule) + typeof(EShopOrdersApplicationContractsModule), + typeof(BookingServiceApplicationContractsModule) )] public class EShopOrdersBookingApplicationModule : AbpModule { diff --git a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/ObjectExtending/EShopOrdersPluginsBookingObjectExtensions.cs b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/ObjectExtending/EShopOrdersPluginsBookingObjectExtensions.cs index 45001466..a0514863 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/ObjectExtending/EShopOrdersPluginsBookingObjectExtensions.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Orders.Booking.Application/EasyAbp/EShop/Orders/Booking/ObjectExtending/EShopOrdersPluginsBookingObjectExtensions.cs @@ -42,6 +42,8 @@ namespace EasyAbp.EShop.Orders.Booking.ObjectExtending { config.AddOrUpdateProperty(BookingOrderProperties.OrderLineBookingAssetId); config.AddOrUpdateProperty(BookingOrderProperties.OrderLineBookingAssetCategoryId); + config.AddOrUpdateProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId); + config.AddOrUpdateProperty(BookingOrderProperties.OrderLineBookingPeriodId); config.AddOrUpdateProperty(BookingOrderProperties.OrderLineBookingDate); config.AddOrUpdateProperty(BookingOrderProperties.OrderLineBookingStartingTime); config.AddOrUpdateProperty(BookingOrderProperties.OrderLineBookingDuration); diff --git a/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp.EShop.Payments.Booking.Application.csproj b/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp.EShop.Payments.Booking.Application.csproj index 8754a3bc..4f61e0f9 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp.EShop.Payments.Booking.Application.csproj +++ b/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp.EShop.Payments.Booking.Application.csproj @@ -8,6 +8,7 @@ + diff --git a/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp/EShop/Payments/Booking/Authorization/BookingPaymentCreationAuthorizationHandler.cs b/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp/EShop/Payments/Booking/Authorization/BookingPaymentCreationAuthorizationHandler.cs index 7d868d03..88b9f85c 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp/EShop/Payments/Booking/Authorization/BookingPaymentCreationAuthorizationHandler.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp/EShop/Payments/Booking/Authorization/BookingPaymentCreationAuthorizationHandler.cs @@ -1,36 +1,187 @@ -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Linq; +using System.Security.Principal; +using System.Threading.Tasks; +using EasyAbp.BookingService.AssetOccupancies; +using EasyAbp.BookingService.AssetOccupancies.Dtos; +using EasyAbp.BookingService.PeriodSchemes; using EasyAbp.EShop.Orders; +using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Payments.Payments; +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 Microsoft.AspNetCore.Authorization; +using Volo.Abp; namespace EasyAbp.EShop.Payments.Booking.Authorization { public class BookingPaymentCreationAuthorizationHandler : PaymentCreationAuthorizationHandler { - public BookingPaymentCreationAuthorizationHandler() + private readonly IPeriodSchemeAppService _periodSchemeAppService; + private readonly IProductAssetAppService _productAssetAppService; + private readonly IProductAssetCategoryAppService _productAssetCategoryAppService; + private readonly IAssetOccupancyAppService _assetOccupancyAppService; + + public BookingPaymentCreationAuthorizationHandler( + IPeriodSchemeAppService periodSchemeAppService, + IProductAssetAppService productAssetAppService, + IProductAssetCategoryAppService productAssetCategoryAppService, + IAssetOccupancyAppService assetOccupancyAppService) { + _periodSchemeAppService = periodSchemeAppService; + _productAssetAppService = productAssetAppService; + _productAssetCategoryAppService = productAssetCategoryAppService; + _assetOccupancyAppService = assetOccupancyAppService; } - + protected override async Task HandlePaymentCreationAsync(AuthorizationHandlerContext context, PaymentOperationAuthorizationRequirement requirement, PaymentCreationResource resource) { foreach (var order in resource.Orders) { - foreach (var orderLine in order.OrderLines) + if (await IsBookingOrderValidAsync(context, order)) + { + continue; + } + + context.Fail(); + return; + } + } + + protected virtual async Task IsBookingOrderValidAsync(AuthorizationHandlerContext context, OrderDto order) + { + var bookingOrderLines = order.OrderLines.Where(x => x.FindBookingAssetId() is not null).ToList(); + + if (!bookingOrderLines.Any()) + { + return true; + } + + var models = new List(); + var byCategoryModels = new List(); + + foreach (var orderLine in bookingOrderLines) + { + if (!await IsPeriodInfoValidAsync(orderLine)) { - var assetId = orderLine.FindBookingAssetId(); - if (assetId is null) + return false; + } + + var assetId = orderLine.FindBookingAssetId(); + var assetCategoryId = orderLine.FindBookingAssetCategoryId(); + + if (assetId is not null) + { + if (!await IsAssetInfoValidAsync(order, orderLine)) { - var assetCategoryId = orderLine.FindBookingAssetCategoryId(); - if (assetCategoryId is null) - { - continue; - } + return false; } - - // Todo: Invoke IAssetOccupancyAppService (in EasyAbp.EShop.Plugins.Booking, not EasyAbp.BookingService) to check the booking info. + + var bookingDate = + Check.NotNull(orderLine.FindBookingDate(), BookingOrderProperties.OrderLineBookingDate)!.Value; + + var bookingStartingTime = Check.NotNull(orderLine.FindBookingStartingTime(), + BookingOrderProperties.OrderLineBookingStartingTime)!.Value; + + var bookingDuration = Check.NotNull(orderLine.FindBookingDuration(), + BookingOrderProperties.OrderLineBookingDuration)!.Value; + + models.Add(new OccupyAssetInfoModel( + assetId.Value, bookingDate, bookingStartingTime, bookingDuration)); + } + else if (assetCategoryId is not null) + { + if (!await IsAssetCategoryInfoValidAsync(order, orderLine)) + { + return false; + } + + var bookingDate = + Check.NotNull(orderLine.FindBookingDate(), BookingOrderProperties.OrderLineBookingDate)!.Value; + + var bookingStartingTime = Check.NotNull(orderLine.FindBookingStartingTime(), + BookingOrderProperties.OrderLineBookingStartingTime)!.Value; + + var bookingDuration = Check.NotNull(orderLine.FindBookingDuration(), + BookingOrderProperties.OrderLineBookingDuration)!.Value; + + byCategoryModels.Add(new OccupyAssetByCategoryInfoModel( + assetCategoryId.Value, bookingDate, bookingStartingTime, bookingDuration)); + } + else + { + return false; + } + } + + try + { + await _assetOccupancyAppService.CheckBulkCreateAsync(new BulkCreateAssetOccupancyDto + { + OccupierUserId = Check.NotNull(context.User.FindUserId(), "CurrentUserId"), + Models = models, + ByCategoryModels = byCategoryModels + }); + } + catch + { + return false; + } + + return true; + } + + protected virtual async Task IsAssetInfoValidAsync(OrderDto order, OrderLineDto orderLine) + { + var productAsset = (await _productAssetAppService.GetListAsync( + new GetProductAssetDto + { + MaxResultCount = 1, + StoreId = order.StoreId, + ProductId = orderLine.ProductId, + ProductSkuId = orderLine.ProductSkuId, + AssetId = orderLine.FindBookingAssetId(), + PeriodSchemeId = orderLine.FindBookingPeriodSchemeId() + } + )).Items.FirstOrDefault(); + + return productAsset is not null; + } + + protected virtual async Task IsAssetCategoryInfoValidAsync(OrderDto order, OrderLineDto orderLine) + { + var productAssetCategory = (await _productAssetCategoryAppService.GetListAsync( + new GetProductAssetCategoryDto + { + MaxResultCount = 1, + StoreId = order.StoreId, + ProductId = orderLine.ProductId, + ProductSkuId = orderLine.ProductSkuId, + AssetCategoryId = orderLine.FindBookingAssetCategoryId(), + PeriodSchemeId = orderLine.FindBookingPeriodSchemeId() } + )).Items.FirstOrDefault(); + + return productAssetCategory is not null; + } + + protected virtual async Task IsPeriodInfoValidAsync(OrderLineDto orderLine) + { + var periodSchemeId = orderLine.FindBookingPeriodSchemeId(); + var periodId = orderLine.FindBookingPeriodId(); + + if (periodSchemeId is null || periodId is null) + { + return false; } + + var periodScheme = await _periodSchemeAppService.GetAsync(periodSchemeId.Value); + var period = periodScheme.Periods.Find(x => x.Id == periodId); + + return period is not null; } } -} \ No newline at end of file +} diff --git a/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp/EShop/Payments/Booking/EShopPaymentsBookingApplicationModule.cs b/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp/EShop/Payments/Booking/EShopPaymentsBookingApplicationModule.cs index 9715b6fa..1a912e2a 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp/EShop/Payments/Booking/EShopPaymentsBookingApplicationModule.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Payments.Booking.Application/EasyAbp/EShop/Payments/Booking/EShopPaymentsBookingApplicationModule.cs @@ -1,11 +1,13 @@ -using EasyAbp.EShop.Plugins.Booking; +using EasyAbp.BookingService; +using EasyAbp.EShop.Plugins.Booking; using Volo.Abp.Modularity; namespace EasyAbp.EShop.Payments.Booking { [DependsOn( typeof(EShopPaymentsApplicationModule), - typeof(EShopPluginsBookingApplicationContractsModule) + typeof(EShopPluginsBookingApplicationContractsModule), + typeof(BookingServiceApplicationContractsModule) )] public class EShopPaymentsBookingApplicationModule : AbpModule { diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/BookingOrderProperties.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/BookingOrderProperties.cs index 685ad92a..08fbd16c 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/BookingOrderProperties.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/BookingOrderProperties.cs @@ -5,6 +5,10 @@ public class BookingOrderProperties public const string OrderLineBookingAssetId = "BookingAssetId"; public const string OrderLineBookingAssetCategoryId = "BookingAssetCategoryId"; + + public const string OrderLineBookingPeriodSchemeId = "BookingPeriodSchemeId"; + + public const string OrderLineBookingPeriodId = "BookingPeriodId"; public const string OrderLineBookingDate = "BookingDate"; 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/CreateOrderLineDtoExtensions.cs index c15e53af..e1921dee 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/CreateOrderLineDtoExtensions.cs @@ -16,6 +16,16 @@ public static class CreateOrderLineDtoExtensions return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingAssetCategoryId); } + public static Guid? FindBookingPeriodSchemeId(this CreateOrderLineDto orderLine) + { + return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId); + } + + public static Guid? FindBookingPeriodId(this CreateOrderLineDto orderLine) + { + return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingPeriodId); + } + public static DateTime? FindBookingDate(this CreateOrderLineDto orderLine) { return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingDate); diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/OrderLineExtensions.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/OrderLineExtensions.cs index 9c4eb41f..dfb07608 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/OrderLineExtensions.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Orders/OrderLineExtensions.cs @@ -15,7 +15,17 @@ public static class OrderLineExtensions { return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingAssetCategoryId); } + + public static Guid? FindBookingPeriodSchemeId(this IOrderLine orderLine) + { + return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId); + } + public static Guid? FindBookingPeriodId(this IOrderLine orderLine) + { + return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingPeriodId); + } + public static DateTime? FindBookingDate(this IOrderLine orderLine) { return orderLine.GetProperty(BookingOrderProperties.OrderLineBookingDate); diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/Permissions/BookingPermissionDefinitionProvider.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/Permissions/BookingPermissionDefinitionProvider.cs index 99534e55..cd328db8 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/Permissions/BookingPermissionDefinitionProvider.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/Permissions/BookingPermissionDefinitionProvider.cs @@ -11,11 +11,13 @@ public class BookingPermissionDefinitionProvider : PermissionDefinitionProvider var myGroup = context.AddGroup(BookingPermissions.GroupName, L("Permission:Booking")); var productAssetPermission = myGroup.AddPermission(BookingPermissions.ProductAsset.Default, L("Permission:ProductAsset")); + productAssetPermission.AddChild(BookingPermissions.ProductAsset.Manage, L("Permission:Manage")); productAssetPermission.AddChild(BookingPermissions.ProductAsset.Create, L("Permission:Create")); productAssetPermission.AddChild(BookingPermissions.ProductAsset.Update, L("Permission:Update")); productAssetPermission.AddChild(BookingPermissions.ProductAsset.Delete, L("Permission:Delete")); var productAssetCategoryPermission = myGroup.AddPermission(BookingPermissions.ProductAssetCategory.Default, L("Permission:ProductAssetCategory")); + productAssetCategoryPermission.AddChild(BookingPermissions.ProductAssetCategory.Manage, L("Permission:Manage")); productAssetCategoryPermission.AddChild(BookingPermissions.ProductAssetCategory.Create, L("Permission:Create")); productAssetCategoryPermission.AddChild(BookingPermissions.ProductAssetCategory.Update, L("Permission:Update")); productAssetCategoryPermission.AddChild(BookingPermissions.ProductAssetCategory.Delete, L("Permission:Delete")); diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/Permissions/BookingPermissions.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/Permissions/BookingPermissions.cs index 59b3c751..c6f07616 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/Permissions/BookingPermissions.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/Permissions/BookingPermissions.cs @@ -14,6 +14,7 @@ public class BookingPermissions public class ProductAsset { public const string Default = GroupName + ".ProductAsset"; + public const string Manage = Default + ".Manage"; public const string Update = Default + ".Update"; public const string Create = Default + ".Create"; public const string Delete = Default + ".Delete"; @@ -22,6 +23,7 @@ public class BookingPermissions public class ProductAssetCategory { public const string Default = GroupName + ".ProductAssetCategory"; + public const string Manage = Default + ".Manage"; public const string Update = Default + ".Update"; public const string Create = Default + ".Create"; public const string Delete = Default + ".Delete"; diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/CreateProductAssetCategoryDto.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/CreateProductAssetCategoryDto.cs index 1814223f..7afda83b 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/CreateProductAssetCategoryDto.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/CreateProductAssetCategoryDto.cs @@ -1,12 +1,15 @@ using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; +using EasyAbp.EShop.Stores.Stores; namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos { [Serializable] - public class CreateProductAssetCategoryDto + public class CreateProductAssetCategoryDto : IMultiStore { + public Guid StoreId { get; set; } + public Guid ProductId { get; set; } public Guid ProductSkuId { get; set; } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/GetProductAssetCategoryDto.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/GetProductAssetCategoryDto.cs new file mode 100644 index 00000000..0c219059 --- /dev/null +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/GetProductAssetCategoryDto.cs @@ -0,0 +1,18 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; + +[Serializable] +public class GetProductAssetCategoryDto : PagedAndSortedResultRequestDto +{ + public Guid? StoreId { get; set; } + + public Guid? ProductId { get; set; } + + public Guid? ProductSkuId { get; set; } + + public Guid? AssetCategoryId { get; set; } + + public Guid? PeriodSchemeId { get; set; } +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/ProductAssetCategoryDto.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/ProductAssetCategoryDto.cs index babb1f05..1f534649 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/ProductAssetCategoryDto.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/Dtos/ProductAssetCategoryDto.cs @@ -7,6 +7,8 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos [Serializable] public class ProductAssetCategoryDto : AuditedEntityDto { + public Guid StoreId { get; set; } + public Guid ProductId { get; set; } public Guid ProductSkuId { get; set; } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/IProductAssetCategoryAppService.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/IProductAssetCategoryAppService.cs index e0e8c63a..eda0cce5 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/IProductAssetCategoryAppService.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/IProductAssetCategoryAppService.cs @@ -1,7 +1,6 @@ using System; using System.Threading.Tasks; using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; -using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories @@ -10,7 +9,7 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories ICrudAppService< ProductAssetCategoryDto, Guid, - PagedAndSortedResultRequestDto, + GetProductAssetCategoryDto, CreateProductAssetCategoryDto, UpdateProductAssetCategoryDto> { diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/CreateProductAssetDto.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/CreateProductAssetDto.cs index bea61ce6..ffa8dd2d 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/CreateProductAssetDto.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/CreateProductAssetDto.cs @@ -1,11 +1,14 @@ using System; using System.ComponentModel.DataAnnotations; +using EasyAbp.EShop.Stores.Stores; namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos { [Serializable] - public class CreateProductAssetDto + public class CreateProductAssetDto : IMultiStore { + public Guid StoreId { get; set; } + public Guid ProductId { get; set; } public Guid ProductSkuId { get; set; } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/GetProductAssetDto.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/GetProductAssetDto.cs new file mode 100644 index 00000000..113df7cf --- /dev/null +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/GetProductAssetDto.cs @@ -0,0 +1,18 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; + +[Serializable] +public class GetProductAssetDto : PagedAndSortedResultRequestDto +{ + public Guid? StoreId { get; set; } + + public Guid? ProductId { get; set; } + + public Guid? ProductSkuId { get; set; } + + public Guid? AssetId { get; set; } + + public Guid? PeriodSchemeId { get; set; } +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/ProductAssetDto.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/ProductAssetDto.cs index 7e0d4c47..8d5bfde4 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/ProductAssetDto.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/Dtos/ProductAssetDto.cs @@ -7,6 +7,8 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos [Serializable] public class ProductAssetDto : AuditedEntityDto { + public Guid StoreId { get; set; } + public Guid ProductId { get; set; } public Guid ProductSkuId { get; set; } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/IProductAssetAppService.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/IProductAssetAppService.cs index c1c77b52..9f732be2 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/IProductAssetAppService.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp/EShop/Plugins/Booking/ProductAssets/IProductAssetAppService.cs @@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets ICrudAppService< ProductAssetDto, Guid, - PagedAndSortedResultRequestDto, + GetProductAssetDto, CreateProductAssetDto, UpdateProductAssetDto> { diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp.EShop.Plugins.Booking.Application.csproj b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp.EShop.Plugins.Booking.Application.csproj index bd2e8251..96b7b215 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp.EShop.Plugins.Booking.Application.csproj +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp.EShop.Plugins.Booking.Application.csproj @@ -10,6 +10,9 @@ + + + diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/BookingApplicationAutoMapperProfile.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/BookingApplicationAutoMapperProfile.cs index d7b05f8c..26a28903 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/BookingApplicationAutoMapperProfile.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/BookingApplicationAutoMapperProfile.cs @@ -16,16 +16,12 @@ public class BookingApplicationAutoMapperProfile : Profile * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ CreateMap(); - CreateMap(MemberList.Source); - CreateMap(MemberList.Source); CreateMap(); CreateMap(MemberList.Source); CreateMap(MemberList.Source); CreateMap(); - CreateMap(MemberList.Source); - CreateMap(MemberList.Source); CreateMap(); CreateMap(MemberList.Source); diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/EShopPluginsBookingApplicationModule.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/EShopPluginsBookingApplicationModule.cs index aa64d11e..b0c882fb 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/EShopPluginsBookingApplicationModule.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/EShopPluginsBookingApplicationModule.cs @@ -1,4 +1,7 @@ -using Microsoft.Extensions.DependencyInjection; +using EasyAbp.BookingService; +using EasyAbp.EShop.Products; +using EasyAbp.EShop.Stores; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; using Volo.Abp.Application; @@ -6,8 +9,11 @@ using Volo.Abp.Application; namespace EasyAbp.EShop.Plugins.Booking; [DependsOn( + typeof(EShopStoresApplicationSharedModule), + typeof(EShopProductsApplicationContractsModule), typeof(EShopPluginsBookingDomainModule), typeof(EShopPluginsBookingApplicationContractsModule), + typeof(BookingServiceApplicationContractsModule), typeof(AbpDddApplicationModule), typeof(AbpAutoMapperModule) )] diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryAppService.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryAppService.cs index ad693760..5af372c0 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryAppService.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryAppService.cs @@ -1,67 +1,173 @@ using System; +using System.Linq; using System.Threading.Tasks; +using EasyAbp.BookingService.AssetCategories; +using EasyAbp.BookingService.PeriodSchemes; using EasyAbp.EShop.Plugins.Booking.Permissions; using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; +using EasyAbp.EShop.Products.Products; +using EasyAbp.EShop.Stores.Stores; +using Volo.Abp; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories { - public class ProductAssetCategoryAppService : CrudAppService, + public class ProductAssetCategoryAppService : MultiStoreCrudAppService, IProductAssetCategoryAppService { + protected override string CrossStorePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Manage; protected override string GetPolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Default; protected override string GetListPolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Default; protected override string CreatePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Create; protected override string UpdatePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Update; protected override string DeletePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Delete; + private readonly IProductAppService _productAppService; + private readonly IPeriodSchemeAppService _periodSchemeAppService; + private readonly IAssetCategoryAppService _assetCategoryAppService; private readonly IProductAssetCategoryRepository _repository; + private readonly ProductAssetCategoryManager _productAssetCategoryManager; - public ProductAssetCategoryAppService(IProductAssetCategoryRepository repository) : base(repository) + public ProductAssetCategoryAppService( + IProductAppService productAppService, + IPeriodSchemeAppService periodSchemeAppService, + IAssetCategoryAppService assetCategoryAppService, + IProductAssetCategoryRepository repository, + ProductAssetCategoryManager productAssetCategoryManager) : base(repository) { + _productAppService = productAppService; + _periodSchemeAppService = periodSchemeAppService; + _assetCategoryAppService = assetCategoryAppService; _repository = repository; + _productAssetCategoryManager = productAssetCategoryManager; } - public virtual async Task CreatePeriodAsync(Guid productAssetCategoryId, CreateProductAssetCategoryPeriodDto input) + protected override async Task> CreateFilteredQueryAsync(GetProductAssetCategoryDto input) { - await CheckUpdatePolicyAsync(); + return (await base.CreateFilteredQueryAsync(input)) + .WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId) + .WhereIf(input.ProductId.HasValue, x => x.ProductId == input.ProductId) + .WhereIf(input.ProductSkuId.HasValue, x => x.ProductSkuId == input.ProductSkuId) + .WhereIf(input.AssetCategoryId.HasValue, x => x.AssetCategoryId == input.AssetCategoryId) + .WhereIf(input.PeriodSchemeId.HasValue, x => x.PeriodSchemeId == input.PeriodSchemeId); + } + + public override async Task> GetListAsync( + GetProductAssetCategoryDto input) + { + await CheckMultiStorePolicyAsync(input.StoreId, GetListPolicyName); - var productAsset = await GetEntityByIdAsync(productAssetCategoryId); + var query = await CreateFilteredQueryAsync(input); - productAsset.AddPeriod(ObjectMapper.Map(input)); + var totalCount = await AsyncExecuter.CountAsync(query); - await _repository.UpdateAsync(productAsset, true); + query = ApplySorting(query, input); + query = ApplyPaging(query, input); - return await MapToGetOutputDtoAsync(productAsset); + var entities = await AsyncExecuter.ToListAsync(query); + var entityDtos = await MapToGetListOutputDtosAsync(entities); + + return new PagedResultDto( + totalCount, + entityDtos + ); } - public virtual async Task UpdatePeriodAsync(Guid productAssetCategoryId, Guid periodId, UpdateProductAssetCategoryPeriodDto input) + public override async Task CreateAsync(CreateProductAssetCategoryDto input) { - await CheckUpdatePolicyAsync(); - - var productAsset = await GetEntityByIdAsync(productAssetCategoryId); + await CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName); + + await EnsureProductSkuExistAsync(input.StoreId, input.ProductId, input.ProductSkuId); + await EnsureAssetCategoryExistAsync(input.AssetCategoryId); + await EnsurePeriodSchemeExistAsync(input.PeriodSchemeId); + + var entity = await MapToEntityAsync(input); + + TryToSetTenantId(entity); + + await Repository.InsertAsync(entity, autoSave: true); + + return await MapToGetOutputDtoAsync(entity); + } + + protected virtual async Task EnsureProductSkuExistAsync(Guid storeId, Guid productId, Guid productSkuId) + { + var product = await _productAppService.GetAsync(productId); + + if (product.StoreId != storeId) + { + throw (new BusinessException(BookingErrorCodes.WrongStoreIdForProduct)) + .WithData(nameof(storeId), storeId) + .WithData(nameof(productId), productId); + } + + product.GetSkuById(productSkuId); + } + + protected virtual async Task EnsureAssetCategoryExistAsync(Guid assetCategoryId) + { + await _assetCategoryAppService.GetAsync(assetCategoryId); + } + + protected virtual async Task EnsurePeriodSchemeExistAsync(Guid periodSchemeId) + { + await _periodSchemeAppService.GetAsync(periodSchemeId); + } + + protected override async Task MapToEntityAsync(CreateProductAssetCategoryDto input) + { + return await _productAssetCategoryManager.CreateAsync(input.StoreId, input.ProductId, input.ProductSkuId, + input.AssetCategoryId, input.PeriodSchemeId, input.FromTime, input.ToTime, input.Price); + } + + protected override async Task MapToEntityAsync(UpdateProductAssetCategoryDto input, ProductAssetCategory entity) + { + await _productAssetCategoryManager.UpdateAsync(entity, input.FromTime, input.ToTime, input.Price); + } + + public virtual async Task CreatePeriodAsync(Guid productAssetCategoryId, + CreateProductAssetCategoryPeriodDto input) + { + var productAssetCategory = await GetEntityByIdAsync(productAssetCategoryId); + + await CheckMultiStorePolicyAsync(productAssetCategory.StoreId, UpdatePolicyName); + + productAssetCategory.AddPeriod( + ObjectMapper.Map(input)); + + await _repository.UpdateAsync(productAssetCategory, true); + + return await MapToGetOutputDtoAsync(productAssetCategory); + } + + public virtual async Task UpdatePeriodAsync(Guid productAssetCategoryId, Guid periodId, + UpdateProductAssetCategoryPeriodDto input) + { + var productAssetCategory = await GetEntityByIdAsync(productAssetCategoryId); + + await CheckMultiStorePolicyAsync(productAssetCategory.StoreId, UpdatePolicyName); + + var productAssetCategoryPeriod = productAssetCategory.GetPeriod(periodId); - var productAssetCategoryPeriod = productAsset.GetPeriod(periodId); - ObjectMapper.Map(input, productAssetCategoryPeriod); - await _repository.UpdateAsync(productAsset, true); + await _repository.UpdateAsync(productAssetCategory, true); - return await MapToGetOutputDtoAsync(productAsset); + return await MapToGetOutputDtoAsync(productAssetCategory); } public virtual async Task DeletePeriodAsync(Guid productAssetCategoryId, Guid periodId) { - await CheckUpdatePolicyAsync(); - - var productAsset = await GetEntityByIdAsync(productAssetCategoryId); + var productAssetCategory = await GetEntityByIdAsync(productAssetCategoryId); + + await CheckMultiStorePolicyAsync(productAssetCategory.StoreId, UpdatePolicyName); - productAsset.RemovePeriod(periodId); + productAssetCategory.RemovePeriod(periodId); - await _repository.UpdateAsync(productAsset, true); + await _repository.UpdateAsync(productAssetCategory, true); - return await MapToGetOutputDtoAsync(productAsset); + return await MapToGetOutputDtoAsync(productAssetCategory); } } } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetAppService.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetAppService.cs index 14fd2a89..ab2f4861 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetAppService.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetAppService.cs @@ -1,49 +1,155 @@ using System; +using System.Linq; using System.Threading.Tasks; +using EasyAbp.BookingService.Assets; +using EasyAbp.BookingService.PeriodSchemes; using EasyAbp.EShop.Plugins.Booking.Permissions; using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; +using EasyAbp.EShop.Products.Products; +using EasyAbp.EShop.Stores.Stores; +using Volo.Abp; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; namespace EasyAbp.EShop.Plugins.Booking.ProductAssets { - public class ProductAssetAppService : CrudAppService, + public class ProductAssetAppService : MultiStoreCrudAppService, IProductAssetAppService { + protected override string CrossStorePolicyName { get; set; } = BookingPermissions.ProductAsset.Manage; protected override string GetPolicyName { get; set; } = BookingPermissions.ProductAsset.Default; protected override string GetListPolicyName { get; set; } = BookingPermissions.ProductAsset.Default; protected override string CreatePolicyName { get; set; } = BookingPermissions.ProductAsset.Create; protected override string UpdatePolicyName { get; set; } = BookingPermissions.ProductAsset.Update; protected override string DeletePolicyName { get; set; } = BookingPermissions.ProductAsset.Delete; + private readonly IProductAppService _productAppService; + private readonly IPeriodSchemeAppService _periodSchemeAppService; + private readonly IAssetAppService _assetAppService; private readonly IProductAssetRepository _repository; + private readonly ProductAssetManager _productAssetManager; - public ProductAssetAppService(IProductAssetRepository repository) : base(repository) + public ProductAssetAppService( + IProductAppService productAppService, + IPeriodSchemeAppService periodSchemeAppService, + IAssetAppService assetAppService, + IProductAssetRepository repository, + ProductAssetManager productAssetManager) : base(repository) { + _productAppService = productAppService; + _periodSchemeAppService = periodSchemeAppService; + _assetAppService = assetAppService; _repository = repository; + _productAssetManager = productAssetManager; } - public virtual async Task CreatePeriodAsync(Guid productAssetId, CreateProductAssetPeriodDto input) + protected override async Task> CreateFilteredQueryAsync(GetProductAssetDto input) { - await CheckUpdatePolicyAsync(); + return (await base.CreateFilteredQueryAsync(input)) + .WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId) + .WhereIf(input.ProductId.HasValue, x => x.ProductId == input.ProductId) + .WhereIf(input.ProductSkuId.HasValue, x => x.ProductSkuId == input.ProductSkuId) + .WhereIf(input.AssetId.HasValue, x => x.AssetId == input.AssetId) + .WhereIf(input.PeriodSchemeId.HasValue, x => x.PeriodSchemeId == input.PeriodSchemeId); + } + + public override async Task> GetListAsync( + GetProductAssetDto input) + { + await CheckMultiStorePolicyAsync(input.StoreId, GetListPolicyName); + var query = await CreateFilteredQueryAsync(input); + + var totalCount = await AsyncExecuter.CountAsync(query); + + query = ApplySorting(query, input); + query = ApplyPaging(query, input); + + var entities = await AsyncExecuter.ToListAsync(query); + var entityDtos = await MapToGetListOutputDtosAsync(entities); + + return new PagedResultDto( + totalCount, + entityDtos + ); + } + + public override async Task CreateAsync(CreateProductAssetDto input) + { + await CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName); + + await EnsureProductSkuExistAsync(input.StoreId, input.ProductId, input.ProductSkuId); + await EnsureAssetExistAsync(input.AssetId); + await EnsurePeriodSchemeExistAsync(input.PeriodSchemeId); + + var entity = await MapToEntityAsync(input); + + TryToSetTenantId(entity); + + await Repository.InsertAsync(entity, autoSave: true); + + return await MapToGetOutputDtoAsync(entity); + } + + protected virtual async Task EnsureProductSkuExistAsync(Guid storeId, Guid productId, Guid productSkuId) + { + var product = await _productAppService.GetAsync(productId); + + if (product.StoreId != storeId) + { + throw (new BusinessException(BookingErrorCodes.WrongStoreIdForProduct)) + .WithData(nameof(storeId), storeId) + .WithData(nameof(productId), productId); + } + + product.GetSkuById(productSkuId); + } + + protected virtual async Task EnsureAssetExistAsync(Guid assetId) + { + await _assetAppService.GetAsync(assetId); + } + + protected virtual async Task EnsurePeriodSchemeExistAsync(Guid periodSchemeId) + { + await _periodSchemeAppService.GetAsync(periodSchemeId); + } + + protected override async Task MapToEntityAsync(CreateProductAssetDto input) + { + return await _productAssetManager.CreateAsync(input.StoreId, input.ProductId, input.ProductSkuId, + input.AssetId, input.PeriodSchemeId, input.FromTime, input.ToTime, input.Price); + } + + protected override async Task MapToEntityAsync(UpdateProductAssetDto input, ProductAsset entity) + { + await _productAssetManager.UpdateAsync(entity, input.FromTime, input.ToTime, input.Price); + } + + public virtual async Task CreatePeriodAsync(Guid productAssetId, + CreateProductAssetPeriodDto input) + { var productAsset = await GetEntityByIdAsync(productAssetId); - productAsset.AddPeriod(ObjectMapper.Map(input)); + await CheckMultiStorePolicyAsync(productAsset.StoreId, UpdatePolicyName); + + productAsset.AddPeriod( + ObjectMapper.Map(input)); await _repository.UpdateAsync(productAsset, true); return await MapToGetOutputDtoAsync(productAsset); } - public virtual async Task UpdatePeriodAsync(Guid productAssetId, Guid periodId, UpdateProductAssetPeriodDto input) + public virtual async Task UpdatePeriodAsync(Guid productAssetId, Guid periodId, + UpdateProductAssetPeriodDto input) { - await CheckUpdatePolicyAsync(); - var productAsset = await GetEntityByIdAsync(productAssetId); + await CheckMultiStorePolicyAsync(productAsset.StoreId, UpdatePolicyName); + var productAssetPeriod = productAsset.GetPeriod(periodId); - + ObjectMapper.Map(input, productAssetPeriod); await _repository.UpdateAsync(productAsset, true); @@ -53,10 +159,10 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets public virtual async Task DeletePeriodAsync(Guid productAssetId, Guid periodId) { - await CheckUpdatePolicyAsync(); - var productAsset = await GetEntityByIdAsync(productAssetId); + await CheckMultiStorePolicyAsync(productAsset.StoreId, UpdatePolicyName); + productAsset.RemovePeriod(periodId); await _repository.UpdateAsync(productAsset, true); diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/BookingErrorCodes.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/BookingErrorCodes.cs index 457046d8..b112a761 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/BookingErrorCodes.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/BookingErrorCodes.cs @@ -4,4 +4,7 @@ public static class BookingErrorCodes { public const string PeriodNotFound = "EasyAbp.EShop.Plugins.Booking:PeriodNotFound"; public const string DuplicatePeriod = "EasyAbp.EShop.Plugins.Booking:DuplicatePeriod"; + public const string ConflictingProductAsset = "EasyAbp.EShop.Plugins.Booking:ConflictingProductAsset"; + public const string ConflictingProductAssetCategory = "EasyAbp.EShop.Plugins.Booking:ConflictingProductAssetCategory"; + public const string WrongStoreIdForProduct = "EasyAbp.EShop.Plugins.Booking:WrongStoreIdForProduct"; } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/en.json b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/en.json index 2b171e9d..3c6a1e3d 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/en.json +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/en.json @@ -8,6 +8,7 @@ "Permission:Delete": "Delete", "Menu:ProductAsset": "Asset prices", "ProductAsset": "Asset prices", + "ProductAssetStoreId": "Store ID", "ProductAssetProductId": "Product ID", "ProductAssetProductSkuId": "Product SKU ID", "ProductAssetAssetId": "Asset ID", @@ -30,6 +31,7 @@ "Permission:ProductAssetCategory": "Asset category prices", "Menu:ProductAssetCategory": "Asset category prices", "ProductAssetCategory": "Asset category prices", + "ProductAssetCategoryStoreId": "Store ID", "ProductAssetCategoryProductId": "Product ID", "ProductAssetCategoryProductSkuId": "Product SKU ID", "ProductAssetCategoryAssetCategoryId": "Asset Category ID", @@ -50,6 +52,9 @@ "ProductAssetCategoryPeriodDeletionConfirmationMessage": "Are you sure to delete the product asset category period {0}?", "EasyAbp.EShop.Plugins.Booking:PeriodNotFound": "Period {id} not found.", "EasyAbp.EShop.Plugins.Booking:DuplicatePeriod": "Period {id} exists.", + "EasyAbp.EShop.Plugins.Booking:ConflictingProductAsset": "Exist conflicting product asset mapping.", + "EasyAbp.EShop.Plugins.Booking:ConflictingProductAssetCategory": "Exist conflicting product asset category mapping.", + "EasyAbp.EShop.Plugins.Booking:WrongStoreIdForProduct": "Wrong StoreId {storeId} for product {productId}.", "Permission:StoreAssetCategory": "Store assets", "Menu:StoreAssetCategory": "Store assets", "StoreAssetCategory": "Store assets", diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hans.json b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hans.json index 2228356b..5de341d0 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hans.json +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hans.json @@ -8,6 +8,7 @@ "Permission:Delete": "删除", "Menu:ProductAsset": "资产价格", "ProductAsset": "资产价格", + "ProductAssetStoreId": "店铺 ID", "ProductAssetProductId": "产品 ID", "ProductAssetProductSkuId": "产品 SKU ID", "ProductAssetAssetId": "资产 ID", @@ -30,6 +31,7 @@ "Permission:ProductAssetCategory": "资产类目价格", "Menu:ProductAssetCategory": "资产类目价格", "ProductAssetCategory": "资产类目价格", + "ProductAssetCategoryStoreId": "店铺 ID", "ProductAssetCategoryProductId": "产品 ID", "ProductAssetCategoryProductSkuId": "产品 SKU ID", "ProductAssetCategoryAssetCategoryId": "资产目录 ID", @@ -50,6 +52,9 @@ "ProductAssetCategoryPeriodDeletionConfirmationMessage": "确认删除资产类目时段价格 {0}?", "EasyAbp.EShop.Plugins.Booking:PeriodNotFound": "时段 {id} 不存在。", "EasyAbp.EShop.Plugins.Booking:DuplicatePeriod": "时段 {id} 已存在。", + "EasyAbp.EShop.Plugins.Booking:ConflictingProductAsset": "存在冲突的产品资产映射。", + "EasyAbp.EShop.Plugins.Booking:ConflictingProductAssetCategory": "存在冲突的产品资产映射。", + "EasyAbp.EShop.Plugins.Booking:WrongStoreIdForProduct": "错误的店铺 ID {storeId} 之于产品 {productId}。", "Permission:StoreAssetCategory": "店铺资产", "Menu:StoreAssetCategory": "店铺资产", "StoreAssetCategory": "店铺资产", diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hant.json b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hant.json index e648ba4a..03be8aaa 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hant.json +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp/EShop/Plugins/Booking/Localization/zh-Hant.json @@ -8,6 +8,7 @@ "Permission:Delete": "刪除", "Menu:ProductAsset": "資產價格", "ProductAsset": "資產價格", + "ProductAssetStoreId": "店鋪 ID", "ProductAssetProductId": "產品 ID", "ProductAssetProductSkuId": "產品 SKU ID", "ProductAssetAssetId": "資產 ID", @@ -30,6 +31,7 @@ "Permission:ProductAssetCategory": "資產類目價格", "Menu:ProductAssetCategory": "資產類目價格", "ProductAssetCategory": "資產類目價格", + "ProductAssetCategoryStoreId": "店鋪 ID", "ProductAssetCategoryProductId": "產品 ID", "ProductAssetCategoryProductSkuId": "產品 SKU ID", "ProductAssetCategoryAssetCategoryId": "資產目錄 ID", @@ -50,6 +52,9 @@ "ProductAssetCategoryPeriodDeletionConfirmationMessage": "確認刪除資產類目時段價格 {0}?", "EasyAbp.EShop.Plugins.Booking:PeriodNotFound": "時段 {id} 不存在。", "EasyAbp.EShop.Plugins.Booking:DuplicatePeriod": "時段 {id} 已存在。", + "EasyAbp.EShop.Plugins.Booking:ConflictingProductAsset": "存在衝突的產品資產映射。", + "EasyAbp.EShop.Plugins.Booking:ConflictingProductAssetCategory": "存在衝突的產品資產映射。", + "EasyAbp.EShop.Plugins.Booking:WrongStoreIdForProduct": "錯誤的店鋪 ID {storeId} 之於產品 {productId}。", "Permission:StoreAssetCategory": "店鋪資產", "Menu:StoreAssetCategory": "店鋪資產", "StoreAssetCategory": "店鋪資產", diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp.EShop.Plugins.Booking.Domain.csproj b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp.EShop.Plugins.Booking.Domain.csproj index fd37e309..5f474ec4 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp.EShop.Plugins.Booking.Domain.csproj +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp.EShop.Plugins.Booking.Domain.csproj @@ -9,6 +9,7 @@ + diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/EShopPluginsBookingDomainModule.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/EShopPluginsBookingDomainModule.cs index 52ca96c0..3887ae06 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/EShopPluginsBookingDomainModule.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/EShopPluginsBookingDomainModule.cs @@ -1,10 +1,12 @@ -using Volo.Abp.Domain; +using EasyAbp.EShop.Stores; +using Volo.Abp.Domain; using Volo.Abp.Modularity; namespace EasyAbp.EShop.Plugins.Booking; [DependsOn( typeof(AbpDddDomainModule), + typeof(EShopStoresDomainSharedModule), typeof(EShopPluginsBookingDomainSharedModule) )] public class EShopPluginsBookingDomainModule : AbpModule diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/IProductAssetCategoryRepository.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/IProductAssetCategoryRepository.cs index 6ed3f163..cb60e3b9 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/IProductAssetCategoryRepository.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/IProductAssetCategoryRepository.cs @@ -1,9 +1,15 @@ using System; +using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories { public interface IProductAssetCategoryRepository : IRepository { + Task FindEffectiveAsync(DateTime currentTime, Guid storeId, Guid productId, + Guid productSkuId, Guid assetCategoryId, Guid periodSchemeId); + + Task ExistConflictAsync(Guid id, Guid storeId, Guid productId, Guid productSkuId, Guid assetCategoryId, + Guid periodSchemeId, DateTime fromTime); } } \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs index 13ebf007..76d3d085 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using EasyAbp.EShop.Plugins.Booking.Shared; +using EasyAbp.EShop.Stores.Stores; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -12,10 +13,12 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; /// Set which SKU can use to book a specified asset category. /// The matched with the larger takes precedence. /// -public class ProductAssetCategory : AuditedAggregateRoot, IMultiTenant +public class ProductAssetCategory : AuditedAggregateRoot, IMultiStore, IMultiTenant { public virtual Guid? TenantId { get; protected set; } + public virtual Guid StoreId { get; protected set; } + public virtual Guid ProductId { get; protected set; } public virtual Guid ProductSkuId { get; protected set; } @@ -53,6 +56,7 @@ public class ProductAssetCategory : AuditedAggregateRoot, IMultiTenant public ProductAssetCategory( Guid id, Guid? tenantId, + Guid storeId, Guid productId, Guid productSkuId, Guid assetCategoryId, @@ -64,6 +68,7 @@ public class ProductAssetCategory : AuditedAggregateRoot, IMultiTenant ) : base(id) { TenantId = tenantId; + StoreId = storeId; ProductId = productId; ProductSkuId = productSkuId; AssetCategoryId = assetCategoryId; @@ -71,9 +76,17 @@ public class ProductAssetCategory : AuditedAggregateRoot, IMultiTenant FromTime = fromTime; ToTime = toTime; Price = price; + Periods = periods ?? new List(); } + internal void Update(DateTime fromTime, DateTime? toTime, decimal? price) + { + FromTime = fromTime; + ToTime = toTime; + Price = price; + } + public void AddPeriod(ProductAssetCategoryPeriod productAssetCategoryPeriod) { if (FindPeriod(productAssetCategoryPeriod.PeriodId) is not null) diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetManager.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetManager.cs new file mode 100644 index 00000000..575f8f15 --- /dev/null +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetManager.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Domain.Services; + +namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; + +public class ProductAssetCategoryManager : DomainService +{ + private readonly IProductAssetCategoryRepository _repository; + + public ProductAssetCategoryManager(IProductAssetCategoryRepository repository) + { + _repository = repository; + } + + public virtual async Task CreateAsync(Guid storeId, Guid productId, Guid productSkuId, Guid assetCategoryId, + Guid periodSchemeId, DateTime fromTime, DateTime? toTime, decimal? price) + { + var id = GuidGenerator.Create(); + + if (await _repository.ExistConflictAsync( + id, storeId, productId, productSkuId, assetCategoryId, periodSchemeId, fromTime)) + { + throw new BusinessException(BookingErrorCodes.ConflictingProductAssetCategory); + } + + return new ProductAssetCategory(GuidGenerator.Create(), CurrentTenant.Id, storeId, productId, productSkuId, assetCategoryId, + periodSchemeId, fromTime, toTime, price, new List()); + } + + public virtual async Task UpdateAsync(ProductAssetCategory entity, DateTime fromTime, DateTime? toTime, decimal? price) + { + if (await _repository.ExistConflictAsync(entity.Id, entity.StoreId, entity.ProductId, entity.ProductSkuId, + entity.AssetCategoryId, entity.PeriodSchemeId, fromTime)) + { + throw new BusinessException(BookingErrorCodes.ConflictingProductAssetCategory); + } + + entity.Update(fromTime, toTime, price); + } +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/IProductAssetRepository.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/IProductAssetRepository.cs index a695211b..6f28b848 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/IProductAssetRepository.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/IProductAssetRepository.cs @@ -1,9 +1,15 @@ using System; +using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; namespace EasyAbp.EShop.Plugins.Booking.ProductAssets { public interface IProductAssetRepository : IRepository { + Task FindEffectiveAsync(DateTime currentTime, Guid storeId, Guid productId, Guid productSkuId, + Guid assetId, Guid periodSchemeId); + + Task ExistConflictAsync(Guid id, Guid storeId, Guid productId, Guid productSkuId, Guid assetId, + Guid periodSchemeId, DateTime fromTime); } } \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs index f0189a8d..3503ca33 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; using EasyAbp.EShop.Plugins.Booking.Shared; +using EasyAbp.EShop.Stores.Stores; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -14,10 +15,12 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets; /// The matched with the larger takes precedence. /// Fall back to if the booking asset has no matched . /// -public class ProductAsset : AuditedAggregateRoot, IMultiTenant +public class ProductAsset : AuditedAggregateRoot, IMultiStore, IMultiTenant { public virtual Guid? TenantId { get; protected set; } + public virtual Guid StoreId { get; protected set; } + public virtual Guid ProductId { get; protected set; } public virtual Guid ProductSkuId { get; protected set; } @@ -52,9 +55,10 @@ public class ProductAsset : AuditedAggregateRoot, IMultiTenant { } - public ProductAsset( + internal ProductAsset( Guid id, Guid? tenantId, + Guid storeId, Guid productId, Guid productSkuId, Guid assetId, @@ -66,6 +70,7 @@ public class ProductAsset : AuditedAggregateRoot, IMultiTenant ) : base(id) { TenantId = tenantId; + StoreId = storeId; ProductId = productId; ProductSkuId = productSkuId; AssetId = assetId; @@ -77,6 +82,13 @@ public class ProductAsset : AuditedAggregateRoot, IMultiTenant Periods = periods ?? new List(); } + internal void Update(DateTime fromTime, DateTime? toTime, decimal? price) + { + FromTime = fromTime; + ToTime = toTime; + Price = price; + } + public void AddPeriod(ProductAssetPeriod productAssetPeriod) { if (FindPeriod(productAssetPeriod.PeriodId) is not null) diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetManager.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetManager.cs new file mode 100644 index 00000000..71764798 --- /dev/null +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetManager.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Domain.Services; + +namespace EasyAbp.EShop.Plugins.Booking.ProductAssets; + +public class ProductAssetManager : DomainService +{ + private readonly IProductAssetRepository _repository; + + public ProductAssetManager(IProductAssetRepository repository) + { + _repository = repository; + } + + public virtual async Task CreateAsync(Guid storeId, Guid productId, Guid productSkuId, Guid assetId, + Guid periodSchemeId, DateTime fromTime, DateTime? toTime, decimal? price) + { + var id = GuidGenerator.Create(); + + if (await _repository.ExistConflictAsync( + id, storeId, productId, productSkuId, assetId, periodSchemeId, fromTime)) + { + throw new BusinessException(BookingErrorCodes.ConflictingProductAsset); + } + + return new ProductAsset(GuidGenerator.Create(), CurrentTenant.Id, storeId, productId, productSkuId, assetId, + periodSchemeId, fromTime, toTime, price, new List()); + } + + public virtual async Task UpdateAsync(ProductAsset entity, DateTime fromTime, DateTime? toTime, decimal? price) + { + if (await _repository.ExistConflictAsync(entity.Id, entity.StoreId, entity.ProductId, entity.ProductSkuId, + entity.AssetId, entity.PeriodSchemeId, fromTime)) + { + throw new BusinessException(BookingErrorCodes.ConflictingProductAsset); + } + + entity.Update(fromTime, toTime, price); + } +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryRepository.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryRepository.cs index de6f9bd8..eadbabb2 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryRepository.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryRepository.cs @@ -2,6 +2,7 @@ using System; using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -17,5 +18,37 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories { return (await GetQueryableAsync()).IncludeDetails(); } + + public virtual async Task FindEffectiveAsync(DateTime currentTime, Guid storeId, + Guid productId, Guid productSkuId, Guid assetCategoryId, Guid periodSchemeId) + { + return await (await GetQueryableAsync()) + .Where(x => + x.StoreId == storeId && + x.ProductId == productId && + x.ProductSkuId == productSkuId && + x.AssetCategoryId == assetCategoryId && + x.PeriodSchemeId == periodSchemeId + && x.FromTime <= currentTime && + (!x.ToTime.HasValue || x.ToTime.Value > currentTime)) + .OrderByDescending(x => x.FromTime) + .FirstOrDefaultAsync(); + } + + public virtual async Task ExistConflictAsync(Guid id, Guid storeId, Guid productId, Guid productSkuId, + Guid assetCategoryId, Guid periodSchemeId, DateTime fromTime) + { + var conflict = await (await GetQueryableAsync()) + .Where(x => + x.StoreId == storeId && + x.ProductId == productId && + x.ProductSkuId == productSkuId && + x.AssetCategoryId == assetCategoryId && + x.PeriodSchemeId == periodSchemeId + && x.FromTime == fromTime) + .FirstOrDefaultAsync(); + + return conflict is not null && conflict.Id != id; + } } } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetRepository.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetRepository.cs index 80c035a5..de96b54b 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetRepository.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetRepository.cs @@ -2,12 +2,14 @@ using System; using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; namespace EasyAbp.EShop.Plugins.Booking.ProductAssets { - public class ProductAssetRepository : EfCoreRepository, IProductAssetRepository + public class ProductAssetRepository : EfCoreRepository, + IProductAssetRepository { public ProductAssetRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -17,5 +19,37 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets { return (await GetQueryableAsync()).IncludeDetails(); } + + public virtual async Task FindEffectiveAsync(DateTime currentTime, Guid storeId, Guid productId, + Guid productSkuId, Guid assetId, Guid periodSchemeId) + { + return await (await GetQueryableAsync()) + .Where(x => + x.StoreId == storeId && + x.ProductId == productId && + x.ProductSkuId == productSkuId && + x.AssetId == assetId && + x.PeriodSchemeId == periodSchemeId + && x.FromTime <= currentTime && + (!x.ToTime.HasValue || x.ToTime.Value > currentTime)) + .OrderByDescending(x => x.FromTime) + .FirstOrDefaultAsync(); + } + + public virtual async Task ExistConflictAsync(Guid id, Guid storeId, Guid productId, Guid productSkuId, + Guid assetId, Guid periodSchemeId, DateTime fromTime) + { + var conflict = await (await GetQueryableAsync()) + .Where(x => + x.StoreId == storeId && + x.ProductId == productId && + x.ProductSkuId == productSkuId && + x.AssetId == assetId && + x.PeriodSchemeId == periodSchemeId + && x.FromTime == fromTime) + .FirstOrDefaultAsync(); + + return conflict is not null && conflict.Id != id; + } } -} +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/StoreAssetCategories/StoreAssetCategoryEfCoreQuerableExtensions.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/StoreAssetCategories/StoreAssetCategoryEfCoreQuerableExtensions.cs index 036101fb..8202f1ee 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/StoreAssetCategories/StoreAssetCategoryEfCoreQuerableExtensions.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp/EShop/Plugins/Booking/StoreAssetCategories/StoreAssetCategoryEfCoreQuerableExtensions.cs @@ -12,9 +12,7 @@ namespace EasyAbp.EShop.Plugins.Booking.StoreAssetCategories return queryable; } - return queryable - // .Include(x => x.xxx) // TODO: AbpHelper generated - ; + return queryable; } } } \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.HttpApi/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryController.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.HttpApi/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryController.cs index a5c57998..445527f2 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.HttpApi/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryController.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.HttpApi/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryController.cs @@ -4,7 +4,6 @@ using Volo.Abp.Application.Dtos; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; -using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories { @@ -70,7 +69,7 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories [HttpGet] [Route("")] - public virtual Task> GetListAsync(PagedAndSortedResultRequestDto input) + public virtual Task> GetListAsync(GetProductAssetCategoryDto input) { return _service.GetListAsync(input); } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.HttpApi/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetController.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.HttpApi/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetController.cs index f1b1d8dc..013be0a0 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.HttpApi/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetController.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.HttpApi/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAssetController.cs @@ -69,7 +69,7 @@ namespace EasyAbp.EShop.Plugins.Booking.ProductAssets [HttpGet] [Route("")] - public virtual Task> GetListAsync(PagedAndSortedResultRequestDto input) + public virtual Task> GetListAsync(GetProductAssetDto input) { return _service.GetListAsync(input); } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/EasyAbp.EShop.Plugins.Booking.Web.csproj b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/EasyAbp.EShop.Plugins.Booking.Web.csproj index 2d6f0d64..224d3f73 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/EasyAbp.EShop.Plugins.Booking.Web.csproj +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/EasyAbp.EShop.Plugins.Booking.Web.csproj @@ -41,16 +41,4 @@ - - - - - - <_ContentIncludedByDefault Remove="Pages\Booking\Index.cshtml" /> - - - - - - diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/CreateModal.cshtml.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/CreateModal.cshtml.cs index 27c2616d..a6950c50 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/CreateModal.cshtml.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/CreateModal.cshtml.cs @@ -8,7 +8,7 @@ namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductA { public class CreateModalModel : BookingPageModel { - [BindProperty] + [BindProperty(SupportsGet = true)] public CreateProductAssetCategoryViewModel ViewModel { get; set; } private readonly IProductAssetCategoryAppService _service; diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/Index.cshtml b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/Index.cshtml index b220601e..8aa54d66 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/Index.cshtml +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/Index.cshtml @@ -25,24 +25,51 @@ } - - - - - @L["ProductAssetCategory"] - - - @if (await Authorization.IsGrantedAsync(BookingPermissions.ProductAssetCategory.Create)) - { - - } - - - - - - - + + +@if (Model.Filter.StoreId == null) +{ + + + + + + @L["ProductAssetCategory"] + + + + + + + + + + + +} +else +{ + + + + + @L["ProductAssetCategory"] + + + @if (await Authorization.IsGrantedAsync(BookingPermissions.ProductAssetCategory.Create)) + { + + } + + + + + + + +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/Index.cshtml.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/Index.cshtml.cs index 6c00d8d3..ab9be1b1 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/Index.cshtml.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/Index.cshtml.cs @@ -1,9 +1,14 @@ using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.ViewModels; +using Microsoft.AspNetCore.Mvc; namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory { public class IndexModel : BookingPageModel { + [BindProperty(SupportsGet = true)] + public ProductAssetCategoryListFilterViewModel Filter { get; set; } + public virtual async Task OnGetAsync() { await Task.CompletedTask; diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/CreateProductAssetCategoryViewModel.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/CreateProductAssetCategoryViewModel.cs index 4a681a86..af082fec 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/CreateProductAssetCategoryViewModel.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/CreateProductAssetCategoryViewModel.cs @@ -1,10 +1,15 @@ using System; using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Mvc; namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.ViewModels { public class CreateProductAssetCategoryViewModel { + [HiddenInput] + [Display(Name = "ProductAssetCategoryStoreId")] + public Guid StoreId { get; set; } + [Display(Name = "ProductAssetCategoryProductId")] public Guid ProductId { get; set; } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/ProductAssetCategoryListFilterViewModel.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/ProductAssetCategoryListFilterViewModel.cs new file mode 100644 index 00000000..5fdf891a --- /dev/null +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/ViewModels/ProductAssetCategoryListFilterViewModel.cs @@ -0,0 +1,19 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.Abp.TagHelperPlus.EasySelector; +using EasyAbp.EShop.Stores; + +namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.ViewModels +{ + public class ProductAssetCategoryListFilterViewModel + { + [EasySelector( + getListedDataSourceUrl: StoresConsts.GetStoreListedDataSourceUrl + "?onlyManageable=true", + getSingleDataSourceUrl: StoresConsts.GetStoreSingleDataSourceUrl, + keyPropertyName: "id", + textPropertyName: "name", + runScriptOnWindowLoad: true)] + [Display(Name = "ProductAssetCategoryStoreId")] + public Guid? StoreId { get; set; } + } +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/index.js b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/index.js index ee88efeb..b4889c7a 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/index.js +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/index.js @@ -14,7 +14,9 @@ $(function () { autoWidth: false, scrollCollapse: true, order: [[0, "asc"]], - ajax: abp.libs.datatables.createAjax(service.getList), + ajax: abp.libs.datatables.createAjax(service.getList, function () { + return { storeId: storeId } + }), columnDefs: [ { rowAction: { @@ -91,6 +93,13 @@ $(function () { $('#NewProductAssetCategoryButton').click(function (e) { e.preventDefault(); - createModal.open(); + createModal.open({ storeId: storeId }); }); + + $('#enter-button').click(function (e) { + e.preventDefault(); + var storeId = $('#Filter_StoreId').val(); + + document.location.href = document.location.origin + document.location.pathname + '?storeId=' + storeId; + }) }); diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/CreateModal.cshtml.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/CreateModal.cshtml.cs index 0117e8af..823753a9 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/CreateModal.cshtml.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/CreateModal.cshtml.cs @@ -8,7 +8,7 @@ namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductA { public class CreateModalModel : BookingPageModel { - [BindProperty] + [BindProperty(SupportsGet = true)] public CreateProductAssetViewModel ViewModel { get; set; } private readonly IProductAssetAppService _service; diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/Index.cshtml b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/Index.cshtml index 7ef4f82c..8a356883 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/Index.cshtml +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/Index.cshtml @@ -25,24 +25,51 @@ } - - - - - @L["ProductAsset"] - - - @if (await Authorization.IsGrantedAsync(BookingPermissions.ProductAsset.Create)) - { - - } - - - - - - - + + +@if (Model.Filter.StoreId == null) +{ + + + + + + @L["ProductAsset"] + + + + + + + + + + + +} +else +{ + + + + + @L["ProductAsset"] + + + @if (await Authorization.IsGrantedAsync(BookingPermissions.ProductAsset.Create)) + { + + } + + + + + + + +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/Index.cshtml.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/Index.cshtml.cs index eacd9bbb..bd2219bc 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/Index.cshtml.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/Index.cshtml.cs @@ -1,9 +1,14 @@ using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.ViewModels; +using Microsoft.AspNetCore.Mvc; namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset { public class IndexModel : BookingPageModel { + [BindProperty(SupportsGet = true)] + public ProductAssetListFilterViewModel Filter { get; set; } + public virtual async Task OnGetAsync() { await Task.CompletedTask; diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/CreateProductAssetViewModel.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/CreateProductAssetViewModel.cs index 5121254e..6ff538f6 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/CreateProductAssetViewModel.cs +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/CreateProductAssetViewModel.cs @@ -1,11 +1,15 @@ using System; - using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Mvc; namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.ViewModels { public class CreateProductAssetViewModel { + [HiddenInput] + [Display(Name = "ProductAssetStoreId")] + public Guid StoreId { get; set; } + [Display(Name = "ProductAssetProductId")] public Guid ProductId { get; set; } diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/ProductAssetListFilterViewModel.cs b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/ProductAssetListFilterViewModel.cs new file mode 100644 index 00000000..5f667290 --- /dev/null +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/ViewModels/ProductAssetListFilterViewModel.cs @@ -0,0 +1,20 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.Abp.TagHelperPlus.EasySelector; +using EasyAbp.EShop.Products; +using EasyAbp.EShop.Stores; + +namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.ViewModels +{ + public class ProductAssetListFilterViewModel + { + [EasySelector( + getListedDataSourceUrl: StoresConsts.GetStoreListedDataSourceUrl + "?onlyManageable=true", + getSingleDataSourceUrl: StoresConsts.GetStoreSingleDataSourceUrl, + keyPropertyName: "id", + textPropertyName: "name", + runScriptOnWindowLoad: true)] + [Display(Name = "ProductAssetStoreId")] + public Guid? StoreId { get; set; } + } +} \ No newline at end of file diff --git a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/index.js b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/index.js index 3a3b3a70..4a7fe6d4 100644 --- a/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/index.js +++ b/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Web/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/index.js @@ -14,7 +14,9 @@ $(function () { autoWidth: false, scrollCollapse: true, order: [[0, "asc"]], - ajax: abp.libs.datatables.createAjax(service.getList), + ajax: abp.libs.datatables.createAjax(service.getList, function () { + return { storeId: storeId } + }), columnDefs: [ { rowAction: { @@ -91,6 +93,13 @@ $(function () { $('#NewProductAssetButton').click(function (e) { e.preventDefault(); - createModal.open(); + createModal.open({ storeId: storeId }); }); + + $('#enter-button').click(function (e) { + e.preventDefault(); + var storeId = $('#Filter_StoreId').val(); + + document.location.href = document.location.origin + document.location.pathname + '?storeId=' + storeId; + }) }); diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220603163430_AddedStoreIdInProductAssetAndProductAssetCategory.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220603163430_AddedStoreIdInProductAssetAndProductAssetCategory.Designer.cs new file mode 100644 index 00000000..e1126bbb --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220603163430_AddedStoreIdInProductAssetAndProductAssetCategory.Designer.cs @@ -0,0 +1,5416 @@ +// +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("20220603163430_AddedStoreIdInProductAssetAndProductAssetCategory")] + partial class AddedStoreIdInProductAssetAndProductAssetCategory + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + 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.OrderExtraFee", b => + { + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Key") + .HasColumnType("nvarchar(450)"); + + 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("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("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.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("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("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("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("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.Booking.StoreAssetCategories.StoreAssetCategory", 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("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("EasyAbpEShopPluginsBookingStoreAssetCategories", (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.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.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("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("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("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.Property("SerializedAttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + 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("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("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(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundFee") + .HasColumnType("int"); + + b.Property("RefundId") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRecvAccout") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRequestSource") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementRefundFee") + .HasColumnType("int"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("SuccessTime") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + 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.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("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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit"); + + 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("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.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.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("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.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.EShop.Orders.Orders.Order", b => + { + 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/20220603163430_AddedStoreIdInProductAssetAndProductAssetCategory.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220603163430_AddedStoreIdInProductAssetAndProductAssetCategory.cs new file mode 100644 index 00000000..57f28cff --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/20220603163430_AddedStoreIdInProductAssetAndProductAssetCategory.cs @@ -0,0 +1,38 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EShopSample.Migrations +{ + public partial class AddedStoreIdInProductAssetAndProductAssetCategory : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "StoreId", + table: "EasyAbpEShopPluginsBookingProductAssets", + type: "uniqueidentifier", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "StoreId", + table: "EasyAbpEShopPluginsBookingProductAssetCategories", + type: "uniqueidentifier", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "StoreId", + table: "EasyAbpEShopPluginsBookingProductAssets"); + + migrationBuilder.DropColumn( + name: "StoreId", + table: "EasyAbpEShopPluginsBookingProductAssetCategories"); + } + } +} 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 1d86b7fa..57c9aaf0 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/Migrations/EShopSampleDbContextModelSnapshot.cs @@ -847,6 +847,9 @@ namespace EShopSample.Migrations b.Property("ProductSkuId") .HasColumnType("uniqueidentifier"); + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); @@ -931,6 +934,9 @@ namespace EShopSample.Migrations b.Property("ProductSkuId") .HasColumnType("uniqueidentifier"); + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId");