Skip to content

Commit

Permalink
Refactor and update report services (#529)
Browse files Browse the repository at this point in the history
Refactored report services by removing and re-adding `OrderReportService` and `CustomerReportService` with updated namespaces and implementations. Removed `CustomerReportService.cs` and `OrderReportService.cs` files, and re-added them in new namespaces with enhanced methods and dependencies. Updated `ProductsReportService` namespace and removed `RegisterReports` method from `StartupApplication.cs`.
  • Loading branch information
KrzysztofPajak authored Nov 24, 2024
1 parent 6e96174 commit dfb7896
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Grand.Data;
using Grand.Domain.Catalog;

namespace Grand.Business.System.Services.Reports;
namespace Grand.Business.Catalog.Services.Products;

/// <summary>
/// Product report service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
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;
Expand Down Expand Up @@ -67,6 +68,7 @@ private void RegisterCatalogService(IServiceCollection serviceCollection)
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>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Grand.Domain.Shipping;
using System.Globalization;

namespace Grand.Business.System.Services.Reports;
namespace Grand.Business.Checkout.Services.Orders;

/// <summary>
/// Order report service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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;
Expand Down Expand Up @@ -52,6 +53,7 @@ private void RegisterOrdersService(IServiceCollection serviceCollection)
serviceCollection.AddScoped<ICheckoutAttributeParser, CheckoutAttributeParser>();
serviceCollection.AddScoped<ICheckoutAttributeService, CheckoutAttributeService>();
serviceCollection.AddScoped<IOrderTagService, OrderTagService>();
serviceCollection.AddScoped<IOrderReportService, OrderReportService>();
}

private void RegisterPaymentsService(IServiceCollection serviceCollection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Grand.Domain.Payments;
using Grand.Domain.Shipping;

namespace Grand.Business.System.Services.Reports;
namespace Grand.Business.Customers.Services;

/// <summary>
/// Customer report service
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -35,6 +36,7 @@ private void RegisterCustomerService(IServiceCollection serviceCollection)
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>();
Expand Down
11 changes: 1 addition & 10 deletions src/Business/Grand.Business.System/Startup/StartupApplication.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -14,7 +12,6 @@ public class StartupApplication : IStartupApplication
{
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
RegisterReports(services);
RegisterTask(services);
}

Expand All @@ -37,10 +34,4 @@ private void RegisterTask(IServiceCollection serviceCollection)
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>();
}
}

0 comments on commit dfb7896

Please sign in to comment.