From 5458df9be28d1cd353009da3d522228d25131d74 Mon Sep 17 00:00:00 2001 From: gdlcf88 <47396430@qq.com> Date: Tue, 2 Jun 2020 03:35:39 +0800 Subject: [PATCH] Try EF TPC --- .../PaymentsPermissionDefinitionProvider.cs | 16 ++++- .../Authorization/PaymentsPermissions.cs | 22 ++++++- .../Payments/Dtos/CreateUpdatePaymentDto.cs | 9 +++ .../Payments/Payments/Dtos/PaymentDto.cs | 10 +++ .../Payments/Payments/IPaymentAppService.cs | 18 ++++++ .../Refunds/Dtos/CreateUpdateRefundDto.cs | 10 +++ .../EShop/Payments/Refunds/Dtos/RefundDto.cs | 11 ++++ .../Payments/Refunds/IRefundAppService.cs | 18 ++++++ .../Payments/Payments/PaymentAppService.cs | 25 ++++++++ .../PaymentsApplicationAutoMapperProfile.cs | 8 +++ .../Payments/Refunds/RefundAppService.cs | 25 ++++++++ .../Payments/Localization/Payments/cs.json | 18 ++++++ .../Payments/Localization/Payments/en.json | 20 +++++- .../Payments/Localization/Payments/pl.json | 18 ++++++ .../Payments/Localization/Payments/pt-BR.json | 18 ++++++ .../Payments/Localization/Payments/sl.json | 20 +++++- .../Payments/Localization/Payments/tr.json | 20 +++++- .../Payments/Localization/Payments/vi.json | 18 ++++++ .../Localization/Payments/zh-Hans.json | 20 +++++- .../Localization/Payments/zh-Hant.json | 20 +++++- .../Payments/Payments/IPaymentRepository.cs | 9 +++ .../EShop/Payments/Payments/Payment.cs | 15 +++++ .../Payments/Refunds/IRefundRepository.cs | 9 +++ .../EasyAbp/EShop/Payments/Refunds/Refund.cs | 15 +++++ .../EShopPaymentsEntityFrameworkCoreModule.cs | 4 ++ .../EntityFrameworkCore/IPaymentsDbContext.cs | 5 ++ .../EntityFrameworkCore/PaymentsDbContext.cs | 4 ++ ...aymentsDbContextModelCreatingExtensions.cs | 17 ++++++ .../Payments/Payments/PaymentRepository.cs | 14 +++++ .../Payments/Refunds/RefundRepository.cs | 14 +++++ .../Payments/Payments/Payment/Index.cshtml | 61 +++++++++++++++++++ .../Payments/Payments/Payment/Index.cshtml.cs | 12 ++++ .../EShop/Payments/Payments/Payment/index.css | 0 .../EShop/Payments/Payments/Payment/index.js | 41 +++++++++++++ .../Payments/Refunds/Refund/Index.cshtml | 60 ++++++++++++++++++ .../Payments/Refunds/Refund/Index.cshtml.cs | 12 ++++ .../EShop/Payments/Refunds/Refund/index.css | 0 .../EShop/Payments/Refunds/Refund/index.js | 55 +++++++++++++++++ .../PaymentsMenuContributor.cs | 21 ++++++- .../PaymentsWebAutoMapperProfile.cs | 2 + .../Payments/PaymentAppServiceTests.cs | 26 ++++++++ .../Refunds/RefundAppServiceTests.cs | 26 ++++++++ .../Payments/PaymentDomainTests.cs | 23 +++++++ .../Refunds/RefundDomainTests.cs | 23 +++++++ .../Payments/PaymentRepositoryTests.cs | 31 ++++++++++ .../Refunds/RefundRepositoryTests.cs | 31 ++++++++++ 46 files changed, 863 insertions(+), 11 deletions(-) create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreateUpdatePaymentDto.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/IPaymentAppService.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateUpdateRefundDto.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentRepository.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundRepository.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Payments/PaymentRepository.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.css create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.js create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.css create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.js create mode 100644 modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Payments/PaymentAppServiceTests.cs create mode 100644 modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Refunds/RefundAppServiceTests.cs create mode 100644 modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Payments/PaymentDomainTests.cs create mode 100644 modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundDomainTests.cs create mode 100644 modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Payments/PaymentRepositoryTests.cs create mode 100644 modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Refunds/RefundRepositoryTests.cs diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs index ed8d7e1f..c5ea781d 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs @@ -1,4 +1,4 @@ -using EasyAbp.EShop.Payments.Localization; +using EasyAbp.EShop.Payments.Localization; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; @@ -8,7 +8,17 @@ namespace EasyAbp.EShop.Payments.Authorization { public override void Define(IPermissionDefinitionContext context) { - // var moduleGroup = context.AddGroup(PaymentsPermissions.GroupName, L("Permission:Payments")); + var moduleGroup = context.AddGroup(PaymentsPermissions.GroupName, L("Permission:Payments")); + + var paymentPermission = moduleGroup.AddPermission(PaymentsPermissions.Payments.Default, L("Permission:Payments")); + paymentPermission.AddChild(PaymentsPermissions.Payments.Create, L("Permission:Create")); + paymentPermission.AddChild(PaymentsPermissions.Payments.Update, L("Permission:Update")); + paymentPermission.AddChild(PaymentsPermissions.Payments.Delete, L("Permission:Delete")); + + var refundPermission = moduleGroup.AddPermission(PaymentsPermissions.Refunds.Default, L("Permission:Refunds")); + refundPermission.AddChild(PaymentsPermissions.Refunds.Create, L("Permission:Create")); + refundPermission.AddChild(PaymentsPermissions.Refunds.Update, L("Permission:Update")); + refundPermission.AddChild(PaymentsPermissions.Refunds.Delete, L("Permission:Delete")); } private static LocalizableString L(string name) @@ -16,4 +26,4 @@ namespace EasyAbp.EShop.Payments.Authorization return LocalizableString.Create(name); } } -} \ No newline at end of file +} diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs index 833c28f4..2b7f231a 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Reflection; +using Volo.Abp.Reflection; namespace EasyAbp.EShop.Payments.Authorization { @@ -10,5 +10,23 @@ namespace EasyAbp.EShop.Payments.Authorization { return ReflectionHelper.GetPublicConstantsRecursively(typeof(PaymentsPermissions)); } + + public class Payments + { + public const string Default = GroupName + ".Payments"; + public const string Update = Default + ".Update"; + public const string Create = Default + ".Create"; + public const string Delete = Default + ".Delete"; + } + + + public class Refunds + { + public const string Default = GroupName + ".Refunds"; + public const string Update = Default + ".Update"; + public const string Create = Default + ".Create"; + public const string Delete = Default + ".Delete"; + } + } -} \ No newline at end of file +} diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreateUpdatePaymentDto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreateUpdatePaymentDto.cs new file mode 100644 index 00000000..fe623035 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreateUpdatePaymentDto.cs @@ -0,0 +1,9 @@ +using System; +using System.ComponentModel; +namespace EasyAbp.EShop.Payments.Payments.Dtos +{ + public class CreateUpdatePaymentDto + { + public Guid? StoreId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs new file mode 100644 index 00000000..d86d0d6f --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs @@ -0,0 +1,10 @@ +using System; +using PaymentServicePaymentDto = EasyAbp.PaymentService.Payments.Dtos.PaymentDto; + +namespace EasyAbp.EShop.Payments.Payments.Dtos +{ + public class PaymentDto : PaymentServicePaymentDto + { + public Guid? StoreId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/IPaymentAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/IPaymentAppService.cs new file mode 100644 index 00000000..939369eb --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/IPaymentAppService.cs @@ -0,0 +1,18 @@ +using System; +using EasyAbp.EShop.Payments.Payments.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Payments.Payments +{ + public interface IPaymentAppService : + ICrudAppService< + PaymentDto, + Guid, + PagedAndSortedResultRequestDto, + CreateUpdatePaymentDto, + CreateUpdatePaymentDto> + { + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateUpdateRefundDto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateUpdateRefundDto.cs new file mode 100644 index 00000000..a5a28373 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateUpdateRefundDto.cs @@ -0,0 +1,10 @@ +using System; +using System.ComponentModel; +namespace EasyAbp.EShop.Payments.Refunds.Dtos +{ + public class CreateUpdateRefundDto + { + [DisplayName("RefundStoreId")] + public Guid? StoreId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs new file mode 100644 index 00000000..5eca51ff --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs @@ -0,0 +1,11 @@ +using System; +using Volo.Abp.Application.Dtos; +using PaymentServiceRefundDto = EasyAbp.PaymentService.Refunds.Dtos.RefundDto; + +namespace EasyAbp.EShop.Payments.Refunds.Dtos +{ + public class RefundDto : PaymentServiceRefundDto + { + public Guid? StoreId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs new file mode 100644 index 00000000..22de6acf --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs @@ -0,0 +1,18 @@ +using System; +using EasyAbp.EShop.Payments.Refunds.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Payments.Refunds +{ + public interface IRefundAppService : + ICrudAppService< + RefundDto, + Guid, + PagedAndSortedResultRequestDto, + CreateUpdateRefundDto, + CreateUpdateRefundDto> + { + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs new file mode 100644 index 00000000..f41a7596 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs @@ -0,0 +1,25 @@ +using System; +using EasyAbp.EShop.Payments.Authorization; +using EasyAbp.EShop.Payments.Payments.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Payments.Payments +{ + public class PaymentAppService : CrudAppService, + IPaymentAppService + { + protected override string GetPolicyName { get; set; } = PaymentsPermissions.Payments.Default; + protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Payments.Default; + protected override string CreatePolicyName { get; set; } = PaymentsPermissions.Payments.Create; + protected override string UpdatePolicyName { get; set; } = PaymentsPermissions.Payments.Update; + protected override string DeletePolicyName { get; set; } = PaymentsPermissions.Payments.Delete; + + private readonly IPaymentRepository _repository; + + public PaymentAppService(IPaymentRepository repository) : base(repository) + { + _repository = repository; + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs index 38e25986..f60de5c9 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs @@ -1,3 +1,7 @@ +using EasyAbp.EShop.Payments.Payments; +using EasyAbp.EShop.Payments.Payments.Dtos; +using EasyAbp.EShop.Payments.Refunds; +using EasyAbp.EShop.Payments.Refunds.Dtos; using AutoMapper; namespace EasyAbp.EShop.Payments @@ -9,6 +13,10 @@ namespace EasyAbp.EShop.Payments /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ + CreateMap(); + CreateMap(MemberList.Source); + CreateMap(); + CreateMap(MemberList.Source); } } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs new file mode 100644 index 00000000..dc693c8d --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs @@ -0,0 +1,25 @@ +using System; +using EasyAbp.EShop.Payments.Authorization; +using EasyAbp.EShop.Payments.Refunds.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Payments.Refunds +{ + public class RefundAppService : CrudAppService, + IRefundAppService + { + protected override string GetPolicyName { get; set; } = PaymentsPermissions.Refunds.Default; + protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Refunds.Default; + protected override string CreatePolicyName { get; set; } = PaymentsPermissions.Refunds.Create; + protected override string UpdatePolicyName { get; set; } = PaymentsPermissions.Refunds.Update; + protected override string DeletePolicyName { get; set; } = PaymentsPermissions.Refunds.Delete; + + private readonly IRefundRepository _repository; + + public RefundAppService(IRefundRepository repository) : base(repository) + { + _repository = repository; + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json index 0032b106..0cd29cca 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json @@ -1,5 +1,23 @@ { "culture": "cs", "texts": { + "Permission:Payments": "Payments", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Payments": "MenuPayments", + "Payment": "Payment", + "PaymentStoreId": "PaymentStoreId", + "CreatePayment": "CreatePayment", + "EditPayment": "EditPayment", + "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Refunds": "Refunds", + "Menu:Refunds": "MenuRefunds", + "Refund": "Refund", + "RefundStoreId": "RefundStoreId", + "CreateRefund": "CreateRefund", + "EditRefund": "EditRefund", + "RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json index bb66921a..9a8ad8f4 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json @@ -1,6 +1,24 @@ { "culture": "en", "texts": { - "ManageYourProfile": "Manage your profile" + "ManageYourProfile": "Manage your profile", + "Permission:Payments": "Payments", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Payments": "MenuPayments", + "Payment": "Payment", + "PaymentStoreId": "PaymentStoreId", + "CreatePayment": "CreatePayment", + "EditPayment": "EditPayment", + "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Refunds": "Refunds", + "Menu:Refunds": "MenuRefunds", + "Refund": "Refund", + "RefundStoreId": "RefundStoreId", + "CreateRefund": "CreateRefund", + "EditRefund": "EditRefund", + "RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json index 26bcf7be..02348a4c 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json @@ -1,5 +1,23 @@ { "culture": "pl", "texts": { + "Permission:Payments": "Payments", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Payments": "MenuPayments", + "Payment": "Payment", + "PaymentStoreId": "PaymentStoreId", + "CreatePayment": "CreatePayment", + "EditPayment": "EditPayment", + "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Refunds": "Refunds", + "Menu:Refunds": "MenuRefunds", + "Refund": "Refund", + "RefundStoreId": "RefundStoreId", + "CreateRefund": "CreateRefund", + "EditRefund": "EditRefund", + "RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json index 2012b4c1..e6e4a115 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json @@ -1,5 +1,23 @@ { "culture": "pt-BR", "texts": { + "Permission:Payments": "Payments", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Payments": "MenuPayments", + "Payment": "Payment", + "PaymentStoreId": "PaymentStoreId", + "CreatePayment": "CreatePayment", + "EditPayment": "EditPayment", + "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Refunds": "Refunds", + "Menu:Refunds": "MenuRefunds", + "Refund": "Refund", + "RefundStoreId": "RefundStoreId", + "CreateRefund": "CreateRefund", + "EditRefund": "EditRefund", + "RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json index bb27e36f..1a38e652 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json @@ -1,6 +1,24 @@ { "culture": "sl", "texts": { - "ManageYourProfile": "Upravljajte svojim profilom" + "ManageYourProfile": "Upravljajte svojim profilom", + "Permission:Payments": "Payments", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Payments": "MenuPayments", + "Payment": "Payment", + "PaymentStoreId": "PaymentStoreId", + "CreatePayment": "CreatePayment", + "EditPayment": "EditPayment", + "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Refunds": "Refunds", + "Menu:Refunds": "MenuRefunds", + "Refund": "Refund", + "RefundStoreId": "RefundStoreId", + "CreateRefund": "CreateRefund", + "EditRefund": "EditRefund", + "RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json index 745dcb01..aad2f663 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json @@ -1,6 +1,24 @@ { "culture": "tr", "texts": { - "ManageYourProfile": "Profil y�netimi" + "ManageYourProfile": "Profil y�netimi", + "Permission:Payments": "Payments", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Payments": "MenuPayments", + "Payment": "Payment", + "PaymentStoreId": "PaymentStoreId", + "CreatePayment": "CreatePayment", + "EditPayment": "EditPayment", + "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Refunds": "Refunds", + "Menu:Refunds": "MenuRefunds", + "Refund": "Refund", + "RefundStoreId": "RefundStoreId", + "CreateRefund": "CreateRefund", + "EditRefund": "EditRefund", + "RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json index 1ce1a0e1..25556879 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json @@ -1,5 +1,23 @@ { "culture": "vi", "texts": { + "Permission:Payments": "Payments", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Payments": "MenuPayments", + "Payment": "Payment", + "PaymentStoreId": "PaymentStoreId", + "CreatePayment": "CreatePayment", + "EditPayment": "EditPayment", + "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Refunds": "Refunds", + "Menu:Refunds": "MenuRefunds", + "Refund": "Refund", + "RefundStoreId": "RefundStoreId", + "CreateRefund": "CreateRefund", + "EditRefund": "EditRefund", + "RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json index 5f0fab67..f2646850 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json @@ -1,6 +1,24 @@ { "culture": "zh-Hans", "texts": { - "ManageYourProfile": "管理个人资料" + "ManageYourProfile": "管理个人资料", + "Permission:Payments": "Payments", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Payments": "MenuPayments", + "Payment": "Payment", + "PaymentStoreId": "PaymentStoreId", + "CreatePayment": "CreatePayment", + "EditPayment": "EditPayment", + "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Refunds": "Refunds", + "Menu:Refunds": "MenuRefunds", + "Refund": "Refund", + "RefundStoreId": "RefundStoreId", + "CreateRefund": "CreateRefund", + "EditRefund": "EditRefund", + "RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json index 7b79ff13..53ade176 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json @@ -1,6 +1,24 @@ { "culture": "zh-Hant", "texts": { - "ManageYourProfile": "管理個人資料" + "ManageYourProfile": "管理個人資料", + "Permission:Payments": "Payments", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Payments": "MenuPayments", + "Payment": "Payment", + "PaymentStoreId": "PaymentStoreId", + "CreatePayment": "CreatePayment", + "EditPayment": "EditPayment", + "PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Refunds": "Refunds", + "Menu:Refunds": "MenuRefunds", + "Refund": "Refund", + "RefundStoreId": "RefundStoreId", + "CreateRefund": "CreateRefund", + "EditRefund": "EditRefund", + "RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentRepository.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentRepository.cs new file mode 100644 index 00000000..a83b9806 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentRepository.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Payments.Payments +{ + public interface IPaymentRepository : IRepository + { + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs new file mode 100644 index 00000000..d447a7c1 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs @@ -0,0 +1,15 @@ +using System; +using PaymentServicePayment = EasyAbp.PaymentService.Payments.Payment; + +namespace EasyAbp.EShop.Payments.Payments +{ + public class Payment : PaymentServicePayment + { + public virtual Guid? StoreId { get; protected set; } + + public void SetStoreId(Guid? storeId) + { + StoreId = storeId; + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundRepository.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundRepository.cs new file mode 100644 index 00000000..3ab73121 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundRepository.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Payments.Refunds +{ + public interface IRefundRepository : IRepository + { + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs new file mode 100644 index 00000000..620e0234 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs @@ -0,0 +1,15 @@ +using System; +using PaymentServiceRefund = EasyAbp.PaymentService.Refunds.Refund; + +namespace EasyAbp.EShop.Payments.Refunds +{ + public class Refund : PaymentServiceRefund + { + public virtual Guid? StoreId { get; protected set; } + + public void SetStoreId(Guid? storeId) + { + StoreId = storeId; + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs index ed0b5c87..5b278cce 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs @@ -1,3 +1,5 @@ +using EasyAbp.EShop.Payments.Refunds; +using EasyAbp.EShop.Payments.Payments; using EasyAbp.PaymentService.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; @@ -19,6 +21,8 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore /* Add custom repositories here. Example: * options.AddRepository(); */ + options.AddRepository(); + options.AddRepository(); }); } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs index 8a8eb6cb..0eecbc6d 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs @@ -1,5 +1,8 @@ +using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using EasyAbp.EShop.Payments.Payments; +using EasyAbp.EShop.Payments.Refunds; namespace EasyAbp.EShop.Payments.EntityFrameworkCore { @@ -9,5 +12,7 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore /* Add DbSet for each Aggregate Root here. Example: * DbSet Questions { get; } */ + DbSet Payments { get; set; } + DbSet Refunds { get; set; } } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs index 0b346b1b..b623ad2b 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs @@ -1,6 +1,8 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using EasyAbp.EShop.Payments.Payments; +using EasyAbp.EShop.Payments.Refunds; namespace EasyAbp.EShop.Payments.EntityFrameworkCore { @@ -10,6 +12,8 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore /* Add DbSet for each Aggregate Root here. Example: * public DbSet Questions { get; set; } */ + public DbSet Payments { get; set; } + public DbSet Refunds { get; set; } public PaymentsDbContext(DbContextOptions options) : base(options) diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs index 1bfda815..560dfead 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs @@ -1,7 +1,10 @@ +using EasyAbp.EShop.Payments.Refunds; +using EasyAbp.EShop.Payments.Payments; using System; using EasyAbp.PaymentService.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; namespace EasyAbp.EShop.Payments.EntityFrameworkCore { @@ -41,6 +44,20 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore */ builder.ConfigurePaymentService(); + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Payments", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + }); + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Refunds", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + }); } } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Payments/PaymentRepository.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Payments/PaymentRepository.cs new file mode 100644 index 00000000..922fcdde --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Payments/PaymentRepository.cs @@ -0,0 +1,14 @@ +using System; +using EasyAbp.EShop.Payments.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Payments.Payments +{ + public class PaymentRepository : EfCoreRepository, IPaymentRepository + { + public PaymentRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs new file mode 100644 index 00000000..f1914215 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs @@ -0,0 +1,14 @@ +using System; +using EasyAbp.EShop.Payments.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Payments.Refunds +{ + public class RefundRepository : EfCoreRepository, IRefundRepository + { + public RefundRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml new file mode 100644 index 00000000..0cf27d0a --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml @@ -0,0 +1,61 @@ +@page +@using Microsoft.AspNetCore.Authorization +@using EasyAbp.EShop.Payments.Authorization +@using EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.Payment +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage +@model IndexModel +@inject IPageLayout PageLayout +@inject IAuthorizationService Authorization +@{ + PageLayout.Content.Title = L["Payment"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:Payment"].Value); + PageLayout.Content.MenuItemName = "Payment"; +} + +@section scripts +{ + +} +@section styles +{ + +} + + + + + + @L["Payment"] + + + @if (await Authorization.IsGrantedAsync(PaymentsPermissions.Payments.Create)) + { + + } + + + + + + + + @L["Actions"] + @L["PaymentStoreId"] + @L["PaymentPaymentMethod"] + @L["PaymentExternalTradingCode"] + @L["PaymentCurrency"] + @L["PaymentOriginalPaymentAmount"] + @L["PaymentPaymentDiscount"] + @L["PaymentActualPaymentAmount"] + @L["PaymentRefundAmount"] + @L["PaymentCompletionTime"] + @L["PaymentCancelledTime"] + + + + + \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml.cs new file mode 100644 index 00000000..41139d58 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; + +namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.Payment +{ + public class IndexModel : PaymentsPageModel + { + public async Task OnGetAsync() + { + await Task.CompletedTask; + } + } +} diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.css b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.css new file mode 100644 index 00000000..e69de29b diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.js b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.js new file mode 100644 index 00000000..27922d2b --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.js @@ -0,0 +1,41 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpEShopPayments'); + + var service = easyAbp.eShop.payments.payments.payment; + + var dataTable = $('#PaymentTable').DataTable(abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[1, "asc"]], + ajax: abp.libs.datatables.createAjax(service.getList), + columnDefs: [ + { + rowAction: { + items: + [ + { + text: l('PaymentItem'), + action: function (data) { + } + } + ] + } + }, + { data: "storeId" }, + { data: "paymentMethod" }, + { data: "externalTradingCode" }, + { data: "currency" }, + { data: "originalPaymentAmount" }, + { data: "paymentDiscount" }, + { data: "actualPaymentAmount" }, + { data: "refundAmount" }, + { data: "completionTime" }, + { data: "cancelledTime" }, + ] + })); +}); \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml new file mode 100644 index 00000000..58ca0b10 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml @@ -0,0 +1,60 @@ +@page +@using Microsoft.AspNetCore.Authorization +@using EasyAbp.EShop.Payments.Authorization +@using EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Refunds.Refund +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage +@model IndexModel +@inject IPageLayout PageLayout +@inject IAuthorizationService Authorization +@{ + PageLayout.Content.Title = L["Refund"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:Refund"].Value); + PageLayout.Content.MenuItemName = "Refund"; +} + +@section scripts +{ + +} +@section styles +{ + +} + + + + + + @L["Refund"] + + + @if (await Authorization.IsGrantedAsync(PaymentsPermissions.Refunds.Create)) + { + + } + + + + + + + + @L["Actions"] + @L["RefundStoreId"] + @L["RefundPaymentId"] + @L["RefundPaymentItemId"] + @L["RefundRefundPaymentMethod"] + @L["RefundExternalTradingCode"] + @L["RefundCurrency"] + @L["RefundRefundAmount"] + @L["RefundCustomerRemark"] + @L["RefundStaffRemark"] + + + + + \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml.cs new file mode 100644 index 00000000..46215177 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; + +namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Refunds.Refund +{ + public class IndexModel : PaymentsPageModel + { + public async Task OnGetAsync() + { + await Task.CompletedTask; + } + } +} diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.css b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.css new file mode 100644 index 00000000..e69de29b diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.js b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.js new file mode 100644 index 00000000..d3ffba64 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.js @@ -0,0 +1,55 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpEShopPayments'); + + var service = easyAbp.eShop.payments.refunds.refund; + var createModal = new abp.ModalManager(abp.appPath + 'EShop/Payments/Refunds/Refund/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'EShop/Payments/Refunds/Refund/EditModal'); + + var dataTable = $('#RefundTable').DataTable(abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[1, "asc"]], + ajax: abp.libs.datatables.createAjax(service.getList), + columnDefs: [ + { + rowAction: { + items: + [ + { + text: l('Detail'), + action: function (data) { + } + }, + ] + } + }, + { data: "storeId" }, + { data: "paymentId" }, + { data: "paymentItemId" }, + { data: "refundPaymentMethod" }, + { data: "externalTradingCode" }, + { data: "currency" }, + { data: "refundAmount" }, + { data: "customerRemark" }, + { data: "staffRemark" }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewRefundButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs index c44e5b80..1876ef11 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs @@ -1,4 +1,9 @@ using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Localization; +using EasyAbp.EShop.Payments.Localization; +using Microsoft.AspNetCore.Authorization; +using EasyAbp.EShop.Payments.Authorization; using System.Threading.Tasks; using EasyAbp.EShop.Payments.Authorization; using Microsoft.Extensions.DependencyInjection; @@ -27,7 +32,21 @@ namespace EasyAbp.EShop.Payments.Web private async Task ConfigureMainMenu(MenuConfigurationContext context) { - + var authorizationService = context.ServiceProvider.GetRequiredService(); + var l = context.ServiceProvider.GetRequiredService>(); + + if (await authorizationService.IsGrantedAsync(PaymentsPermissions.Payments.Default)) + { + context.Menu.AddItem( + new ApplicationMenuItem("Payments", l["Menu:Payments"], "/Payments/Payment") + ); + } + if (await authorizationService.IsGrantedAsync(PaymentsPermissions.Refunds.Default)) + { + context.Menu.AddItem( + new ApplicationMenuItem("Refunds", l["Menu:Refunds"], "/Refunds/Refund") + ); + } } } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsWebAutoMapperProfile.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsWebAutoMapperProfile.cs index f135f468..d0ed1e24 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsWebAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsWebAutoMapperProfile.cs @@ -1,3 +1,4 @@ +using EasyAbp.EShop.Payments.Refunds.Dtos; using AutoMapper; namespace EasyAbp.EShop.Payments.Web @@ -9,6 +10,7 @@ namespace EasyAbp.EShop.Payments.Web /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ + CreateMap(); } } } diff --git a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Payments/PaymentAppServiceTests.cs b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Payments/PaymentAppServiceTests.cs new file mode 100644 index 00000000..d8c7dd39 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Payments/PaymentAppServiceTests.cs @@ -0,0 +1,26 @@ +using Shouldly; +using System.Threading.Tasks; +using Xunit; + +namespace EasyAbp.EShop.Payments.Payments +{ + public class PaymentAppServiceTests : PaymentsApplicationTestBase + { + private readonly IPaymentAppService _paymentAppService; + + public PaymentAppServiceTests() + { + _paymentAppService = GetRequiredService(); + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Act + + // Assert + } + } +} diff --git a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Refunds/RefundAppServiceTests.cs b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Refunds/RefundAppServiceTests.cs new file mode 100644 index 00000000..626e117c --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Refunds/RefundAppServiceTests.cs @@ -0,0 +1,26 @@ +using Shouldly; +using System.Threading.Tasks; +using Xunit; + +namespace EasyAbp.EShop.Payments.Refunds +{ + public class RefundAppServiceTests : PaymentsApplicationTestBase + { + private readonly IRefundAppService _refundAppService; + + public RefundAppServiceTests() + { + _refundAppService = GetRequiredService(); + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Act + + // Assert + } + } +} diff --git a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Payments/PaymentDomainTests.cs b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Payments/PaymentDomainTests.cs new file mode 100644 index 00000000..530c661e --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Payments/PaymentDomainTests.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace EasyAbp.EShop.Payments.Payments +{ + public class PaymentDomainTests : PaymentsDomainTestBase + { + public PaymentDomainTests() + { + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Assert + + // Assert + } + } +} diff --git a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundDomainTests.cs b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundDomainTests.cs new file mode 100644 index 00000000..e0b696ce --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundDomainTests.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace EasyAbp.EShop.Payments.Refunds +{ + public class RefundDomainTests : PaymentsDomainTestBase + { + public RefundDomainTests() + { + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Assert + + // Assert + } + } +} diff --git a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Payments/PaymentRepositoryTests.cs b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Payments/PaymentRepositoryTests.cs new file mode 100644 index 00000000..8156457c --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Payments/PaymentRepositoryTests.cs @@ -0,0 +1,31 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Payments.Payments; +using Volo.Abp.Domain.Repositories; +using Xunit; + +namespace EasyAbp.EShop.Payments.EntityFrameworkCore.Payments +{ + public class PaymentRepositoryTests : PaymentsEntityFrameworkCoreTestBase + { + private readonly IRepository _paymentRepository; + + public PaymentRepositoryTests() + { + _paymentRepository = GetRequiredService>(); + } + + [Fact] + public async Task Test1() + { + await WithUnitOfWorkAsync(async () => + { + // Arrange + + // Act + + //Assert + }); + } + } +} diff --git a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Refunds/RefundRepositoryTests.cs b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Refunds/RefundRepositoryTests.cs new file mode 100644 index 00000000..2caca9a6 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Refunds/RefundRepositoryTests.cs @@ -0,0 +1,31 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Payments.Refunds; +using Volo.Abp.Domain.Repositories; +using Xunit; + +namespace EasyAbp.EShop.Payments.EntityFrameworkCore.Refunds +{ + public class RefundRepositoryTests : PaymentsEntityFrameworkCoreTestBase + { + private readonly IRepository _refundRepository; + + public RefundRepositoryTests() + { + _refundRepository = GetRequiredService>(); + } + + [Fact] + public async Task Test1() + { + await WithUnitOfWorkAsync(async () => + { + // Arrange + + // Act + + //Assert + }); + } + } +}