Browse Source

Merge pull request #172 from abpframework/gterdem/minor_enhancements

MongoExpress addition and file-scoped namespaces
pull/174/head
Enis Necipoglu 3 years ago
committed by GitHub
parent
commit
fffa71df21
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      etc/docker/docker-compose.infrastructure.override.yml
  2. 15
      etc/docker/docker-compose.infrastructure.yml
  3. 9
      services/basket/src/EShopOnAbp.BasketService.Contracts/Localization/BasketServiceResource.cs
  4. 29
      services/basket/src/EShopOnAbp.BasketService/Entities/Orders/OrderPlacedEventHandler.cs
  5. 5
      services/catalog/src/EShopOnAbp.CatalogService.Application/CatalogServiceAppService.cs
  6. 2
      services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/DbMigrations/CatalogServiceDatabaseMigrationChecker.cs
  7. 9
      services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/EntityFrameworkCore/ICmskitServiceDbContext.cs
  8. 6
      services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/DbMigrations/CmskitServiceDatabaseMigrationChecker.cs
  9. 19
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/OrderingServiceApplicationContractsModule.cs
  10. 11
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/OrderingServiceRemoteServiceConsts.cs
  11. 15
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/DashboardDto.cs
  12. 9
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/DashboardInput.cs
  13. 9
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/GetOrdersInput.cs
  14. 29
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissions.cs
  15. 31
      services/ordering/src/EShopOnAbp.OrderingService.Application/OrderingServiceApplicationModule.cs
  16. 11
      services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingServiceResource.cs
  17. 47
      services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/OrderingServiceDomainSharedModule.cs
  18. 21
      services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Orders/OrderAcceptedEto.cs
  19. 21
      services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Orders/OrderItemEto.cs
  20. 15
      services/ordering/src/EShopOnAbp.OrderingService.Domain/OrderingServiceDbProperties.cs
  21. 17
      services/ordering/src/EShopOnAbp.OrderingService.Domain/OrderingServiceDomainModule.cs
  22. 1
      services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/IOrderRepository.cs
  23. 73
      services/ordering/src/EShopOnAbp.OrderingService.Domain/PaymentRequests/PaymentRequestEventHandler.cs
  24. 15
      services/ordering/src/EShopOnAbp.OrderingService.Domain/Settings/OrderingServiceSettingDefinitionProvider.cs
  25. 15
      services/ordering/src/EShopOnAbp.OrderingService.Domain/Settings/OrderingServiceSettings.cs
  26. 17
      services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/IOrderingServiceDbContext.cs
  27. 43
      services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContextFactory.cs
  28. 43
      services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContextModelCreatingExtensions.cs
  29. 61
      services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceEfCoreEntityExtensionMappings.cs
  30. 55
      services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceEntityFrameworkCoreModule.cs
  31. 1
      services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/Orders/EfCoreOrderRepository.cs
  32. 33
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/OrderingServiceHttpApiClientModule.cs
  33. 3
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/DbMigrations/OrderingServiceDatabaseMigrationChecker.cs
  34. 13
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi/OrderingServiceController.cs
  35. 39
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi/OrderingServiceHttpApiModule.cs
  36. 13
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentCompletedEto.cs
  37. 31
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestCreationDto.cs
  38. 29
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestDto.cs
  39. 29
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductCreationDto.cs
  40. 21
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestProductDto.cs
  41. 19
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartDto.cs
  42. 11
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentRequests/PaymentRequestStartResultDto.cs
  43. 9
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentServiceConsts.cs
  44. 1
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/PaymentRequests/EfCorePaymentRequestRepository.cs
  45. 3
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/DbMigrations/PaymentServiceDatabaseMigrationChecker.cs
  46. 8
      shared/EShopOnAbp.Shared.Hosting.Microservices/DbMigrations/MongoDb/PendingMongoDbMigrationsChecker.cs

8
etc/docker/docker-compose.infrastructure.override.yml

@ -14,6 +14,14 @@ services:
ports:
- "27017:27017"
mongo-express:
ports:
- "8081:8081"
environment:
- ME_CONFIG_MONGODB_SERVER=mongodb
- ME_CONFIG_BASICAUTH_USERNAME=admin
- ME_CONFIG_BASICAUTH_PASSWORD=admin123
postgres-db:
ports:
- "5432:5432"

15
etc/docker/docker-compose.infrastructure.yml

@ -24,6 +24,21 @@ services:
retries: 10
networks:
- eshoponabp-network
mongo-express:
image: mongo-express
container_name: mongo-express
depends_on:
- mongodb
restart: unless-stopped
healthcheck:
test: wget --quiet --tries=3 --spider http://admin:admin123@mongo-express:8081 || exit 1
interval: 30s
timeout: 10s
retries: 3
networks:
- eshoponabp-network
redis:
container_name: redis
image: redis:alpine

9
services/basket/src/EShopOnAbp.BasketService.Contracts/Localization/BasketServiceResource.cs

@ -1,10 +1,9 @@
using Volo.Abp.Localization;
namespace EShopOnAbp.BasketService.Localization
namespace EShopOnAbp.BasketService.Localization;
[LocalizationResourceName("BasketService")]
public class BasketServiceResource
{
[LocalizationResourceName("BasketService")]
public class BasketServiceResource
{
}
}

29
services/basket/src/EShopOnAbp.BasketService/Entities/Orders/OrderPlacedEventHandler.cs

@ -3,23 +3,22 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Uow;
namespace EShopOnAbp.BasketService.Entities.Orders
namespace EShopOnAbp.BasketService.Entities.Orders;
public class OrderPlacedEventHandler : IDistributedEventHandler<OrderPlacedEto>, ITransientDependency
{
public class OrderPlacedEventHandler : IDistributedEventHandler<OrderPlacedEto>, ITransientDependency
{
private readonly IBasketRepository _basketRepository;
private readonly IBasketRepository _basketRepository;
public OrderPlacedEventHandler(IBasketRepository basketRepository)
{
_basketRepository = basketRepository;
}
public OrderPlacedEventHandler(IBasketRepository basketRepository)
{
_basketRepository = basketRepository;
}
[UnitOfWork]
public async Task HandleEventAsync(OrderPlacedEto eventData)
{
var basket = await _basketRepository.GetAsync(eventData.Buyer.BuyerId.GetValueOrDefault());
basket.Clear();
await _basketRepository.UpdateAsync(basket);
}
[UnitOfWork]
public async Task HandleEventAsync(OrderPlacedEto eventData)
{
var basket = await _basketRepository.GetAsync(eventData.Buyer.BuyerId.GetValueOrDefault());
basket.Clear();
await _basketRepository.UpdateAsync(basket);
}
}

5
services/catalog/src/EShopOnAbp.CatalogService.Application/CatalogServiceAppService.cs

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using EShopOnAbp.CatalogService.Localization;
using EShopOnAbp.CatalogService.Localization;
using Volo.Abp.Application.Services;
namespace EShopOnAbp.CatalogService

2
services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/DbMigrations/CatalogServiceDatabaseMigrationChecker.cs

@ -1,6 +1,6 @@
using EShopOnAbp.CatalogService.MongoDB;
using EShopOnAbp.Shared.Hosting.Microservices.DbMigrations;
using System;
using EShopOnAbp.Shared.Hosting.Microservices.DbMigrations.MongoDb;
using Volo.Abp.Data;
using Volo.Abp.DistributedLocking;
using Volo.Abp.MultiTenancy;

9
services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/EntityFrameworkCore/ICmskitServiceDbContext.cs

@ -1,10 +1,9 @@
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace EShopOnAbp.CmskitService.EntityFrameworkCore
namespace EShopOnAbp.CmskitService.EntityFrameworkCore;
[ConnectionStringName(CmskitServiceDbProperties.ConnectionStringName)]
public interface ICmskitServiceDbContext : IEfCoreDbContext
{
[ConnectionStringName(CmskitServiceDbProperties.ConnectionStringName)]
public interface ICmskitServiceDbContext : IEfCoreDbContext
{
}
}

6
services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/DbMigrations/CmskitServiceDatabaseMigrationChecker.cs

@ -8,8 +8,7 @@ using Volo.Abp.Uow;
namespace EShopOnAbp.CmskitService.DbMigrations;
public class CmskitServiceDatabaseMigrationChecker
: PendingEfCoreMigrationsChecker<CmskitServiceDbContext>
public class CmskitServiceDatabaseMigrationChecker : PendingEfCoreMigrationsChecker<CmskitServiceDbContext>
{
public CmskitServiceDatabaseMigrationChecker(
IUnitOfWorkManager unitOfWorkManager,
@ -25,6 +24,5 @@ public class CmskitServiceDatabaseMigrationChecker
abpDistributedLock,
CmskitServiceDbProperties.ConnectionStringName)
{
}
}
}

19
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/OrderingServiceApplicationContractsModule.cs

@ -2,15 +2,14 @@
using Volo.Abp.Modularity;
using Volo.Abp.Authorization;
namespace EShopOnAbp.OrderingService
namespace EShopOnAbp.OrderingService;
[DependsOn(
typeof(OrderingServiceDomainSharedModule),
typeof(AbpDddApplicationContractsModule),
typeof(AbpAuthorizationModule)
)]
public class OrderingServiceApplicationContractsModule : AbpModule
{
[DependsOn(
typeof(OrderingServiceDomainSharedModule),
typeof(AbpDddApplicationContractsModule),
typeof(AbpAuthorizationModule)
)]
public class OrderingServiceApplicationContractsModule : AbpModule
{
}
}
}

11
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/OrderingServiceRemoteServiceConsts.cs

@ -1,7 +1,6 @@
namespace EShopOnAbp.OrderingService
namespace EShopOnAbp.OrderingService;
public static class OrderingServiceRemoteServiceConsts
{
public static class OrderingServiceRemoteServiceConsts
{
public const string RemoteServiceName = "Ordering";
}
}
public const string RemoteServiceName = "Ordering";
}

15
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/DashboardDto.cs

@ -2,12 +2,11 @@
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;
namespace EShopOnAbp.OrderingService.Orders
namespace EShopOnAbp.OrderingService.Orders;
public class DashboardDto: EntityDto
{
public class DashboardDto: EntityDto
{
public List<TopSellingDto> TopSellings { get; set; }
public List<PaymentDto> Payments { get; set; }
public List<OrderStatusDto> OrderStatusDto { get; set; }
}
}
public List<TopSellingDto> TopSellings { get; set; }
public List<PaymentDto> Payments { get; set; }
public List<OrderStatusDto> OrderStatusDto { get; set; }
}

9
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/DashboardInput.cs

@ -1,7 +1,6 @@
namespace EShopOnAbp.OrderingService.Orders
namespace EShopOnAbp.OrderingService.Orders;
public class DashboardInput
{
public class DashboardInput
{
public string Filter { get; set; }
}
public string Filter { get; set; }
}

9
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/GetOrdersInput.cs

@ -1,7 +1,6 @@
namespace EShopOnAbp.OrderingService.Orders
namespace EShopOnAbp.OrderingService.Orders;
public class GetOrdersInput
{
public class GetOrdersInput
{
public string Filter { get; set; }
}
public string Filter { get; set; }
}

29
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Permissions/OrderingServicePermissions.cs

@ -1,22 +1,21 @@
using Volo.Abp.Reflection;
namespace EShopOnAbp.OrderingService.Permissions
namespace EShopOnAbp.OrderingService.Permissions;
public static class OrderingServicePermissions
{
public static class OrderingServicePermissions
{
public const string GroupName = "OrderingService";
public const string GroupName = "OrderingService";
public static class Orders
{
public const string Default = GroupName + ".Orders";
public const string SetAsCancelled = GroupName + ".SetAsCancelled";
public const string SetAsShipped = GroupName + ".SetAsShipped";
public const string Dashboard = GroupName + ".Dashboard";
}
public static class Orders
{
public const string Default = GroupName + ".Orders";
public const string SetAsCancelled = GroupName + ".SetAsCancelled";
public const string SetAsShipped = GroupName + ".SetAsShipped";
public const string Dashboard = GroupName + ".Dashboard";
}
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(OrderingServicePermissions));
}
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(OrderingServicePermissions));
}
}

31
services/ordering/src/EShopOnAbp.OrderingService.Application/OrderingServiceApplicationModule.cs

@ -3,23 +3,22 @@ using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.Application;
namespace EShopOnAbp.OrderingService
namespace EShopOnAbp.OrderingService;
[DependsOn(
typeof(OrderingServiceDomainModule),
typeof(OrderingServiceApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule)
)]
public class OrderingServiceApplicationModule : AbpModule
{
[DependsOn(
typeof(OrderingServiceDomainModule),
typeof(OrderingServiceApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule)
)]
public class OrderingServiceApplicationModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
context.Services.AddAutoMapperObjectMapper<OrderingServiceApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
context.Services.AddAutoMapperObjectMapper<OrderingServiceApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<OrderingServiceApplicationModule>(validate: true);
});
}
options.AddMaps<OrderingServiceApplicationModule>(validate: true);
});
}
}
}

11
services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Localization/OrderingServiceResource.cs

@ -1,10 +1,9 @@
using Volo.Abp.Localization;
namespace EShopOnAbp.OrderingService.Localization
namespace EShopOnAbp.OrderingService.Localization;
[LocalizationResourceName("OrderingService")]
public class OrderingServiceResource
{
[LocalizationResourceName("OrderingService")]
public class OrderingServiceResource
{
}
}
}

47
services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/OrderingServiceDomainSharedModule.cs

@ -7,33 +7,32 @@ using Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;
using EShopOnAbp.PaymentService;
namespace EShopOnAbp.OrderingService
namespace EShopOnAbp.OrderingService;
[DependsOn(
typeof(AbpValidationModule),
typeof(PaymentServiceDomainSharedModule)
)]
public class OrderingServiceDomainSharedModule : AbpModule
{
[DependsOn(
typeof(AbpValidationModule),
typeof(PaymentServiceDomainSharedModule)
)]
public class OrderingServiceDomainSharedModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
Configure<AbpVirtualFileSystemOptions>(options =>
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<OrderingServiceDomainSharedModule>();
});
options.FileSets.AddEmbedded<OrderingServiceDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<OrderingServiceResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/OrderingService");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<OrderingServiceResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/OrderingService");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("OrderingService", typeof(OrderingServiceResource));
});
}
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("OrderingService", typeof(OrderingServiceResource));
});
}
}
}

21
services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Orders/OrderAcceptedEto.cs

@ -3,15 +3,14 @@ using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
namespace EShopOnAbp.OrderingService.Orders
namespace EShopOnAbp.OrderingService.Orders;
[Serializable]
[EventName("EShopOnAbp.Order.Accepted")]
public class OrderAcceptedEto : EtoBase
{
[Serializable]
[EventName("EShopOnAbp.Order.Accepted")]
public class OrderAcceptedEto : EtoBase
{
public Guid OrderId { get; set; }
public string PaymentStatus { get; set; }
public BuyerEto Buyer { get; set; }
public List<OrderItemEto> Items { get; set; }
}
}
public Guid OrderId { get; set; }
public string PaymentStatus { get; set; }
public BuyerEto Buyer { get; set; }
public List<OrderItemEto> Items { get; set; }
}

21
services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/Orders/OrderItemEto.cs

@ -1,16 +1,15 @@
using System;
using Volo.Abp.Domain.Entities.Events.Distributed;
namespace EShopOnAbp.OrderingService.Orders
namespace EShopOnAbp.OrderingService.Orders;
public class OrderItemEto : EtoBase
{
public class OrderItemEto : EtoBase
{
public Guid ProductId { get; set; }
public string ProductCode { get; set; }
public string ProductName { get; set; }
public string PictureUrl { get; set; }
public decimal UnitPrice { get; set; }
public decimal Discount { get; set; }
public int Units { get; set; }
}
public Guid ProductId { get; set; }
public string ProductCode { get; set; }
public string ProductName { get; set; }
public string PictureUrl { get; set; }
public decimal UnitPrice { get; set; }
public decimal Discount { get; set; }
public int Units { get; set; }
}

15
services/ordering/src/EShopOnAbp.OrderingService.Domain/OrderingServiceDbProperties.cs

@ -1,11 +1,10 @@
namespace EShopOnAbp.OrderingService
namespace EShopOnAbp.OrderingService;
public static class OrderingServiceDbProperties
{
public static class OrderingServiceDbProperties
{
public static string DbTablePrefix { get; set; } = "";
public static string DbTablePrefix { get; set; } = "";
public static string DbSchema { get; set; }
public static string DbSchema { get; set; }
public const string ConnectionStringName = "OrderingService";
}
}
public const string ConnectionStringName = "OrderingService";
}

17
services/ordering/src/EShopOnAbp.OrderingService.Domain/OrderingServiceDomainModule.cs

@ -1,14 +1,13 @@
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
namespace EShopOnAbp.OrderingService
namespace EShopOnAbp.OrderingService;
[DependsOn(
typeof(AbpDddDomainModule),
typeof(OrderingServiceDomainSharedModule)
)]
public class OrderingServiceDomainModule : AbpModule
{
[DependsOn(
typeof(AbpDddDomainModule),
typeof(OrderingServiceDomainSharedModule)
)]
public class OrderingServiceDomainModule : AbpModule
{
}
}
}

1
services/ordering/src/EShopOnAbp.OrderingService.Domain/Orders/IOrderRepository.cs

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;

73
services/ordering/src/EShopOnAbp.OrderingService.Domain/PaymentRequests/PaymentRequestEventHandler.cs

@ -7,52 +7,51 @@ using Volo.Abp;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
namespace EShopOnAbp.OrderingService.PaymentRequests
namespace EShopOnAbp.OrderingService.PaymentRequests;
public class PaymentRequestEventHandler : IDistributedEventHandler<PaymentRequestCompletedEto>,
ITransientDependency
{
public class PaymentRequestEventHandler : IDistributedEventHandler<PaymentRequestCompletedEto>,
ITransientDependency
private readonly IDistributedEventBus _eventBus;
private readonly OrderManager _orderManager;
public PaymentRequestEventHandler(IDistributedEventBus eventBus, OrderManager orderManager)
{
private readonly IDistributedEventBus _eventBus;
private readonly OrderManager _orderManager;
_eventBus = eventBus;
_orderManager = orderManager;
}
public PaymentRequestEventHandler(IDistributedEventBus eventBus, OrderManager orderManager)
public async Task HandleEventAsync(PaymentRequestCompletedEto eventData)
{
if (!Guid.TryParse(eventData.OrderId, out var orderId))
{
_eventBus = eventBus;
_orderManager = orderManager;
throw new BusinessException(OrderingServiceErrorCodes.OrderIdIdNotGuid);
}
public async Task HandleEventAsync(PaymentRequestCompletedEto eventData)
{
if (!Guid.TryParse(eventData.OrderId, out var orderId))
{
throw new BusinessException(OrderingServiceErrorCodes.OrderIdIdNotGuid);
}
var acceptedOrder = await _orderManager.AcceptOrderAsync(
orderId, eventData.PaymentRequestId, eventData.State.ToString()
);
var acceptedOrder = await _orderManager.AcceptOrderAsync(
orderId, eventData.PaymentRequestId, eventData.State.ToString()
);
await _eventBus.PublishAsync(new OrderAcceptedEto
await _eventBus.PublishAsync(new OrderAcceptedEto
{
Items = eventData.Products.Select(MapProductToOrderItem).ToList(),
PaymentStatus = acceptedOrder.PaymentStatus,
Buyer = new BuyerEto
{
Items = eventData.Products.Select(MapProductToOrderItem).ToList(),
PaymentStatus = acceptedOrder.PaymentStatus,
Buyer = new BuyerEto
{
BuyerId = acceptedOrder.Buyer.Id,
BuyerEmail = acceptedOrder.Buyer.Email,
BuyerName = acceptedOrder.Buyer.Name
},
OrderId = acceptedOrder.Id
});
}
BuyerId = acceptedOrder.Buyer.Id,
BuyerEmail = acceptedOrder.Buyer.Email,
BuyerName = acceptedOrder.Buyer.Name
},
OrderId = acceptedOrder.Id
});
}
private static OrderItemEto MapProductToOrderItem(PaymentRequestProductEto arg)
private static OrderItemEto MapProductToOrderItem(PaymentRequestProductEto arg)
{
return new OrderItemEto
{
return new OrderItemEto
{
Units = arg.Quantity,
ProductId = Guid.Parse(arg.ReferenceId)
};
}
Units = arg.Quantity,
ProductId = Guid.Parse(arg.ReferenceId)
};
}
}

15
services/ordering/src/EShopOnAbp.OrderingService.Domain/Settings/OrderingServiceSettingDefinitionProvider.cs

@ -1,14 +1,13 @@
using Volo.Abp.Settings;
namespace EShopOnAbp.OrderingService.Settings
namespace EShopOnAbp.OrderingService.Settings;
public class OrderingServiceSettingDefinitionProvider : SettingDefinitionProvider
{
public class OrderingServiceSettingDefinitionProvider : SettingDefinitionProvider
public override void Define(ISettingDefinitionContext context)
{
public override void Define(ISettingDefinitionContext context)
{
/* Define module settings here.
* Use names from OrderingServiceSettings class.
*/
}
/* Define module settings here.
* Use names from OrderingServiceSettings class.
*/
}
}

15
services/ordering/src/EShopOnAbp.OrderingService.Domain/Settings/OrderingServiceSettings.cs

@ -1,11 +1,10 @@
namespace EShopOnAbp.OrderingService.Settings
namespace EShopOnAbp.OrderingService.Settings;
public static class OrderingServiceSettings
{
public static class OrderingServiceSettings
{
public const string GroupName = "OrderingService";
public const string GroupName = "OrderingService";
/* Add constants for setting names. Example:
* public const string MySettingName = GroupName + ".MySettingName";
*/
}
/* Add constants for setting names. Example:
* public const string MySettingName = GroupName + ".MySettingName";
*/
}

17
services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/IOrderingServiceDbContext.cs

@ -3,14 +3,13 @@ using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace EShopOnAbp.OrderingService.EntityFrameworkCore
namespace EShopOnAbp.OrderingService.EntityFrameworkCore;
[ConnectionStringName(OrderingServiceDbProperties.ConnectionStringName)]
public interface IOrderingServiceDbContext : IEfCoreDbContext
{
[ConnectionStringName(OrderingServiceDbProperties.ConnectionStringName)]
public interface IOrderingServiceDbContext : IEfCoreDbContext
{
/* Add DbSet for each Aggregate Root here. Example:
* DbSet<Question> Questions { get; }
*/
DbSet<Order> Orders { get; }
}
/* Add DbSet for each Aggregate Root here. Example:
* DbSet<Question> Questions { get; }
*/
DbSet<Order> Orders { get; }
}

43
services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContextFactory.cs

@ -4,39 +4,38 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
namespace EShopOnAbp.OrderingService.EntityFrameworkCore
namespace EShopOnAbp.OrderingService.EntityFrameworkCore;
/* This class is needed for EF Core console commands
* (like Add-Migration and Update-Database commands) */
public class OrderingServiceDbContextFactory : IDesignTimeDbContextFactory<OrderingServiceDbContext>
{
/* This class is needed for EF Core console commands
* (like Add-Migration and Update-Database commands) */
public class OrderingServiceDbContextFactory : IDesignTimeDbContextFactory<OrderingServiceDbContext>
public OrderingServiceDbContext CreateDbContext(string[] args)
{
public OrderingServiceDbContext CreateDbContext(string[] args)
{
OrderingServiceEfCoreEntityExtensionMappings.Configure();
OrderingServiceEfCoreEntityExtensionMappings.Configure();
var configuration = BuildConfiguration();
var configuration = BuildConfiguration();
var builder = new DbContextOptionsBuilder<OrderingServiceDbContext>()
.UseNpgsql(
var builder = new DbContextOptionsBuilder<OrderingServiceDbContext>()
.UseNpgsql(
configuration.GetConnectionString(OrderingServiceDbProperties.ConnectionStringName),
b =>
{
b.MigrationsHistoryTable("__OrderingService_Migrations");
});
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
return new OrderingServiceDbContext(builder.Options);
}
return new OrderingServiceDbContext(builder.Options);
}
private static IConfigurationRoot BuildConfiguration()
{
var builder = new ConfigurationBuilder()
.SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../EShopOnAbp.OrderingService.HttpApi.Host/"))
.AddJsonFile("appsettings.json", optional: false);
private static IConfigurationRoot BuildConfiguration()
{
var builder = new ConfigurationBuilder()
.SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../EShopOnAbp.OrderingService.HttpApi.Host/"))
.AddJsonFile("appsettings.json", optional: false);
return builder.Build();
}
return builder.Build();
}
}
}

43
services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContextModelCreatingExtensions.cs

@ -1,34 +1,33 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
namespace EShopOnAbp.OrderingService.EntityFrameworkCore
namespace EShopOnAbp.OrderingService.EntityFrameworkCore;
public static class OrderingServiceDbContextModelCreatingExtensions
{
public static class OrderingServiceDbContextModelCreatingExtensions
public static void ConfigureOrderingService(
this ModelBuilder builder)
{
public static void ConfigureOrderingService(
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
Check.NotNull(builder, nameof(builder));
/* Configure all entities here. Example:
/* Configure all entities here. Example:
builder.Entity<Question>(b =>
{
//Configure table & schema name
b.ToTable(OrderingServiceDbProperties.DbTablePrefix + "Questions", OrderingServiceDbProperties.DbSchema);
builder.Entity<Question>(b =>
{
//Configure table & schema name
b.ToTable(OrderingServiceDbProperties.DbTablePrefix + "Questions", OrderingServiceDbProperties.DbSchema);
b.ConfigureByConvention();
b.ConfigureByConvention();
//Properties
b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength);
//Properties
b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength);
//Relations
b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId);
//Relations
b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId);
//Indexes
b.HasIndex(q => q.CreationTime);
});
*/
}
//Indexes
b.HasIndex(q => q.CreationTime);
});
*/
}
}
}

61
services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceEfCoreEntityExtensionMappings.cs

@ -1,39 +1,38 @@
using Volo.Abp.Threading;
namespace EShopOnAbp.OrderingService.EntityFrameworkCore
namespace EShopOnAbp.OrderingService.EntityFrameworkCore;
public static class OrderingServiceEfCoreEntityExtensionMappings
{
public static class OrderingServiceEfCoreEntityExtensionMappings
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
public static void Configure()
{
OneTimeRunner.Run(() =>
{
OneTimeRunner.Run(() =>
{
/* You can configure extra properties for the
* entities defined in the modules used by your application.
*
* This class can be used to map these extra properties to table fields in the database.
*
* USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING.
* USE OrderingServiceModuleExtensionConfigurator CLASS (in the Domain.Shared project)
* FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES
*
* Example: Map a property to a table field:
/* You can configure extra properties for the
* entities defined in the modules used by your application.
*
* This class can be used to map these extra properties to table fields in the database.
*
* USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING.
* USE OrderingServiceModuleExtensionConfigurator CLASS (in the Domain.Shared project)
* FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES
*
* Example: Map a property to a table field:
ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, string>(
"MyProperty",
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(128);
}
);
ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, string>(
"MyProperty",
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(128);
}
);
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
*/
});
}
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
*/
});
}
}
}

55
services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceEntityFrameworkCoreModule.cs

@ -4,40 +4,39 @@ using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.PostgreSql;
using Volo.Abp.Modularity;
namespace EShopOnAbp.OrderingService.EntityFrameworkCore
namespace EShopOnAbp.OrderingService.EntityFrameworkCore;
[DependsOn(
typeof(OrderingServiceDomainModule),
typeof(AbpEntityFrameworkCorePostgreSqlModule)
)]
public class OrderingServiceEntityFrameworkCoreModule : AbpModule
{
[DependsOn(
typeof(OrderingServiceDomainModule),
typeof(AbpEntityFrameworkCorePostgreSqlModule)
)]
public class OrderingServiceEntityFrameworkCoreModule : AbpModule
public override void PreConfigureServices(ServiceConfigurationContext context)
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
OrderingServiceEfCoreEntityExtensionMappings.Configure();
}
OrderingServiceEfCoreEntityExtensionMappings.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<OrderingServiceDbContext>(options =>
{
context.Services.AddAbpDbContext<OrderingServiceDbContext>(options =>
{
/* Remove "includeAllEntities: true" to create
* default repositories only for aggregate roots */
options.AddDefaultRepositories(includeAllEntities: true);
});
/* Remove "includeAllEntities: true" to create
* default repositories only for aggregate roots */
options.AddDefaultRepositories(includeAllEntities: true);
});
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
Configure<AbpDbContextOptions>(options =>
Configure<AbpDbContextOptions>(options =>
{
/* The main point to change your DBMS.
* See also OrderingServiceMigrationsDbContextFactory for EF Core tooling. */
options.UseNpgsql(b =>
{
/* The main point to change your DBMS.
* See also OrderingServiceMigrationsDbContextFactory for EF Core tooling. */
options.UseNpgsql(b =>
{
b.MigrationsHistoryTable("__OrderingService_Migrations");
});
b.MigrationsHistoryTable("__OrderingService_Migrations");
});
}
});
}
}
}

1
services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/Orders/EfCoreOrderRepository.cs

@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

33
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/OrderingServiceHttpApiClientModule.cs

@ -3,25 +3,24 @@ using Volo.Abp.Http.Client;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace EShopOnAbp.OrderingService
namespace EShopOnAbp.OrderingService;
[DependsOn(
typeof(OrderingServiceApplicationContractsModule),
typeof(AbpHttpClientModule))]
public class OrderingServiceHttpApiClientModule : AbpModule
{
[DependsOn(
typeof(OrderingServiceApplicationContractsModule),
typeof(AbpHttpClientModule))]
public class OrderingServiceHttpApiClientModule : AbpModule
public const string RemoteServiceName = "Ordering";
public override void ConfigureServices(ServiceConfigurationContext context)
{
public const string RemoteServiceName = "Ordering";
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddStaticHttpClientProxies(
typeof(OrderingServiceApplicationContractsModule).Assembly,
RemoteServiceName
);
context.Services.AddStaticHttpClientProxies(
typeof(OrderingServiceApplicationContractsModule).Assembly,
RemoteServiceName
);
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<OrderingServiceHttpApiClientModule>();
});
}
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<OrderingServiceHttpApiClientModule>();
});
}
}

3
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/DbMigrations/OrderingServiceDatabaseMigrationChecker.cs

@ -8,8 +8,7 @@ using Volo.Abp.DistributedLocking;
namespace EShopOnAbp.OrderingService.DbMigrations;
public class OrderingServiceDatabaseMigrationChecker
: PendingEfCoreMigrationsChecker<OrderingServiceDbContext>
public class OrderingServiceDatabaseMigrationChecker : PendingEfCoreMigrationsChecker<OrderingServiceDbContext>
{
public OrderingServiceDatabaseMigrationChecker(
IUnitOfWorkManager unitOfWorkManager,

13
services/ordering/src/EShopOnAbp.OrderingService.HttpApi/OrderingServiceController.cs

@ -1,13 +1,12 @@
using EShopOnAbp.OrderingService.Localization;
using Volo.Abp.AspNetCore.Mvc;
namespace EShopOnAbp.OrderingService
namespace EShopOnAbp.OrderingService;
public abstract class OrderingServiceController : AbpControllerBase
{
public abstract class OrderingServiceController : AbpControllerBase
protected OrderingServiceController()
{
protected OrderingServiceController()
{
LocalizationResource = typeof(OrderingServiceResource);
}
LocalizationResource = typeof(OrderingServiceResource);
}
}
}

39
services/ordering/src/EShopOnAbp.OrderingService.HttpApi/OrderingServiceHttpApiModule.cs

@ -5,29 +5,28 @@ using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Microsoft.Extensions.DependencyInjection;
namespace EShopOnAbp.OrderingService
namespace EShopOnAbp.OrderingService;
[DependsOn(
typeof(OrderingServiceApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule))]
public class OrderingServiceHttpApiModule : AbpModule
{
[DependsOn(
typeof(OrderingServiceApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule))]
public class OrderingServiceHttpApiModule : AbpModule
public override void PreConfigureServices(ServiceConfigurationContext context)
{
public override void PreConfigureServices(ServiceConfigurationContext context)
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(OrderingServiceHttpApiModule).Assembly);
});
}
mvcBuilder.AddApplicationPartIfNotExists(typeof(OrderingServiceHttpApiModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpLocalizationOptions>(options =>
{
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<OrderingServiceResource>()
.AddBaseTypes(typeof(AbpUiResource));
});
}
options.Resources
.Get<OrderingServiceResource>()
.AddBaseTypes(typeof(AbpUiResource));
});
}
}
}

13
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; }
}

31
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<PaymentRequestProductCreationDto> Products { get; set; }
}
public string BuyerId { get; set; }
public List<PaymentRequestProductCreationDto> Products { get; set; }
}

29
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<Guid>
{
[Serializable]
public class PaymentRequestDto : CreationAuditedEntityDto<Guid>
{
[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<PaymentRequestProductDto> Products { get; set; }
}
}
public List<PaymentRequestProductDto> Products { get; set; }
}

29
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; }
}

21
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<Guid>
{
public class PaymentRequestProductDto : EntityDto<Guid>
{
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; }
}
}

19
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; }
}

11
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; }
}

9
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
{
}
}
}

1
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;

3
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<PaymentServiceDbContext>
public class PaymentServiceDatabaseMigrationChecker : PendingEfCoreMigrationsChecker<PaymentServiceDbContext>
{
public PaymentServiceDatabaseMigrationChecker(
IUnitOfWorkManager unitOfWorkManager,

8
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<TDbContext> : PendingMigrationsCheckerBase
where TDbContext : AbpMongoDbContext

Loading…
Cancel
Save