diff --git a/src/Zeus.Infrastructure/Configuration/Modules/PlcModule.cs b/src/Zeus.Infrastructure/Configuration/Modules/PlcModule.cs deleted file mode 100644 index 2a25209..0000000 --- a/src/Zeus.Infrastructure/Configuration/Modules/PlcModule.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Autofac; -using Zeus.Enums.Plcs; -using Zeus.Infrastructure.Plc; -using Zeus.Infrastructure.Plc.Base; - -namespace Zeus.Infrastructure.Configuration.Modules -{ - internal sealed class PlcModule : Module - { - protected override void Load(ContainerBuilder builder) - { - builder - .RegisterType() - .Keyed(PlcType.Meter); - - builder - .RegisterType() - .Keyed(PlcType.Rvd145); - } - } -} diff --git a/src/Zeus.Infrastructure/Configuration/Modules/ReportModule.cs b/src/Zeus.Infrastructure/Configuration/Modules/ReportModule.cs index 1db1457..b19c738 100644 --- a/src/Zeus.Infrastructure/Configuration/Modules/ReportModule.cs +++ b/src/Zeus.Infrastructure/Configuration/Modules/ReportModule.cs @@ -1,13 +1,33 @@ using Autofac; +using Zeus.Enums.Plcs; using Zeus.Enums.Reports; -using Zeus.Infrastructure.Reports; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Plcs; +using Zeus.Infrastructure.Reports.Plcs.Base; +using Zeus.Infrastructure.Reports.Types; +using Zeus.Infrastructure.Reports.Types.Base; namespace Zeus.Infrastructure.Configuration.Modules { internal sealed class ReportModule : Module { protected override void Load(ContainerBuilder builder) + { + RegisterPlcProcessors(builder); + RegisterTypeProcessors(builder); + } + + private static void RegisterPlcProcessors(ContainerBuilder builder) + { + builder + .RegisterType() + .Keyed(PlcType.Meter); + + builder + .RegisterType() + .Keyed(PlcType.Rvd145); + } + + private static void RegisterTypeProcessors(ContainerBuilder builder) { builder .RegisterType() diff --git a/src/Zeus.Infrastructure/Configuration/ZeusModule.cs b/src/Zeus.Infrastructure/Configuration/ZeusModule.cs index 873abb4..86f8b4a 100644 --- a/src/Zeus.Infrastructure/Configuration/ZeusModule.cs +++ b/src/Zeus.Infrastructure/Configuration/ZeusModule.cs @@ -30,7 +30,6 @@ private void RegisterMappers(ContainerBuilder builder) private void RegisterModules(ContainerBuilder builder) { builder.RegisterModule(); - builder.RegisterModule(); builder.RegisterModule(); builder.RegisterModule(); builder.RegisterModule(new SettingsModule(_configuration)); diff --git a/src/Zeus.Infrastructure/Handlers/Reports/Queries/GetReportHandler.cs b/src/Zeus.Infrastructure/Handlers/Reports/Queries/GetReportHandler.cs index 560a9fc..4b5ded4 100644 --- a/src/Zeus.Infrastructure/Handlers/Reports/Queries/GetReportHandler.cs +++ b/src/Zeus.Infrastructure/Handlers/Reports/Queries/GetReportHandler.cs @@ -13,8 +13,8 @@ using Zeus.Infrastructure.Extensions; using Zeus.Infrastructure.Handlers.Base; using Zeus.Infrastructure.Mongo; -using Zeus.Infrastructure.Plc.Base; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Plcs.Base; +using Zeus.Infrastructure.Reports.Types.Base; using Zeus.Infrastructure.Repositories; using Zeus.Models.Devices.Dto; using Zeus.Models.Locations.Dto; diff --git a/src/Zeus.Infrastructure/Plc/Base/BasePlcProcessor.cs b/src/Zeus.Infrastructure/Reports/Plcs/Base/BasePlcProcessor.cs similarity index 91% rename from src/Zeus.Infrastructure/Plc/Base/BasePlcProcessor.cs rename to src/Zeus.Infrastructure/Reports/Plcs/Base/BasePlcProcessor.cs index 3df33dc..397b2d1 100644 --- a/src/Zeus.Infrastructure/Plc/Base/BasePlcProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Plcs/Base/BasePlcProcessor.cs @@ -7,12 +7,12 @@ using MongoDB.Driver; using MongoDB.Driver.Linq; using Zeus.Domain.Base; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Types.Base; using Zeus.Models.Base.Dto; using Zeus.Models.Devices.Dto; using Zeus.Models.Utilities; -namespace Zeus.Infrastructure.Plc.Base +namespace Zeus.Infrastructure.Reports.Plcs.Base { internal abstract class BasePlcProcessor { diff --git a/src/Zeus.Infrastructure/Plc/Base/IPlcProcessor.cs b/src/Zeus.Infrastructure/Reports/Plcs/Base/IPlcProcessor.cs similarity index 83% rename from src/Zeus.Infrastructure/Plc/Base/IPlcProcessor.cs rename to src/Zeus.Infrastructure/Reports/Plcs/Base/IPlcProcessor.cs index a5558a0..505eab6 100644 --- a/src/Zeus.Infrastructure/Plc/Base/IPlcProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Plcs/Base/IPlcProcessor.cs @@ -4,11 +4,11 @@ using System.Threading.Tasks; using AutoMapper; using OfficeOpenXml; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Types.Base; using Zeus.Infrastructure.Repositories; using Zeus.Models.Devices.Dto; -namespace Zeus.Infrastructure.Plc.Base +namespace Zeus.Infrastructure.Reports.Plcs.Base { internal interface IPlcProcessor { diff --git a/src/Zeus.Infrastructure/Plc/MeterPlcProcessor.cs b/src/Zeus.Infrastructure/Reports/Plcs/MeterPlcProcessor.cs similarity index 98% rename from src/Zeus.Infrastructure/Plc/MeterPlcProcessor.cs rename to src/Zeus.Infrastructure/Reports/Plcs/MeterPlcProcessor.cs index bc3a015..e7c3be7 100644 --- a/src/Zeus.Infrastructure/Plc/MeterPlcProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Plcs/MeterPlcProcessor.cs @@ -10,15 +10,15 @@ using OfficeOpenXml; using Zeus.Domain.Plcs.Meters; using Zeus.Infrastructure.Mongo; -using Zeus.Infrastructure.Plc.Base; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Plcs.Base; +using Zeus.Infrastructure.Reports.Types.Base; using Zeus.Infrastructure.Repositories; using Zeus.Models.Devices.Dto; using Zeus.Models.Plcs.Meters.Dto; using Zeus.Models.Utilities; using Zeus.Utilities.Extensions; -namespace Zeus.Infrastructure.Plc +namespace Zeus.Infrastructure.Reports.Plcs { internal sealed class MeterPlcProcessor : BasePlcProcessor, IPlcProcessor { diff --git a/src/Zeus.Infrastructure/Plc/Rvd145PlcProcessor.cs b/src/Zeus.Infrastructure/Reports/Plcs/Rvd145PlcProcessor.cs similarity index 98% rename from src/Zeus.Infrastructure/Plc/Rvd145PlcProcessor.cs rename to src/Zeus.Infrastructure/Reports/Plcs/Rvd145PlcProcessor.cs index db6cd1d..b75d3d9 100644 --- a/src/Zeus.Infrastructure/Plc/Rvd145PlcProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Plcs/Rvd145PlcProcessor.cs @@ -8,14 +8,14 @@ using MongoDB.Driver; using OfficeOpenXml; using Zeus.Domain.Plcs.Rvds; -using Zeus.Infrastructure.Plc.Base; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Plcs.Base; +using Zeus.Infrastructure.Reports.Types.Base; using Zeus.Infrastructure.Repositories; using Zeus.Models.Devices.Dto; using Zeus.Models.Plcs.Rvds.Dto; using Zeus.Utilities.Extensions; -namespace Zeus.Infrastructure.Plc +namespace Zeus.Infrastructure.Reports.Plcs { internal sealed class Rvd145PlcProcessor : BasePlcProcessor, IPlcProcessor { diff --git a/src/Zeus.Infrastructure/Reports/Base/BaseReportProcessor.cs b/src/Zeus.Infrastructure/Reports/Types/Base/BaseReportProcessor.cs similarity index 92% rename from src/Zeus.Infrastructure/Reports/Base/BaseReportProcessor.cs rename to src/Zeus.Infrastructure/Reports/Types/Base/BaseReportProcessor.cs index 3456d0c..958ce79 100644 --- a/src/Zeus.Infrastructure/Reports/Base/BaseReportProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Types/Base/BaseReportProcessor.cs @@ -1,7 +1,7 @@ using System; using Zeus.Models.Utilities; -namespace Zeus.Infrastructure.Reports.Base +namespace Zeus.Infrastructure.Reports.Types.Base { internal abstract class BaseReportProcessor { diff --git a/src/Zeus.Infrastructure/Reports/Base/IReportProcessor.cs b/src/Zeus.Infrastructure/Reports/Types/Base/IReportProcessor.cs similarity index 92% rename from src/Zeus.Infrastructure/Reports/Base/IReportProcessor.cs rename to src/Zeus.Infrastructure/Reports/Types/Base/IReportProcessor.cs index 912b028..d80866a 100644 --- a/src/Zeus.Infrastructure/Reports/Base/IReportProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Types/Base/IReportProcessor.cs @@ -4,7 +4,7 @@ using Zeus.Enums.Reports; using Zeus.Models.Utilities; -namespace Zeus.Infrastructure.Reports.Base +namespace Zeus.Infrastructure.Reports.Types.Base { internal interface IReportProcessor { diff --git a/src/Zeus.Infrastructure/Reports/DayOfYearReportProcessor.cs b/src/Zeus.Infrastructure/Reports/Types/DayOfYearReportProcessor.cs similarity index 92% rename from src/Zeus.Infrastructure/Reports/DayOfYearReportProcessor.cs rename to src/Zeus.Infrastructure/Reports/Types/DayOfYearReportProcessor.cs index bd0623f..caf783c 100644 --- a/src/Zeus.Infrastructure/Reports/DayOfYearReportProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Types/DayOfYearReportProcessor.cs @@ -2,10 +2,10 @@ using System.Linq.Expressions; using Zeus.Domain.Base; using Zeus.Enums.Reports; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Types.Base; using Zeus.Models.Utilities; -namespace Zeus.Infrastructure.Reports +namespace Zeus.Infrastructure.Reports.Types { internal sealed class DayOfYearReportProcessor : BaseReportProcessor, IReportProcessor { diff --git a/src/Zeus.Infrastructure/Reports/DayReportProcessor.cs b/src/Zeus.Infrastructure/Reports/Types/DayReportProcessor.cs similarity index 92% rename from src/Zeus.Infrastructure/Reports/DayReportProcessor.cs rename to src/Zeus.Infrastructure/Reports/Types/DayReportProcessor.cs index 61703d8..b0e6988 100644 --- a/src/Zeus.Infrastructure/Reports/DayReportProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Types/DayReportProcessor.cs @@ -2,10 +2,10 @@ using System.Linq.Expressions; using Zeus.Domain.Base; using Zeus.Enums.Reports; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Types.Base; using Zeus.Models.Utilities; -namespace Zeus.Infrastructure.Reports +namespace Zeus.Infrastructure.Reports.Types { internal sealed class DayReportProcessor : BaseReportProcessor, IReportProcessor { diff --git a/src/Zeus.Infrastructure/Reports/MonthReportProcessor.cs b/src/Zeus.Infrastructure/Reports/Types/MonthReportProcessor.cs similarity index 92% rename from src/Zeus.Infrastructure/Reports/MonthReportProcessor.cs rename to src/Zeus.Infrastructure/Reports/Types/MonthReportProcessor.cs index bf36b6f..210d68a 100644 --- a/src/Zeus.Infrastructure/Reports/MonthReportProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Types/MonthReportProcessor.cs @@ -2,10 +2,10 @@ using System.Linq.Expressions; using Zeus.Domain.Base; using Zeus.Enums.Reports; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Types.Base; using Zeus.Models.Utilities; -namespace Zeus.Infrastructure.Reports +namespace Zeus.Infrastructure.Reports.Types { internal sealed class MonthReportProcessor : BaseReportProcessor, IReportProcessor { diff --git a/src/Zeus.Infrastructure/Reports/YearReportProcessor.cs b/src/Zeus.Infrastructure/Reports/Types/YearReportProcessor.cs similarity index 92% rename from src/Zeus.Infrastructure/Reports/YearReportProcessor.cs rename to src/Zeus.Infrastructure/Reports/Types/YearReportProcessor.cs index 1688adb..523c183 100644 --- a/src/Zeus.Infrastructure/Reports/YearReportProcessor.cs +++ b/src/Zeus.Infrastructure/Reports/Types/YearReportProcessor.cs @@ -2,10 +2,10 @@ using System.Linq.Expressions; using Zeus.Domain.Base; using Zeus.Enums.Reports; -using Zeus.Infrastructure.Reports.Base; +using Zeus.Infrastructure.Reports.Types.Base; using Zeus.Models.Utilities; -namespace Zeus.Infrastructure.Reports +namespace Zeus.Infrastructure.Reports.Types { internal sealed class YearReportProcessor : BaseReportProcessor, IReportProcessor {