Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Refactor and update report services (#529)

Krzysztof Pajakdfb7896461df
diff --git a/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs b/src/Business/Grand.Business.Catalog/Services/Products/ProductsReportService.cs
similarity index 98%
rename from src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs
rename to src/Business/Grand.Business.Catalog/Services/Products/ProductsReportService.cs
index 42e842d31..040a274ad 100644
--- a/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs
+++ b/src/Business/Grand.Business.Catalog/Services/Products/ProductsReportService.cs
@@ -3,7 +3,7 @@ using Grand.Business.Core.Utilities.System;
using Grand.Data;
using Grand.Domain.Catalog;
-namespace Grand.Business.System.Services.Reports;
+namespace Grand.Business.Catalog.Services.Products;
/// <summary>
/// Product report service
diff --git a/src/Business/Grand.Business.Catalog/Startup/StartupApplication.cs b/src/Business/Grand.Business.Catalog/Startup/StartupApplication.cs
index 26fdaecfd..a530fa153 100644
--- a/src/Business/Grand.Business.Catalog/Startup/StartupApplication.cs
+++ b/src/Business/Grand.Business.Catalog/Startup/StartupApplication.cs
@@ -17,6 +17,7 @@ using Grand.Business.Core.Interfaces.Catalog.Prices;
using Grand.Business.Core.Interfaces.Catalog.Products;
using Grand.Business.Core.Interfaces.Catalog.Tax;
using Grand.Business.Core.Interfaces.ExportImport;
+using Grand.Business.Core.Interfaces.System.Reports;
using Grand.Domain.Catalog;
using Grand.Infrastructure;
using Microsoft.AspNetCore.Builder;
@@ -67,6 +68,7 @@ public class StartupApplication : IStartupApplication
serviceCollection.AddScoped<ICategoryLayoutService, CategoryLayoutService>();
serviceCollection.AddScoped<ICollectionLayoutService, CollectionLayoutService>();
serviceCollection.AddScoped<IProductTagService, ProductTagService>();
+ serviceCollection.AddScoped<IProductsReportService, ProductsReportService>();
serviceCollection.AddScoped<ICustomerGroupProductService, CustomerGroupProductService>();
serviceCollection.AddScoped<IInventoryManageService, InventoryManageService>();
serviceCollection.AddScoped<IStockQuantityService, StockQuantityService>();
diff --git a/src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs b/src/Business/Grand.Business.Checkout/Services/Orders/OrderReportService.cs
similarity index 99%
rename from src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs
rename to src/Business/Grand.Business.Checkout/Services/Orders/OrderReportService.cs
index 9b5fd2d54..5753742c1 100644
--- a/src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs
+++ b/src/Business/Grand.Business.Checkout/Services/Orders/OrderReportService.cs
@@ -9,7 +9,7 @@ using Grand.Domain.Payments;
using Grand.Domain.Shipping;
using System.Globalization;
-namespace Grand.Business.System.Services.Reports;
+namespace Grand.Business.Checkout.Services.Orders;
/// <summary>
/// Order report service
diff --git a/src/Business/Grand.Business.Checkout/Startup/StartupApplication.cs b/src/Business/Grand.Business.Checkout/Startup/StartupApplication.cs
index 9e1d39ff1..b48043fb4 100644
--- a/src/Business/Grand.Business.Checkout/Startup/StartupApplication.cs
+++ b/src/Business/Grand.Business.Checkout/Startup/StartupApplication.cs
@@ -10,6 +10,7 @@ using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Checkout.Payments;
using Grand.Business.Core.Interfaces.Checkout.Shipping;
using Grand.Business.Core.Interfaces.ExportImport;
+using Grand.Business.Core.Interfaces.System.Reports;
using Grand.Domain.Orders;
using Grand.Infrastructure;
using Microsoft.AspNetCore.Builder;
@@ -52,6 +53,7 @@ public class StartupApplication : IStartupApplication
serviceCollection.AddScoped<ICheckoutAttributeParser, CheckoutAttributeParser>();
serviceCollection.AddScoped<ICheckoutAttributeService, CheckoutAttributeService>();
serviceCollection.AddScoped<IOrderTagService, OrderTagService>();
+ serviceCollection.AddScoped<IOrderReportService, OrderReportService>();
}
private void RegisterPaymentsService(IServiceCollection serviceCollection)
diff --git a/src/Business/Grand.Business.System/Services/Reports/CustomerReportService.cs b/src/Business/Grand.Business.Customers/Services/CustomerReportService.cs
similarity index 99%
rename from src/Business/Grand.Business.System/Services/Reports/CustomerReportService.cs
rename to src/Business/Grand.Business.Customers/Services/CustomerReportService.cs
index 29434d34b..1f0c740e4 100644
--- a/src/Business/Grand.Business.System/Services/Reports/CustomerReportService.cs
+++ b/src/Business/Grand.Business.Customers/Services/CustomerReportService.cs
@@ -8,7 +8,7 @@ using Grand.Domain.Orders;
using Grand.Domain.Payments;
using Grand.Domain.Shipping;
-namespace Grand.Business.System.Services.Reports;
+namespace Grand.Business.Customers.Services;
/// <summary>
/// Customer report service
diff --git a/src/Business/Grand.Business.Customers/Startup/StartupApplication.cs b/src/Business/Grand.Business.Customers/Startup/StartupApplication.cs
index c2835e49c..6014744c0 100644
--- a/src/Business/Grand.Business.Customers/Startup/StartupApplication.cs
+++ b/src/Business/Grand.Business.Customers/Startup/StartupApplication.cs
@@ -1,5 +1,6 @@
using Grand.Business.Core.Interfaces.Customers;
using Grand.Business.Core.Interfaces.ExportImport;
+using Grand.Business.Core.Interfaces.System.Reports;
using Grand.Business.Customers.Services;
using Grand.Business.Customers.Services.ExportImport;
using Grand.Domain.Common;
@@ -35,6 +36,7 @@ public class StartupApplication : IStartupApplication
serviceCollection.AddScoped<ICustomerNoteService, CustomerNoteService>();
serviceCollection.AddScoped<ICustomerHistoryPasswordService, CustomerHistoryPasswordService>();
serviceCollection.AddScoped<ICustomerManagerService, CustomerManagerService>();
+ serviceCollection.AddScoped<ICustomerReportService, CustomerReportService>();
serviceCollection.AddScoped<ISalesEmployeeService, SalesEmployeeService>();
serviceCollection.AddScoped<IUserApiService, UserApiService>();
serviceCollection.AddScoped<IAffiliateService, AffiliateService>();
diff --git a/src/Business/Grand.Business.System/Startup/StartupApplication.cs b/src/Business/Grand.Business.System/Startup/StartupApplication.cs
index c9de784d9..d185668b6 100644
--- a/src/Business/Grand.Business.System/Startup/StartupApplication.cs
+++ b/src/Business/Grand.Business.System/Startup/StartupApplication.cs
@@ -1,7 +1,5 @@
-using Grand.Business.Core.Interfaces.System.Reports;
-using Grand.Business.Core.Interfaces.System.ScheduleTasks;
+using Grand.Business.Core.Interfaces.System.ScheduleTasks;
using Grand.Business.System.Services.BackgroundServices.ScheduleTasks;
-using Grand.Business.System.Services.Reports;
using Grand.Infrastructure;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@@ -14,7 +12,6 @@ public class StartupApplication : IStartupApplication
{
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
- RegisterReports(services);
RegisterTask(services);
}
@@ -37,10 +34,4 @@ public class StartupApplication : IStartupApplication
serviceCollection.AddScoped<IScheduleTask, EndAuctionsTask>();
serviceCollection.AddScoped<IScheduleTask, CancelOrderScheduledTask>();
}
- private void RegisterReports(IServiceCollection serviceCollection)
- {
- serviceCollection.AddScoped<ICustomerReportService, CustomerReportService>();
- serviceCollection.AddScoped<IOrderReportService, OrderReportService>();
- serviceCollection.AddScoped<IProductsReportService, ProductsReportService>();
- }
}
\ No newline at end of file