Browse Source

Merge pull request #119 from EasyAbp/order-auto-cancel

Order automatically cancel
pull/122/head 2.3.0
Super 5 years ago
committed by GitHub
parent
commit
0252e2d9a2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      Directory.Build.props
  2. 7
      EShop.sln
  3. 2
      azure-pipelines.yml
  4. 2
      common.props
  5. 5
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderLineDto.cs
  6. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDto.cs
  7. 10
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs
  8. 5
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs
  9. 7
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/OrdersConsts.cs
  10. 1
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj
  11. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/EShopOrdersDomainModule.cs
  12. 66
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DefaultUnpaidOrderAutoCancelProvider.cs
  13. 7
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IUnpaidOrderAutoCancelProvider.cs
  14. 17
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs
  15. 25
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentIdChangedEto.cs
  16. 9
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCanceledEventHandler.cs
  17. 14
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/UnpaidOrderAutoCancelArgs.cs
  18. 53
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/UnpaidOrderAutoCancelJob.cs
  19. 222
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs
  20. 46
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/CancelPaymentEventHandler.cs
  21. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Categories/Dtos/CategoryDto.cs
  22. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Categories/Dtos/CreateUpdateCategoryDto.cs
  23. 14
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/CreateUpdateProductDto.cs
  24. 9
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs
  25. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductSkuDto.cs
  26. 25
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/UpdateProductSkuDto.cs
  27. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs
  28. 18
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs
  29. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs
  30. 15
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductViewAppService.cs
  31. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs
  32. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json
  33. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json
  34. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json
  35. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json
  36. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json
  37. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json
  38. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json
  39. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hans.json
  40. 9
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hant.json
  41. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/ProductsConsts.cs
  42. 18
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Categories/Category.cs
  43. 40
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Categories/CategoryManager.cs
  44. 12
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Categories/DuplicateCategoryUniqueNameException.cs
  45. 26
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Categories/ICategoryManager.cs
  46. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs
  47. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs
  48. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductSku.cs
  49. 15
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Settings/ProductsSettingDefinitionProvider.cs
  50. 9
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Settings/ProductsSettings.cs
  51. 16
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/Categories/CategoryRepository.cs
  52. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContextModelCreatingExtensions.cs
  53. 10
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs
  54. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/Index.cshtml
  55. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/ViewModels/CreateEditProductViewModel.cs
  56. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/index.js
  57. 7
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs
  58. 6
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs
  59. 1
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js
  60. 8
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/ViewModels/EditProductSkuViewModel.cs
  61. 2
      samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj
  62. 2
      samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSampleDbMigratorModule.cs
  63. 63
      samples/EShopSample/aspnet-core/src/EShopSample.Domain/Users/AppUser.cs
  64. 25
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EShopSample.EntityFrameworkCore.DbMigrations.csproj
  65. 16
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EShopSampleEntityFrameworkCoreDbMigrationsModule.cs
  66. 62
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EShopSampleMigrationsDbContext.cs
  67. 3123
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200526074907_AddedCodeToProductSku.Designer.cs
  68. 1715
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200526074907_AddedCodeToProductSku.cs
  69. 3123
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200527083620_ChangedToSerializedEntityData.Designer.cs
  70. 51
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200527083620_ChangedToSerializedEntityData.cs
  71. 3129
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200602074752_AddedPaymentAndRefundEntities.Designer.cs
  72. 32
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200602074752_AddedPaymentAndRefundEntities.cs
  73. 3367
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.Designer.cs
  74. 143
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.cs
  75. 3533
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200610111529_UpgradedToAbp2_9_0.Designer.cs
  76. 127
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200610111529_UpgradedToAbp2_9_0.cs
  77. 3540
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200612085218_AddedOrderNumberProperty.Designer.cs
  78. 33
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200612085218_AddedOrderNumberProperty.cs
  79. 3543
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200612105914_AddedOrderMaxQuantityProperty.Designer.cs
  80. 23
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200612105914_AddedOrderMaxQuantityProperty.cs
  81. 3543
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200620070213_ChangedMoneyToDecimal20_8.Designer.cs
  82. 303
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200620070213_ChangedMoneyToDecimal20_8.cs
  83. 3561
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200620145307_UsedEasyAbpTreesModule.Designer.cs
  84. 63
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200620145307_UsedEasyAbpTreesModule.cs
  85. 3589
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624075154_UpgradedPaymentServiceModuleTo0_3_7.Designer.cs
  86. 219
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624075154_UpgradedPaymentServiceModuleTo0_3_7.cs
  87. 3601
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624181705_AddedMissingPropertiesInPaymentAndRefund.Designer.cs
  88. 52
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624181705_AddedMissingPropertiesInPaymentAndRefund.cs
  89. 3601
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624191051_AddedColumnTypeOfPendingRefundAmount.Designer.cs
  90. 45
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624191051_AddedColumnTypeOfPendingRefundAmount.cs
  91. 3601
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200627172358_RenamedCancelledToCanceled.Designer.cs
  92. 64
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200627172358_RenamedCancelledToCanceled.cs
  93. 3625
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200702100757_UpgradedAbpTo3_0_0.Designer.cs
  94. 519
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200702100757_UpgradedAbpTo3_0_0.cs
  95. 3699
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704104743_AddedMediaResourcesToProductSku.Designer.cs
  96. 59
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704104743_AddedMediaResourcesToProductSku.cs
  97. 3699
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704130321_AddedDecimalConfigurationsToBasketItem.Designer.cs
  98. 61
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704130321_AddedDecimalConfigurationsToBasketItem.cs
  99. 3702
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704130714_AddedStoreIdToBasketItem.Designer.cs
  100. 24
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704130714_AddedStoreIdToBasketItem.cs

8
Directory.Build.props

@ -1,10 +1,10 @@
<Project>
<PropertyGroup>
<AbpVersion>4.3.0</AbpVersion>
<EasyAbpAbpTreesModuleVersion>2.3.0</EasyAbpAbpTreesModuleVersion>
<EasyAbpPaymentServiceModuleVersion>1.10.2</EasyAbpPaymentServiceModuleVersion>
<EasyAbpAbpTagHelperPlusModuleVersion>0.6.3</EasyAbpAbpTagHelperPlusModuleVersion>
<AbpVersion>4.4.0</AbpVersion>
<EasyAbpAbpTreesModuleVersion>2.4.0</EasyAbpAbpTreesModuleVersion>
<EasyAbpPaymentServiceModuleVersion>1.10.3</EasyAbpPaymentServiceModuleVersion>
<EasyAbpAbpTagHelperPlusModuleVersion>0.7.1</EasyAbpAbpTagHelperPlusModuleVersion>
</PropertyGroup>
</Project>

7
EShop.sln

@ -19,8 +19,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopSample.Application.Tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopSample.Web.Tests", "samples\EShopSample\aspnet-core\test\EShopSample.Web.Tests\EShopSample.Web.Tests.csproj", "{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopSample.EntityFrameworkCore.DbMigrations", "samples\EShopSample\aspnet-core\src\EShopSample.EntityFrameworkCore.DbMigrations\EShopSample.EntityFrameworkCore.DbMigrations.csproj", "{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopSample.Domain.Shared", "samples\EShopSample\aspnet-core\src\EShopSample.Domain.Shared\EShopSample.Domain.Shared.csproj", "{42F719ED-8413-4895-B5B4-5AB56079BC66}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopSample.Application.Contracts", "samples\EShopSample\aspnet-core\src\EShopSample.Application.Contracts\EShopSample.Application.Contracts.csproj", "{520659C8-C734-4298-A3DA-B539DB9DFC0B}"
@ -373,10 +371,6 @@ Global
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Release|Any CPU.Build.0 = Release|Any CPU
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0}.Release|Any CPU.Build.0 = Release|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -914,7 +908,6 @@ Global
{04DBDB01-70F4-4E06-B468-8F87850B22BE} = {FE0A5FD6-AEE7-4738-9A6D-261BF086704D}
{50B2631D-129C-47B3-A587-029CCD6099BC} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{0372FA84-C517-4EB3-9A9F-B9ACAC0CA5E0} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{42F719ED-8413-4895-B5B4-5AB56079BC66} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{520659C8-C734-4298-A3DA-B539DB9DFC0B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}

2
azure-pipelines.yml

@ -105,7 +105,7 @@ stages:
displayName: 'update database'
inputs:
script: |
dotnet ef database update --project samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EShopSample.EntityFrameworkCore.DbMigrations.csproj -s samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj
dotnet ef database update --project samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj -s samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj
- task: CmdLine@2
inputs:

2
common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>2.1.8</Version>
<Version>2.3.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>

5
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderLineDto.cs

@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.ObjectExtending;
namespace EasyAbp.EShop.Orders.Orders.Dtos
@ -7,6 +8,9 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos
[Serializable]
public class CreateOrderLineDto : ExtensibleObject
{
public const int MinimumQuantity = 1;
public const int MaximumQuantity = int.MaxValue;
[DisplayName("OrderLineProductId")]
public Guid ProductId { get; set; }
@ -14,6 +18,7 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos
public Guid ProductSkuId { get; set; }
[DisplayName("OrderLineQuantity")]
[Range(MinimumQuantity, MaximumQuantity)]
public int Quantity { get; set; }
}
}

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDto.cs

@ -45,6 +45,8 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos
public DateTime? ReducedInventoryAfterPaymentTime { get; set; }
public DateTime? PaymentExpiration { get; set; }
public List<OrderLineDto> OrderLines { get; set; }
}
}

10
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs

@ -10,11 +10,13 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Timing;
namespace EasyAbp.EShop.Orders.Orders
{
public class NewOrderGenerator : INewOrderGenerator, ITransientDependency
{
private readonly IClock _clock;
private readonly IGuidGenerator _guidGenerator;
private readonly ICurrentTenant _currentTenant;
private readonly IServiceProvider _serviceProvider;
@ -22,12 +24,14 @@ namespace EasyAbp.EShop.Orders.Orders
private readonly IProductSkuDescriptionProvider _productSkuDescriptionProvider;
public NewOrderGenerator(
IClock clock,
IGuidGenerator guidGenerator,
ICurrentTenant currentTenant,
IServiceProvider serviceProvider,
IOrderNumberGenerator orderNumberGenerator,
IProductSkuDescriptionProvider productSkuDescriptionProvider)
{
_clock = clock;
_guidGenerator = guidGenerator;
_currentTenant = currentTenant;
_serviceProvider = serviceProvider;
@ -53,6 +57,8 @@ namespace EasyAbp.EShop.Orders.Orders
}
var productTotalPrice = orderLines.Select(x => x.TotalPrice).Sum();
var paymentExpireIn = orderLines.Select(x => productDict[x.ProductId].GetSkuPaymentExpireIn(x.ProductSkuId)).Min();
var totalPrice = productTotalPrice;
var totalDiscount = orderLines.Select(x => x.TotalDiscount).Sum();
@ -67,7 +73,9 @@ namespace EasyAbp.EShop.Orders.Orders
totalDiscount: totalDiscount,
totalPrice: totalPrice,
actualTotalPrice: totalPrice - totalDiscount,
customerRemark: input.CustomerRemark);
customerRemark: input.CustomerRemark,
paymentExpiration: paymentExpireIn.HasValue ? _clock.Now.Add(paymentExpireIn.Value) : null
);
input.MapExtraPropertiesTo(order, MappingPropertyDefinitionChecks.Destination);

5
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs

@ -84,8 +84,7 @@ namespace EasyAbp.EShop.Orders.Orders
{
// Todo: Check if the store is open.
var productDict = await GetProductDictionaryAsync(input.OrderLines.Select(dto => dto.ProductId).ToList(),
input.StoreId);
var productDict = await GetProductDictionaryAsync(input.OrderLines.Select(dto => dto.ProductId).ToList());
await AuthorizationService.CheckAsync(
new OrderCreationResource
@ -114,7 +113,7 @@ namespace EasyAbp.EShop.Orders.Orders
}
protected virtual async Task<Dictionary<Guid, ProductDto>> GetProductDictionaryAsync(
IEnumerable<Guid> productIds, Guid storeId)
IEnumerable<Guid> productIds)
{
var dict = new Dictionary<Guid, ProductDto>();

7
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/OrdersConsts.cs

@ -0,0 +1,7 @@
namespace EasyAbp.EShop.Orders
{
public static class OrdersConsts
{
public static string CancellationReason = "Order payment timed out and not paid";
}
}

1
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj

@ -10,6 +10,7 @@
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Abstractions" Version="$(AbpVersion)" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Products\src\EasyAbp.EShop.Products.Domain.Shared\EasyAbp.EShop.Products.Domain.Shared.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain.Shared\EasyAbp.EShop.Orders.Domain.Shared.csproj" />

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/EShopOrdersDomainModule.cs

@ -4,6 +4,7 @@ using EasyAbp.EShop.Products;
using EasyAbp.EShop.Stores;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Modularity;
@ -12,6 +13,7 @@ namespace EasyAbp.EShop.Orders
{
[DependsOn(
typeof(AbpAutoMapperModule),
typeof(AbpBackgroundJobsAbstractionsModule),
typeof(EShopPaymentsDomainSharedModule),
typeof(EShopProductsDomainSharedModule),
typeof(EShopOrdersDomainSharedModule)

66
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/DefaultUnpaidOrderAutoCancelProvider.cs

@ -0,0 +1,66 @@
using System.Threading.Tasks;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Timing;
using Volo.Abp.Uow;
namespace EasyAbp.EShop.Orders.Orders
{
[Dependency(TryRegister = true)]
[UnitOfWork]
public class DefaultUnpaidOrderAutoCancelProvider :
IUnpaidOrderAutoCancelProvider,
ILocalEventHandler<EntityCreatedEventData<Order>>,
ILocalEventHandler<OrderPaymentIdChangedEto>,
ITransientDependency
{
private readonly IClock _clock;
private readonly IOrderManager _orderManager;
private readonly IBackgroundJobManager _backgroundJobManager;
public DefaultUnpaidOrderAutoCancelProvider(
IClock clock,
IOrderManager orderManager,
IBackgroundJobManager backgroundJobManager)
{
_clock = clock;
_orderManager = orderManager;
_backgroundJobManager = backgroundJobManager;
}
public virtual async Task HandleEventAsync(EntityCreatedEventData<Order> eventData)
{
if (!eventData.Entity.PaymentExpiration.HasValue)
{
return;
}
var args = new UnpaidOrderAutoCancelArgs
{
TenantId = eventData.Entity.TenantId,
OrderId = eventData.Entity.Id
};
await _backgroundJobManager.EnqueueAsync(
args: args,
delay: eventData.Entity.PaymentExpiration.Value.Subtract(_clock.Now) // Todo: use a absolute time.
);
}
public virtual async Task HandleEventAsync(OrderPaymentIdChangedEto eventData)
{
if (!eventData.Order.PaymentExpiration.HasValue || eventData.ToPaymentId.HasValue)
{
return;
}
if (_clock.Now > eventData.Order.PaymentExpiration.Value && !eventData.Order.CanceledTime.HasValue)
{
await _orderManager.CancelAsync(eventData.Order, OrdersConsts.CancellationReason);
}
}
}
}

7
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IUnpaidOrderAutoCancelProvider.cs

@ -0,0 +1,7 @@
namespace EasyAbp.EShop.Orders.Orders
{
public interface IUnpaidOrderAutoCancelProvider
{
}
}

17
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs

@ -58,6 +58,8 @@ namespace EasyAbp.EShop.Orders.Orders
public virtual DateTime? ReducedInventoryAfterPaymentTime { get; protected set; }
public virtual DateTime? PaymentExpiration { get; protected set; }
public virtual List<OrderLine> OrderLines { get; protected set; }
public virtual List<OrderExtraFee> OrderExtraFees { get; protected set; }
@ -71,12 +73,13 @@ namespace EasyAbp.EShop.Orders.Orders
Guid? tenantId,
Guid storeId,
Guid customerUserId,
string currency,
[NotNull] string currency,
decimal productTotalPrice,
decimal totalDiscount,
decimal totalPrice,
decimal actualTotalPrice,
[CanBeNull] string customerRemark
[CanBeNull] string customerRemark,
DateTime? paymentExpiration
) : base(id)
{
TenantId = tenantId;
@ -88,6 +91,7 @@ namespace EasyAbp.EShop.Orders.Orders
TotalPrice = totalPrice;
ActualTotalPrice = actualTotalPrice;
CustomerRemark = customerRemark;
PaymentExpiration = paymentExpiration;
RefundAmount = 0;
@ -115,9 +119,16 @@ namespace EasyAbp.EShop.Orders.Orders
{
ReducedInventoryAfterPaymentTime = time;
}
public void SetPaymentExpiration(DateTime? paymentExpiration)
{
PaymentExpiration = paymentExpiration;
}
public void SetPaymentId(Guid? paymentId)
{
AddLocalEvent(new OrderPaymentIdChangedEto(TenantId, this, PaymentId, paymentId));
PaymentId = paymentId;
}

25
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentIdChangedEto.cs

@ -0,0 +1,25 @@
using System;
using Volo.Abp.MultiTenancy;
namespace EasyAbp.EShop.Orders.Orders
{
[Serializable]
public class OrderPaymentIdChangedEto : IMultiTenant
{
public Guid? TenantId { get; set; }
public Order Order { get; set; }
public Guid? FromPaymentId { get; set; }
public Guid? ToPaymentId { get; set; }
public OrderPaymentIdChangedEto(Guid? tenantId, Order order, Guid? fromPaymentId, Guid? toPaymentId)
{
TenantId = tenantId;
Order = order;
FromPaymentId = fromPaymentId;
ToPaymentId = toPaymentId;
}
}
}

9
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCanceledEventHandler.cs

@ -5,22 +5,29 @@ using EasyAbp.EShop.Payments;
using EasyAbp.EShop.Payments.Payments;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;
namespace EasyAbp.EShop.Orders.Orders
{
public class PaymentCanceledEventHandler : IDistributedEventHandler<EShopPaymentCanceledEto>, ITransientDependency
{
private readonly ICurrentTenant _currentTenant;
private readonly IOrderRepository _orderRepository;
public PaymentCanceledEventHandler(IOrderRepository orderRepository)
public PaymentCanceledEventHandler(
ICurrentTenant currentTenant,
IOrderRepository orderRepository)
{
_currentTenant = currentTenant;
_orderRepository = orderRepository;
}
[UnitOfWork(true)]
public virtual async Task HandleEventAsync(EShopPaymentCanceledEto eventData)
{
using var currentTenant = _currentTenant.Change(eventData.TenantId);
foreach (var paymentItem in eventData.Payment.PaymentItems.Where(item =>
item.ItemType == PaymentsConsts.PaymentItemType))
{

14
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/UnpaidOrderAutoCancelArgs.cs

@ -0,0 +1,14 @@
using System;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.MultiTenancy;
namespace EasyAbp.EShop.Orders.Orders
{
[BackgroundJobName("EShopUnpaidOrderAutoCancel")]
public class UnpaidOrderAutoCancelArgs : IMultiTenant
{
public Guid? TenantId { get; set; }
public Guid OrderId { get; set; }
}
}

53
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/UnpaidOrderAutoCancelJob.cs

@ -0,0 +1,53 @@
using System.Threading.Tasks;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;
namespace EasyAbp.EShop.Orders.Orders
{
public class UnpaidOrderAutoCancelJob : AsyncBackgroundJob<UnpaidOrderAutoCancelArgs>, ITransientDependency
{
private readonly ICurrentTenant _currentTenant;
private readonly IOrderManager _orderManager;
private readonly IOrderRepository _orderRepository;
private readonly IDistributedEventBus _distributedEventBus;
public UnpaidOrderAutoCancelJob(
ICurrentTenant currentTenant,
IOrderManager orderManager,
IOrderRepository orderRepository,
IDistributedEventBus distributedEventBus)
{
_currentTenant = currentTenant;
_orderManager = orderManager;
_orderRepository = orderRepository;
_distributedEventBus = distributedEventBus;
}
[UnitOfWork]
public override async Task ExecuteAsync(UnpaidOrderAutoCancelArgs args)
{
using var changeTenant = _currentTenant.Change(args.TenantId);
var order = await _orderRepository.FindAsync(args.OrderId);
if (order is not {CanceledTime: null} || order.IsPaid())
{
return;
}
if (order.IsInPayment())
{
// Cancel the payment and cancel the order in EasyAbp.EShop.Orders.Orders.PaymentCanceledEventHandler
await _distributedEventBus.PublishAsync(new CancelPaymentEto(args.TenantId, order.PaymentId!.Value));
}
else
{
await _orderManager.CancelAsync(order, OrdersConsts.CancellationReason);
}
}
}
}

222
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs

@ -9,16 +9,19 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute;
using Shouldly;
using Volo.Abp.Timing;
using Xunit;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderAppServiceTests : OrdersApplicationTestBase
{
private readonly IClock _clock;
private readonly IOrderAppService _orderAppService;
public OrderAppServiceTests()
{
_clock = GetRequiredService<IClock>();
_orderAppService = GetRequiredService<IOrderAppService>();
}
@ -226,5 +229,224 @@ namespace EasyAbp.EShop.Orders.Orders
order.CancellationReason.ShouldBe("Repeat orders.");
});
}
[Fact]
public async Task Unpaid_Order_Should_Be_Auto_Canceled_When_Payment_Is_Canceled()
{
// Arrange
await Order_Should_Be_Created();
Guid orderId = Guid.Empty;
UsingDbContext(db =>
{
var order = db.Orders.First();
orderId = order.Id;
order.SetPaymentId(Guid.NewGuid());
db.SaveChanges();
});
// Act
var now = _clock.Now;
UsingDbContext(async db =>
{
var orderRepository = ServiceProvider.GetRequiredService<IOrderRepository>();
var order = await orderRepository.GetAsync(orderId);
order.SetPaymentExpiration(now);
order.SetPaymentId(null);
await orderRepository.UpdateAsync(order, true);
});
var response = await _orderAppService.GetAsync(orderId);
// Assert
response.ShouldNotBeNull();
response.PaymentId.ShouldBeNull();
response.PaymentExpiration.ShouldBe(now);
response.OrderStatus.ShouldBe(OrderStatus.Canceled);
response.CanceledTime.ShouldNotBeNull();
response.CancellationReason.ShouldBe(OrdersConsts.CancellationReason);
UsingDbContext(db =>
{
var order = db.Orders.FirstOrDefault(o => o.Id == orderId);
order.ShouldNotBeNull();
order.PaymentId.ShouldBeNull();
order.PaymentExpiration.ShouldBe(now);
order.OrderStatus.ShouldBe(OrderStatus.Canceled);
order.CanceledTime.ShouldNotBeNull();
order.CancellationReason.ShouldBe(OrdersConsts.CancellationReason);
});
}
[Fact]
public async Task Paid_Order_Should_Not_Be_Auto_Canceled_When_Payment_Overtime()
{
// Arrange
await Order_Should_Be_Created();
Guid orderId = Guid.Empty;
UsingDbContext(db =>
{
var order = db.Orders.First();
orderId = order.Id;
order.SetPaymentId(Guid.NewGuid());
order.SetPaidTime(_clock.Now);
order.SetOrderStatus(OrderStatus.Processing);
db.SaveChanges();
});
// Act
var now = _clock.Now;
UsingDbContext(async db =>
{
var orderRepository = ServiceProvider.GetRequiredService<IOrderRepository>();
var order = await orderRepository.GetAsync(orderId);
order.SetPaymentExpiration(now);
await orderRepository.UpdateAsync(order, true);
});
UsingDbContext(async db =>
{
var backgroundJob = ServiceProvider.GetRequiredService<UnpaidOrderAutoCancelJob>();
await backgroundJob.ExecuteAsync(new UnpaidOrderAutoCancelArgs
{
TenantId = null,
OrderId = orderId
});
});
var response = await _orderAppService.GetAsync(orderId);
// Assert
response.ShouldNotBeNull();
response.PaymentId.ShouldNotBeNull();
response.PaymentExpiration.ShouldBe(now);
response.OrderStatus.ShouldBe(OrderStatus.Processing);
response.CanceledTime.ShouldBeNull();
response.CancellationReason.ShouldBeNull();
UsingDbContext(db =>
{
var order = db.Orders.FirstOrDefault(o => o.Id == orderId);
order.ShouldNotBeNull();
order.PaymentId.ShouldNotBeNull();
order.PaymentExpiration.ShouldBe(now);
order.OrderStatus.ShouldBe(OrderStatus.Processing);
order.CanceledTime.ShouldBeNull();
order.CancellationReason.ShouldBeNull();
});
}
[Fact]
public async Task Unpaid_Order_Should_Be_Auto_Canceled_When_Payment_Overtime()
{
// Arrange
await Order_Should_Be_Created();
Guid orderId = Guid.Empty;
UsingDbContext(db =>
{
var order = db.Orders.First();
orderId = order.Id;
});
// Act
var now = _clock.Now;
UsingDbContext(async db =>
{
var orderRepository = ServiceProvider.GetRequiredService<IOrderRepository>();
var order = await orderRepository.GetAsync(orderId);
order.SetPaymentExpiration(now);
await orderRepository.UpdateAsync(order, true);
});
UsingDbContext(async db =>
{
var backgroundJob = ServiceProvider.GetRequiredService<UnpaidOrderAutoCancelJob>();
await backgroundJob.ExecuteAsync(new UnpaidOrderAutoCancelArgs
{
TenantId = null,
OrderId = orderId
});
});
var response = await _orderAppService.GetAsync(orderId);
// Assert
response.ShouldNotBeNull();
response.PaymentId.ShouldBeNull();
response.PaymentExpiration.ShouldBe(now);
response.OrderStatus.ShouldBe(OrderStatus.Canceled);
response.CanceledTime.ShouldNotBeNull();
response.CancellationReason.ShouldBe(OrdersConsts.CancellationReason);
UsingDbContext(db =>
{
var order = db.Orders.FirstOrDefault(o => o.Id == orderId);
order.ShouldNotBeNull();
order.PaymentId.ShouldBeNull();
order.PaymentExpiration.ShouldBe(now);
order.OrderStatus.ShouldBe(OrderStatus.Canceled);
order.CanceledTime.ShouldNotBeNull();
order.CancellationReason.ShouldBe(OrdersConsts.CancellationReason);
});
}
[Fact]
public async Task Payment_Pending_Order_Should_Be_Auto_Canceled_When_Payment_Overtime()
{
// Arrange
await Order_Should_Be_Created();
Guid orderId = Guid.Empty;
UsingDbContext(db =>
{
var order = db.Orders.First();
orderId = order.Id;
order.SetPaymentId(Guid.NewGuid());
db.SaveChanges();
});
// Act
var now = _clock.Now;
UsingDbContext(async db =>
{
var orderRepository = ServiceProvider.GetRequiredService<IOrderRepository>();
var order = await orderRepository.GetAsync(orderId);
order.SetPaymentExpiration(now);
await orderRepository.UpdateAsync(order, true);
});
UsingDbContext(async db =>
{
var backgroundJob = ServiceProvider.GetRequiredService<UnpaidOrderAutoCancelJob>();
await backgroundJob.ExecuteAsync(new UnpaidOrderAutoCancelArgs
{
TenantId = null,
OrderId = orderId
});
});
var response = await _orderAppService.GetAsync(orderId);
// Assert
response.ShouldNotBeNull();
response.PaymentId.ShouldBeNull();
response.PaymentExpiration.ShouldBe(now);
response.OrderStatus.ShouldBe(OrderStatus.Canceled);
response.CanceledTime.ShouldNotBeNull();
response.CancellationReason.ShouldBe(OrdersConsts.CancellationReason);
UsingDbContext(db =>
{
var order = db.Orders.FirstOrDefault(o => o.Id == orderId);
order.ShouldNotBeNull();
order.PaymentId.ShouldBeNull();
order.PaymentExpiration.ShouldBe(now);
order.OrderStatus.ShouldBe(OrderStatus.Canceled);
order.CanceledTime.ShouldNotBeNull();
order.CancellationReason.ShouldBe(OrdersConsts.CancellationReason);
});
}
}
}

46
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/CancelPaymentEventHandler.cs

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Uow;
namespace EasyAbp.EShop.Orders.Orders
{
[UnitOfWork]
public class CancelPaymentEventHandler : IDistributedEventHandler<CancelPaymentEto>, ITransientDependency
{
private readonly IOrderRepository _orderRepository;
private readonly IDistributedEventBus _distributedEventBus;
public CancelPaymentEventHandler(
IOrderRepository orderRepository,
IDistributedEventBus distributedEventBus)
{
_orderRepository = orderRepository;
_distributedEventBus = distributedEventBus;
}
public async Task HandleEventAsync(CancelPaymentEto eventData)
{
await _distributedEventBus.PublishAsync(new EShopPaymentCanceledEto(new EShopPaymentEto
{
TenantId = eventData.TenantId,
Id = eventData.PaymentId,
PaymentItems = new List<EShopPaymentItemEto>
{
new()
{
Id = Guid.NewGuid(),
ItemType = PaymentsConsts.PaymentItemType,
ItemKey = (await _orderRepository.FirstAsync()).Id.ToString()
}
}
}));
}
}
}

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Categories/Dtos/CategoryDto.cs

@ -24,5 +24,7 @@ namespace EasyAbp.EShop.Products.Categories.Dtos
public string Description { get; set; }
public string MediaResources { get; set; }
public bool IsHidden { get; set; }
}
}

3
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Categories/Dtos/CreateUpdateCategoryDto.cs

@ -23,5 +23,8 @@ namespace EasyAbp.EShop.Products.Categories.Dtos
[DisplayName("CategoryMediaResources")]
public string MediaResources { get; set; }
[DisplayName("CategoryIsHidden")]
public bool IsHidden { get; set; }
}
}

14
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/CreateUpdateProductDto.cs

@ -43,10 +43,24 @@ namespace EasyAbp.EShop.Products.Products.Dtos
[DisplayName("ProductIsPublished")]
public bool IsPublished { get; set; }
[DisplayName("ProductIsHidden")]
public bool IsHidden { get; set; }
[DisplayName("ProductPaymentExpireIn")]
public TimeSpan? PaymentExpireIn { get; set; }
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
base.Validate(validationContext);
if (PaymentExpireIn.HasValue && PaymentExpireIn.Value < TimeSpan.Zero)
{
yield return new ValidationResult(
"PaymentExpireIn should be greater than or equal to 0.",
new[] { "PaymentExpireIn" }
);
}
if (ProductAttributes.Select(a => a.DisplayName.Trim()).Distinct().Count() != ProductAttributes.Count)
{

9
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs

@ -32,6 +32,8 @@ namespace EasyAbp.EShop.Products.Products.Dtos
public bool IsHidden { get; set; }
public TimeSpan? PaymentExpireIn { get; set; }
public long Sold { get; set; }
public decimal? MinimumPrice { get; set; }
@ -51,5 +53,12 @@ namespace EasyAbp.EShop.Products.Products.Dtos
{
return ProductSkus.FirstOrDefault(x => x.Id == skuId);
}
public TimeSpan? GetSkuPaymentExpireIn(Guid skuId)
{
var sku = GetSkuById(skuId);
return sku.PaymentExpireIn ?? PaymentExpireIn;
}
}
}

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductSkuDto.cs

@ -28,6 +28,8 @@ namespace EasyAbp.EShop.Products.Products.Dtos
public int OrderMaxQuantity { get; set; }
public TimeSpan? PaymentExpireIn { get; set; }
public string MediaResources { get; set; }
public Guid? ProductDetailId { get; set; }

25
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/UpdateProductSkuDto.cs

@ -9,6 +9,11 @@ namespace EasyAbp.EShop.Products.Products.Dtos
[Serializable]
public class UpdateProductSkuDto : ExtensibleObject
{
public const double MinimumPrice = 0f;
public const double MaximumPrice = 999999999999.99999999f;
public const int MinimumQuantity = 1;
public const int MaximumQuantity = int.MaxValue;
[DisplayName("ProductSkuName")]
public string Name { get; set; }
@ -17,23 +22,43 @@ namespace EasyAbp.EShop.Products.Products.Dtos
public string Currency { get; set; }
[DisplayName("ProductSkuOriginalPrice")]
[Range(MinimumPrice, MaximumPrice)]
public decimal? OriginalPrice { get; set; }
[DisplayName("ProductSkuPrice")]
[Range(MinimumPrice, MaximumPrice)]
public decimal Price { get; set; }
[DefaultValue(1)]
[DisplayName("ProductSkuOrderMinQuantity")]
[Range(MinimumQuantity, MaximumQuantity)]
public int OrderMinQuantity { get; set; }
[DefaultValue(99)]
[DisplayName("ProductSkuOrderMaxQuantity")]
[Range(MinimumQuantity, MaximumQuantity)]
public int OrderMaxQuantity { get; set; }
[DisplayName("ProductSkuPaymentExpireIn")]
public TimeSpan? PaymentExpireIn { get; set; }
[DisplayName("ProductSkuMediaResources")]
public string MediaResources { get; set; }
[DisplayName("ProductSkuProductDetailId")]
public Guid? ProductDetailId { get; set; }
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
base.Validate(validationContext);
if (PaymentExpireIn.HasValue && PaymentExpireIn.Value < TimeSpan.Zero)
{
yield return new ValidationResult(
"PaymentExpireIn should be greater than or equal to 0.",
new[] { "PaymentExpireIn" }
);
}
}
}
}

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs

@ -20,7 +20,7 @@ namespace EasyAbp.EShop.Products.Products
Task<ProductDto> DeleteSkuAsync(Guid productId, Guid productSkuId);
Task<ProductDto> GetByCodeAsync(Guid storeId, string code);
Task<ProductDto> GetByUniqueNameAsync(Guid storeId, string uniqueName);
Task<ListResultDto<ProductGroupDto>> GetProductGroupListAsync();
}

18
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs

@ -20,10 +20,14 @@ namespace EasyAbp.EShop.Products.Categories
protected override string GetPolicyName { get; set; } = null;
protected override string GetListPolicyName { get; set; } = null;
private readonly ICategoryManager _categoryManager;
private readonly ICategoryRepository _repository;
public CategoryAppService(ICategoryRepository repository) : base(repository)
public CategoryAppService(
ICategoryManager categoryManager,
ICategoryRepository repository) : base(repository)
{
_categoryManager = categoryManager;
_repository = repository;
}
@ -34,6 +38,18 @@ namespace EasyAbp.EShop.Products.Categories
return input.ShowHidden ? query : query.Where(x => !x.IsHidden);
}
protected override async Task<Category> MapToEntityAsync(CreateUpdateCategoryDto createInput)
{
return await _categoryManager.CreateAsync(createInput.ParentId, createInput.UniqueName,
createInput.DisplayName, createInput.Description, createInput.MediaResources, createInput.IsHidden);
}
protected override async Task MapToEntityAsync(CreateUpdateCategoryDto updateInput, Category entity)
{
await _categoryManager.UpdateAsync(entity, updateInput.ParentId, updateInput.UniqueName,
updateInput.DisplayName, updateInput.Description, updateInput.MediaResources, updateInput.IsHidden);
}
public override async Task<PagedResultDto<CategoryDto>> GetListAsync(GetCategoryListDto input)
{
if (input.ShowHidden && !await AuthorizationService.IsGrantedAsync(ProductsPermissions.Categories.ShowHidden))

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs

@ -234,11 +234,11 @@ namespace EasyAbp.EShop.Products.Products
return Task.CompletedTask;
}
public virtual async Task<ProductDto> GetByCodeAsync(Guid storeId, string code)
public virtual async Task<ProductDto> GetByUniqueNameAsync(Guid storeId, string uniqueName)
{
await CheckGetPolicyAsync();
var product = await _repository.GetAsync(x => x.UniqueName == code);
var product = await _repository.GetAsync(x => x.UniqueName == uniqueName);
if (!product.IsPublished)
{

15
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductViewAppService.cs

@ -20,18 +20,18 @@ namespace EasyAbp.EShop.Products.Products
private readonly IProductViewCacheKeyProvider _productViewCacheKeyProvider;
private readonly IDistributedCache<ProductViewCacheItem> _cache;
private readonly IProductAppService _productAppService;
private readonly IProductRepository _productRepository;
private readonly IProductViewRepository _repository;
public ProductViewAppService(
IProductViewCacheKeyProvider productViewCacheKeyProvider,
IDistributedCache<ProductViewCacheItem> cache,
IProductAppService productAppService,
IProductRepository productRepository,
IProductViewRepository repository) : base(repository)
{
_productViewCacheKeyProvider = productViewCacheKeyProvider;
_cache = cache;
_productAppService = productAppService;
_productRepository = productRepository;
_repository = repository;
}
@ -96,18 +96,15 @@ namespace EasyAbp.EShop.Products.Products
protected virtual async Task BuildStoreProductViewsAsync(Guid storeId)
{
var resultDto = await _productAppService.GetListAsync(new GetProductListInput
{
StoreId = storeId
});
var products = await _productRepository.GetListAsync(x => x.StoreId == storeId);
using var uow = UnitOfWorkManager.Begin(true, true);
await _repository.DeleteAsync(x => x.StoreId == storeId, true);
foreach (var product in resultDto.Items)
foreach (var product in products)
{
await _repository.InsertAsync(ObjectMapper.Map<ProductDto, ProductView>(product));
await _repository.InsertAsync(ObjectMapper.Map<Product, ProductView>(product));
}
await uow.CompleteAsync();

3
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs

@ -62,13 +62,12 @@ namespace EasyAbp.EShop.Products
CreateMap<UpdateProductSkuDto, ProductSku>(MemberList.Source);
CreateMap<Category, CategoryDto>();
CreateMap<Category, CategorySummaryDto>();
CreateMap<CreateUpdateCategoryDto, Category>(MemberList.Source);
CreateMap<ProductCategory, ProductCategoryDto>();
CreateMap<ProductHistory, ProductHistoryDto>();
CreateMap<ProductDetailHistory, ProductDetailHistoryDto>();
CreateMap<ProductInventory, ProductInventoryDto>();
CreateMap<ProductView, ProductViewDto>();
CreateMap<ProductDto, ProductView>(MemberList.Destination);
CreateMap<Product, ProductView>(MemberList.Destination);
}
}
}

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json

@ -33,6 +33,7 @@
"ProductSkuSold": "Sold",
"ProductSkuOrderMinQuantity": "Minimum quantity per purchase",
"ProductSkuOrderMaxQuantity": "Maximum quantity per purchase",
"ProductSkuPaymentExpireIn": "Payment expire in",
"ProductSkuMediaResources": "Media resources",
"ProductSkuProductDetailId": "Product detail ID",
"ProductSkuContentDescription": "SKU content",
@ -44,6 +45,9 @@
"InventoryStrategy.ReduceAfterPlacing": "Reduce inventory after placing",
"InventoryStrategy.ReduceAfterPayment": "Reduce inventory after payment",
"ProductIsPublished": "Published",
"ProductIsStatic": "Static",
"ProductIsHidden": "Hidden",
"ProductPaymentExpireIn": "Payment expire in",
"ProductMediaResources": "Media resources",
"ProductAttributeDisplayName": "Display name",
"ProductAttributeDescription": "Description",
@ -66,6 +70,7 @@
"CategoryDisplayName": "Display name",
"CategoryDescription": "Description",
"CategoryMediaResources": "Media resources",
"CategoryIsHidden": "Hidden",
"CreateCategory": "New",
"EditCategory": "Edit",
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?",

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json

@ -34,6 +34,7 @@
"ProductSkuSold": "Sold",
"ProductSkuOrderMinQuantity": "Minimum quantity per purchase",
"ProductSkuOrderMaxQuantity": "Maximum quantity per purchase",
"ProductSkuPaymentExpireIn": "Payment expire in",
"ProductSkuMediaResources": "Media resources",
"ProductSkuProductDetailId": "Product detail ID",
"ProductSkuContentDescription": "SKU content",
@ -45,6 +46,9 @@
"InventoryStrategy.ReduceAfterPlacing": "Reduce inventory after placing",
"InventoryStrategy.ReduceAfterPayment": "Reduce inventory after payment",
"ProductIsPublished": "Published",
"ProductIsStatic": "Static",
"ProductIsHidden": "Hidden",
"ProductPaymentExpireIn": "Payment expire in",
"ProductMediaResources": "Media resources",
"ProductAttributeDisplayName": "Display name",
"ProductAttributeDescription": "Description",
@ -67,6 +71,7 @@
"CategoryDisplayName": "Display name",
"CategoryDescription": "Description",
"CategoryMediaResources": "Media resources",
"CategoryIsHidden": "Hidden",
"CreateCategory": "New",
"EditCategory": "Edit",
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?",

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json

@ -33,6 +33,7 @@
"ProductSkuSold": "Sold",
"ProductSkuOrderMinQuantity": "Minimum quantity per purchase",
"ProductSkuOrderMaxQuantity": "Maximum quantity per purchase",
"ProductSkuPaymentExpireIn": "Payment expire in",
"ProductSkuMediaResources": "Media resources",
"ProductSkuProductDetailId": "Product detail ID",
"ProductSkuContentDescription": "SKU content",
@ -44,6 +45,9 @@
"InventoryStrategy.ReduceAfterPlacing": "Reduce inventory after placing",
"InventoryStrategy.ReduceAfterPayment": "Reduce inventory after payment",
"ProductIsPublished": "Published",
"ProductIsStatic": "Static",
"ProductIsHidden": "Hidden",
"ProductPaymentExpireIn": "Payment expire in",
"ProductMediaResources": "Media resources",
"ProductAttributeDisplayName": "Display name",
"ProductAttributeDescription": "Description",
@ -66,6 +70,7 @@
"CategoryDisplayName": "Display name",
"CategoryDescription": "Description",
"CategoryMediaResources": "Media resources",
"CategoryIsHidden": "Hidden",
"CreateCategory": "New",
"EditCategory": "Edit",
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?",

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json

@ -33,6 +33,7 @@
"ProductSkuSold": "Sold",
"ProductSkuOrderMinQuantity": "Minimum quantity per purchase",
"ProductSkuOrderMaxQuantity": "Maximum quantity per purchase",
"ProductSkuPaymentExpireIn": "Payment expire in",
"ProductSkuMediaResources": "Media resources",
"ProductSkuProductDetailId": "Product detail ID",
"ProductSkuContentDescription": "SKU content",
@ -44,6 +45,9 @@
"InventoryStrategy.ReduceAfterPlacing": "Reduce inventory after placing",
"InventoryStrategy.ReduceAfterPayment": "Reduce inventory after payment",
"ProductIsPublished": "Published",
"ProductIsStatic": "Static",
"ProductIsHidden": "Hidden",
"ProductPaymentExpireIn": "Payment expire in",
"ProductMediaResources": "Media resources",
"ProductAttributeDisplayName": "Display name",
"ProductAttributeDescription": "Description",
@ -66,6 +70,7 @@
"CategoryDisplayName": "Display name",
"CategoryDescription": "Description",
"CategoryMediaResources": "Media resources",
"CategoryIsHidden": "Hidden",
"CreateCategory": "New",
"EditCategory": "Edit",
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?",

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json

@ -34,6 +34,7 @@
"ProductSkuSold": "Sold",
"ProductSkuOrderMinQuantity": "Minimum quantity per purchase",
"ProductSkuOrderMaxQuantity": "Maximum quantity per purchase",
"ProductSkuPaymentExpireIn": "Payment expire in",
"ProductSkuMediaResources": "Media resources",
"ProductSkuProductDetailId": "Product detail ID",
"ProductSkuContentDescription": "SKU content",
@ -45,6 +46,9 @@
"InventoryStrategy.ReduceAfterPlacing": "Reduce inventory after placing",
"InventoryStrategy.ReduceAfterPayment": "Reduce inventory after payment",
"ProductIsPublished": "Published",
"ProductIsStatic": "Static",
"ProductIsHidden": "Hidden",
"ProductPaymentExpireIn": "Payment expire in",
"ProductMediaResources": "Media resources",
"ProductAttributeDisplayName": "Display name",
"ProductAttributeDescription": "Description",
@ -67,6 +71,7 @@
"CategoryDisplayName": "Display name",
"CategoryDescription": "Description",
"CategoryMediaResources": "Media resources",
"CategoryIsHidden": "Hidden",
"CreateCategory": "New",
"EditCategory": "Edit",
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?",

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json

@ -34,6 +34,7 @@
"ProductSkuSold": "Sold",
"ProductSkuOrderMinQuantity": "Minimum quantity per purchase",
"ProductSkuOrderMaxQuantity": "Maximum quantity per purchase",
"ProductSkuPaymentExpireIn": "Payment expire in",
"ProductSkuMediaResources": "Media resources",
"ProductSkuProductDetailId": "Product detail ID",
"ProductSkuContentDescription": "SKU content",
@ -45,6 +46,9 @@
"InventoryStrategy.ReduceAfterPlacing": "Reduce inventory after placing",
"InventoryStrategy.ReduceAfterPayment": "Reduce inventory after payment",
"ProductIsPublished": "Published",
"ProductIsStatic": "Static",
"ProductIsHidden": "Hidden",
"ProductPaymentExpireIn": "Payment expire in",
"ProductMediaResources": "Media resources",
"ProductAttributeDisplayName": "Display name",
"ProductAttributeDescription": "Description",
@ -67,6 +71,7 @@
"CategoryDisplayName": "Display name",
"CategoryDescription": "Description",
"CategoryMediaResources": "Media resources",
"CategoryIsHidden": "Hidden",
"CreateCategory": "New",
"EditCategory": "Edit",
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?",

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json

@ -33,6 +33,7 @@
"ProductSkuSold": "Sold",
"ProductSkuOrderMinQuantity": "Minimum quantity per purchase",
"ProductSkuOrderMaxQuantity": "Maximum quantity per purchase",
"ProductSkuPaymentExpireIn": "Payment expire in",
"ProductSkuMediaResources": "Media resources",
"ProductSkuProductDetailId": "Product detail ID",
"ProductSkuContentDescription": "SKU content",
@ -44,6 +45,9 @@
"InventoryStrategy.ReduceAfterPlacing": "Reduce inventory after placing",
"InventoryStrategy.ReduceAfterPayment": "Reduce inventory after payment",
"ProductIsPublished": "Published",
"ProductIsStatic": "Static",
"ProductIsHidden": "Hidden",
"ProductPaymentExpireIn": "Payment expire in",
"ProductMediaResources": "Media resources",
"ProductAttributeDisplayName": "Display name",
"ProductAttributeDescription": "Description",
@ -66,6 +70,7 @@
"CategoryDisplayName": "Display name",
"CategoryDescription": "Description",
"CategoryMediaResources": "Media resources",
"CategoryIsHidden": "Hidden",
"CreateCategory": "New",
"EditCategory": "Edit",
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?",

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hans.json

@ -34,6 +34,7 @@
"ProductSkuSold": "已售",
"ProductSkuOrderMinQuantity": "单次最小购买数量",
"ProductSkuOrderMaxQuantity": "单次最大购买数量",
"ProductSkuPaymentExpireIn": "支付限时",
"ProductSkuMediaResources": "多媒体资源",
"ProductSkuProductDetailId": "商品详情 ID",
"ProductSkuContentDescription": "SKU 描述",
@ -45,6 +46,9 @@
"InventoryStrategy.ReduceAfterPlacing": "下单后减库存",
"InventoryStrategy.ReduceAfterPayment": "支付后减库存",
"ProductIsPublished": "是否发布",
"ProductIsStatic": "是否静态",
"ProductIsHidden": "是否隐藏",
"ProductPaymentExpireIn": "支付限时",
"ProductMediaResources": "多媒体资源",
"ProductAttributeDisplayName": "名称",
"ProductAttributeDescription": "描述",
@ -64,6 +68,7 @@
"CategoryDisplayName": "类目名称",
"CategoryDescription": "描述",
"CategoryMediaResources": "多媒体资源",
"CategoryIsHidden": "隐藏",
"CreateCategory": "新建",
"EditCategory": "编辑",
"CategoryDeletionConfirmationMessage": "确认删除类目 {0}?",

9
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hant.json

@ -34,6 +34,7 @@
"ProductSkuSold": "已售",
"ProductSkuOrderMinQuantity": "單次最小購買數量",
"ProductSkuOrderMaxQuantity": "單次最大購買數量",
"ProductSkuPaymentExpireIn": "支付限時",
"ProductSkuMediaResources": "多媒體資源",
"ProductSkuProductDetailId": "商品詳情 ID",
"ProductSkuContentDescription": "SKU 描述",
@ -42,9 +43,12 @@
"ProductSkuDeletionConfirmationMessage": "確認刪除 SKU {0}?",
"ProductInventoryStrategy": "庫存扣減策略",
"InventoryStrategy.NoNeed": "No need",
"InventoryStrategy.ReduceAfterPlacing": "Reduce inventory after placing",
"InventoryStrategy.ReduceAfterPayment": "Reduce inventory after payment",
"InventoryStrategy.ReduceAfterPlacing": "下單後減庫存",
"InventoryStrategy.ReduceAfterPayment": "支付後減庫存",
"ProductIsPublished": "是否發布",
"ProductIsStatic": "是否靜態",
"ProductIsHidden": "是否隱藏",
"ProductPaymentExpireIn": "支付限時",
"ProductMediaResources": "多媒體資源",
"ProductAttributeDisplayName": "名稱",
"ProductAttributeDescription": "描述",
@ -64,6 +68,7 @@
"CategoryDisplayName": "類目名稱",
"CategoryDescription": "描述",
"CategoryMediaResources": "多媒體資源",
"CategoryIsHidden": "隱藏",
"CreateCategory": "新建",
"EditCategory": "編輯",
"CategoryDeletionConfirmationMessage": "確認刪除類目 {0}?",

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/ProductsConsts.cs

@ -13,5 +13,7 @@
public const string GetCategorySummaryListedDataSourceUrl = CategoryRouteBase + "/summary";
public const string GetCategorySummarySingleDataSourceUrl = CategoryRouteBase + "/{id}";
public const string DefaultPaymentExpireInSettingName = "EasyAbp.EShop.Products.Product.DefaultPaymentExpireIn";
}
}

18
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Categories/Category.cs

@ -44,17 +44,31 @@ namespace EasyAbp.EShop.Products.Categories
{
}
public Category(
internal Category(
Guid id,
Guid? tenantId,
Guid? parentId,
string uniqueName,
string displayName,
string description,
string mediaResources,
bool isHidden
) :base(id)
) : base(id)
{
TenantId = tenantId;
Update(parentId, uniqueName, displayName, description, mediaResources, isHidden);
}
internal void Update(
Guid? parentId,
string uniqueName,
string displayName,
string description,
string mediaResources,
bool isHidden)
{
ParentId = parentId;
UniqueName = uniqueName;
DisplayName = displayName;
Description = description;

40
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Categories/CategoryManager.cs

@ -0,0 +1,40 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
namespace EasyAbp.EShop.Products.Categories
{
public class CategoryManager : DomainService, ICategoryManager
{
private readonly ICategoryRepository _repository;
public CategoryManager(ICategoryRepository repository)
{
_repository = repository;
}
public virtual async Task<Category> CreateAsync(Guid? parentId, string uniqueName, string displayName,
string description, string mediaResources, bool isHidden)
{
if (await _repository.AnyAsync(x => x.UniqueName == uniqueName))
{
throw new DuplicateCategoryUniqueNameException();
}
return new Category(GuidGenerator.Create(), CurrentTenant.Id, parentId, uniqueName, displayName,
description, mediaResources, isHidden);
}
public virtual async Task UpdateAsync(Category entity, Guid? parentId, string uniqueName, string displayName, string description,
string mediaResources, bool isHidden)
{
if (await _repository.AnyAsync(x => x.UniqueName == uniqueName && x.Id != entity.Id))
{
throw new DuplicateCategoryUniqueNameException();
}
entity.Update(parentId, uniqueName, displayName, description, mediaResources, isHidden);
}
}
}

12
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Categories/DuplicateCategoryUniqueNameException.cs

@ -0,0 +1,12 @@
using Volo.Abp;
namespace EasyAbp.EShop.Products.Categories
{
public class DuplicateCategoryUniqueNameException : BusinessException
{
public DuplicateCategoryUniqueNameException() : base("DuplicateCategoryUniqueName")
{
}
}
}

26
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Categories/ICategoryManager.cs

@ -0,0 +1,26 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Domain.Services;
namespace EasyAbp.EShop.Products.Categories
{
public interface ICategoryManager : IDomainService
{
Task<Category> CreateAsync(
Guid? parentId,
string uniqueName,
string displayName,
string description,
string mediaResources,
bool isHidden);
Task UpdateAsync(
Category entity,
Guid? parentId,
string uniqueName,
string displayName,
string description,
string mediaResources,
bool isHidden);
}
}

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs

@ -36,6 +36,8 @@ namespace EasyAbp.EShop.Products.Products
public virtual bool IsHidden { get; protected set; }
public virtual TimeSpan? PaymentExpireIn { get; protected set; }
public virtual List<ProductAttribute> ProductAttributes { get; protected set; }
public virtual List<ProductSku> ProductSkus { get; protected set; }
@ -56,6 +58,7 @@ namespace EasyAbp.EShop.Products.Products
bool isPublished,
bool isStatic,
bool isHidden,
TimeSpan? paymentExpireIn,
[CanBeNull] string mediaResources,
int displayOrder
) : base(id)
@ -70,6 +73,7 @@ namespace EasyAbp.EShop.Products.Products
IsPublished = isPublished;
IsStatic = isStatic;
IsHidden = isHidden;
PaymentExpireIn = paymentExpireIn;
MediaResources = mediaResources;
DisplayOrder = displayOrder;

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs

@ -52,7 +52,7 @@ namespace EasyAbp.EShop.Products.Products
{
if (_productGroupConfigurationProvider.Get(product.ProductGroupName) == null)
{
throw new NonexistentProductGroupException(product.DisplayName);
throw new NonexistentProductGroupException(product.ProductGroupName);
}
return Task.CompletedTask;

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductSku.cs

@ -25,6 +25,8 @@ namespace EasyAbp.EShop.Products.Products
public virtual int OrderMaxQuantity { get; protected set; }
public virtual TimeSpan? PaymentExpireIn { get; protected set; }
[CanBeNull]
public virtual string MediaResources { get; protected set; }
@ -47,6 +49,7 @@ namespace EasyAbp.EShop.Products.Products
decimal price,
int orderMinQuantity,
int orderMaxQuantity,
TimeSpan? paymentExpireIn,
[CanBeNull] string mediaResources,
Guid? productDetailId) : base(id)
{
@ -57,6 +60,7 @@ namespace EasyAbp.EShop.Products.Products
Price = price;
OrderMinQuantity = orderMinQuantity;
OrderMaxQuantity = orderMaxQuantity;
PaymentExpireIn = paymentExpireIn;
MediaResources = mediaResources;
ProductDetailId = productDetailId;

15
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Settings/ProductsSettingDefinitionProvider.cs

@ -1,4 +1,5 @@
using Volo.Abp.Settings;
using System;
using Volo.Abp.Settings;
namespace EasyAbp.EShop.Products.Settings
{
@ -10,7 +11,17 @@ namespace EasyAbp.EShop.Products.Settings
* Use names from ProductsSettings class.
*/
context.Add(new SettingDefinition(ProductsSettings.ProductView.CacheDurationSeconds, "60"));
context.Add(
new SettingDefinition(
ProductsSettings.ProductView.CacheDurationSeconds,
"60"
),
new SettingDefinition(
ProductsSettings.Product.DefaultPaymentExpireIn,
TimeSpan.FromMinutes(15).ToString(),
isVisibleToClients: true
)
);
}
}
}

9
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Settings/ProductsSettings.cs

@ -8,11 +8,18 @@
* public const string MySettingName = GroupName + ".MySettingName";
*/
public class ProductView
public static class ProductView
{
private const string ProductViewGroupName = GroupName + ".GroupName";
public const string CacheDurationSeconds = ProductViewGroupName + ".CacheDuration";
}
public static class Product
{
private const string ProductGroupName = GroupName + ".Product";
public const string DefaultPaymentExpireIn = ProductGroupName + ".DefaultPaymentExpireIn";
}
}
}

16
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/Categories/CategoryRepository.cs

@ -1,4 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using EasyAbp.Abp.Trees;
using EasyAbp.EShop.Products.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
@ -11,5 +15,17 @@ namespace EasyAbp.EShop.Products.Categories
public CategoryRepository(IDbContextProvider<IProductsDbContext> dbContextProvider) : base(dbContextProvider)
{
}
public override Task InsertManyAsync(IEnumerable<Category> entities, bool autoSave = false,
CancellationToken cancellationToken = new CancellationToken())
{
throw new NotSupportedException();
}
public override Task UpdateManyAsync(IEnumerable<Category> entities, bool autoSave = false,
CancellationToken cancellationToken = new CancellationToken())
{
throw new NotSupportedException();
}
}
}

3
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContextModelCreatingExtensions.cs

@ -91,9 +91,6 @@ namespace EasyAbp.EShop.Products.EntityFrameworkCore
b.ToTable(options.TablePrefix + "Categories", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
// Todo: soft delete support?
b.HasIndex(x => x.UniqueName).IsUnique();
});
builder.Entity<ProductCategory>(b =>

10
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs

@ -66,10 +66,18 @@ namespace EasyAbp.EShop.Products.Products
}
[HttpGet]
[Obsolete("Use `by-unique-name/{uniqueName}`")]
[Route("by-code/{code}")]
public Task<ProductDto> GetByCodeAsync(Guid storeId, string code)
{
return _service.GetByCodeAsync(storeId, code);
return _service.GetByUniqueNameAsync(storeId, code);
}
[HttpGet]
[Route("by-unique-name/{uniqueName}")]
public Task<ProductDto> GetByUniqueNameAsync(Guid storeId, string uniqueName)
{
return _service.GetByUniqueNameAsync(storeId, uniqueName);
}
[HttpDelete]

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/Index.cshtml

@ -50,7 +50,7 @@
<th>@L["CategoryUniqueName"]</th>
<th>@L["CategoryDisplayName"]</th>
<th>@L["CategoryDescription"]</th>
<th>@L["CategoryMediaResources"]</th>
<th>@L["CategoryIsHidden"]</th>
</tr>
</thead>
</abp-table>

3
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/ViewModels/CreateEditProductViewModel.cs

@ -20,5 +20,8 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Categories.Category.Vi
[Display(Name = "CategoryMediaResources")]
public string MediaResources { get; set; }
[Display(Name = "CategoryIsHidden")]
public bool IsHidden { get; set; }
}
}

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Categories/Category/index.js

@ -59,7 +59,7 @@ $(function () {
{ data: "uniqueName" },
{ data: "displayName" },
{ data: "description" },
{ data: "mediaResources" },
{ data: "isHidden" },
]
}));

7
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs

@ -12,6 +12,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Settings;
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
{
@ -62,6 +63,12 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
{
Product.CategoryIds = new List<Guid>(new[] { categoryId.Value });
}
var paymentExpireInString =
await SettingProvider.GetOrNullAsync(ProductsConsts.DefaultPaymentExpireInSettingName);
Product.PaymentExpireIn =
!paymentExpireInString.IsNullOrEmpty() ? TimeSpan.Parse(paymentExpireInString) : null;
}
public virtual async Task<IActionResult> OnPostAsync()

6
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs

@ -59,6 +59,12 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewM
[Display(Name = "ProductIsPublished")]
public bool IsPublished { get; set; }
[Display(Name = "ProductIsHidden")]
public bool IsHidden { get; set; }
[Display(Name = "ProductPaymentExpireIn")]
public TimeSpan? PaymentExpireIn { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{

1
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js

@ -56,6 +56,7 @@ $(function () {
{ data: "inventoryStrategy" },
{ data: "sold" },
{ data: "isPublished" },
{ data: "isHidden" },
]
}));

8
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/ProductSku/ViewModels/EditProductSkuViewModel.cs

@ -1,6 +1,7 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using EasyAbp.EShop.Products.Products.Dtos;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
@ -17,21 +18,28 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.ProductSku.Vi
[Required]
[Display(Name = "ProductSkuPrice")]
[Range(UpdateProductSkuDto.MinimumPrice, UpdateProductSkuDto.MaximumPrice)]
public decimal Price { get; set; }
[Display(Name = "ProductSkuOriginalPrice")]
[Range(UpdateProductSkuDto.MinimumPrice, UpdateProductSkuDto.MaximumPrice)]
public decimal? OriginalPrice { get; set; }
[Required]
[DefaultValue(1)]
[Display(Name = "ProductSkuOrderMinQuantity")]
[Range(UpdateProductSkuDto.MinimumQuantity, UpdateProductSkuDto.MaximumQuantity)]
public int OrderMinQuantity { get; set; }
[Required]
[DefaultValue(99)]
[Display(Name = "ProductSkuOrderMaxQuantity")]
[Range(UpdateProductSkuDto.MinimumQuantity, UpdateProductSkuDto.MaximumQuantity)]
public int OrderMaxQuantity { get; set; }
[DisplayName("ProductSkuPaymentExpireIn")]
public TimeSpan? PaymentExpireIn { get; set; }
[Display(Name = "ProductSkuMediaResources")]
public string MediaResources { get; set; }

2
samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj

@ -28,7 +28,7 @@
<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="$(AbpVersion)" />
<ProjectReference Include="..\EShopSample.Application.Contracts\EShopSample.Application.Contracts.csproj" />
<ProjectReference Include="..\EShopSample.EntityFrameworkCore.DbMigrations\EShopSample.EntityFrameworkCore.DbMigrations.csproj" />
<ProjectReference Include="..\EShopSample.EntityFrameworkCore\EShopSample.EntityFrameworkCore.csproj" />
</ItemGroup>
</Project>

2
samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSampleDbMigratorModule.cs

@ -7,7 +7,7 @@ namespace EShopSample.DbMigrator
{
[DependsOn(
typeof(AbpAutofacModule),
typeof(EShopSampleEntityFrameworkCoreDbMigrationsModule),
typeof(EShopSampleEntityFrameworkCoreModule),
typeof(EShopSampleApplicationContractsModule)
)]
public class EShopSampleDbMigratorModule : AbpModule

63
samples/EShopSample/aspnet-core/src/EShopSample.Domain/Users/AppUser.cs

@ -1,63 +0,0 @@
using System;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.Users;
namespace EShopSample.Users
{
/* This entity shares the same table/collection ("AbpUsers" by default) with the
* IdentityUser entity of the Identity module.
*
* - You can define your custom properties into this class.
* - You never create or delete this entity, because it is Identity module's job.
* - You can query users from database with this entity.
* - You can update values of your custom properties.
*/
public class AppUser : FullAuditedAggregateRoot<Guid>, IUser
{
#region Base properties
/* These properties are shared with the IdentityUser entity of the Identity module.
* Do not change these properties through this class. Instead, use Identity module
* services (like IdentityUserManager) to change them.
* So, this properties are designed as read only!
*/
public virtual Guid? TenantId { get; private set; }
public virtual string UserName { get; private set; }
public virtual string Name { get; private set; }
public virtual string Surname { get; private set; }
public virtual string Email { get; private set; }
public virtual bool EmailConfirmed { get; private set; }
public virtual string PhoneNumber { get; private set; }
public virtual bool PhoneNumberConfirmed { get; private set; }
#endregion
/* Add your own properties here. Example:
*
* public string MyProperty { get; set; }
*
* If you add a property and using the EF Core, remember these;
*
* 1. Update EShopSampleDbContext.OnModelCreating
* to configure the mapping for your new property
* 2. Update EShopSampleEfCoreEntityExtensionMappings to extend the IdentityUser entity
* and add your new property to the migration.
* 3. Use the Add-Migration to add a new database migration.
* 4. Run the .DbMigrator project (or use the Update-Database command) to apply
* schema change to the database.
*/
private AppUser()
{
}
}
}

25
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EShopSample.EntityFrameworkCore.DbMigrations.csproj

@ -1,25 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>EShopSample</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Migrations\20200517122756_UsedPaymentServiceModule.cs" />
<Compile Remove="Migrations\20200517122756_UsedPaymentServiceModule.Designer.cs" />
<Compile Remove="Migrations\20200517123312_UsedPaymentServiceModule.cs" />
<Compile Remove="Migrations\20200517123312_UsedPaymentServiceModule.Designer.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EShopSample.EntityFrameworkCore\EShopSample.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.*" />
</ItemGroup>
</Project>

16
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EShopSampleEntityFrameworkCoreDbMigrationsModule.cs

@ -1,16 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
namespace EShopSample.EntityFrameworkCore
{
[DependsOn(
typeof(EShopSampleEntityFrameworkCoreModule)
)]
public class EShopSampleEntityFrameworkCoreDbMigrationsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<EShopSampleMigrationsDbContext>();
}
}
}

62
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EShopSampleMigrationsDbContext.cs

@ -1,62 +0,0 @@
using EasyAbp.EShop.EntityFrameworkCore;
using EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore;
using EasyAbp.EShop.Plugins.Coupons.EntityFrameworkCore;
using EasyAbp.PaymentService.EntityFrameworkCore;
using EasyAbp.PaymentService.Prepayment.EntityFrameworkCore;
using EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
namespace EShopSample.EntityFrameworkCore
{
/* This DbContext is only used for database migrations.
* It is not used on runtime. See EShopSampleDbContext for the runtime DbContext.
* It is a unified model that includes configuration for
* all used modules and your application.
*/
public class EShopSampleMigrationsDbContext : AbpDbContext<EShopSampleMigrationsDbContext>
{
public EShopSampleMigrationsDbContext(DbContextOptions<EShopSampleMigrationsDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
/* Include modules to your migration db context */
builder.ConfigurePermissionManagement();
builder.ConfigureSettingManagement();
builder.ConfigureBackgroundJobs();
builder.ConfigureAuditLogging();
builder.ConfigureIdentity();
builder.ConfigureIdentityServer();
builder.ConfigureFeatureManagement();
builder.ConfigureTenantManagement();
/* Configure your own tables/entities inside the ConfigureEShopSample method */
builder.ConfigureEShopSample();
builder.ConfigureEShop();
builder.ConfigureEShopPluginsBaskets();
builder.ConfigureEShopPluginsCoupons();
builder.ConfigurePaymentService();
builder.ConfigurePaymentServiceWeChatPay();
builder.ConfigurePaymentServicePrepayment();
}
}
}

3123
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200526074907_AddedCodeToProductSku.Designer.cs

File diff suppressed because it is too large

1715
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200526074907_AddedCodeToProductSku.cs

File diff suppressed because it is too large

3123
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200527083620_ChangedToSerializedEntityData.Designer.cs

File diff suppressed because it is too large

51
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200527083620_ChangedToSerializedEntityData.cs

@ -1,51 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class ChangedToSerializedEntityData : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SerializedDto",
table: "EShopProductsProductHistories");
migrationBuilder.DropColumn(
name: "SerializedDto",
table: "EShopProductsProductDetailHistories");
migrationBuilder.AddColumn<string>(
name: "SerializedEntityData",
table: "EShopProductsProductHistories",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SerializedEntityData",
table: "EShopProductsProductDetailHistories",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SerializedEntityData",
table: "EShopProductsProductHistories");
migrationBuilder.DropColumn(
name: "SerializedEntityData",
table: "EShopProductsProductDetailHistories");
migrationBuilder.AddColumn<string>(
name: "SerializedDto",
table: "EShopProductsProductHistories",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SerializedDto",
table: "EShopProductsProductDetailHistories",
type: "nvarchar(max)",
nullable: true);
}
}
}

3129
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200602074752_AddedPaymentAndRefundEntities.Designer.cs

File diff suppressed because it is too large

32
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200602074752_AddedPaymentAndRefundEntities.cs

@ -1,32 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedPaymentAndRefundEntities : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "StoreId",
table: "PaymentServiceRefunds",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "StoreId",
table: "PaymentServicePayments",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "StoreId",
table: "PaymentServiceRefunds");
migrationBuilder.DropColumn(
name: "StoreId",
table: "PaymentServicePayments");
}
}
}

3367
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.Designer.cs

File diff suppressed because it is too large

143
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.cs

@ -1,143 +0,0 @@
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<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
PaymentMethod = table.Column<string>(nullable: true),
PayeeAccount = table.Column<string>(nullable: true),
ExternalTradingCode = table.Column<string>(nullable: true),
Currency = table.Column<string>(nullable: true),
OriginalPaymentAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PaymentDiscount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
ActualPaymentAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
RefundAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CompletionTime = table.Column<DateTime>(nullable: true),
CancelledTime = table.Column<DateTime>(nullable: true),
StoreId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_EShopPaymentsPayments", x => x.Id);
});
migrationBuilder.CreateTable(
name: "EShopPaymentsRefunds",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
PaymentId = table.Column<Guid>(nullable: false),
PaymentItemId = table.Column<Guid>(nullable: false),
RefundPaymentMethod = table.Column<string>(nullable: true),
ExternalTradingCode = table.Column<string>(nullable: true),
Currency = table.Column<string>(nullable: true),
RefundAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CustomerRemark = table.Column<string>(nullable: true),
StaffRemark = table.Column<string>(nullable: true),
StoreId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_EShopPaymentsRefunds", x => x.Id);
});
migrationBuilder.CreateTable(
name: "EShopPaymentsPaymentItems",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
ItemType = table.Column<string>(nullable: true),
ItemKey = table.Column<Guid>(nullable: false),
Currency = table.Column<string>(nullable: true),
OriginalPaymentAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PaymentDiscount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
ActualPaymentAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
RefundAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PaymentId = table.Column<Guid>(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<Guid>(
name: "StoreId",
table: "PaymentServiceRefunds",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "StoreId",
table: "PaymentServicePayments",
type: "uniqueidentifier",
nullable: true);
}
}
}

3533
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200610111529_UpgradedToAbp2_9_0.Designer.cs

File diff suppressed because it is too large

127
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200610111529_UpgradedToAbp2_9_0.cs

@ -1,127 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class UpgradedToAbp2_9_0 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpOrganizationUnits",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
ParentId = table.Column<Guid>(nullable: true),
Code = table.Column<string>(maxLength: 95, nullable: false),
DisplayName = table.Column<string>(maxLength: 128, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id);
table.ForeignKey(
name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId",
column: x => x.ParentId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "AbpOrganizationUnitRoles",
columns: table => new
{
RoleId = table.Column<Guid>(nullable: false),
OrganizationUnitId = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId });
table.ForeignKey(
name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUnitId",
column: x => x.OrganizationUnitId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserOrganizationUnits",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
OrganizationUnitId = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId });
table.ForeignKey(
name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUnitId",
column: x => x.OrganizationUnitId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId",
table: "AbpOrganizationUnitRoles",
columns: new[] { "RoleId", "OrganizationUnitId" });
migrationBuilder.CreateIndex(
name: "IX_AbpOrganizationUnits_Code",
table: "AbpOrganizationUnits",
column: "Code");
migrationBuilder.CreateIndex(
name: "IX_AbpOrganizationUnits_ParentId",
table: "AbpOrganizationUnits",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId",
table: "AbpUserOrganizationUnits",
columns: new[] { "UserId", "OrganizationUnitId" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpOrganizationUnitRoles");
migrationBuilder.DropTable(
name: "AbpUserOrganizationUnits");
migrationBuilder.DropTable(
name: "AbpOrganizationUnits");
}
}
}

3540
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200612085218_AddedOrderNumberProperty.Designer.cs

File diff suppressed because it is too large

33
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200612085218_AddedOrderNumberProperty.cs

@ -1,33 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedOrderNumberProperty : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "OrderNumber",
table: "EShopOrdersOrders",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_EShopOrdersOrders_OrderNumber",
table: "EShopOrdersOrders",
column: "OrderNumber",
unique: true,
filter: "[OrderNumber] IS NOT NULL");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_EShopOrdersOrders_OrderNumber",
table: "EShopOrdersOrders");
migrationBuilder.DropColumn(
name: "OrderNumber",
table: "EShopOrdersOrders");
}
}
}

3543
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200612105914_AddedOrderMaxQuantityProperty.Designer.cs

File diff suppressed because it is too large

23
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200612105914_AddedOrderMaxQuantityProperty.cs

@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedOrderMaxQuantityProperty : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "OrderMaxQuantity",
table: "EShopProductsProductSkus",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OrderMaxQuantity",
table: "EShopProductsProductSkus");
}
}
}

3543
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200620070213_ChangedMoneyToDecimal20_8.Designer.cs

File diff suppressed because it is too large

303
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200620070213_ChangedMoneyToDecimal20_8.cs

@ -1,303 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class ChangedMoneyToDecimal20_8 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "Price",
table: "EShopProductsProductSkus",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "OriginalPrice",
table: "EShopProductsProductSkus",
type: "decimal(20,8)",
nullable: true,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)",
oldNullable: true);
migrationBuilder.AlterColumn<decimal>(
name: "RefundAmount",
table: "EShopPaymentsRefunds",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "RefundAmount",
table: "EShopPaymentsPayments",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "PaymentDiscount",
table: "EShopPaymentsPayments",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "OriginalPaymentAmount",
table: "EShopPaymentsPayments",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "ActualPaymentAmount",
table: "EShopPaymentsPayments",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "RefundAmount",
table: "EShopPaymentsPaymentItems",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "PaymentDiscount",
table: "EShopPaymentsPaymentItems",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "OriginalPaymentAmount",
table: "EShopPaymentsPaymentItems",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "ActualPaymentAmount",
table: "EShopPaymentsPaymentItems",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "EShopOrdersOrders",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "EShopOrdersOrders",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "RefundedAmount",
table: "EShopOrdersOrders",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "ProductTotalPrice",
table: "EShopOrdersOrders",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "UnitPrice",
table: "EShopOrdersOrderLines",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "EShopOrdersOrderLines",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "EShopOrdersOrderLines",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "Price",
table: "EShopProductsProductSkus",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "OriginalPrice",
table: "EShopProductsProductSkus",
type: "decimal(18,6)",
nullable: true,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)",
oldNullable: true);
migrationBuilder.AlterColumn<decimal>(
name: "RefundAmount",
table: "EShopPaymentsRefunds",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "RefundAmount",
table: "EShopPaymentsPayments",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "PaymentDiscount",
table: "EShopPaymentsPayments",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "OriginalPaymentAmount",
table: "EShopPaymentsPayments",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "ActualPaymentAmount",
table: "EShopPaymentsPayments",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "RefundAmount",
table: "EShopPaymentsPaymentItems",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "PaymentDiscount",
table: "EShopPaymentsPaymentItems",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "OriginalPaymentAmount",
table: "EShopPaymentsPaymentItems",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "ActualPaymentAmount",
table: "EShopPaymentsPaymentItems",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "EShopOrdersOrders",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "EShopOrdersOrders",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "RefundedAmount",
table: "EShopOrdersOrders",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "ProductTotalPrice",
table: "EShopOrdersOrders",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "UnitPrice",
table: "EShopOrdersOrderLines",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "EShopOrdersOrderLines",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "EShopOrdersOrderLines",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
}
}
}

3561
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200620145307_UsedEasyAbpTreesModule.Designer.cs

File diff suppressed because it is too large

63
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200620145307_UsedEasyAbpTreesModule.cs

@ -1,63 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class UsedEasyAbpTreesModule : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Code",
table: "EShopProductsCategories",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "Level",
table: "EShopProductsCategories",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<Guid>(
name: "ParentId",
table: "EShopProductsCategories",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_EShopProductsCategories_ParentId",
table: "EShopProductsCategories",
column: "ParentId");
migrationBuilder.AddForeignKey(
name: "FK_EShopProductsCategories_EShopProductsCategories_ParentId",
table: "EShopProductsCategories",
column: "ParentId",
principalTable: "EShopProductsCategories",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_EShopProductsCategories_EShopProductsCategories_ParentId",
table: "EShopProductsCategories");
migrationBuilder.DropIndex(
name: "IX_EShopProductsCategories_ParentId",
table: "EShopProductsCategories");
migrationBuilder.DropColumn(
name: "Code",
table: "EShopProductsCategories");
migrationBuilder.DropColumn(
name: "Level",
table: "EShopProductsCategories");
migrationBuilder.DropColumn(
name: "ParentId",
table: "EShopProductsCategories");
}
}
}

3589
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624075154_UpgradedPaymentServiceModuleTo0_3_7.Designer.cs

File diff suppressed because it is too large

219
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624075154_UpgradedPaymentServiceModuleTo0_3_7.cs

@ -1,219 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class UpgradedPaymentServiceModuleTo0_3_7 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "NonceStr",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "ReqInfo",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "NonceStr",
table: "PaymentServiceWeChatPayPaymentRecords");
migrationBuilder.DropColumn(
name: "Sign",
table: "PaymentServiceWeChatPayPaymentRecords");
migrationBuilder.DropColumn(
name: "SignType",
table: "PaymentServiceWeChatPayPaymentRecords");
migrationBuilder.AlterColumn<int>(
name: "SettlementRefundFee",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AddColumn<int>(
name: "CashFee",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "CashFeeType",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "CashRefundFee",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CouponIds",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "CouponRefundCount",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "CouponRefundFee",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CouponRefundFees",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CouponTypes",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FeeType",
table: "PaymentServiceWeChatPayRefundRecords",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "CancelledTime",
table: "PaymentServiceRefunds",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "CompletedTime",
table: "PaymentServiceRefunds",
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "PendingRefundAmount",
table: "PaymentServicePayments",
type: "decimal(18,6)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<decimal>(
name: "PendingRefundAmount",
table: "PaymentServicePaymentItems",
type: "decimal(18,6)",
nullable: false,
defaultValue: 0m);
migrationBuilder.CreateIndex(
name: "IX_PaymentServiceWeChatPayRefundRecords_PaymentId",
table: "PaymentServiceWeChatPayRefundRecords",
column: "PaymentId");
migrationBuilder.CreateIndex(
name: "IX_PaymentServiceWeChatPayPaymentRecords_PaymentId",
table: "PaymentServiceWeChatPayPaymentRecords",
column: "PaymentId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_PaymentServiceWeChatPayRefundRecords_PaymentId",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropIndex(
name: "IX_PaymentServiceWeChatPayPaymentRecords_PaymentId",
table: "PaymentServiceWeChatPayPaymentRecords");
migrationBuilder.DropColumn(
name: "CashFee",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "CashFeeType",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "CashRefundFee",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "CouponIds",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "CouponRefundCount",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "CouponRefundFee",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "CouponRefundFees",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "CouponTypes",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "FeeType",
table: "PaymentServiceWeChatPayRefundRecords");
migrationBuilder.DropColumn(
name: "CancelledTime",
table: "PaymentServiceRefunds");
migrationBuilder.DropColumn(
name: "CompletedTime",
table: "PaymentServiceRefunds");
migrationBuilder.DropColumn(
name: "PendingRefundAmount",
table: "PaymentServicePayments");
migrationBuilder.DropColumn(
name: "PendingRefundAmount",
table: "PaymentServicePaymentItems");
migrationBuilder.AlterColumn<int>(
name: "SettlementRefundFee",
table: "PaymentServiceWeChatPayRefundRecords",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "NonceStr",
table: "PaymentServiceWeChatPayRefundRecords",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ReqInfo",
table: "PaymentServiceWeChatPayRefundRecords",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "NonceStr",
table: "PaymentServiceWeChatPayPaymentRecords",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Sign",
table: "PaymentServiceWeChatPayPaymentRecords",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SignType",
table: "PaymentServiceWeChatPayPaymentRecords",
type: "nvarchar(max)",
nullable: true);
}
}
}

3601
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624181705_AddedMissingPropertiesInPaymentAndRefund.Designer.cs

File diff suppressed because it is too large

52
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624181705_AddedMissingPropertiesInPaymentAndRefund.cs

@ -1,52 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedMissingPropertiesInPaymentAndRefund : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "CancelledTime",
table: "EShopPaymentsRefunds",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "CompletedTime",
table: "EShopPaymentsRefunds",
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "PendingRefundAmount",
table: "EShopPaymentsPayments",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<decimal>(
name: "PendingRefundAmount",
table: "EShopPaymentsPaymentItems",
nullable: false,
defaultValue: 0m);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CancelledTime",
table: "EShopPaymentsRefunds");
migrationBuilder.DropColumn(
name: "CompletedTime",
table: "EShopPaymentsRefunds");
migrationBuilder.DropColumn(
name: "PendingRefundAmount",
table: "EShopPaymentsPayments");
migrationBuilder.DropColumn(
name: "PendingRefundAmount",
table: "EShopPaymentsPaymentItems");
}
}
}

3601
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624191051_AddedColumnTypeOfPendingRefundAmount.Designer.cs

File diff suppressed because it is too large

45
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624191051_AddedColumnTypeOfPendingRefundAmount.cs

@ -1,45 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedColumnTypeOfPendingRefundAmount : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "PendingRefundAmount",
table: "EShopPaymentsPayments",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "PendingRefundAmount",
table: "EShopPaymentsPaymentItems",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "PendingRefundAmount",
table: "EShopPaymentsPayments",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "PendingRefundAmount",
table: "EShopPaymentsPaymentItems",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
}
}
}

3601
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200627172358_RenamedCancelledToCanceled.Designer.cs

File diff suppressed because it is too large

64
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200627172358_RenamedCancelledToCanceled.cs

@ -1,64 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class RenamedCancelledToCanceled : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "CancelledTime",
table: "PaymentServiceRefunds",
newName: "CanceledTime");
migrationBuilder.RenameColumn(
name: "CancelledTime",
table: "PaymentServicePayments",
newName: "CanceledTime");
migrationBuilder.RenameColumn(
name: "CancelledTime",
table: "EShopPaymentsRefunds",
newName: "CanceledTime");
migrationBuilder.RenameColumn(
name: "CancelledTime",
table: "EShopPaymentsPayments",
newName: "CanceledTime");
migrationBuilder.RenameColumn(
name: "CancelledTime",
table: "EShopOrdersOrders",
newName: "CanceledTime");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "CanceledTime",
table: "PaymentServiceRefunds",
newName: "CancelledTime");
migrationBuilder.RenameColumn(
name: "CanceledTime",
table: "PaymentServicePayments",
newName: "CancelledTime");
migrationBuilder.RenameColumn(
name: "CanceledTime",
table: "EShopPaymentsRefunds",
newName: "CancelledTime");
migrationBuilder.RenameColumn(
name: "CanceledTime",
table: "EShopPaymentsPayments",
newName: "CancelledTime");
migrationBuilder.RenameColumn(
name: "CanceledTime",
table: "EShopOrdersOrders",
newName: "CancelledTime");
}
}
}

3625
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200702100757_UpgradedAbpTo3_0_0.Designer.cs

File diff suppressed because it is too large

519
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200702100757_UpgradedAbpTo3_0_0.cs

@ -1,519 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class UpgradedAbpTo3_0_0 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "PaymentServiceWeChatPayRefundRecords",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "PaymentServiceWeChatPayPaymentRecords",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "PaymentServiceRefunds",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "PaymentServicePayments",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerPersistedGrants",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerIdentityResources",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerDeviceFlowCodes",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerClients",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerApiResources",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopStoresStores",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductTypes",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductStores",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProducts",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductHistories",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductDetails",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductDetailHistories",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductCategories",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsCategories",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopPaymentsRefunds",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopPaymentsPayments",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopOrdersOrders",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpTenants",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpOrganizationUnits",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpClaimTypes",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpBackgroundJobs",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpAuditLogs",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "PaymentServiceWeChatPayRefundRecords",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "PaymentServiceWeChatPayPaymentRecords",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "PaymentServiceRefunds",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "PaymentServicePayments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerPersistedGrants",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerIdentityResources",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerDeviceFlowCodes",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerClients",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "IdentityServerApiResources",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopStoresStores",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductTypes",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductStores",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProducts",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductHistories",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductDetails",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductDetailHistories",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsProductCategories",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopProductsCategories",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopPaymentsRefunds",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopPaymentsPayments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "EShopOrdersOrders",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpTenants",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
type: "nvarchar(256)",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpOrganizationUnits",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpClaimTypes",
type: "nvarchar(256)",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpBackgroundJobs",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpAuditLogs",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 40,
oldNullable: true);
}
}
}

3699
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704104743_AddedMediaResourcesToProductSku.Designer.cs

File diff suppressed because it is too large

59
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704104743_AddedMediaResourcesToProductSku.cs

@ -1,59 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedMediaResourcesToProductSku : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "MediaResources",
table: "EShopProductsProductSkus",
nullable: true);
migrationBuilder.CreateTable(
name: "EShopPluginsBasketsBasketItems",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
BasketName = table.Column<string>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
ProductId = table.Column<Guid>(nullable: false),
ProductSkuId = table.Column<Guid>(nullable: false),
Quantity = table.Column<int>(nullable: false),
MediaResources = table.Column<string>(nullable: true),
ProductName = table.Column<string>(nullable: true),
SkuDescription = table.Column<string>(nullable: true),
Currency = table.Column<string>(nullable: true),
UnitPrice = table.Column<decimal>(nullable: false),
TotalPrice = table.Column<decimal>(nullable: false),
TotalDiscount = table.Column<decimal>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EShopPluginsBasketsBasketItems", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_EShopPluginsBasketsBasketItems_UserId",
table: "EShopPluginsBasketsBasketItems",
column: "UserId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EShopPluginsBasketsBasketItems");
migrationBuilder.DropColumn(
name: "MediaResources",
table: "EShopProductsProductSkus");
}
}
}

3699
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704130321_AddedDecimalConfigurationsToBasketItem.Designer.cs

File diff suppressed because it is too large

61
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704130321_AddedDecimalConfigurationsToBasketItem.cs

@ -1,61 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedDecimalConfigurationsToBasketItem : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "UnitPrice",
table: "EShopPluginsBasketsBasketItems",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "EShopPluginsBasketsBasketItems",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "EShopPluginsBasketsBasketItems",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "UnitPrice",
table: "EShopPluginsBasketsBasketItems",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "EShopPluginsBasketsBasketItems",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "EShopPluginsBasketsBasketItems",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
}
}
}

3702
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704130714_AddedStoreIdToBasketItem.Designer.cs

File diff suppressed because it is too large

24
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200704130714_AddedStoreIdToBasketItem.cs

@ -1,24 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedStoreIdToBasketItem : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "StoreId",
table: "EShopPluginsBasketsBasketItems",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "StoreId",
table: "EShopPluginsBasketsBasketItems");
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save