From 8b76e8cda7dfb3d8f959e675754d401e18bd9c6e Mon Sep 17 00:00:00 2001 From: gdlcf88 <47396430@qq.com> Date: Wed, 3 Jun 2020 22:15:29 +0800 Subject: [PATCH] Close #40: Make Payment and Refund exclusive table entities --- integration/EasyAbp.EShop/common.props | 2 +- modules/EasyAbp.EShop.Baskets/common.props | 2 +- modules/EasyAbp.EShop.Orders/common.props | 2 +- .../EasyAbp.EShop.Orders.Domain.csproj | 2 +- .../Orders/Orders/IOrderPaymentChecker.cs | 10 + .../Orders/Orders/OrderPaymentChecker.cs | 19 + .../OrderPaymentCompletedEventHandler.cs | 6 +- .../Orders/OrderPaymentCreatedEventHandler.cs | 8 +- modules/EasyAbp.EShop.Payments/common.props | 2 +- ...Shop.Payments.Application.Contracts.csproj | 1 - ...EShopPaymentsApplicationContractsModule.cs | 6 +- .../Payments/Payments/Dtos/PaymentDto.cs | 27 +- .../Payments/Payments/Dtos/PaymentItemDto.cs | 23 + .../EShop/Payments/Refunds/Dtos/RefundDto.cs | 19 +- .../EasyAbp.EShop.Payments.Application.csproj | 1 - .../EShopPaymentsApplicationModule.cs | 3 +- .../PaymentsApplicationAutoMapperProfile.cs | 1 + .../Payments/EShopOrderPaymentAuthorizer.cs | 74 - ...asyAbp.EShop.Payments.Domain.Shared.csproj | 1 - .../EShopPaymentsDomainSharedModule.cs | 4 +- .../Payments/Localization/Payments/cs.json | 8 + .../Payments/Localization/Payments/en.json | 8 + .../Payments/Localization/Payments/pl.json | 8 + .../Payments/Localization/Payments/pt-BR.json | 8 + .../Payments/Localization/Payments/sl.json | 8 + .../Payments/Localization/Payments/tr.json | 8 + .../Payments/Localization/Payments/vi.json | 8 + .../Localization/Payments/zh-Hans.json | 8 + .../Localization/Payments/zh-Hant.json | 8 + .../EasyAbp.EShop.Payments.Domain.csproj | 2 +- .../Payments/EShopPaymentsDomainModule.cs | 2 +- .../EShop/Payments/Payments/Payment.cs | 3 +- .../EShop/Payments/Payments/PaymentItem.cs | 35 + .../Payments/Payments/PaymentSynchronizer.cs | 50 + .../PaymentsDomainAutoMapperProfile.cs | 6 + ....EShop.Payments.EntityFrameworkCore.csproj | 1 - ...opPaymentsEfCoreEntityExtensionMappings.cs | 29 - .../EShopPaymentsEntityFrameworkCoreModule.cs | 9 +- .../EntityFrameworkCore/IPaymentsDbContext.cs | 1 + .../EntityFrameworkCore/PaymentsDbContext.cs | 17 +- ...aymentsDbContextModelCreatingExtensions.cs | 31 +- ...syAbp.EShop.Payments.HttpApi.Client.csproj | 1 - .../EShopPaymentsHttpApiClientModule.cs | 6 +- .../EasyAbp.EShop.Payments.HttpApi.csproj | 1 - .../Payments/EShopPaymentsHttpApiModule.cs | 4 +- .../EasyAbp.EShop.Payments.MongoDB.csproj | 1 - .../MongoDB/EShopPaymentsMongoDbModule.cs | 6 +- .../PaymentsMongoDbContextExtensions.cs | 3 - .../EShopPaymentsWebModule.cs | 4 +- .../EasyAbp.EShop.Payments.Web.csproj | 1 - modules/EasyAbp.EShop.Products/common.props | 2 +- modules/EasyAbp.EShop.Stores/common.props | 2 +- .../EShopSample.Application.Contracts.csproj | 3 +- .../EShopSampleApplicationContractsModule.cs | 2 + .../EShopSample.Application.csproj | 3 +- .../EShopSampleApplicationModule.cs | 2 + .../EShopSample.Domain.Shared.csproj | 3 +- .../EShopSampleDomainSharedModule.cs | 2 + .../EShopSample.Domain.csproj | 3 +- .../EShopSampleDomainModule.cs | 2 + ...ndRefundExclusiveTableEntities.Designer.cs | 3367 +++++++++++++++++ ...ePaymentAndRefundExclusiveTableEntities.cs | 143 + ...pSampleMigrationsDbContextModelSnapshot.cs | 250 +- .../EShopSample.EntityFrameworkCore.csproj | 3 +- .../EShopSampleEntityFrameworkCoreModule.cs | 2 + .../EShopSample.HttpApi.Client.csproj | 3 +- .../EShopSampleHttpApiClientModule.cs | 2 + .../EShopSample.HttpApi.csproj | 3 +- .../EShopSampleHttpApiModule.cs | 2 + .../EShopSample.Web/EShopSample.Web.csproj | 3 +- .../EShopSample.Web/EShopSampleWebModule.cs | 2 + 71 files changed, 4108 insertions(+), 194 deletions(-) create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentItemDto.cs delete mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentItem.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs delete mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEfCoreEntityExtensionMappings.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.cs diff --git a/integration/EasyAbp.EShop/common.props b/integration/EasyAbp.EShop/common.props index 00b3138e..8dc36126 100644 --- a/integration/EasyAbp.EShop/common.props +++ b/integration/EasyAbp.EShop/common.props @@ -1,7 +1,7 @@ latest - 0.2.0 + 0.2.1 $(NoWarn);CS1591 true EasyAbp Team diff --git a/modules/EasyAbp.EShop.Baskets/common.props b/modules/EasyAbp.EShop.Baskets/common.props index 00b3138e..8dc36126 100644 --- a/modules/EasyAbp.EShop.Baskets/common.props +++ b/modules/EasyAbp.EShop.Baskets/common.props @@ -1,7 +1,7 @@ latest - 0.2.0 + 0.2.1 $(NoWarn);CS1591 true EasyAbp Team diff --git a/modules/EasyAbp.EShop.Orders/common.props b/modules/EasyAbp.EShop.Orders/common.props index 00b3138e..8dc36126 100644 --- a/modules/EasyAbp.EShop.Orders/common.props +++ b/modules/EasyAbp.EShop.Orders/common.props @@ -1,7 +1,7 @@ latest - 0.2.0 + 0.2.1 $(NoWarn);CS1591 true EasyAbp Team diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj index d418aea4..1587a0bd 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj @@ -8,9 +8,9 @@ + - diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs new file mode 100644 index 00000000..af1eeb93 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; +using EasyAbp.PaymentService.Payments; + +namespace EasyAbp.EShop.Orders.Orders +{ + public interface IOrderPaymentChecker + { + Task IsValidPaymentAsync(Order order, PaymentEto paymentEto); + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs new file mode 100644 index 00000000..ba6dbd75 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs @@ -0,0 +1,19 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.PaymentService.Payments; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; + +namespace EasyAbp.EShop.Orders.Orders +{ + public class OrderPaymentChecker : IOrderPaymentChecker, ITransientDependency + { + public Task IsValidPaymentAsync(Order order, PaymentEto paymentEto) + { + return Task.FromResult( + Guid.TryParse(paymentEto.GetProperty("StoreId"), out var paymentStoreId) && + order.StoreId == paymentStoreId + ); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs index c1f6a386..73e6b08b 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs @@ -13,15 +13,18 @@ namespace EasyAbp.EShop.Orders.Orders { private readonly IClock _clock; private readonly ICurrentTenant _currentTenant; + private readonly IOrderPaymentChecker _orderPaymentChecker; private readonly IOrderRepository _orderRepository; public OrderPaymentCompletedEventHandler( IClock clock, ICurrentTenant currentTenant, + IOrderPaymentChecker orderPaymentChecker, IOrderRepository orderRepository) { _clock = clock; _currentTenant = currentTenant; + _orderPaymentChecker = orderPaymentChecker; _orderRepository = orderRepository; } @@ -39,7 +42,8 @@ namespace EasyAbp.EShop.Orders.Orders { var order = await _orderRepository.FindAsync(item.ItemKey); - if (order == null || order.PaidTime.HasValue) + if (order == null || order.PaidTime.HasValue || + !await _orderPaymentChecker.IsValidPaymentAsync(order, eventData.Entity)) { continue; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs index 01e1d5b7..8eb12f28 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs @@ -11,13 +11,16 @@ namespace EasyAbp.EShop.Orders.Orders public class OrderPaymentCreatedEventHandler : IOrderPaymentCreatedEventHandler, ITransientDependency { private readonly ICurrentTenant _currentTenant; + private readonly IOrderPaymentChecker _orderPaymentChecker; private readonly IOrderRepository _orderRepository; public OrderPaymentCreatedEventHandler( ICurrentTenant currentTenant, + IOrderPaymentChecker orderPaymentChecker, IOrderRepository orderRepository) { _currentTenant = currentTenant; + _orderPaymentChecker = orderPaymentChecker; _orderRepository = orderRepository; } @@ -30,11 +33,12 @@ namespace EasyAbp.EShop.Orders.Orders { var order = await _orderRepository.FindAsync(item.ItemKey); - if (order == null || order.PaymentId.HasValue) + if (order == null || order.PaymentId.HasValue || + !await _orderPaymentChecker.IsValidPaymentAsync(order, eventData.Entity)) { continue; } - + order.SetPaymentId(eventData.Entity.Id); await _orderRepository.UpdateAsync(order, true); diff --git a/modules/EasyAbp.EShop.Payments/common.props b/modules/EasyAbp.EShop.Payments/common.props index 00b3138e..8dc36126 100644 --- a/modules/EasyAbp.EShop.Payments/common.props +++ b/modules/EasyAbp.EShop.Payments/common.props @@ -1,7 +1,7 @@ latest - 0.2.0 + 0.2.1 $(NoWarn);CS1591 true EasyAbp Team diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj index 3bc28854..641cd60b 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj @@ -8,7 +8,6 @@ - diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/EShopPaymentsApplicationContractsModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/EShopPaymentsApplicationContractsModule.cs index 1ba4d9f1..d51433d8 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/EShopPaymentsApplicationContractsModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/EShopPaymentsApplicationContractsModule.cs @@ -1,5 +1,4 @@ -using EasyAbp.PaymentService; -using Volo.Abp.Application; +using Volo.Abp.Application; using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; using Volo.Abp.Authorization; @@ -9,8 +8,7 @@ namespace EasyAbp.EShop.Payments [DependsOn( typeof(EShopPaymentsDomainSharedModule), typeof(AbpDddApplicationContractsModule), - typeof(AbpAuthorizationModule), - typeof(PaymentServiceApplicationContractsModule) + typeof(AbpAuthorizationModule) )] public class EShopPaymentsApplicationContractsModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs index d86d0d6f..9b0e40c7 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs @@ -1,10 +1,33 @@ using System; -using PaymentServicePaymentDto = EasyAbp.PaymentService.Payments.Dtos.PaymentDto; +using System.Collections.Generic; +using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Payments.Payments.Dtos { - public class PaymentDto : PaymentServicePaymentDto + public class PaymentDto : ExtensibleFullAuditedEntityDto { public Guid? StoreId { get; set; } + + public Guid UserId { get; set; } + + public string PaymentMethod { get; set; } + + public string ExternalTradingCode { get; set; } + + public string Currency { get; set; } + + public decimal OriginalPaymentAmount { get; set; } + + public decimal PaymentDiscount { get; set; } + + public decimal ActualPaymentAmount { get; set; } + + public decimal RefundAmount { get; set; } + + public DateTime? CompletionTime { get; set; } + + public DateTime? CancelledTime { get; set; } + + public List PaymentItems { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentItemDto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentItemDto.cs new file mode 100644 index 00000000..ad6d3a4f --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentItemDto.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Payments.Payments.Dtos +{ + public class PaymentItemDto : FullAuditedEntityDto + { + public string ItemType { get; set; } + + public Guid ItemKey { get; set; } + + public string Currency { get; set; } + + public decimal OriginalPaymentAmount { get; set; } + + public decimal PaymentDiscount { get; set; } + + public decimal ActualPaymentAmount { get; set; } + + public decimal RefundAmount { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs index 5eca51ff..9672507c 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs @@ -1,11 +1,26 @@ using System; using Volo.Abp.Application.Dtos; -using PaymentServiceRefundDto = EasyAbp.PaymentService.Refunds.Dtos.RefundDto; namespace EasyAbp.EShop.Payments.Refunds.Dtos { - public class RefundDto : PaymentServiceRefundDto + public class RefundDto : FullAuditedEntityDto { public Guid? StoreId { get; set; } + + public Guid PaymentId { get; set; } + + public Guid PaymentItemId { get; set; } + + public string RefundPaymentMethod { get; set; } + + public string ExternalTradingCode { get; set; } + + public string Currency { get; set; } + + public decimal RefundAmount { get; set; } + + public string CustomerRemark { get; set; } + + public string StaffRemark { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj index d67d047f..766aeb7c 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj @@ -8,7 +8,6 @@ - diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/EShopPaymentsApplicationModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/EShopPaymentsApplicationModule.cs index 2efec0eb..962e2d02 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/EShopPaymentsApplicationModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/EShopPaymentsApplicationModule.cs @@ -10,8 +10,7 @@ namespace EasyAbp.EShop.Payments typeof(EShopPaymentsDomainModule), typeof(EShopPaymentsApplicationContractsModule), typeof(AbpDddApplicationModule), - typeof(AbpAutoMapperModule), - typeof(PaymentServiceApplicationModule) + typeof(AbpAutoMapperModule) )] public class EShopPaymentsApplicationModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs index 88c5a767..d9799048 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs @@ -14,6 +14,7 @@ namespace EasyAbp.EShop.Payments * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ CreateMap(); + CreateMap(); CreateMap(); } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs deleted file mode 100644 index 6ded6247..00000000 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using EasyAbp.EShop.Orders.Orders; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Users; - -namespace EasyAbp.PaymentService.Payments -{ - public class EShopOrderPaymentAuthorizer : IPaymentAuthorizer, ITransientDependency - { - private readonly ICurrentUser _currentUser; - private readonly IOrderAppService _orderAppService; - - public EShopOrderPaymentAuthorizer( - ICurrentUser currentUser, - IOrderAppService orderAppService) - { - _currentUser = currentUser; - _orderAppService = orderAppService; - } - - public virtual async Task IsPaymentItemAllowedAsync(Payment payment, PaymentItem paymentItem, - Dictionary inputExtraProperties) - { - if (paymentItem.ItemType != "EasyAbpEShopOrder") - { - return false; - } - - var order = await _orderAppService.GetAsync(paymentItem.ItemKey); - - if (order.CustomerUserId != _currentUser.Id) - { - return false; - } - - if (order.TotalPrice != paymentItem.OriginalPaymentAmount) - { - return false; - } - - if (!order.ReducedInventoryAfterPlacingTime.HasValue) - { - return false; - } - - var inputStoreIdString = inputExtraProperties.GetOrDefault("StoreId") as string; - - if (order.StoreId.ToString() != inputStoreIdString) - { - if (inputStoreIdString == null) - { - inputExtraProperties.Add("StoreId", order.StoreId); - } - else - { - return false; - } - } - - if (order.OrderStatus != OrderStatus.Pending) - { - return false; - } - - // Record the StoreId so EasyAbp.EShop.Payments.Payments.Payment entity can use it. - payment.SetProperty("StoreId", order.StoreId); - - return true; - } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj index 7c836c96..b765f931 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj @@ -8,7 +8,6 @@ - diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs index cb25efb7..523e5479 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs @@ -1,7 +1,6 @@ using Volo.Abp.Modularity; using Volo.Abp.Localization; using EasyAbp.EShop.Payments.Localization; -using EasyAbp.PaymentService; using Volo.Abp.Localization.ExceptionHandling; using Volo.Abp.Validation; using Volo.Abp.Validation.Localization; @@ -10,8 +9,7 @@ using Volo.Abp.VirtualFileSystem; namespace EasyAbp.EShop.Payments { [DependsOn( - typeof(AbpValidationModule), - typeof(PaymentServiceDomainSharedModule) + typeof(AbpValidationModule) )] public class EShopPaymentsDomainSharedModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json index 0cd29cca..080c7226 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json @@ -11,6 +11,14 @@ "CreatePayment": "CreatePayment", "EditPayment": "EditPayment", "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "PaymentItem": "PaymentItem", + "PaymentItemItemType": "PaymentItemItemType", + "PaymentItemItemKey": "PaymentItemItemKey", + "PaymentItemCurrency": "PaymentItemCurrency", + "PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", + "PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", + "PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", + "PaymentItemRefundAmount": "PaymentItemRefundAmount", "SuccessfullyDeleted": "Successfully deleted", "Permission:Refunds": "Refunds", "Menu:Refunds": "MenuRefunds", diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json index 9a8ad8f4..bff3eefa 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json @@ -12,6 +12,14 @@ "CreatePayment": "CreatePayment", "EditPayment": "EditPayment", "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "PaymentItem": "PaymentItem", + "PaymentItemItemType": "PaymentItemItemType", + "PaymentItemItemKey": "PaymentItemItemKey", + "PaymentItemCurrency": "PaymentItemCurrency", + "PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", + "PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", + "PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", + "PaymentItemRefundAmount": "PaymentItemRefundAmount", "SuccessfullyDeleted": "Successfully deleted", "Permission:Refunds": "Refunds", "Menu:Refunds": "MenuRefunds", diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json index 02348a4c..58d0dcab 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json @@ -11,6 +11,14 @@ "CreatePayment": "CreatePayment", "EditPayment": "EditPayment", "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "PaymentItem": "PaymentItem", + "PaymentItemItemType": "PaymentItemItemType", + "PaymentItemItemKey": "PaymentItemItemKey", + "PaymentItemCurrency": "PaymentItemCurrency", + "PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", + "PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", + "PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", + "PaymentItemRefundAmount": "PaymentItemRefundAmount", "SuccessfullyDeleted": "Successfully deleted", "Permission:Refunds": "Refunds", "Menu:Refunds": "MenuRefunds", diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json index e6e4a115..9d42eaea 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json @@ -11,6 +11,14 @@ "CreatePayment": "CreatePayment", "EditPayment": "EditPayment", "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "PaymentItem": "PaymentItem", + "PaymentItemItemType": "PaymentItemItemType", + "PaymentItemItemKey": "PaymentItemItemKey", + "PaymentItemCurrency": "PaymentItemCurrency", + "PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", + "PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", + "PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", + "PaymentItemRefundAmount": "PaymentItemRefundAmount", "SuccessfullyDeleted": "Successfully deleted", "Permission:Refunds": "Refunds", "Menu:Refunds": "MenuRefunds", diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json index 1a38e652..60155915 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json @@ -12,6 +12,14 @@ "CreatePayment": "CreatePayment", "EditPayment": "EditPayment", "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "PaymentItem": "PaymentItem", + "PaymentItemItemType": "PaymentItemItemType", + "PaymentItemItemKey": "PaymentItemItemKey", + "PaymentItemCurrency": "PaymentItemCurrency", + "PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", + "PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", + "PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", + "PaymentItemRefundAmount": "PaymentItemRefundAmount", "SuccessfullyDeleted": "Successfully deleted", "Permission:Refunds": "Refunds", "Menu:Refunds": "MenuRefunds", diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json index aad2f663..7c907e83 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json @@ -12,6 +12,14 @@ "CreatePayment": "CreatePayment", "EditPayment": "EditPayment", "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "PaymentItem": "PaymentItem", + "PaymentItemItemType": "PaymentItemItemType", + "PaymentItemItemKey": "PaymentItemItemKey", + "PaymentItemCurrency": "PaymentItemCurrency", + "PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", + "PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", + "PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", + "PaymentItemRefundAmount": "PaymentItemRefundAmount", "SuccessfullyDeleted": "Successfully deleted", "Permission:Refunds": "Refunds", "Menu:Refunds": "MenuRefunds", diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json index 25556879..1b2d8732 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json @@ -11,6 +11,14 @@ "CreatePayment": "CreatePayment", "EditPayment": "EditPayment", "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "PaymentItem": "PaymentItem", + "PaymentItemItemType": "PaymentItemItemType", + "PaymentItemItemKey": "PaymentItemItemKey", + "PaymentItemCurrency": "PaymentItemCurrency", + "PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", + "PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", + "PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", + "PaymentItemRefundAmount": "PaymentItemRefundAmount", "SuccessfullyDeleted": "Successfully deleted", "Permission:Refunds": "Refunds", "Menu:Refunds": "MenuRefunds", diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json index f2646850..ea6dca33 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json @@ -12,6 +12,14 @@ "CreatePayment": "CreatePayment", "EditPayment": "EditPayment", "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "PaymentItem": "PaymentItem", + "PaymentItemItemType": "PaymentItemItemType", + "PaymentItemItemKey": "PaymentItemItemKey", + "PaymentItemCurrency": "PaymentItemCurrency", + "PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", + "PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", + "PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", + "PaymentItemRefundAmount": "PaymentItemRefundAmount", "SuccessfullyDeleted": "Successfully deleted", "Permission:Refunds": "Refunds", "Menu:Refunds": "MenuRefunds", diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json index 53ade176..31ad5344 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json @@ -12,6 +12,14 @@ "CreatePayment": "CreatePayment", "EditPayment": "EditPayment", "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "PaymentItem": "PaymentItem", + "PaymentItemItemType": "PaymentItemItemType", + "PaymentItemItemKey": "PaymentItemItemKey", + "PaymentItemCurrency": "PaymentItemCurrency", + "PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", + "PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", + "PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", + "PaymentItemRefundAmount": "PaymentItemRefundAmount", "SuccessfullyDeleted": "Successfully deleted", "Permission:Refunds": "Refunds", "Menu:Refunds": "MenuRefunds", diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj index 856a517e..1fae6d0c 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs index 85146981..535c2bf5 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs @@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Payments typeof(AbpAutoMapperModule), typeof(EShopPaymentsDomainSharedModule), typeof(EShopStoresDomainSharedModule), - typeof(PaymentServiceDomainModule) + typeof(PaymentServiceDomainSharedModule) )] public class EShopPaymentsDomainModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs index 920c6074..367e849e 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs @@ -3,10 +3,11 @@ using System.Collections.Generic; using EasyAbp.PaymentService.Payments; using JetBrains.Annotations; using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; namespace EasyAbp.EShop.Payments.Payments { - public class Payment : FullAuditedAggregateRoot, IPayment + public class Payment : FullAuditedAggregateRoot, IPayment, IMultiTenant { #region Base properties diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentItem.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentItem.cs new file mode 100644 index 00000000..693e8c5f --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentItem.cs @@ -0,0 +1,35 @@ +using System; +using EasyAbp.PaymentService.Payments; +using JetBrains.Annotations; +using Volo.Abp.Domain.Entities.Auditing; + +namespace EasyAbp.EShop.Payments.Payments +{ + public class PaymentItem : FullAuditedEntity, IPaymentItem + { + #region Base properties + + [NotNull] + public virtual string ItemType { get; protected set; } + + public virtual Guid ItemKey { get; protected set; } + + [NotNull] + public virtual string Currency { get; protected set; } + + public virtual decimal OriginalPaymentAmount { get; protected set; } + + public virtual decimal PaymentDiscount { get; protected set; } + + public virtual decimal ActualPaymentAmount { get; protected set; } + + public virtual decimal RefundAmount { get; protected set; } + + #endregion + + private PaymentItem() + { + + } + } +} diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs new file mode 100644 index 00000000..bb26e7e0 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs @@ -0,0 +1,50 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.PaymentService.Payments; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; + +namespace EasyAbp.EShop.Payments.Payments +{ + public class PaymentSynchronizer : + IDistributedEventHandler>, + ITransientDependency + { + private readonly IObjectMapper _objectMapper; + private readonly IPaymentRepository _paymentRepository; + + public PaymentSynchronizer( + IObjectMapper objectMapper, + IPaymentRepository paymentRepository) + { + _objectMapper = objectMapper; + _paymentRepository = paymentRepository; + } + + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var payment = await _paymentRepository.FindAsync(eventData.Entity.Id); + + if (payment == null) + { + payment = _objectMapper.Map(eventData.Entity); + + if (Guid.TryParse(eventData.Entity.GetProperty("StoreId"), out var storeId)) + { + payment.SetStoreId(storeId); + } + + await _paymentRepository.InsertAsync(payment, true); + } + else + { + _objectMapper.Map(eventData.Entity, payment); + + await _paymentRepository.UpdateAsync(payment, true); + } + } + } +} diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs index 75c2694c..87653aeb 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs @@ -1,4 +1,7 @@ using AutoMapper; +using EasyAbp.EShop.Payments.Payments; +using EasyAbp.PaymentService.Payments; +using Volo.Abp.AutoMapper; namespace EasyAbp.EShop.Payments { @@ -9,6 +12,9 @@ namespace EasyAbp.EShop.Payments /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ + + CreateMap(MemberList.Source).Ignore(x => x.StoreId); + CreateMap(MemberList.Source); } } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj index 9d74b85b..83712334 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj @@ -8,7 +8,6 @@ - diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEfCoreEntityExtensionMappings.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEfCoreEntityExtensionMappings.cs deleted file mode 100644 index f10403ee..00000000 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEfCoreEntityExtensionMappings.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using EasyAbp.PaymentService.Payments; -using EasyAbp.PaymentService.Refunds; -using Volo.Abp.ObjectExtending; -using Volo.Abp.Threading; - -namespace EasyAbp.EShop.Payments.EntityFrameworkCore -{ - public static class EShopPaymentsEfCoreEntityExtensionMappings - { - private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); - - public static void Configure() - { - OneTimeRunner.Run(() => - { - ObjectExtensionManager.Instance - .MapEfCoreProperty( - "StoreId" - ); - - ObjectExtensionManager.Instance - .MapEfCoreProperty( - "StoreId" - ); - }); - } - } -} diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs index 1dc53525..3e860320 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs @@ -1,6 +1,5 @@ using EasyAbp.EShop.Payments.Refunds; using EasyAbp.EShop.Payments.Payments; -using EasyAbp.PaymentService.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Modularity; @@ -9,16 +8,10 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore { [DependsOn( typeof(EShopPaymentsDomainModule), - typeof(AbpEntityFrameworkCoreModule), - typeof(PaymentServiceEntityFrameworkCoreModule) + typeof(AbpEntityFrameworkCoreModule) )] public class EShopPaymentsEntityFrameworkCoreModule : AbpModule { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - EShopPaymentsEfCoreEntityExtensionMappings.Configure(); - } - public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAbpDbContext(options => diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs index 0eecbc6d..36a0406a 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs @@ -13,6 +13,7 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore * DbSet Questions { get; } */ DbSet Payments { get; set; } + DbSet PaymentItems { get; set; } DbSet Refunds { get; set; } } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs index 631f9767..4bc641bd 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs @@ -3,8 +3,6 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using EasyAbp.EShop.Payments.Payments; using EasyAbp.EShop.Payments.Refunds; -using EasyAbp.PaymentService; -using Volo.Abp.EntityFrameworkCore.Modeling; namespace EasyAbp.EShop.Payments.EntityFrameworkCore { @@ -15,6 +13,7 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore * public DbSet Questions { get; set; } */ public DbSet Payments { get; set; } + public DbSet PaymentItems { get; set; } public DbSet Refunds { get; set; } public PaymentsDbContext(DbContextOptions options) @@ -29,20 +28,6 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore /* Configure the shared tables (with included modules) here */ - builder.Entity(b => - { - b.ToTable(PaymentServiceDbProperties.DbTablePrefix + "Payments"); - - b.ConfigureByConvention(); - }); - - builder.Entity(b => - { - b.ToTable(PaymentServiceDbProperties.DbTablePrefix + "Refunds"); - - b.ConfigureByConvention(); - }); - builder.ConfigureEShopPayments(); } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs index ef0b0d1d..e954d6e4 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs @@ -1,7 +1,6 @@ using EasyAbp.EShop.Payments.Refunds; using EasyAbp.EShop.Payments.Payments; using System; -using EasyAbp.PaymentService.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; @@ -43,7 +42,35 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore }); */ - EShopPaymentsEfCoreEntityExtensionMappings.Configure(); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Payments", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + b.Property(x => x.ActualPaymentAmount).HasColumnType("decimal(18,6)"); + b.Property(x => x.OriginalPaymentAmount).HasColumnType("decimal(18,6)"); + b.Property(x => x.PaymentDiscount).HasColumnType("decimal(18,6)"); + b.Property(x => x.RefundAmount).HasColumnType("decimal(18,6)"); + }); + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Refunds", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + b.Property(x => x.RefundAmount).HasColumnType("decimal(18,6)"); + }); + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "PaymentItems", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + b.Property(x => x.ActualPaymentAmount).HasColumnType("decimal(18,6)"); + b.Property(x => x.OriginalPaymentAmount).HasColumnType("decimal(18,6)"); + b.Property(x => x.PaymentDiscount).HasColumnType("decimal(18,6)"); + b.Property(x => x.RefundAmount).HasColumnType("decimal(18,6)"); + }); } } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj index df1b9514..90ccfacb 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj @@ -8,7 +8,6 @@ - diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp/EShop/Payments/EShopPaymentsHttpApiClientModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp/EShop/Payments/EShopPaymentsHttpApiClientModule.cs index aa00783c..85a709d0 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp/EShop/Payments/EShopPaymentsHttpApiClientModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp/EShop/Payments/EShopPaymentsHttpApiClientModule.cs @@ -1,5 +1,4 @@ -using EasyAbp.PaymentService; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Http.Client; using Volo.Abp.Modularity; @@ -7,8 +6,7 @@ namespace EasyAbp.EShop.Payments { [DependsOn( typeof(EShopPaymentsApplicationContractsModule), - typeof(AbpHttpClientModule), - typeof(PaymentServiceHttpApiClientModule) + typeof(AbpHttpClientModule) )] public class EShopPaymentsHttpApiClientModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj index 4f440290..b4f70401 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj @@ -8,7 +8,6 @@ - diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/EShopPaymentsHttpApiModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/EShopPaymentsHttpApiModule.cs index 3b121a3f..7c5ea92a 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/EShopPaymentsHttpApiModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/EShopPaymentsHttpApiModule.cs @@ -1,6 +1,5 @@ using Localization.Resources.AbpUi; using EasyAbp.EShop.Payments.Localization; -using EasyAbp.PaymentService; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Localization; using Volo.Abp.Modularity; @@ -10,8 +9,7 @@ namespace EasyAbp.EShop.Payments { [DependsOn( typeof(EShopPaymentsApplicationContractsModule), - typeof(AbpAspNetCoreMvcModule), - typeof(PaymentServiceHttpApiModule) + typeof(AbpAspNetCoreMvcModule) )] public class EShopPaymentsHttpApiModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj index 867363bc..25e63210 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj @@ -8,7 +8,6 @@ - diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/EShopPaymentsMongoDbModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/EShopPaymentsMongoDbModule.cs index 482a147e..affdc923 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/EShopPaymentsMongoDbModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/EShopPaymentsMongoDbModule.cs @@ -1,5 +1,4 @@ -using EasyAbp.PaymentService.MongoDB; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; using Volo.Abp.MongoDB; @@ -7,8 +6,7 @@ namespace EasyAbp.EShop.Payments.MongoDB { [DependsOn( typeof(EShopPaymentsDomainModule), - typeof(AbpMongoDbModule), - typeof(PaymentServiceMongoDbModule) + typeof(AbpMongoDbModule) )] public class EShopPaymentsMongoDbModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/PaymentsMongoDbContextExtensions.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/PaymentsMongoDbContextExtensions.cs index 481c2b6a..5e5daaef 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/PaymentsMongoDbContextExtensions.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/PaymentsMongoDbContextExtensions.cs @@ -1,5 +1,4 @@ using System; -using EasyAbp.PaymentService.MongoDB; using Volo.Abp; using Volo.Abp.MongoDB; @@ -18,8 +17,6 @@ namespace EasyAbp.EShop.Payments.MongoDB ); optionsAction?.Invoke(options); - - builder.ConfigurePaymentService(); } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs index 2433366a..e8eb9eb1 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using EasyAbp.EShop.Payments.Localization; -using EasyAbp.PaymentService.Web; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; @@ -14,8 +13,7 @@ namespace EasyAbp.EShop.Payments.Web [DependsOn( typeof(EShopPaymentsHttpApiModule), typeof(AbpAspNetCoreMvcUiThemeSharedModule), - typeof(AbpAutoMapperModule), - typeof(PaymentServiceWebModule) + typeof(AbpAutoMapperModule) )] public class EShopPaymentsWebModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj index 5f5203a3..06c1ace1 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj @@ -11,7 +11,6 @@ - diff --git a/modules/EasyAbp.EShop.Products/common.props b/modules/EasyAbp.EShop.Products/common.props index 00b3138e..8dc36126 100644 --- a/modules/EasyAbp.EShop.Products/common.props +++ b/modules/EasyAbp.EShop.Products/common.props @@ -1,7 +1,7 @@ latest - 0.2.0 + 0.2.1 $(NoWarn);CS1591 true EasyAbp Team diff --git a/modules/EasyAbp.EShop.Stores/common.props b/modules/EasyAbp.EShop.Stores/common.props index 00b3138e..8dc36126 100644 --- a/modules/EasyAbp.EShop.Stores/common.props +++ b/modules/EasyAbp.EShop.Stores/common.props @@ -1,7 +1,7 @@ latest - 0.2.0 + 0.2.1 $(NoWarn);CS1591 true EasyAbp Team diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj index ed0a6f92..edf2bcc7 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj @@ -13,7 +13,8 @@ - + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs index 018ad149..fd0a9ecd 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs @@ -1,4 +1,5 @@ using EasyAbp.EShop; +using EasyAbp.PaymentService; using EasyAbp.PaymentService.WeChatPay; using Volo.Abp.Account; using Volo.Abp.FeatureManagement; @@ -19,6 +20,7 @@ namespace EShopSample typeof(AbpTenantManagementApplicationContractsModule), typeof(AbpObjectExtendingModule), typeof(EShopApplicationContractsModule), + typeof(PaymentServiceApplicationContractsModule), typeof(PaymentServiceWeChatPayApplicationContractsModule) )] public class EShopSampleApplicationContractsModule : AbpModule diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj index af684af1..43cd3e3b 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj @@ -14,7 +14,8 @@ - + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs index 267f05b7..9da68fa7 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs @@ -1,4 +1,5 @@ using EasyAbp.EShop; +using EasyAbp.PaymentService; using EasyAbp.PaymentService.WeChatPay; using Volo.Abp.Account; using Volo.Abp.AutoMapper; @@ -19,6 +20,7 @@ namespace EShopSample typeof(AbpTenantManagementApplicationModule), typeof(AbpFeatureManagementApplicationModule), typeof(EShopApplicationModule), + typeof(PaymentServiceApplicationModule), typeof(PaymentServiceWeChatPayApplicationModule) )] public class EShopSampleApplicationModule : AbpModule diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj index 73155ed3..e9ec9b0c 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj @@ -8,7 +8,8 @@ - + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs index 697c9755..72ca41e0 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs @@ -1,4 +1,5 @@ using EasyAbp.EShop; +using EasyAbp.PaymentService; using EasyAbp.PaymentService.WeChatPay; using EShopSample.Localization; using Volo.Abp.AuditLogging; @@ -26,6 +27,7 @@ namespace EShopSample typeof(AbpSettingManagementDomainSharedModule), typeof(AbpTenantManagementDomainSharedModule), typeof(EShopDomainSharedModule), + typeof(PaymentServiceDomainSharedModule), typeof(PaymentServiceWeChatPayDomainSharedModule) )] public class EShopSampleDomainSharedModule : AbpModule diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj index 0442c15e..0e2e4038 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj @@ -13,7 +13,8 @@ - + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs index 0180e06b..1c4cdc62 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs @@ -1,4 +1,5 @@ using EasyAbp.EShop; +using EasyAbp.PaymentService; using EasyAbp.PaymentService.Payments; using EasyAbp.PaymentService.WeChatPay; using EShopSample.MultiTenancy; @@ -31,6 +32,7 @@ namespace EShopSample typeof(AbpSettingManagementDomainModule), typeof(AbpTenantManagementDomainModule), typeof(EShopDomainModule), + typeof(PaymentServiceDomainModule), typeof(PaymentServiceWeChatPayDomainModule) )] public class EShopSampleDomainModule : AbpModule diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.Designer.cs new file mode 100644 index 00000000..775eaa9f --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.Designer.cs @@ -0,0 +1,3367 @@ +// +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; + +namespace EShopSample.Migrations +{ + [DbContext(typeof(EShopSampleMigrationsDbContext))] + [Migration("20200603115405_MadePaymentAndRefundExclusiveTableEntities")] + partial class MadePaymentAndRefundExclusiveTableEntities + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.2") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CancelledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("PaidTime") + .HasColumnType("datetime2"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTotalPrice") + .HasColumnType("decimal(18,6)"); + + b.Property("ReducedInventoryAfterPaymentTime") + .HasColumnType("datetime2"); + + b.Property("ReducedInventoryAfterPlacingTime") + .HasColumnType("datetime2"); + + b.Property("RefundedAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(18,6)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(18,6)"); + + b.HasKey("Id"); + + b.ToTable("EShopOrdersOrders"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(18,6)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(18,6)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(18,6)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("EShopOrdersOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("CancelledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(18,6)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopPaymentsPayments"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("uniqueidentifier"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(18,6)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(18,6)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EShopPaymentsPaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopPaymentsRefunds"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopProductsCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductCategories.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopProductsProductCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetailHistories.ProductDetailHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductDetailId"); + + b.ToTable("EShopProductsProductDetailHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetails.ProductDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopProductsProductDetails"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductHistories.ProductHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductId"); + + b.ToTable("EShopProductsProductHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductStores.ProductStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsOwner") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopProductsProductStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductTypes.ProductType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MultiTenancySide") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EShopProductsProductTypes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopProductsProducts"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EShopProductsProductAttributes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductAttributeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("EShopProductsProductAttributeOptions"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderMinQuantity") + .HasColumnType("int"); + + b.Property("OriginalPrice") + .HasColumnType("decimal(18,6)"); + + b.Property("Price") + .HasColumnType("decimal(18,6)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedAttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + b.Property("Sold") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EShopProductsProductSkus"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopStoresStores"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("CancelledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(18,6)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("PaymentServicePayments"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("uniqueidentifier"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(18,6)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(18,6)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("PaymentServicePaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("PaymentServiceRefunds"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.PaymentRecords.PaymentRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("Attach") + .HasColumnType("nvarchar(max)"); + + b.Property("BankType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponCount") + .HasColumnType("int"); + + b.Property("CouponFee") + .HasColumnType("int"); + + b.Property("CouponFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeviceInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCodeDes") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSubscribe") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("NonceStr") + .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("Sign") + .HasColumnType("nvarchar(max)"); + + b.Property("SignType") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TimeEnd") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TradeType") + .HasColumnType("nvarchar(max)"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PaymentServiceWeChatPayPaymentRecords"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.RefundRecords.RefundRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("NonceStr") + .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("ReqInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementRefundFee") + .HasColumnType("int"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("SuccessTime") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("PaymentServiceWeChatPayRefundRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Comments") + .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CorrelationId") + .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Exceptions") + .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("HttpMethod") + .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("HttpStatusCode") + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); + + b.Property("ImpersonatorTenantId") + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("ImpersonatorUserId") + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnName("Url") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("UserId") + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MethodName") + .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Parameters") + .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ServiceName") + .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeTime") + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityId") + .IsRequired() + .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .IsRequired() + .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Description") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Regex") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnName("IsDefault") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnName("IsPublic") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnName("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .IsRequired() + .HasColumnName("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnName("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(196)") + .HasMaxLength(196); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderLines") + .HasForeignKey("OrderId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.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("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.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.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.cs new file mode 100644 index 00000000..6ee43e73 --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.cs @@ -0,0 +1,143 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace EShopSample.Migrations +{ + public partial class MadePaymentAndRefundExclusiveTableEntities : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "StoreId", + table: "PaymentServiceRefunds"); + + migrationBuilder.DropColumn( + name: "StoreId", + table: "PaymentServicePayments"); + + migrationBuilder.CreateTable( + name: "EShopPaymentsPayments", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + LastModificationTime = table.Column(nullable: true), + LastModifierId = table.Column(nullable: true), + IsDeleted = table.Column(nullable: false, defaultValue: false), + DeleterId = table.Column(nullable: true), + DeletionTime = table.Column(nullable: true), + TenantId = table.Column(nullable: true), + UserId = table.Column(nullable: false), + PaymentMethod = table.Column(nullable: true), + PayeeAccount = table.Column(nullable: true), + ExternalTradingCode = table.Column(nullable: true), + Currency = table.Column(nullable: true), + OriginalPaymentAmount = table.Column(type: "decimal(18,6)", nullable: false), + PaymentDiscount = table.Column(type: "decimal(18,6)", nullable: false), + ActualPaymentAmount = table.Column(type: "decimal(18,6)", nullable: false), + RefundAmount = table.Column(type: "decimal(18,6)", nullable: false), + CompletionTime = table.Column(nullable: true), + CancelledTime = table.Column(nullable: true), + StoreId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EShopPaymentsPayments", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EShopPaymentsRefunds", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + LastModificationTime = table.Column(nullable: true), + LastModifierId = table.Column(nullable: true), + IsDeleted = table.Column(nullable: false, defaultValue: false), + DeleterId = table.Column(nullable: true), + DeletionTime = table.Column(nullable: true), + TenantId = table.Column(nullable: true), + PaymentId = table.Column(nullable: false), + PaymentItemId = table.Column(nullable: false), + RefundPaymentMethod = table.Column(nullable: true), + ExternalTradingCode = table.Column(nullable: true), + Currency = table.Column(nullable: true), + RefundAmount = table.Column(type: "decimal(18,6)", nullable: false), + CustomerRemark = table.Column(nullable: true), + StaffRemark = table.Column(nullable: true), + StoreId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EShopPaymentsRefunds", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EShopPaymentsPaymentItems", + columns: table => new + { + Id = table.Column(nullable: false), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + LastModificationTime = table.Column(nullable: true), + LastModifierId = table.Column(nullable: true), + IsDeleted = table.Column(nullable: false, defaultValue: false), + DeleterId = table.Column(nullable: true), + DeletionTime = table.Column(nullable: true), + ItemType = table.Column(nullable: true), + ItemKey = table.Column(nullable: false), + Currency = table.Column(nullable: true), + OriginalPaymentAmount = table.Column(type: "decimal(18,6)", nullable: false), + PaymentDiscount = table.Column(type: "decimal(18,6)", nullable: false), + ActualPaymentAmount = table.Column(type: "decimal(18,6)", nullable: false), + RefundAmount = table.Column(type: "decimal(18,6)", nullable: false), + PaymentId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EShopPaymentsPaymentItems", x => x.Id); + table.ForeignKey( + name: "FK_EShopPaymentsPaymentItems_EShopPaymentsPayments_PaymentId", + column: x => x.PaymentId, + principalTable: "EShopPaymentsPayments", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_EShopPaymentsPaymentItems_PaymentId", + table: "EShopPaymentsPaymentItems", + column: "PaymentId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EShopPaymentsPaymentItems"); + + migrationBuilder.DropTable( + name: "EShopPaymentsRefunds"); + + migrationBuilder.DropTable( + name: "EShopPaymentsPayments"); + + migrationBuilder.AddColumn( + name: "StoreId", + table: "PaymentServiceRefunds", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "StoreId", + table: "PaymentServicePayments", + type: "uniqueidentifier", + nullable: true); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs index 320469b0..d7c3aa5c 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs @@ -203,6 +203,243 @@ namespace EShopSample.Migrations b.ToTable("EShopOrdersOrderLines"); }); + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("CancelledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(18,6)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopPaymentsPayments"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("uniqueidentifier"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(18,6)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(18,6)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EShopPaymentsPaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(18,6)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EShopPaymentsRefunds"); + }); + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => { b.Property("Id") @@ -960,9 +1197,6 @@ namespace EShopSample.Migrations b.Property("RefundAmount") .HasColumnType("decimal(18,6)"); - b.Property("StoreId") - .HasColumnType("uniqueidentifier"); - b.Property("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); @@ -1111,9 +1345,6 @@ namespace EShopSample.Migrations b.Property("StaffRemark") .HasColumnType("nvarchar(max)"); - b.Property("StoreId") - .HasColumnType("uniqueidentifier"); - b.Property("TenantId") .HasColumnName("TenantId") .HasColumnType("uniqueidentifier"); @@ -2881,6 +3112,13 @@ namespace EShopSample.Migrations .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.Products.Products.ProductAttribute", b => { b.HasOne("EasyAbp.EShop.Products.Products.Product", null) diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj index ef63853b..6d8e132d 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj @@ -10,7 +10,8 @@ - + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs index ba53e2c2..37085390 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs @@ -1,4 +1,5 @@ using EasyAbp.EShop.EntityFrameworkCore; +using EasyAbp.PaymentService.EntityFrameworkCore; using EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AuditLogging.EntityFrameworkCore; @@ -27,6 +28,7 @@ namespace EShopSample.EntityFrameworkCore typeof(AbpTenantManagementEntityFrameworkCoreModule), typeof(AbpFeatureManagementEntityFrameworkCoreModule), typeof(EShopEntityFrameworkCoreModule), + typeof(PaymentServiceEntityFrameworkCoreModule), typeof(PaymentServiceWeChatPayEntityFrameworkCoreModule) )] public class EShopSampleEntityFrameworkCoreModule : AbpModule diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj index d2b73b49..ae833a00 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj @@ -13,7 +13,8 @@ - + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs index a51d4f8b..33ee1527 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs @@ -1,4 +1,5 @@ using EasyAbp.EShop; +using EasyAbp.PaymentService; using EasyAbp.PaymentService.WeChatPay; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Account; @@ -18,6 +19,7 @@ namespace EShopSample typeof(AbpTenantManagementHttpApiClientModule), typeof(AbpFeatureManagementHttpApiClientModule), typeof(EShopHttpApiClientModule), + typeof(PaymentServiceHttpApiClientModule), typeof(PaymentServiceWeChatPayHttpApiClientModule) )] public class EShopSampleHttpApiClientModule : AbpModule diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj index 3c1be7dd..a72613e8 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj @@ -13,7 +13,8 @@ - + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs index c28b6e26..9c9cbb8a 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs @@ -1,4 +1,5 @@ using EasyAbp.EShop; +using EasyAbp.PaymentService; using EasyAbp.PaymentService.WeChatPay; using Volo.Abp.Account; using Volo.Abp.FeatureManagement; @@ -17,6 +18,7 @@ namespace EShopSample typeof(AbpTenantManagementHttpApiModule), typeof(AbpFeatureManagementHttpApiModule), typeof(EShopHttpApiModule), + typeof(PaymentServiceHttpApiModule), typeof(PaymentServiceWeChatPayHttpApiModule) )] public class EShopSampleHttpApiModule : AbpModule diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj index c867bace..3fecf969 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj @@ -45,7 +45,8 @@ - + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs index 8d3403a2..f290abd6 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs @@ -13,6 +13,7 @@ using EasyAbp.EShop.Stores; using EasyAbp.EShop.Stores.Web; using EasyAbp.EShop.Web; using EasyAbp.PaymentService; +using EasyAbp.PaymentService.Web; using EasyAbp.PaymentService.WeChatPay; using EasyAbp.PaymentService.WeChatPay.Web; using Localization.Resources.AbpUi; @@ -66,6 +67,7 @@ namespace EShopSample.Web typeof(AbpTenantManagementWebModule), typeof(AbpAspNetCoreSerilogModule), typeof(EShopWebModule), + typeof(PaymentServiceWebModule), typeof(PaymentServiceWeChatPayWebModule) )] public class EShopSampleWebModule : AbpModule