From 1590f819d2c4903f705d3db2fb0f0da672ca44c2 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Tue, 6 Jun 2023 15:54:20 -0400 Subject: [PATCH] PaymentService updated to use file-scoped namespaces and namespace fix --- .../PaymentRequests/PaymentCompletedEto.cs | 13 ++++---- .../PaymentRequestCreationDto.cs | 31 +++++++++---------- .../PaymentRequests/PaymentRequestDto.cs | 29 +++++++++-------- .../PaymentRequestProductCreationDto.cs | 29 +++++++++-------- .../PaymentRequestProductDto.cs | 21 ++++++------- .../PaymentRequests/PaymentRequestStartDto.cs | 19 ++++++------ .../PaymentRequestStartResultDto.cs | 11 +++---- .../PaymentServiceConsts.cs | 9 +++--- .../EfCorePaymentRequestRepository.cs | 1 - .../PaymentServiceDatabaseMigrationChecker.cs | 3 +- .../PendingMongoDbMigrationsChecker.cs | 8 ++--- 11 files changed, 82 insertions(+), 92 deletions(-) diff --git a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentCompletedEto.cs b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentCompletedEto.cs index dd872e5b..aefc8b46 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentCompletedEto.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentCompletedEto.cs @@ -1,11 +1,10 @@ using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EventBus; -namespace EShopOnAbp.PaymentService.PaymentRequests +namespace EShopOnAbp.PaymentService.PaymentRequests; + +[EventName("EShopOnAbp.Payment.Completed")] +public class PaymentCompletedEto : EtoBase { - [EventName("EShopOnAbp.Payment.Completed")] - public class PaymentCompletedEto : EtoBase - { - public PaymentRequestDto PaymentRequest { get; set; } - } -} + public PaymentRequestDto PaymentRequest { get; set; } +} \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestCreationDto.cs b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestCreationDto.cs index 5584c680..f589e9f5 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestCreationDto.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestCreationDto.cs @@ -2,24 +2,23 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace EShopOnAbp.PaymentService.PaymentRequests +namespace EShopOnAbp.PaymentService.PaymentRequests; + +[Serializable] +public class PaymentRequestCreationDto { - [Serializable] - public class PaymentRequestCreationDto - { - [Required] - [MaxLength(PaymentRequestConsts.MaxCurrencyLength)] - public string Currency { get; set; } + [Required] + [MaxLength(PaymentRequestConsts.MaxCurrencyLength)] + public string Currency { get; set; } - [Required] - [MinLength(PaymentRequestConsts.MinOrderIdLength)] - [MaxLength(PaymentRequestConsts.MaxOrderIdLength)] - public string OrderId { get; set; } + [Required] + [MinLength(PaymentRequestConsts.MinOrderIdLength)] + [MaxLength(PaymentRequestConsts.MaxOrderIdLength)] + public string OrderId { get; set; } - [Required] - public int OrderNo { get; set; } + [Required] + public int OrderNo { get; set; } - public string BuyerId { get; set; } - public List Products { get; set; } - } + public string BuyerId { get; set; } + public List Products { get; set; } } \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestDto.cs b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestDto.cs index 40631e8f..01cc0385 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestDto.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestDto.cs @@ -3,25 +3,24 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -namespace EShopOnAbp.PaymentService.PaymentRequests +namespace EShopOnAbp.PaymentService.PaymentRequests; + +[Serializable] +public class PaymentRequestDto : CreationAuditedEntityDto { - [Serializable] - public class PaymentRequestDto : CreationAuditedEntityDto - { - [Required] - [MaxLength(PaymentRequestConsts.MaxCurrencyLength)] - public string Currency { get; set; } + [Required] + [MaxLength(PaymentRequestConsts.MaxCurrencyLength)] + public string Currency { get; set; } - public string OrderId { get; set; } + public string OrderId { get; set; } - public int OrderNo {get;set;} + public int OrderNo {get;set;} - public string BuyerId { get; set; } + public string BuyerId { get; set; } - public bool IsDeleted { get; set; } + public bool IsDeleted { get; set; } - public PaymentRequestState State { get; set; } + public PaymentRequestState State { get; set; } - public List Products { get; set; } - } -} + public List Products { get; set; } +} \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductCreationDto.cs b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductCreationDto.cs index 51ded8cf..8783a9d0 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductCreationDto.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductCreationDto.cs @@ -1,22 +1,21 @@ using System; using System.ComponentModel.DataAnnotations; -namespace EShopOnAbp.PaymentService.PaymentRequests +namespace EShopOnAbp.PaymentService.PaymentRequests; + +[Serializable] +public class PaymentRequestProductCreationDto { - [Serializable] - public class PaymentRequestProductCreationDto - { - public string ReferenceId { get; set; } + public string ReferenceId { get; set; } - [Required] - [MaxLength(PaymentRequestConsts.MaxCodeLength)] - public string Code { get; set; } + [Required] + [MaxLength(PaymentRequestConsts.MaxCodeLength)] + public string Code { get; set; } - [Required] - [MaxLength(PaymentRequestConsts.MaxNameLength)] - public string Name { get; set; } - public decimal UnitPrice { get; set; } - public int Quantity { get; set; } - public decimal TotalPrice { get; set; } - } + [Required] + [MaxLength(PaymentRequestConsts.MaxNameLength)] + public string Name { get; set; } + public decimal UnitPrice { get; set; } + public int Quantity { get; set; } + public decimal TotalPrice { get; set; } } \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductDto.cs b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductDto.cs index 4246e772..062ac0e1 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductDto.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductDto.cs @@ -1,23 +1,22 @@ using System; using Volo.Abp.Application.Dtos; -namespace EShopOnAbp.PaymentService.PaymentRequests +namespace EShopOnAbp.PaymentService.PaymentRequests; + +public class PaymentRequestProductDto : EntityDto { - public class PaymentRequestProductDto : EntityDto - { - public Guid PaymentRequestId { get; set; } + public Guid PaymentRequestId { get; set; } - public string ReferenceId { get; set; } + public string ReferenceId { get; set; } - public string Code { get; set; } + public string Code { get; set; } - public string Name { get; set; } + public string Name { get; set; } - public decimal UnitPrice { get; set; } + public decimal UnitPrice { get; set; } - public int Quantity { get; set; } + public int Quantity { get; set; } - public decimal TotalPrice { get; set; } + public decimal TotalPrice { get; set; } - } } \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartDto.cs b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartDto.cs index d5b06af4..e1c691f4 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartDto.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartDto.cs @@ -1,17 +1,16 @@ using System; using System.ComponentModel.DataAnnotations; -namespace EShopOnAbp.PaymentService.PaymentRequests +namespace EShopOnAbp.PaymentService.PaymentRequests; + +[Serializable] +public class PaymentRequestStartDto { - [Serializable] - public class PaymentRequestStartDto - { - public int PaymentTypeId { get; set; } - public Guid PaymentRequestId { get; set; } + public int PaymentTypeId { get; set; } + public Guid PaymentRequestId { get; set; } - [Required] - public string ReturnUrl { get; set; } + [Required] + public string ReturnUrl { get; set; } - public string CancelUrl { get; set; } - } + public string CancelUrl { get; set; } } \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartResultDto.cs b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartResultDto.cs index faae6889..a2bba62a 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartResultDto.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartResultDto.cs @@ -1,10 +1,9 @@ using System; -namespace EShopOnAbp.PaymentService.PaymentRequests +namespace EShopOnAbp.PaymentService.PaymentRequests; + +[Serializable] +public class PaymentRequestStartResultDto { - [Serializable] - public class PaymentRequestStartResultDto - { - public string CheckoutLink { get; set; } - } + public string CheckoutLink { get; set; } } \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentServiceConsts.cs b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentServiceConsts.cs index 6bfa585d..362dc6ed 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentServiceConsts.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentServiceConsts.cs @@ -1,6 +1,5 @@ -namespace EShopOnAbp.PaymentService +namespace EShopOnAbp.PaymentService; + +public static class PaymentServiceConsts { - public static class PaymentServiceConsts - { - } -} +} \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs b/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs index 8d5cffa7..35df6935 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs @@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore; using System; using System.Linq; using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/DbMigrations/PaymentServiceDatabaseMigrationChecker.cs b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/DbMigrations/PaymentServiceDatabaseMigrationChecker.cs index 5551fb38..ddca32ec 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/DbMigrations/PaymentServiceDatabaseMigrationChecker.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/DbMigrations/PaymentServiceDatabaseMigrationChecker.cs @@ -8,8 +8,7 @@ using Volo.Abp.DistributedLocking; namespace EShopOnAbp.PaymentService.DbMigrations; -public class PaymentServiceDatabaseMigrationChecker - : PendingEfCoreMigrationsChecker +public class PaymentServiceDatabaseMigrationChecker : PendingEfCoreMigrationsChecker { public PaymentServiceDatabaseMigrationChecker( IUnitOfWorkManager unitOfWorkManager, diff --git a/shared/EShopOnAbp.Shared.Hosting.Microservices/DbMigrations/MongoDb/PendingMongoDbMigrationsChecker.cs b/shared/EShopOnAbp.Shared.Hosting.Microservices/DbMigrations/MongoDb/PendingMongoDbMigrationsChecker.cs index ed8cb227..6a5fccf7 100644 --- a/shared/EShopOnAbp.Shared.Hosting.Microservices/DbMigrations/MongoDb/PendingMongoDbMigrationsChecker.cs +++ b/shared/EShopOnAbp.Shared.Hosting.Microservices/DbMigrations/MongoDb/PendingMongoDbMigrationsChecker.cs @@ -1,15 +1,15 @@ -using Microsoft.Extensions.DependencyInjection; +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using MongoDB.Driver; using Serilog; -using System; -using System.Threading.Tasks; using Volo.Abp.Data; using Volo.Abp.DistributedLocking; using Volo.Abp.MongoDB; using Volo.Abp.MultiTenancy; using Volo.Abp.Uow; -namespace EShopOnAbp.Shared.Hosting.Microservices.DbMigrations; +namespace EShopOnAbp.Shared.Hosting.Microservices.DbMigrations.MongoDb; public class PendingMongoDbMigrationsChecker : PendingMigrationsCheckerBase where TDbContext : AbpMongoDbContext