Browse Source

Implement order refund feature #85

pull/96/head
gdlcf88 6 years ago
parent
commit
3e55734041
  1. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDto.cs
  2. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs
  3. 1
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs
  4. 18
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs
  5. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs
  6. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs
  7. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderEto.cs
  8. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs
  9. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj
  10. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs
  11. 12
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/InvalidRefundAmountException.cs
  12. 12
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/InvalidRefundQuantityException.cs
  13. 37
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs
  14. 13
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs
  15. 8
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs
  16. 35
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderRefundEventHandler.cs
  17. 3
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs
  18. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj
  19. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs
  20. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs
  21. 7
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs
  22. 7
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentItemDto.cs
  23. 43
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateEShopRefundInput.cs
  24. 19
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateEShopRefundItemInput.cs
  25. 16
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs
  26. 31
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundItemDto.cs
  27. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs
  28. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs
  29. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/InvalidRefundQuantityException.cs
  30. 69
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs
  31. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj
  32. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs
  33. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json
  34. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json
  35. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json
  36. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json
  37. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json
  38. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json
  39. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json
  40. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json
  41. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json
  42. 44
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundEto.cs
  43. 33
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundItemEto.cs
  44. 13
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderLineRefundInfoModel.cs
  45. 14
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/RefundItemOrderLineEto.cs
  46. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj
  47. 21
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs
  48. 11
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/OrderIdNotFoundException.cs
  49. 7
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs
  50. 7
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundSynchronizer.cs
  51. 10
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs
  52. 28
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundItem.cs
  53. 32
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundItemOrderLine.cs
  54. 134
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs
  55. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs
  56. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs
  57. 30
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs
  58. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/Refunds/RefundController.cs
  59. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj
  60. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml
  61. 3
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.js
  62. 54
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentItem/Index.cshtml
  63. 17
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentItem/Index.cshtml.cs
  64. 0
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentItem/index.css
  65. 49
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentItem/index.js
  66. 5
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml
  67. 5
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.js
  68. 50
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/RefundItem/Index.cshtml
  69. 17
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/RefundItem/Index.cshtml.cs
  70. 0
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/RefundItem/index.css
  71. 46
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/RefundItem/index.js
  72. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json
  73. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json
  74. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json
  75. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json
  76. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json
  77. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json
  78. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json
  79. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hans.json
  80. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hant.json
  81. 3
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/cs.json
  82. 3
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/en.json
  83. 3
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/pl-PL.json
  84. 3
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/pt-BR.json
  85. 3
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/sl.json
  86. 3
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/tr.json
  87. 3
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/vi.json
  88. 3
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/zh-Hans.json
  89. 3
      plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/zh-Hant.json
  90. 4
      samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj
  91. 4
      samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj
  92. 2
      samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/appsettings.json
  93. 4
      samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj
  94. 4
      samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj
  95. 3989
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826083027_AddedRefundItem.Designer.cs
  96. 52
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826083027_AddedRefundItem.cs
  97. 3998
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826083250_AddedRefundItemToDbContext.Designer.cs
  98. 105
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826083250_AddedRefundItemToDbContext.cs
  99. 4047
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826123655_ChangesForOrderRefund.Designer.cs
  100. 116
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826123655_ChangesForOrderRefund.cs

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

@ -22,7 +22,7 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos
public decimal TotalPrice { get; set; }
public decimal RefundedAmount { get; set; }
public decimal RefundAmount { get; set; }
public string CustomerRemark { get; set; }

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs

@ -34,5 +34,9 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos
public decimal TotalDiscount { get; set; }
public int Quantity { get; set; }
public int RefundedQuantity { get; set; }
public decimal RefundAmount { get; set; }
}
}

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

@ -58,7 +58,6 @@ namespace EasyAbp.EShop.Orders.Orders
productTotalPrice: productTotalPrice,
totalDiscount: orderLines.Select(x => x.TotalDiscount).Sum(),
totalPrice: productTotalPrice,
refundedAmount: 0,
customerRemark: input.CustomerRemark);
foreach (var orderExtraProperty in orderExtraProperties)

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

@ -173,10 +173,22 @@ namespace EasyAbp.EShop.Orders.Orders
return MapToGetOutputDto(order);
}
public virtual Task<OrderDto> CancelAsync(Guid id, CancelOrderInput input)
[Authorize(OrdersPermissions.Orders.Cancel)]
public virtual async Task<OrderDto> CancelAsync(Guid id, CancelOrderInput input)
{
throw new NotImplementedException();
var order = await GetEntityByIdAsync(id);
if (order.IsPaid() || order.CustomerUserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(OrdersPermissions.Orders.Manage);
// Todo: Check if current user is an admin of the store.
}
order = await _orderManager.CancelAsync(order, input.CancellationReason);
return MapToGetOutputDto(order);
}
}
}

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs

@ -18,8 +18,8 @@ namespace EasyAbp.EShop.Orders.Orders
decimal TotalDiscount { get; }
decimal TotalPrice { get; }
decimal RefundedAmount { get; }
decimal RefundAmount { get; }
string CustomerRemark { get; }

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs

@ -33,5 +33,9 @@ namespace EasyAbp.EShop.Orders.Orders
decimal TotalDiscount { get; }
int Quantity { get; }
int RefundedQuantity { get; }
decimal RefundAmount { get; }
}
}

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderEto.cs

@ -26,8 +26,8 @@ namespace EasyAbp.EShop.Orders.Orders
public decimal TotalDiscount { get; set; }
public decimal TotalPrice { get; set; }
public decimal RefundedAmount { get; set; }
public decimal RefundAmount { get; set; }
public string CustomerRemark { get; set; }

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs

@ -36,5 +36,9 @@ namespace EasyAbp.EShop.Orders.Orders
public decimal TotalDiscount { get; set; }
public int Quantity { get; set; }
public int RefundedQuantity { get; set; }
public decimal RefundAmount { get; set; }
}
}

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

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="1.1.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.4" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />

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

@ -9,5 +9,7 @@ namespace EasyAbp.EShop.Orders.Orders
Task<Order> DiscountAsync(Order order, Dictionary<string, object> inputExtraProperties);
Task<Order> CompleteAsync(Order order);
Task<Order> CancelAsync(Order order, string cancellationReason);
}
}

12
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/InvalidRefundAmountException.cs

@ -0,0 +1,12 @@
using Volo.Abp;
namespace EasyAbp.EShop.Orders.Orders
{
public class InvalidRefundAmountException : BusinessException
{
public InvalidRefundAmountException(decimal amount)
: base("InvalidRefundAmount", $"The refund amount ({amount}) is invalid.")
{
}
}
}

12
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/InvalidRefundQuantityException.cs

@ -0,0 +1,12 @@
using Volo.Abp;
namespace EasyAbp.EShop.Orders.Orders
{
public class InvalidRefundQuantityException : BusinessException
{
public InvalidRefundQuantityException(int quantity)
: base("InvalidRefundQuantity", $"The refund quantity ({quantity}) is invalid.")
{
}
}
}

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

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
@ -27,8 +28,8 @@ namespace EasyAbp.EShop.Orders.Orders
public virtual decimal TotalDiscount { get; protected set; }
public virtual decimal TotalPrice { get; protected set; }
public virtual decimal RefundedAmount { get; protected set; }
public virtual decimal RefundAmount { get; protected set; }
[CanBeNull]
public virtual string CustomerRemark { get; protected set; }
@ -66,7 +67,6 @@ namespace EasyAbp.EShop.Orders.Orders
decimal productTotalPrice,
decimal totalDiscount,
decimal totalPrice,
decimal refundedAmount,
[CanBeNull] string customerRemark
) : base(id)
{
@ -77,9 +77,10 @@ namespace EasyAbp.EShop.Orders.Orders
ProductTotalPrice = productTotalPrice;
TotalDiscount = totalDiscount;
TotalPrice = totalPrice;
RefundedAmount = refundedAmount;
CustomerRemark = customerRemark;
RefundAmount = 0;
OrderStatus = OrderStatus.Pending;
OrderLines = new List<OrderLine>();
}
@ -124,10 +125,34 @@ namespace EasyAbp.EShop.Orders.Orders
CompletionTime = completionTime;
}
public void Cancel(DateTime canceledTime, [CanBeNull] string reason)
public void Cancel(DateTime canceledTime, [CanBeNull] string cancellationReason)
{
CanceledTime = canceledTime;
CancellationReason = reason;
CancellationReason = cancellationReason;
}
public bool IsPaid()
{
return PaidTime.HasValue;
}
public void Refund(Guid orderLineId, int quantity, decimal amount)
{
if (amount <= decimal.Zero)
{
throw new InvalidRefundAmountException(amount);
}
var orderLine = OrderLines.Single(x => x.Id == orderLineId);
if (orderLine.RefundedQuantity + quantity > orderLine.Quantity)
{
throw new InvalidRefundQuantityException(quantity);
}
orderLine.Refund(quantity, amount);
RefundAmount += amount;
}
}
}

13
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs

@ -43,6 +43,10 @@ namespace EasyAbp.EShop.Orders.Orders
public virtual int Quantity { get; protected set; }
public virtual int RefundedQuantity { get; protected set; }
public virtual decimal RefundAmount { get; protected set; }
protected OrderLine() {}
public OrderLine(
@ -78,6 +82,15 @@ namespace EasyAbp.EShop.Orders.Orders
TotalPrice = totalPrice;
TotalDiscount = totalDiscount;
Quantity = quantity;
RefundedQuantity = 0;
RefundAmount = 0;
}
internal void Refund(int quantity, decimal amount)
{
RefundedQuantity -= quantity;
RefundAmount += amount;
}
}
}

8
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs

@ -48,5 +48,13 @@ namespace EasyAbp.EShop.Orders.Orders
return await _orderRepository.UpdateAsync(order, true);
}
public virtual async Task<Order> CancelAsync(Order order, string cancellationReason)
{
order.Cancel(_clock.Now, cancellationReason);
order.SetOrderStatus(OrderStatus.Canceled);
return await _orderRepository.UpdateAsync(order, true);
}
}
}

35
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderRefundEventHandler.cs

@ -0,0 +1,35 @@
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Refunds;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Uow;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderRefundEventHandler : IDistributedEventHandler<EntityCreatedEto<EShopRefundEto>>, ITransientDependency
{
private readonly IOrderRepository _orderRepository;
public OrderRefundEventHandler(IOrderRepository orderRepository)
{
_orderRepository = orderRepository;
}
[UnitOfWork(true)]
public virtual async Task HandleEventAsync(EntityCreatedEto<EShopRefundEto> eventData)
{
foreach (var refundItem in eventData.Entity.RefundItems)
{
var order = await _orderRepository.GetAsync(refundItem.OrderId);
foreach (var eto in refundItem.RefundItemOrderLines)
{
order.Refund(eto.OrderLineId, eto.RefundedQuantity, eto.RefundAmount);
}
await _orderRepository.UpdateAsync(order, true);
}
}
}
}

3
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs

@ -49,7 +49,7 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore
b.Property(x => x.ProductTotalPrice).HasColumnType("decimal(20,8)");
b.Property(x => x.TotalPrice).HasColumnType("decimal(20,8)");
b.Property(x => x.TotalDiscount).HasColumnType("decimal(20,8)");
b.Property(x => x.RefundedAmount).HasColumnType("decimal(20,8)");
b.Property(x => x.RefundAmount).HasColumnType("decimal(20,8)");
b.HasIndex(x => x.OrderNumber).IsUnique();
});
@ -61,6 +61,7 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore
b.Property(x => x.TotalPrice).HasColumnType("decimal(20,8)");
b.Property(x => x.TotalDiscount).HasColumnType("decimal(20,8)");
b.Property(x => x.UnitPrice).HasColumnType("decimal(20,8)");
b.Property(x => x.RefundAmount).HasColumnType("decimal(20,8)");
});
}
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="1.1.4" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs

@ -12,10 +12,12 @@ namespace EasyAbp.EShop.Payments.Authorization
var paymentPermission = moduleGroup.AddPermission(PaymentsPermissions.Payments.Default, L("Permission:Payments"));
paymentPermission.AddChild(PaymentsPermissions.Payments.Manage, L("Permission:Manage"));
paymentPermission.AddChild(PaymentsPermissions.Payments.CrossStore, L("Permission:CrossStore"));
paymentPermission.AddChild(PaymentsPermissions.Payments.Create, L("Permission:Create"));
var refundPermission = moduleGroup.AddPermission(PaymentsPermissions.Refunds.Default, L("Permission:Refunds"));
refundPermission.AddChild(PaymentsPermissions.Refunds.Manage, L("Permission:Manage"));
refundPermission.AddChild(PaymentsPermissions.Refunds.CrossStore, L("Permission:CrossStore"));
refundPermission.AddChild(PaymentsPermissions.Refunds.Create, L("Permission:Create"));
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs

@ -15,6 +15,7 @@ namespace EasyAbp.EShop.Payments.Authorization
{
public const string Default = GroupName + ".Payment";
public const string Manage = Default + ".Manage";
public const string CrossStore = Default + ".CrossStore";
public const string Create = Default + ".Create";
}
@ -23,6 +24,7 @@ namespace EasyAbp.EShop.Payments.Authorization
{
public const string Default = GroupName + ".Refund";
public const string Manage = Default + ".Manage";
public const string CrossStore = Default + ".CrossStore";
public const string Create = Default + ".Create";
}

7
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs

@ -1,14 +1,17 @@
using System;
using System.Collections.Generic;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class PaymentDto : ExtensibleFullAuditedEntityDto<Guid>
public class PaymentDto : ExtensibleFullAuditedEntityDto<Guid>, IPayment
{
public Guid UserId { get; set; }
public string PaymentMethod { get; set; }
public string PayeeAccount { get; set; }
public string ExternalTradingCode { get; set; }
@ -21,6 +24,8 @@ namespace EasyAbp.EShop.Payments.Payments.Dtos
public decimal ActualPaymentAmount { get; set; }
public decimal RefundAmount { get; set; }
public decimal PendingRefundAmount { get; set; }
public DateTime? CompletionTime { get; set; }

7
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentItemDto.cs

@ -1,16 +1,17 @@
using System;
using System.Collections.Generic;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class PaymentItemDto : ExtensibleFullAuditedEntityDto<Guid>
public class PaymentItemDto : ExtensibleFullAuditedEntityDto<Guid>, IPaymentItem
{
public Guid StoreId { get; set; }
public string ItemType { get; set; }
public Guid ItemKey { get; set; }
public string ItemKey { get; set; }
public string Currency { get; set; }
@ -21,5 +22,7 @@ namespace EasyAbp.EShop.Payments.Payments.Dtos
public decimal ActualPaymentAmount { get; set; }
public decimal RefundAmount { get; set; }
public decimal PendingRefundAmount { get; set; }
}
}

43
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateEShopRefundInput.cs

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using JetBrains.Annotations;
namespace EasyAbp.EShop.Payments.Refunds.Dtos
{
public class CreateEShopRefundInput : IValidatableObject
{
public Guid PaymentId { get; set; }
[CanBeNull]
public string DisplayReason { get; set; }
[CanBeNull]
public string CustomerRemark { get; set; }
[CanBeNull]
public string StaffRemark { get; set; }
public List<CreateEShopRefundItemInput> RefundItems { get; set; } = new List<CreateEShopRefundItemInput>();
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (RefundItems.IsNullOrEmpty())
{
yield return new ValidationResult(
"RefundItems should not be empty!",
new[] { nameof(RefundItems) }
);
}
if (RefundItems.Any(x => x.OrderLines.IsNullOrEmpty()))
{
yield return new ValidationResult(
"RefundItem.OrderLines should not be empty!",
new[] { nameof(CreateEShopRefundItemInput.OrderLines) }
);
}
}
}
}

19
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateEShopRefundItemInput.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
namespace EasyAbp.EShop.Payments.Refunds.Dtos
{
public class CreateEShopRefundItemInput
{
public Guid OrderId { get; set; }
[CanBeNull]
public string CustomerRemark { get; set; }
[CanBeNull]
public string StaffRemark { get; set; }
public List<OrderLineRefundInfoModel> OrderLines { get; set; } = new List<OrderLineRefundInfoModel>();
}
}

16
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs

@ -1,15 +1,13 @@
using System;
using System.Collections.Generic;
using EasyAbp.PaymentService.Refunds;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Refunds.Dtos
{
public class RefundDto : FullAuditedEntityDto<Guid>
public class RefundDto : FullAuditedEntityDto<Guid>, IRefund
{
public Guid? StoreId { get; set; }
public Guid PaymentId { get; set; }
public Guid PaymentItemId { get; set; }
public string RefundPaymentMethod { get; set; }
@ -18,9 +16,17 @@ namespace EasyAbp.EShop.Payments.Refunds.Dtos
public string Currency { get; set; }
public decimal RefundAmount { get; set; }
public string DisplayReason { get; set; }
public string CustomerRemark { get; set; }
public string StaffRemark { get; set; }
public DateTime? CompletedTime { get; set; }
public DateTime? CanceledTime { get; set; }
public List<RefundItemDto> RefundItems { get; set; }
}
}

31
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundItemDto.cs

@ -0,0 +1,31 @@
using System;
using EasyAbp.PaymentService.Payments;
using EasyAbp.PaymentService.Refunds;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Refunds.Dtos
{
public class RefundItemDto : ExtensibleFullAuditedEntityDto<Guid>, IRefund
{
public virtual Guid PaymentId { get; set; }
public virtual string RefundPaymentMethod { get; set; }
public virtual string ExternalTradingCode { get; set; }
public virtual string Currency { get; set; }
public virtual decimal RefundAmount { get; set; }
public virtual string DisplayReason { get; set; }
public virtual string CustomerRemark { get; set; }
public virtual string StaffRemark { get; set; }
public virtual DateTime? CompletedTime { get; set; }
public virtual DateTime? CanceledTime { get; set; }
}
}

4
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs

@ -1,6 +1,6 @@
using System;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Refunds.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace EasyAbp.EShop.Payments.Refunds
@ -11,6 +11,6 @@ namespace EasyAbp.EShop.Payments.Refunds
Guid,
GetRefundListDto>
{
Task CreateAsync(CreateEShopRefundInput input);
}
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs

@ -41,6 +41,7 @@ namespace EasyAbp.EShop.Payments.Payments
_repository = repository;
}
// Todo: should a store owner user see orders of other stores in the same payment/refund?
public override async Task<PaymentDto> GetAsync(Guid id)
{
var payment = await base.GetAsync(id);
@ -65,6 +66,7 @@ namespace EasyAbp.EShop.Payments.Payments
return query;
}
// Todo: should a store owner user see orders of other stores in the same payment/refund?
public override async Task<PagedResultDto<PaymentDto>> GetListAsync(GetPaymentListDto input)
{
if (input.UserId != CurrentUser.GetId())

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/InvalidRefundQuantityException.cs

@ -0,0 +1,12 @@
using Volo.Abp;
namespace EasyAbp.EShop.Payments.Refunds
{
public class InvalidRefundQuantityException : BusinessException
{
public InvalidRefundQuantityException(int quantity)
: base("InvalidRefundQuantity", $"The refund quantity ({quantity}) is invalid.")
{
}
}
}

69
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs

@ -1,13 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Orders;
using EasyAbp.EShop.Payments.Authorization;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Refunds.Dtos;
using EasyAbp.PaymentService.Payments;
using EasyAbp.PaymentService.Refunds;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Data;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Json;
using Volo.Abp.Users;
namespace EasyAbp.EShop.Payments.Refunds
@ -19,17 +25,27 @@ namespace EasyAbp.EShop.Payments.Refunds
protected override string GetPolicyName { get; set; } = PaymentsPermissions.Refunds.Default;
protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Refunds.Default;
private readonly IOrderAppService _orderAppService;
private readonly IDistributedEventBus _distributedEventBus;
private readonly IPaymentRepository _paymentRepository;
private readonly IJsonSerializer _jsonSerializer;
private readonly IRefundRepository _repository;
public RefundAppService(
IOrderAppService orderAppService,
IDistributedEventBus distributedEventBus,
IPaymentRepository paymentRepository,
IJsonSerializer jsonSerializer,
IRefundRepository repository) : base(repository)
{
_orderAppService = orderAppService;
_distributedEventBus = distributedEventBus;
_paymentRepository = paymentRepository;
_jsonSerializer = jsonSerializer;
_repository = repository;
}
// Todo: should a store owner user see orders of other stores in the same payment/refund?
public override async Task<RefundDto> GetAsync(Guid id)
{
var refund = await base.GetAsync(id);
@ -51,6 +67,7 @@ namespace EasyAbp.EShop.Payments.Refunds
return query;
}
// Todo: should a store owner user see orders of other stores in the same payment/refund?
public override async Task<PagedResultDto<RefundDto>> GetListAsync(GetRefundListDto input)
{
if (input.UserId != CurrentUser.GetId())
@ -60,5 +77,55 @@ namespace EasyAbp.EShop.Payments.Refunds
return await base.GetListAsync(input);
}
public virtual async Task CreateAsync(CreateEShopRefundInput input)
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage);
var createRefundInput = new CreateRefundInput
{
PaymentId = input.PaymentId,
DisplayReason = input.DisplayReason,
CustomerRemark = input.CustomerRemark,
StaffRemark = input.StaffRemark
};
foreach (var refundItem in input.RefundItems)
{
var order = await _orderAppService.GetAsync(refundItem.OrderId);
// Todo: Check if current user is an admin of the store.
foreach (var orderLineRefundInfoModel in refundItem.OrderLines)
{
var orderLine = order.OrderLines.Single(x => x.Id == orderLineRefundInfoModel.OrderLineId);
if (orderLine.RefundedQuantity + orderLineRefundInfoModel.Quantity > orderLine.Quantity)
{
throw new InvalidRefundQuantityException(orderLineRefundInfoModel.Quantity);
}
}
createRefundInput.RefundItems.Add(new CreateRefundItemInput
{
PaymentItemId = refundItem.OrderId,
RefundAmount = refundItem.OrderLines.Sum(x => x.TotalAmount),
CustomerRemark = refundItem.CustomerRemark,
StaffRemark = refundItem.StaffRemark,
ExtraProperties = new Dictionary<string, object>
{
{"StoreId", order.StoreId.ToString()},
{"OrderId", order.Id.ToString()},
{"OrderLines", _jsonSerializer.Serialize(refundItem.OrderLines)}
}
});
}
await _distributedEventBus.PublishAsync(new RefundPaymentEto
{
TenantId = CurrentTenant.Id,
CreateRefundInput = createRefundInput
});
}
}
}

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj

@ -10,6 +10,7 @@
<ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="3.0.4" />
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="1.1.4" />
</ItemGroup>
<ItemGroup>

6
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs

@ -1,6 +1,8 @@
using Volo.Abp.Modularity;
using Volo.Abp.Localization;
using EasyAbp.EShop.Payments.Localization;
using EasyAbp.PaymentService;
using EasyAbp.PaymentService.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Validation;
using Volo.Abp.Validation.Localization;
@ -9,7 +11,8 @@ using Volo.Abp.VirtualFileSystem;
namespace EasyAbp.EShop.Payments
{
[DependsOn(
typeof(AbpValidationModule)
typeof(AbpValidationModule),
typeof(PaymentServiceDomainSharedModule)
)]
public class EShopPaymentsDomainSharedModule : AbpModule
{
@ -25,6 +28,7 @@ namespace EasyAbp.EShop.Payments
options.Resources
.Add<PaymentsResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddBaseTypes(typeof(PaymentServiceResource))
.AddVirtualJson("/EasyAbp/EShop/Payments/Localization/Payments");
});

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json

@ -2,30 +2,11 @@
"culture": "cs",
"texts": {
"Permission:Payments": "Payments",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:Payment": "MenuPayments",
"Payment": "Payment",
"PaymentStoreId": "PaymentStoreId",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"PaymentItemStoreId": "PaymentItemStoreId",
"Permission:Refunds": "Refunds",
"Menu:Refund": "MenuRefunds",
"Refund": "Refund",
"RefundStoreId": "RefundStoreId",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?"
"Menu:RefundItem": "MenuRefundsItem",
"RefundItemStoreId": "RefundItemStoreId"
}
}

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json

@ -3,30 +3,11 @@
"texts": {
"ManageYourProfile": "Manage your profile",
"Permission:Payments": "Payments",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:Payment": "MenuPayments",
"Payment": "Payment",
"PaymentStoreId": "PaymentStoreId",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"PaymentItemStoreId": "PaymentItemStoreId",
"Permission:Refunds": "Refunds",
"Menu:Refund": "MenuRefunds",
"Refund": "Refund",
"RefundStoreId": "RefundStoreId",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?"
"Menu:RefundItem": "MenuRefundsItem",
"RefundItemStoreId": "RefundItemStoreId"
}
}

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json

@ -2,30 +2,11 @@
"culture": "pl",
"texts": {
"Permission:Payments": "Payments",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:Payment": "MenuPayments",
"Payment": "Payment",
"PaymentStoreId": "PaymentStoreId",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"PaymentItemStoreId": "PaymentItemStoreId",
"Permission:Refunds": "Refunds",
"Menu:Refund": "MenuRefunds",
"Refund": "Refund",
"RefundStoreId": "RefundStoreId",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?"
"Menu:RefundItem": "MenuRefundsItem",
"RefundItemStoreId": "RefundItemStoreId"
}
}

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json

@ -2,30 +2,11 @@
"culture": "pt-BR",
"texts": {
"Permission:Payments": "Payments",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:Payment": "MenuPayments",
"Payment": "Payment",
"PaymentStoreId": "PaymentStoreId",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"PaymentItemStoreId": "PaymentItemStoreId",
"Permission:Refunds": "Refunds",
"Menu:Refund": "MenuRefunds",
"Refund": "Refund",
"RefundStoreId": "RefundStoreId",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?"
"Menu:RefundItem": "MenuRefundsItem",
"RefundItemStoreId": "RefundItemStoreId"
}
}

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json

@ -3,30 +3,11 @@
"texts": {
"ManageYourProfile": "Upravljajte svojim profilom",
"Permission:Payments": "Payments",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:Payment": "MenuPayments",
"Payment": "Payment",
"PaymentStoreId": "PaymentStoreId",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"PaymentItemStoreId": "PaymentItemStoreId",
"Permission:Refunds": "Refunds",
"Menu:Refund": "MenuRefunds",
"Refund": "Refund",
"RefundStoreId": "RefundStoreId",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?"
"Menu:RefundItem": "MenuRefundsItem",
"RefundItemStoreId": "RefundItemStoreId"
}
}

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json

@ -3,30 +3,11 @@
"texts": {
"ManageYourProfile": "Profil y�netimi",
"Permission:Payments": "Payments",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:Payment": "MenuPayments",
"Payment": "Payment",
"PaymentStoreId": "PaymentStoreId",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"PaymentItemStoreId": "PaymentItemStoreId",
"Permission:Refunds": "Refunds",
"Menu:Refund": "MenuRefunds",
"Refund": "Refund",
"RefundStoreId": "RefundStoreId",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?"
"Menu:RefundItem": "MenuRefundsItem",
"RefundItemStoreId": "RefundItemStoreId"
}
}

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json

@ -2,30 +2,11 @@
"culture": "vi",
"texts": {
"Permission:Payments": "Payments",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:Payment": "MenuPayments",
"Payment": "Payment",
"PaymentStoreId": "PaymentStoreId",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"PaymentItemStoreId": "PaymentItemStoreId",
"Permission:Refunds": "Refunds",
"Menu:Refund": "MenuRefunds",
"Refund": "Refund",
"RefundStoreId": "RefundStoreId",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?"
"Menu:RefundItem": "MenuRefundsItem",
"RefundItemStoreId": "RefundItemStoreId"
}
}

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json

@ -3,30 +3,11 @@
"texts": {
"ManageYourProfile": "管理个人资料",
"Permission:Payments": "Payments",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:Payment": "MenuPayments",
"Payment": "Payment",
"PaymentStoreId": "PaymentStoreId",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"PaymentItemStoreId": "PaymentItemStoreId",
"Permission:Refunds": "Refunds",
"Menu:Refund": "MenuRefunds",
"Refund": "Refund",
"RefundStoreId": "RefundStoreId",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?"
"Menu:RefundItem": "MenuRefundsItem",
"RefundItemStoreId": "RefundItemStoreId"
}
}

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json

@ -3,30 +3,11 @@
"texts": {
"ManageYourProfile": "管理個人資料",
"Permission:Payments": "Payments",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:Payment": "MenuPayments",
"Payment": "Payment",
"PaymentStoreId": "PaymentStoreId",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"PaymentItemStoreId": "PaymentItemStoreId",
"Permission:Refunds": "Refunds",
"Menu:Refund": "MenuRefunds",
"Refund": "Refund",
"RefundStoreId": "RefundStoreId",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?"
"Menu:RefundItem": "MenuRefundsItem",
"RefundItemStoreId": "RefundItemStoreId"
}
}

44
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundEto.cs

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using EasyAbp.PaymentService.Refunds;
using Volo.Abp.Data;
using Volo.Abp.MultiTenancy;
namespace EasyAbp.EShop.Payments.Refunds
{
[Serializable]
public class EShopRefundEto : IRefund, IMultiTenant, IHasExtraProperties
{
#region Base properties
public Guid Id { get; set; }
public Guid? TenantId { get; set; }
public Guid PaymentId { get; set; }
public string RefundPaymentMethod { get; set; }
public string ExternalTradingCode { get; set; }
public string Currency { get; set; }
public decimal RefundAmount { get; set; }
public string DisplayReason { get; set; }
public string CustomerRemark { get; set; }
public string StaffRemark { get; set; }
public DateTime? CompletedTime { get; set; }
public DateTime? CanceledTime { get; set; }
public Dictionary<string, object> ExtraProperties { get; set; }
#endregion
public List<EShopRefundItemEto> RefundItems { get; set; } = new List<EShopRefundItemEto>();
}
}

33
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundItemEto.cs

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using EasyAbp.PaymentService.Refunds;
using Volo.Abp.Data;
namespace EasyAbp.EShop.Payments.Refunds
{
[Serializable]
public class EShopRefundItemEto : IRefundItem, IHasExtraProperties
{
#region Base properties
public Guid Id { get; set; }
public Guid PaymentItemId { get; set; }
public decimal RefundAmount { get; set; }
public string CustomerRemark { get; set; }
public string StaffRemark { get; set; }
public Dictionary<string, object> ExtraProperties { get; set; }
#endregion
public Guid StoreId { get; set; }
public Guid OrderId { get; set; }
public List<RefundItemOrderLineEto> RefundItemOrderLines { get; set; } = new List<RefundItemOrderLineEto>();
}
}

13
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderLineRefundInfoModel.cs

@ -0,0 +1,13 @@
using System;
namespace EasyAbp.EShop.Payments.Refunds
{
public class OrderLineRefundInfoModel
{
public Guid OrderLineId { get; set; }
public int Quantity { get; set; }
public decimal TotalAmount { get; set; }
}
}

14
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/RefundItemOrderLineEto.cs

@ -0,0 +1,14 @@
using System;
namespace EasyAbp.EShop.Payments.Refunds
{
[Serializable]
public class RefundItemOrderLineEto
{
public Guid OrderLineId { get; set; }
public int RefundedQuantity { get; set; }
public decimal RefundAmount { get; set; }
}
}

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

@ -8,7 +8,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="1.1.0" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.4" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Domain.Shared\EasyAbp.EShop.Stores.Domain.Shared.csproj" />

21
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs

@ -1,7 +1,11 @@
using EasyAbp.EShop.Stores;
using EasyAbp.PaymentService;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Refunds;
using EasyAbp.EShop.Stores;
using EasyAbp.PaymentService.Payments;
using EasyAbp.PaymentService.Refunds;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Modularity;
namespace EasyAbp.EShop.Payments
@ -9,11 +13,20 @@ namespace EasyAbp.EShop.Payments
[DependsOn(
typeof(AbpAutoMapperModule),
typeof(EShopPaymentsDomainSharedModule),
typeof(EShopStoresDomainSharedModule),
typeof(PaymentServiceDomainSharedModule)
typeof(EShopStoresDomainSharedModule)
)]
public class EShopPaymentsDomainModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpDistributedEntityEventOptions>(options =>
{
options.EtoMappings.Add<Refund, RefundEto>(typeof(EShopPaymentsDomainModule));
options.AutoEventSelectors.Add<Refund>();
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<EShopPaymentsDomainModule>();

11
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/OrderIdNotFoundException.cs

@ -0,0 +1,11 @@
using Volo.Abp;
namespace EasyAbp.EShop.Payments
{
public class OrderIdNotFoundException : BusinessException
{
public OrderIdNotFoundException() : base(message: $"Cannot get valid OrderId from ExtraProperties.")
{
}
}
}

7
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs

@ -1,6 +1,8 @@
using AutoMapper;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Refunds;
using EasyAbp.PaymentService.Payments;
using EasyAbp.PaymentService.Refunds;
using Volo.Abp.AutoMapper;
namespace EasyAbp.EShop.Payments
@ -17,6 +19,11 @@ namespace EasyAbp.EShop.Payments
.Ignore(x => x.PaymentItems);
CreateMap<PaymentItemEto, PaymentItem>(MemberList.Source)
.Ignore(x => x.StoreId);
CreateMap<RefundEto, Refund>(MemberList.Source)
.Ignore(x => x.RefundItems);
CreateMap<RefundItemEto, RefundItem>(MemberList.Source)
.Ignore(x => x.StoreId);
}
}
}

7
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundSynchronizer.cs

@ -0,0 +1,7 @@
namespace EasyAbp.EShop.Payments.Refunds
{
public interface IRefundSynchronizer
{
}
}

10
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs

@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
using AutoMapper;
using EasyAbp.PaymentService.Refunds;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace EasyAbp.EShop.Payments.Refunds
{
[AutoMap(typeof(EShopRefundEto))]
public class Refund : FullAuditedAggregateRoot<Guid>, IRefund
{
#region Base properties
@ -35,6 +38,8 @@ namespace EasyAbp.EShop.Payments.Refunds
public virtual DateTime? CompletedTime { get; protected set; }
public virtual DateTime? CanceledTime { get; protected set; }
public virtual List<RefundItem> RefundItems { get; protected set; }
#endregion
@ -42,5 +47,10 @@ namespace EasyAbp.EShop.Payments.Refunds
{
}
public void SetRefundItems(List<RefundItem> refundItems)
{
RefundItems = refundItems;
}
}
}

28
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundItem.cs

@ -1,11 +1,17 @@
using System;
using System.Collections.Generic;
using AutoMapper;
using EasyAbp.EShop.Stores.Stores;
using EasyAbp.PaymentService.Refunds;
using JetBrains.Annotations;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities.Auditing;
namespace EasyAbp.EShop.Payments.Refunds
{
public class RefundItem : FullAuditedEntity<Guid>, IRefundItem
[AutoMap(typeof(EShopRefundItemEto))]
public class RefundItem : FullAuditedEntity<Guid>, IRefundItem, IMultiStore, IHasExtraProperties
{
#region Base properties
@ -17,18 +23,30 @@ namespace EasyAbp.EShop.Payments.Refunds
public virtual string StaffRemark { get; protected set; }
public virtual Dictionary<string, object> ExtraProperties { get; set; }
#endregion
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid OrderId { get; protected set; }
public virtual List<RefundItemOrderLine> RefundItemOrderLines { get; protected set; }
private RefundItem()
protected RefundItem()
{
ExtraProperties = new Dictionary<string, object>();
RefundItemOrderLines = new List<RefundItemOrderLine>();
}
public void SetStoreId(Guid? storeId)
public void SetStoreId(Guid storeId)
{
StoreId = storeId;
}
public void SetOrderId(Guid orderId)
{
OrderId = orderId;
}
}
}

32
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundItemOrderLine.cs

@ -0,0 +1,32 @@
using System;
using AutoMapper;
using Volo.Abp.Domain.Entities;
namespace EasyAbp.EShop.Payments.Refunds
{
[AutoMap(typeof(RefundItemOrderLineEto))]
public class RefundItemOrderLine : Entity<Guid>
{
public virtual Guid OrderLineId { get; protected set; }
public virtual int RefundedQuantity { get; protected set; }
public virtual decimal RefundAmount { get; protected set; }
protected RefundItemOrderLine()
{
}
public RefundItemOrderLine(
Guid id,
Guid orderLineId,
int refundedQuantity,
decimal refundAmount
) : base(id)
{
OrderLineId = orderLineId;
RefundedQuantity = refundedQuantity;
RefundAmount = refundAmount;
}
}
}

134
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs

@ -0,0 +1,134 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.PaymentService.Refunds;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids;
using Volo.Abp.Json;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow;
namespace EasyAbp.EShop.Payments.Refunds
{
public class RefundSynchronizer :
IDistributedEventHandler<EntityUpdatedEto<EShopRefundEto>>,
IDistributedEventHandler<EntityDeletedEto<EShopRefundEto>>,
IRefundSynchronizer,
ITransientDependency
{
private readonly IObjectMapper _objectMapper;
private readonly IGuidGenerator _guidGenerator;
private readonly IJsonSerializer _jsonSerializer;
private readonly IRefundRepository _refundRepository;
public RefundSynchronizer(
IObjectMapper objectMapper,
IGuidGenerator guidGenerator,
IJsonSerializer jsonSerializer,
IRefundRepository refundRepository)
{
_objectMapper = objectMapper;
_guidGenerator = guidGenerator;
_jsonSerializer = jsonSerializer;
_refundRepository = refundRepository;
}
[UnitOfWork(true)]
public virtual async Task HandleEventAsync(EntityUpdatedEto<EShopRefundEto> eventData)
{
var refund = await _refundRepository.FindAsync(eventData.Entity.Id);
if (refund == null)
{
refund = _objectMapper.Map<EShopRefundEto, Refund>(eventData.Entity);
refund.SetRefundItems(
_objectMapper.Map<List<EShopRefundItemEto>, List<RefundItem>>(eventData.Entity.RefundItems));
await _refundRepository.InsertAsync(refund, true);
}
else
{
_objectMapper.Map(eventData.Entity, refund);
foreach (var etoItem in eventData.Entity.RefundItems)
{
var item = refund.RefundItems.FirstOrDefault(i => i.Id == etoItem.Id);
if (item == null)
{
if (!Guid.TryParse(etoItem.GetProperty<string>("StoreId"), out var storeId))
{
throw new StoreIdNotFoundException();
}
if (!Guid.TryParse(etoItem.GetProperty<string>("OrderId"), out var orderId))
{
throw new OrderIdNotFoundException();
}
item = _objectMapper.Map<EShopRefundItemEto, RefundItem>(etoItem);
item.SetStoreId(storeId);
item.SetOrderId(orderId);
refund.RefundItems.Add(item);
}
else
{
_objectMapper.Map(etoItem, item);
}
}
var etoRefundItemIds = eventData.Entity.RefundItems.Select(i => i.Id).ToList();
refund.RefundItems.RemoveAll(i => !etoRefundItemIds.Contains(i.Id));
}
foreach (var refundItem in refund.RefundItems)
{
var orderLineInfoModels =
_jsonSerializer.Deserialize<List<OrderLineRefundInfoModel>>(
refundItem.GetProperty<string>("OrderLines"));
foreach (var orderLineInfoModel in orderLineInfoModels)
{
var refundItemOrderLineEntity =
refundItem.RefundItemOrderLines.FirstOrDefault(x =>
x.OrderLineId == orderLineInfoModel.OrderLineId);
if (refundItemOrderLineEntity == null)
{
refundItemOrderLineEntity = new RefundItemOrderLine(_guidGenerator.Create(),
orderLineInfoModel.OrderLineId, orderLineInfoModel.Quantity,
orderLineInfoModel.TotalAmount);
refundItem.RefundItemOrderLines.Add(refundItemOrderLineEntity);
}
var orderLineIds = orderLineInfoModels.Select(i => i.OrderLineId).ToList();
refundItem.RefundItemOrderLines.RemoveAll(i => !orderLineIds.Contains(i.OrderLineId));
}
}
await _refundRepository.UpdateAsync(refund, true);
}
public virtual async Task HandleEventAsync(EntityDeletedEto<EShopRefundEto> eventData)
{
var refund = await _refundRepository.FindAsync(eventData.Entity.Id);
if (refund == null)
{
return;
}
await _refundRepository.DeleteAsync(refund, true);
}
}
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs

@ -15,5 +15,7 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
DbSet<Payment> Payments { get; set; }
DbSet<PaymentItem> PaymentItems { get; set; }
DbSet<Refund> Refunds { get; set; }
DbSet<RefundItem> RefundItems { get; set; }
DbSet<RefundItemOrderLine> RefundItemOrderLines { get; set; }
}
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs

@ -15,6 +15,8 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
public DbSet<Payment> Payments { get; set; }
public DbSet<PaymentItem> PaymentItems { get; set; }
public DbSet<Refund> Refunds { get; set; }
public DbSet<RefundItem> RefundItems { get; set; }
public DbSet<RefundItemOrderLine> RefundItemOrderLines { get; set; }
public PaymentsDbContext(DbContextOptions<PaymentsDbContext> options)
: base(options)

30
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs

@ -54,6 +54,18 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
b.Property(x => x.PendingRefundAmount).HasColumnType("decimal(20,8)");
});
builder.Entity<PaymentItem>(b =>
{
b.ToTable(options.TablePrefix + "PaymentItems", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
b.Property(x => x.ActualPaymentAmount).HasColumnType("decimal(20,8)");
b.Property(x => x.OriginalPaymentAmount).HasColumnType("decimal(20,8)");
b.Property(x => x.PaymentDiscount).HasColumnType("decimal(20,8)");
b.Property(x => x.RefundAmount).HasColumnType("decimal(20,8)");
b.Property(x => x.PendingRefundAmount).HasColumnType("decimal(20,8)");
});
builder.Entity<Refund>(b =>
{
b.ToTable(options.TablePrefix + "Refunds", options.Schema);
@ -61,17 +73,21 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
/* Configure more properties here */
b.Property(x => x.RefundAmount).HasColumnType("decimal(20,8)");
});
builder.Entity<PaymentItem>(b =>
builder.Entity<RefundItem>(b =>
{
b.ToTable(options.TablePrefix + "PaymentItems", options.Schema);
b.ToTable(options.TablePrefix + "RefundItems", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
b.Property(x => x.RefundAmount).HasColumnType("decimal(20,8)");
});
builder.Entity<RefundItemOrderLine>(b =>
{
b.ToTable(options.TablePrefix + "RefundItemOrderLines", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
b.Property(x => x.ActualPaymentAmount).HasColumnType("decimal(20,8)");
b.Property(x => x.OriginalPaymentAmount).HasColumnType("decimal(20,8)");
b.Property(x => x.PaymentDiscount).HasColumnType("decimal(20,8)");
b.Property(x => x.RefundAmount).HasColumnType("decimal(20,8)");
b.Property(x => x.PendingRefundAmount).HasColumnType("decimal(20,8)");
});
}
}

6
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/Refunds/RefundController.cs

@ -30,5 +30,11 @@ namespace EasyAbp.EShop.Payments.Refunds
{
return _service.GetListAsync(input);
}
[HttpPost]
public Task CreateAsync(CreateEShopRefundInput input)
{
return _service.CreateAsync(input);
}
}
}

8
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj

@ -32,6 +32,14 @@
<Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.js" />
<Content Remove="wwwroot\**\*.*" />
<Content Update="Pages\EShop\Payments\Payments\PaymentItem\Index.cshtml">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Update="Pages\EShop\Payments\Refunds\RefundItem\Index.cshtml">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml

@ -49,7 +49,6 @@
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["PaymentStoreId"]</th>
<th>@L["PaymentPaymentMethod"]</th>
<th>@L["PaymentExternalTradingCode"]</th>
<th>@L["PaymentCurrency"]</th>
@ -57,6 +56,7 @@
<th>@L["PaymentPaymentDiscount"]</th>
<th>@L["PaymentActualPaymentAmount"]</th>
<th>@L["PaymentRefundAmount"]</th>
<th>@L["PaymentPendingRefundAmount"]</th>
<th>@L["PaymentCompletionTime"]</th>
<th>@L["PaymentCanceledTime"]</th>
</tr>

3
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.js

@ -21,12 +21,12 @@ $(function () {
{
text: l('PaymentItem'),
action: function (data) {
document.location.href = document.location.origin + '/EShop/Payments/Payments/PaymentItem?PaymentId=' + data.record.id;
}
}
]
}
},
{ data: "storeId" },
{ data: "paymentMethod" },
{ data: "externalTradingCode" },
{ data: "currency" },
@ -34,6 +34,7 @@ $(function () {
{ data: "paymentDiscount" },
{ data: "actualPaymentAmount" },
{ data: "refundAmount" },
{ data: "pendingRefundAmount" },
{ data: "completionTime" },
{ data: "canceledTime" },
]

54
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentItem/Index.cshtml

@ -0,0 +1,54 @@
@page
@using EasyAbp.EShop.Payments.Localization
@using EasyAbp.EShop.Payments.Web.Menus
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.PaymentItem
@model IndexModel
@inject IPageLayout PageLayout
@inject IHtmlLocalizer<PaymentsResource> L
@{
PageLayout.Content.Title = L["PaymentItem"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:PaymentItem"].Value);
PageLayout.Content.MenuItemName = PaymentsMenus.Payment;
}
@section scripts
{
<abp-script src="/Pages/EShop/Payments/Payments/PaymentItem/index.js" />
}
@section styles
{
<abp-style src="/Pages/EShop/Payments/Payments/PaymentItem/index.css"/>
}
<script>
var paymentId = '@Model.PaymentId';
</script>
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["PaymentItem"]</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="PaymentItemTable" class="nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["PaymentItemStoreId"]</th>
<th>@L["PaymentItemItemType"]</th>
<th>@L["PaymentItemItemKey"]</th>
<th>@L["PaymentItemOriginalPaymentAmount"]</th>
<th>@L["PaymentItemPaymentDiscount"]</th>
<th>@L["PaymentItemActualPaymentAmount"]</th>
<th>@L["PaymentItemRefundAmount"]</th>
<th>@L["PaymentItemPendingRefundAmount"]</th>
</tr>
</thead>
</abp-table>
</abp-card-body>
</abp-card>

17
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentItem/Index.cshtml.cs

@ -0,0 +1,17 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.PaymentItem
{
public class IndexModel : PaymentsPageModel
{
[BindProperty(SupportsGet = true)]
public Guid PaymentId { get; set; }
public async Task OnGetAsync()
{
await Task.CompletedTask;
}
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentItem/index.css

49
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentItem/index.js

@ -0,0 +1,49 @@
$(function () {
var l = abp.localization.getResource('EasyAbpEShopPayments');
var service = easyAbp.eShop.payments.payments.payment;
var dataTable = $('#PaymentItemTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
searching: false,
autoWidth: false,
scrollCollapse: true,
order: [[1, "asc"]],
ajax: function (requestData, callback, settings) {
if (callback) {
service.get(paymentId).then(function (result) {
callback({
recordsTotal: result.paymentItems.length,
recordsFiltered: result.paymentItems.length,
data: result.paymentItems
});
});
}
},
columnDefs: [
{
rowAction: {
items:
[
{
text: l('Detail'),
action: function (data) {
}
}
]
}
},
{ data: "storeId" },
{ data: "itemType" },
{ data: "itemKey" },
{ data: "originalPaymentAmount" },
{ data: "paymentDiscount" },
{ data: "actualPaymentAmount" },
{ data: "refundAmount" },
{ data: "pendingRefundAmount" },
]
}));
});

5
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml

@ -50,15 +50,16 @@
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["RefundStoreId"]</th>
<th>@L["RefundPaymentId"]</th>
<th>@L["RefundPaymentItemId"]</th>
<th>@L["RefundRefundPaymentMethod"]</th>
<th>@L["RefundExternalTradingCode"]</th>
<th>@L["RefundCurrency"]</th>
<th>@L["RefundRefundAmount"]</th>
<th>@L["RefundDisplayReason"]</th>
<th>@L["RefundCustomerRemark"]</th>
<th>@L["RefundStaffRemark"]</th>
<th>@L["RefundCompletedTime"]</th>
<th>@L["RefundCanceledTime"]</th>
</tr>
</thead>
</abp-table>

5
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.js

@ -28,15 +28,16 @@ $(function () {
]
}
},
{ data: "storeId" },
{ data: "paymentId" },
{ data: "paymentItemId" },
{ data: "refundPaymentMethod" },
{ data: "externalTradingCode" },
{ data: "currency" },
{ data: "refundAmount" },
{ data: "displayReason" },
{ data: "customerRemark" },
{ data: "staffRemark" },
{ data: "completedTime" },
{ data: "canceledTime" },
]
}));

50
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/RefundItem/Index.cshtml

@ -0,0 +1,50 @@
@page
@using EasyAbp.EShop.Payments.Localization
@using EasyAbp.EShop.Payments.Web.Menus
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@model EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Refunds.RefundItem.IndexModel
@inject IPageLayout PageLayout
@inject IHtmlLocalizer<PaymentsResource> L
@{
PageLayout.Content.Title = L["RefundItem"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:RefundItem"].Value);
PageLayout.Content.MenuItemName = PaymentsMenus.Refund;
}
@section scripts
{
<abp-script src="/Pages/EShop/Payments/Refunds/RefundItem/index.js" />
}
@section styles
{
<abp-style src="/Pages/EShop/Payments/Refunds/RefundItem/index.css"/>
}
<script>
var refundId = '@Model.RefundId';
</script>
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["RefundItem"]</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="RefundTable" class="nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["RefundItemStoreId"]</th>
<th>@L["RefundItemPaymentItemId"]</th>
<th>@L["RefundItemRefundAmount"]</th>
<th>@L["RefundItemCustomerRemark"]</th>
<th>@L["RefundItemStaffRemark"]</th>
</tr>
</thead>
</abp-table>
</abp-card-body>
</abp-card>

17
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/RefundItem/Index.cshtml.cs

@ -0,0 +1,17 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Refunds.RefundItem
{
public class IndexModel : PaymentsPageModel
{
[BindProperty(SupportsGet = true)]
public Guid RefundId { get; set; }
public async Task OnGetAsync()
{
await Task.CompletedTask;
}
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/RefundItem/index.css

46
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/RefundItem/index.js

@ -0,0 +1,46 @@
$(function () {
var l = abp.localization.getResource('EasyAbpEShopPayments');
var service = easyAbp.eShop.payments.refunds.refund;
var dataTable = $('#RefundTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
searching: false,
autoWidth: false,
scrollCollapse: true,
order: [[1, "asc"]],
ajax: function (requestData, callback, settings) {
if (callback) {
service.get(refundId).then(function (result) {
callback({
recordsTotal: result.refundItems.length,
recordsFiltered: result.refundItems.length,
data: result.refundItems
});
});
}
},
columnDefs: [
{
rowAction: {
items:
[
{
text: l('Detail'),
action: function (data) {
}
},
]
}
},
{ data: "storeId" },
{ data: "paymentItemId" },
{ data: "refundAmount" },
{ data: "customerRemark" },
{ data: "staffRemark" },
]
}));
});

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

@ -80,9 +80,6 @@
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"ProductInventory": "ProductInventory",
"ProductInventoryChangeType": "ProductInventoryChangeType",
"IncreaseInventory": "Increase",

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

@ -81,9 +81,6 @@
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"ProductInventory": "ProductInventory",
"ProductInventoryChangeType": "ProductInventoryChangeType",
"IncreaseInventory": "Increase",

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

@ -80,9 +80,6 @@
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"ProductInventory": "ProductInventory",
"ProductInventoryChangeType": "ProductInventoryChangeType",
"IncreaseInventory": "Increase",

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

@ -80,9 +80,6 @@
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"ProductInventory": "ProductInventory",
"ProductInventoryChangeType": "ProductInventoryChangeType",
"IncreaseInventory": "Increase",

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

@ -81,9 +81,6 @@
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"ProductInventory": "ProductInventory",
"ProductInventoryChangeType": "ProductInventoryChangeType",
"IncreaseInventory": "Increase",

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

@ -81,9 +81,6 @@
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"ProductInventory": "ProductInventory",
"ProductInventoryChangeType": "ProductInventoryChangeType",
"IncreaseInventory": "Increase",

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

@ -80,9 +80,6 @@
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"ProductInventory": "ProductInventory",
"ProductInventoryChangeType": "ProductInventoryChangeType",
"IncreaseInventory": "Increase",

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

@ -81,9 +81,6 @@
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"ProductInventory": "ProductInventory",
"ProductInventoryChangeType": "ProductInventoryChangeType",
"IncreaseInventory": "Increase",

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

@ -81,9 +81,6 @@
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"ProductInventory": "ProductInventory",
"ProductInventoryChangeType": "ProductInventoryChangeType",
"IncreaseInventory": "Increase",

3
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/cs.json

@ -3,9 +3,6 @@
"texts": {
"ManageYourProfile": "Spravovat profil",
"Permission:BasketItem": "BasketItem",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:BasketItem": "MenuBasketItem",
"BasketItem": "BasketItem",
"BasketItemBasketName": "BasketItemBasketName",

3
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/en.json

@ -4,9 +4,6 @@
"ManageYourProfile": "Manage your profile",
"SamplePageMessage": "A sample page for the Baskets module",
"Permission:BasketItem": "BasketItem",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:BasketItem": "MenuBasketItem",
"BasketItem": "BasketItem",
"BasketItemBasketName": "BasketItemBasketName",

3
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/pl-PL.json

@ -2,9 +2,6 @@
"culture": "pl-PL",
"texts": {
"Permission:BasketItem": "BasketItem",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:BasketItem": "MenuBasketItem",
"BasketItem": "BasketItem",
"BasketItemBasketName": "BasketItemBasketName",

3
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/pt-BR.json

@ -2,9 +2,6 @@
"culture": "pt-BR",
"texts": {
"Permission:BasketItem": "BasketItem",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:BasketItem": "MenuBasketItem",
"BasketItem": "BasketItem",
"BasketItemBasketName": "BasketItemBasketName",

3
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/sl.json

@ -3,9 +3,6 @@
"texts": {
"ManageYourProfile": "Upravljajte svojim profilom",
"Permission:BasketItem": "BasketItem",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:BasketItem": "MenuBasketItem",
"BasketItem": "BasketItem",
"BasketItemBasketName": "BasketItemBasketName",

3
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/tr.json

@ -4,9 +4,6 @@
"ManageYourProfile": "Profil yönetimi",
"SamplePageMessage": "Baskets modulünden örnek bir sayfa",
"Permission:BasketItem": "BasketItem",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:BasketItem": "MenuBasketItem",
"BasketItem": "BasketItem",
"BasketItemBasketName": "BasketItemBasketName",

3
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/vi.json

@ -2,9 +2,6 @@
"culture": "vi",
"texts": {
"Permission:BasketItem": "BasketItem",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:BasketItem": "MenuBasketItem",
"BasketItem": "BasketItem",
"BasketItemBasketName": "BasketItemBasketName",

3
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/zh-Hans.json

@ -3,9 +3,6 @@
"texts": {
"ManageYourProfile": "管理个人资料",
"Permission:BasketItem": "BasketItem",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:BasketItem": "MenuBasketItem",
"BasketItem": "BasketItem",
"BasketItemBasketName": "BasketItemBasketName",

3
plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp/EShop/Plugins/Baskets/Localization/zh-Hant.json

@ -3,9 +3,6 @@
"texts": {
"ManageYourProfile": "管理個人資料",
"Permission:BasketItem": "BasketItem",
"Permission:Create": "Create",
"Permission:Update": "Update",
"Permission:Delete": "Delete",
"Menu:BasketItem": "MenuBasketItem",
"BasketItem": "BasketItem",
"BasketItemBasketName": "BasketItemBasketName",

4
samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj

@ -14,8 +14,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Application.Contracts" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application.Contracts" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.Application.Contracts" Version="1.1.4" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application.Contracts" Version="1.1.4" />
<PackageReference Include="Volo.Abp.ObjectExtending" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="3.0.4" />

4
samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj

@ -15,8 +15,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Application" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.Application" Version="1.1.4" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application" Version="1.1.4" />
<PackageReference Include="Volo.Abp.Account.Application" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="3.0.4" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="3.0.4" />

2
samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/appsettings.json

@ -1,6 +1,6 @@
{
"ConnectionStrings": {
"Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=EShopSample;Trusted_Connection=True;MultipleActiveResultSets=true"
"Default": "Server=60.208.32.153;Database=fenghui01test;User Id=fenghui01test;Password=WYSytJdMORYnhTYmvf;Trusted_Connection=True;Integrated Security=false"
},
"IdentityServer": {
"Clients": {

4
samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj

@ -9,8 +9,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain.Shared" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="1.1.4" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain.Shared" Version="1.1.4" />
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="3.0.4" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="3.0.4" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="3.0.4" />

4
samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj

@ -14,8 +14,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain" Version="1.1.0" />
<PackageReference Include="EasyAbp.PaymentService.Domain" Version="1.1.4" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain" Version="1.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="3.0.4" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="3.0.4" />

3989
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826083027_AddedRefundItem.Designer.cs

File diff suppressed because it is too large

52
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826083027_AddedRefundItem.cs

@ -0,0 +1,52 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedRefundItem : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RefundItem",
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),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
PaymentItemId = table.Column<Guid>(nullable: false),
RefundAmount = table.Column<decimal>(nullable: false),
CustomerRemark = table.Column<string>(nullable: true),
StaffRemark = table.Column<string>(nullable: true),
StoreId = table.Column<Guid>(nullable: true),
RefundId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RefundItem", x => x.Id);
table.ForeignKey(
name: "FK_RefundItem_EasyAbpEShopPaymentsRefunds_RefundId",
column: x => x.RefundId,
principalTable: "EasyAbpEShopPaymentsRefunds",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_RefundItem_RefundId",
table: "RefundItem",
column: "RefundId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RefundItem");
}
}
}

3998
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826083250_AddedRefundItemToDbContext.Designer.cs

File diff suppressed because it is too large

105
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826083250_AddedRefundItemToDbContext.cs

@ -0,0 +1,105 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedRefundItemToDbContext : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_RefundItem_EasyAbpEShopPaymentsRefunds_RefundId",
table: "RefundItem");
migrationBuilder.DropPrimaryKey(
name: "PK_RefundItem",
table: "RefundItem");
migrationBuilder.RenameTable(
name: "RefundItem",
newName: "EasyAbpEShopPaymentsRefundItems");
migrationBuilder.RenameIndex(
name: "IX_RefundItem_RefundId",
table: "EasyAbpEShopPaymentsRefundItems",
newName: "IX_EasyAbpEShopPaymentsRefundItems_RefundId");
migrationBuilder.AlterColumn<decimal>(
name: "RefundAmount",
table: "EasyAbpEShopPaymentsRefundItems",
type: "decimal(20,8)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<bool>(
name: "IsDeleted",
table: "EasyAbpEShopPaymentsRefundItems",
nullable: false,
defaultValue: false,
oldClrType: typeof(bool),
oldType: "bit");
migrationBuilder.AddPrimaryKey(
name: "PK_EasyAbpEShopPaymentsRefundItems",
table: "EasyAbpEShopPaymentsRefundItems",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_EasyAbpEShopPaymentsRefundItems_EasyAbpEShopPaymentsRefunds_RefundId",
table: "EasyAbpEShopPaymentsRefundItems",
column: "RefundId",
principalTable: "EasyAbpEShopPaymentsRefunds",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_EasyAbpEShopPaymentsRefundItems_EasyAbpEShopPaymentsRefunds_RefundId",
table: "EasyAbpEShopPaymentsRefundItems");
migrationBuilder.DropPrimaryKey(
name: "PK_EasyAbpEShopPaymentsRefundItems",
table: "EasyAbpEShopPaymentsRefundItems");
migrationBuilder.RenameTable(
name: "EasyAbpEShopPaymentsRefundItems",
newName: "RefundItem");
migrationBuilder.RenameIndex(
name: "IX_EasyAbpEShopPaymentsRefundItems_RefundId",
table: "RefundItem",
newName: "IX_RefundItem_RefundId");
migrationBuilder.AlterColumn<decimal>(
name: "RefundAmount",
table: "RefundItem",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(20,8)");
migrationBuilder.AlterColumn<bool>(
name: "IsDeleted",
table: "RefundItem",
type: "bit",
nullable: false,
oldClrType: typeof(bool),
oldDefaultValue: false);
migrationBuilder.AddPrimaryKey(
name: "PK_RefundItem",
table: "RefundItem",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_RefundItem_EasyAbpEShopPaymentsRefunds_RefundId",
table: "RefundItem",
column: "RefundId",
principalTable: "EasyAbpEShopPaymentsRefunds",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

4047
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826123655_ChangesForOrderRefund.Designer.cs

File diff suppressed because it is too large

116
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200826123655_ChangesForOrderRefund.cs

@ -0,0 +1,116 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class ChangesForOrderRefund : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "RefundedAmount",
table: "EasyAbpEShopOrdersOrders",
newName: "RefundAmount");
migrationBuilder.AddColumn<string>(
name: "ExtraProperties",
table: "EasyAbpPaymentServiceRefundItems",
nullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "StoreId",
table: "EasyAbpEShopPaymentsRefundItems",
nullable: false,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier",
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "ExtraProperties",
table: "EasyAbpEShopPaymentsRefundItems",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "OrderId",
table: "EasyAbpEShopPaymentsRefundItems",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.AddColumn<decimal>(
name: "RefundAmount",
table: "EasyAbpEShopOrdersOrderLines",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<int>(
name: "RefundedQuantity",
table: "EasyAbpEShopOrdersOrderLines",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "RefundItemOrderLine",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
OrderLineId = table.Column<Guid>(nullable: false),
RefundedQuantity = table.Column<int>(nullable: false),
RefundAmount = table.Column<decimal>(nullable: false),
RefundItemId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RefundItemOrderLine", x => x.Id);
table.ForeignKey(
name: "FK_RefundItemOrderLine_EasyAbpEShopPaymentsRefundItems_RefundItemId",
column: x => x.RefundItemId,
principalTable: "EasyAbpEShopPaymentsRefundItems",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_RefundItemOrderLine_RefundItemId",
table: "RefundItemOrderLine",
column: "RefundItemId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RefundItemOrderLine");
migrationBuilder.DropColumn(
name: "ExtraProperties",
table: "EasyAbpPaymentServiceRefundItems");
migrationBuilder.DropColumn(
name: "ExtraProperties",
table: "EasyAbpEShopPaymentsRefundItems");
migrationBuilder.DropColumn(
name: "OrderId",
table: "EasyAbpEShopPaymentsRefundItems");
migrationBuilder.DropColumn(
name: "RefundAmount",
table: "EasyAbpEShopOrdersOrderLines");
migrationBuilder.DropColumn(
name: "RefundedQuantity",
table: "EasyAbpEShopOrdersOrderLines");
migrationBuilder.RenameColumn(
name: "RefundAmount",
table: "EasyAbpEShopOrdersOrders",
newName: "RefundedAmount");
migrationBuilder.AlterColumn<Guid>(
name: "StoreId",
table: "EasyAbpEShopPaymentsRefundItems",
type: "uniqueidentifier",
nullable: true,
oldClrType: typeof(Guid));
}
}
}

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

Loading…
Cancel
Save