DD.WellWorkover.Cloud/AsbCloudInfrastructure/DependencyInjection.cs

622 lines
37 KiB
C#

using AsbCloudApp.Data;
using AsbCloudApp.Data.DailyReport.Blocks.TimeBalance;
using AsbCloudApp.Data.DetectedOperation;
using AsbCloudApp.Data.DrillTestReport;
using AsbCloudApp.Data.Manuals;
using AsbCloudApp.Data.ProcessMaps;
using AsbCloudApp.Data.SAUB;
using AsbCloudApp.Data.Subsystems;
using AsbCloudApp.Data.Trajectory;
using AsbCloudApp.Repositories;
using AsbCloudApp.Requests;
using AsbCloudApp.Services;
using AsbCloudApp.Services.DailyReport;
using AsbCloudApp.Services.Notifications;
using AsbCloudApp.Services.ProcessMaps.WellDrilling;
using AsbCloudDb.Model;
using AsbCloudDb.Model.DailyReports.Blocks.TimeBalance;
using AsbCloudDb.Model.Manuals;
using AsbCloudDb.Model.ProcessMapPlan;
using AsbCloudDb.Model.ProcessMaps;
using AsbCloudDb.Model.Trajectory;
using AsbCloudDb.Model.WellSections;
using AsbCloudInfrastructure.Background;
using AsbCloudInfrastructure.Repository;
using AsbCloudInfrastructure.Services;
using AsbCloudInfrastructure.Services.DailyReport;
using AsbCloudInfrastructure.Services.DetectOperations;
using AsbCloudInfrastructure.Services.DrillingProgram;
using AsbCloudInfrastructure.Services.DrillTestReport;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
using AsbCloudInfrastructure.Services.ProcessMaps.Report;
using AsbCloudInfrastructure.Services.SAUB;
using AsbCloudInfrastructure.Services.Subsystems;
using AsbCloudInfrastructure.Services.Trajectory;
using AsbCloudInfrastructure.Services.Trajectory.Export;
using AsbCloudInfrastructure.Services.Trajectory.Parser;
using AsbCloudInfrastructure.Services.WellOperations.Factories;
using AsbCloudInfrastructure.Services.WellOperationService;
using Mapster;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace AsbCloudInfrastructure
{
public static class DependencyInjection
{
public static void MapsterSetup()
{
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<SetpointsRequestDto, SetpointsRequest>()
.Ignore(source => source.Author)
.Ignore(source => source.Well);
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<DetectedOperationDto, DetectedOperation>()
.Ignore(source => source.OperationCategory);
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<ScheduleDto, Schedule>()
.Ignore(source => source.Driller);
#pragma warning disable CS8603 // Possible null reference return.
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<ProcessMapPlanBaseDto, ProcessMapPlanBase>()
.Ignore(dst => dst.Author, dst => dst.Editor);
#pragma warning restore CS8603 // Possible null reference return.
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<DateTimeOffset, DateTime>()
.MapWith((source) => source.DateTime);
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<DateTime, DateTimeOffset>()
.MapWith((source) => source == default ? new DateTime(0, DateTimeKind.Utc) : source);
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<TimeDto, TimeOnly>()
.MapWith((source) => source.MakeTimeOnly());
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<TimeOnly, TimeDto>()
.MapWith((source) => new(source));
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<TimeOnly, TimeDto>()
.MapWith((source) => new(source));
#pragma warning disable CS8603 // Possible null reference return.
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<WellDto, Well>()
.Ignore(dst => dst.Cluster,
dst => dst.RelationCompaniesWells,
dst => dst.Telemetry,
dst => dst.WellComposites,
dst => dst.WellCompositeSrcs,
dst => dst.WellOperations,
dst => dst.WellType);
#pragma warning restore CS8603 // Possible null reference return.
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<ClusterDto, Cluster>()
.Ignore(dst => dst.Deposit,
dst => dst.Wells);
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<FileCategoryDto, FileCategory>();
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<WellFinalDocumentDto, WellFinalDocument>();
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<NotificationDto, Notification>()
.Ignore(dst => dst.NotificationCategory,
dst => dst.User);
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<TimeBalanceRecord, TimeBalanceRecordDto>()
.Map(dest => dest.DurationHours, src => new PlanFactDto<double?>()
{
Plan = src.DurationHoursPlan,
Fact = src.DurationHoursFact
});
TypeAdapterConfig.GlobalSettings.Default.Config
.ForType<TimeBalanceBlock, TimeBalanceBlockDto>()
.Map(dest => dest.WellDepth, src => new PlanFactDto<double?>()
{
Plan = src.WellDepthPlan
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanRotorDto>>.NewConfig()
.Include<ProcessMapPlanRotor, ChangeLogDto<ProcessMapPlanRotorDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanRotorDto>()
{
Item = src.Adapt<ProcessMapPlanRotorDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanSlideDto>>.NewConfig()
.Include<ProcessMapPlanSlide, ChangeLogDto<ProcessMapPlanSlideDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanSlideDto>()
{
Item = src.Adapt<ProcessMapPlanSlideDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanReamingRotorDto>>.NewConfig()
.Include<ProcessMapPlanReamingRotor, ChangeLogDto<ProcessMapPlanReamingRotorDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanReamingRotorDto>()
{
Item = src.Adapt<ProcessMapPlanReamingRotorDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanReamingSlideDto>>.NewConfig()
.Include<ProcessMapPlanReamingSlide, ChangeLogDto<ProcessMapPlanReamingSlideDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanReamingSlideDto>()
{
Item = src.Adapt<ProcessMapPlanReamingSlideDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanLoadCapacityDto>>.NewConfig()
.Include<ProcessMapPlanLoadCapacity, ChangeLogDto<ProcessMapPlanLoadCapacityDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanLoadCapacityDto>()
{
Item = src.Adapt<ProcessMapPlanLoadCapacityDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanRecordingStaticMeasurementDto>>.NewConfig()
.Include<ProcessMapPlanRecordingStaticMeasurement, ChangeLogDto<ProcessMapPlanRecordingStaticMeasurementDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanRecordingStaticMeasurementDto>()
{
Item = src.Adapt<ProcessMapPlanRecordingStaticMeasurementDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanPositioningOffTheBottomDto>>.NewConfig()
.Include<ProcessMapPlanPositioningOffTheBottom, ChangeLogDto<ProcessMapPlanPositioningOffTheBottomDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanPositioningOffTheBottomDto>()
{
Item = src.Adapt<ProcessMapPlanPositioningOffTheBottomDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanOscillationAnglesDto>>.NewConfig()
.Include<ProcessMapPlanOscillationAngles, ChangeLogDto<ProcessMapPlanOscillationAnglesDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanOscillationAnglesDto>()
{
Item = src.Adapt<ProcessMapPlanOscillationAnglesDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanTFOrientationDto>>.NewConfig()
.Include<ProcessMapPlanTFOrientation, ChangeLogDto<ProcessMapPlanTFOrientationDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanTFOrientationDto>()
{
Item = src.Adapt<ProcessMapPlanTFOrientationDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanSwitchingOffThePumpDto>>.NewConfig()
.Include<ProcessMapPlanSwitchingOffThePump, ChangeLogDto<ProcessMapPlanSwitchingOffThePumpDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanSwitchingOffThePumpDto>()
{
Item = src.Adapt<ProcessMapPlanSwitchingOffThePumpDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanSwitchingToTheModeDto>>.NewConfig()
.Include<ProcessMapPlanSwitchingToTheMode, ChangeLogDto<ProcessMapPlanSwitchingToTheModeDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanSwitchingToTheModeDto>()
{
Item = src.Adapt<ProcessMapPlanSwitchingToTheModeDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanDrillTestDto>>.NewConfig()
.Include<ProcessMapPlanSwitchingToTheMode, ChangeLogDto<ProcessMapPlanDrillTestDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanDrillTestDto>()
{
Item = src.Adapt<ProcessMapPlanDrillTestDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanShockTestDto>>.NewConfig()
.Include<ProcessMapPlanSwitchingToTheMode, ChangeLogDto<ProcessMapPlanShockTestDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanShockTestDto>()
{
Item = src.Adapt<ProcessMapPlanShockTestDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanDamperDto>>.NewConfig()
.Include<ProcessMapPlanDamper, ChangeLogDto<ProcessMapPlanDamperDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanDamperDto>()
{
Item = src.Adapt<ProcessMapPlanDamperDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanAutoHoldTFDto>>.NewConfig()
.Include<ProcessMapPlanAutoHoldTF, ChangeLogDto<ProcessMapPlanAutoHoldTFDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanAutoHoldTFDto>()
{
Item = src.Adapt<ProcessMapPlanAutoHoldTFDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<RotorRpmAccelerationDto>>.NewConfig()
.Include<ProcessMapPlanRotorRpmAcceleration, ChangeLogDto<RotorRpmAccelerationDto>>()
.Map(dest => dest, src => new ChangeLogDto<RotorRpmAccelerationDto>()
{
Item = src.Adapt<RotorRpmAccelerationDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanUpdatingNoloadParametersDto>>.NewConfig()
.Include<ProcessMapPlanUpdatingNoloadParameters, ChangeLogDto<ProcessMapPlanUpdatingNoloadParametersDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanUpdatingNoloadParametersDto>()
{
Item = src.Adapt<ProcessMapPlanUpdatingNoloadParametersDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanOscillationDto>>.NewConfig()
.Include<ProcessMapPlanOscillation, ChangeLogDto<ProcessMapPlanOscillationDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanOscillationDto>()
{
Item = src.Adapt<ProcessMapPlanOscillationDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanAntiCrashRotationDto>>.NewConfig()
.Include<ProcessMapPlanAntiCrashRotation, ChangeLogDto<ProcessMapPlanAntiCrashRotationDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanAntiCrashRotationDto>()
{
Item = src.Adapt<ProcessMapPlanAntiCrashRotationDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanStaticMeasurementOutputDto>>.NewConfig()
.Include<ProcessMapPlanStaticMeasurementOutput, ChangeLogDto<ProcessMapPlanStaticMeasurementOutputDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanStaticMeasurementOutputDto>()
{
Item = src.Adapt<ProcessMapPlanStaticMeasurementOutputDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanRotorLoweringBitDto>>.NewConfig()
.Include<ProcessMapPlanRotorLoweringBit, ChangeLogDto<ProcessMapPlanRotorLoweringBitDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanRotorLoweringBitDto>()
{
Item = src.Adapt<ProcessMapPlanRotorLoweringBitDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanSlideLoweringBitDto>>.NewConfig()
.Include<ProcessMapPlanSlideLoweringBit, ChangeLogDto<ProcessMapPlanSlideLoweringBitDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanSlideLoweringBitDto>()
{
Item = src.Adapt<ProcessMapPlanSlideLoweringBitDto>()
});
}
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
{
MapsterSetup();
string connectionStringName = "DefaultConnection";
#if DEBUG
connectionStringName = "DebugConnection";
#endif
services.AddDbContext<AsbCloudDbContext>(options =>
options.UseNpgsql(configuration.GetConnectionString(connectionStringName)));
services.AddMemoryCache();
services.AddScoped<IAsbCloudDbContext>(provider => provider.GetRequiredService<AsbCloudDbContext>());
services.AddSingleton(new WitsInfoService());
services.AddSingleton<ITelemetryDataCache<TelemetryDataSaubDto>>(provider =>
TelemetryDataCache<TelemetryDataSaubDto>.GetInstance<TelemetryDataSaub>(provider));
services.AddSingleton<ITelemetryDataCache<TelemetryDataSpinDto>>(provider =>
TelemetryDataCache<TelemetryDataSpinDto>.GetInstance<TelemetryDataSpin>(provider));
services.AddSingleton<IRequerstTrackerService, RequestTrackerService>();
services.AddSingleton<PeriodicBackgroundWorker>();
services.AddSingleton<BackgroundWorker>();
services.AddSingleton<NotificationBackgroundWorker>();
services.AddSingleton<IReduceSamplingService>(provider => ReduceSamplingService.GetInstance(configuration));
services.AddTransient<IAuthService, AuthService>();
services.AddTransient<IDepositRepository, DepositRepository>();
services.AddTransient<IDrillingProgramService, DrillingProgramService>();
services.AddTransient<IEventService, EventService>();
services.AddTransient<FileService>();
services.AddTransient<IMeasureService, MeasureService>();
services.AddTransient<IMessageService, MessageService>();
services.AddTransient<IOperationsStatService, OperationsStatService>();
services.AddTransient<IReportService, ReportService>();
services.AddTransient<ISetpointsService, SetpointsService>();
services.AddScoped<ITelemetryService, TelemetryService>();
services.AddTransient<ITelemetryUserService, TelemetryUserService>();
services.AddTransient<ITimezoneService, TimezoneService>();
services.AddScoped<IWellService, WellService>();
services.AddTransient<IProcessMapReportDrillingExportService, ProcessMapReportDataSaubStatExportService>();
services.AddTransient<IWellOperationRepository, WellOperationRepository>();
services.AddTransient<IDailyReportService, DailyReportService>();
services.AddTransient<IDetectedOperationService, DetectedOperationService>();
services.AddTransient<ISubsystemService, SubsystemService>();
services.AddTransient<IScheduleRepository, ScheduleRepository>();
services.AddTransient<IRepositoryWellRelated<OperationValueDto>, CrudWellRelatedRepositoryBase<OperationValueDto, OperationValue>>();
services.AddTransient<IUserSettingsRepository, UserSettingsRepository>();
services.AddTransient<IWellFinalDocumentsService, WellFinalDocumentsService>();
services.AddTransient<IFileCategoryService, FileCategoryService>();
services.AddTransient<ILimitingParameterService, LimitingParameterService>();
services.AddTransient<WellInfoService>();
services.AddTransient<IHelpPageService, HelpPageService>();
services.AddTransient<IScheduleReportService, ScheduleReportService>();
services.AddTransient<IDataSaubStatRepository, DataSaubStatRepository>();
services.AddTransient<IProcessMapReportDrillingService, ProcessMapReportDrillingService>();
services.AddTransient<TrajectoryService>();
services.AddTransient<IGtrRepository, GtrWitsRepository>();
services.AddTransient<NotificationService>();
services.AddTransient<INotificationRepository, NotificationRepository>();
services.AddTransient<ICrudRepository<NotificationCategoryDto>, CrudCacheRepositoryBase<NotificationCategoryDto,
NotificationCategory>>();
services.AddTransient<IDrillTestRepository, DrillTestRepository>();
services.AddTransient<IWellCompositeOperationService, WellCompositeOperationService>();
// admin crud services:
services.AddTransient<ICrudRepository<TelemetryDto>, CrudCacheRepositoryBase<TelemetryDto, Telemetry>>(s =>
new CrudCacheRepositoryBase<TelemetryDto, Telemetry>(
s.GetRequiredService<IAsbCloudDbContext>(),
s.GetRequiredService<IMemoryCache>(),
dbSet => dbSet.Include(t => t.Well))); // может быть включен в сервис TelemetryService
services.AddTransient<ICrudRepository<DepositDto>, CrudCacheRepositoryBase<DepositDto, Deposit>>(s =>
new CrudCacheRepositoryBase<DepositDto, Deposit>(
s.GetRequiredService<IAsbCloudDbContext>(),
s.GetRequiredService<IMemoryCache>(),
dbSet => dbSet.Include(d => d.Clusters)
.ThenInclude(c => c.Wells)));
services.AddTransient<ICrudRepository<CompanyDto>, CrudCacheRepositoryBase<CompanyDto, Company>>(s =>
new CrudCacheRepositoryBase<CompanyDto, Company>(
s.GetRequiredService<IAsbCloudDbContext>(),
s.GetRequiredService<IMemoryCache>(),
dbSet => dbSet.Include(c => c.CompanyType)));
services.AddTransient<ICrudRepository<CompanyTypeDto>, CrudCacheRepositoryBase<CompanyTypeDto, CompanyType>>();
services.AddTransient<ICrudRepository<ClusterDto>, CrudCacheRepositoryBase<ClusterDto, Cluster>>(s =>
new CrudCacheRepositoryBase<ClusterDto, Cluster>(
s.GetRequiredService<IAsbCloudDbContext>(),
s.GetRequiredService<IMemoryCache>(),
dbSet => dbSet
.Include(c => c.Wells)
.Include(c => c.Deposit))); // может быть включен в сервис ClusterService
services.AddTransient<ICrudRepository<DrillerDto>, CrudCacheRepositoryBase<DrillerDto, Driller>>();
services.AddTransient<IHelpPageRepository, HelpPageRepository>();
services.AddTransient<IFileRepository, FileRepository>();
services.AddTransient<IFileStorageRepository, FileStorageRepository>();
services.AddTransient<IUserRoleRepository, UserRoleRepository>();
services.AddTransient<IUserRepository, UserRepository>();
services.AddTransient<ILimitingParameterRepository, LimitingParameterRepository>();
services.AddTransient<ITelemetryWirelineRunOutRepository, TelemetryWirelineRunOutRepository>();
services.AddTransient<IWellFinalDocumentsRepository, WellFinalDocumentsRepository>();
services.AddTransient<ITrajectoryEditableRepository<TrajectoryGeoPlanDto>, TrajectoryEditableRepository<TrajectoryPlan, TrajectoryGeoPlanDto>>();
services.AddTransient<ITrajectoryEditableRepository<TrajectoryGeoFactDto>, TrajectoryEditableRepository<TrajectoryFact, TrajectoryGeoFactDto>>();
services.AddTransient<ITrajectoryNnbRepository, TrajectoryNnbRepository>();
services.AddTransient<IFaqRepository, FaqRepository>();
services.AddTransient<ISlipsStatService, SlipsStatService>();
services.AddTransient<IWellContactService, WellContactService>();
services.AddTransient<ICrudRepository<WellSectionTypeDto>, CrudCacheRepositoryBase<WellSectionTypeDto,
WellSectionType>>();
services.AddTransient<ICrudRepository<SubsystemDto>, CrudCacheRepositoryBase<SubsystemDto, Subsystem>>();
services.AddTransient<ICrudRepository<PermissionDto>, CrudCacheRepositoryBase<PermissionDto, Permission>>();
// TelemetryData services
services.AddTransient<ITelemetryDataSaubService, TelemetryDataSaubService>();
services.AddTransient<ITelemetryDataService<TelemetryDataSpinDto>, TelemetryDataSpinService>();
// Wits
services.AddTransient<IWitsRecordRepository<AsbCloudApp.Data.WITS.Record1Dto>, WitsRecordRepository<AsbCloudApp.Data.WITS.Record1Dto, AsbCloudDb.Model.WITS.Record1>>();
services.AddTransient<IWitsRecordRepository<AsbCloudApp.Data.WITS.Record7Dto>, WitsRecordRepository<AsbCloudApp.Data.WITS.Record7Dto, AsbCloudDb.Model.WITS.Record7>>();
services.AddTransient<IWitsRecordRepository<AsbCloudApp.Data.WITS.Record8Dto>, WitsRecordRepository<AsbCloudApp.Data.WITS.Record8Dto, AsbCloudDb.Model.WITS.Record8>>();
services.AddTransient<IWitsRecordRepository<AsbCloudApp.Data.WITS.Record50Dto>, WitsRecordRepository<AsbCloudApp.Data.WITS.Record50Dto, AsbCloudDb.Model.WITS.Record50>>();
services.AddTransient<IWitsRecordRepository<AsbCloudApp.Data.WITS.Record60Dto>, WitsRecordRepository<AsbCloudApp.Data.WITS.Record60Dto, AsbCloudDb.Model.WITS.Record60>>();
services.AddTransient<IWitsRecordRepository<AsbCloudApp.Data.WITS.Record61Dto>, WitsRecordRepository<AsbCloudApp.Data.WITS.Record61Dto, AsbCloudDb.Model.WITS.Record61>>();
services.AddTransient<IDrillTestReportService, DrillTestReportService>();
services.AddTransient<IReportMakerService<DrillTestReportDataDto>, DrillTestReportMakerService>();
services.AddTransient<IManualDirectoryRepository, ManualDirectoryRepository>();
services.AddTransient<IManualCatalogService, ManualCatalogService>();
services.AddTransient<ICrudRepository<ManualDto>, CrudRepositoryBase<ManualDto, Manual>>();
services.AddTransient<IWellboreService, WellboreService>();
services.AddTransient<DetectedOperationExportService>();
services.AddTransient<IDailyReportService, DailyReportService>();
services.AddTransient<IDailyReportRepository, DailyReportRepository>();
services.AddTransient<IDailyReportExportService, DailyReportExportService>();
services.AddTransient<IRepositoryWellRelated<WellSectionPlanDto>, CrudWellRelatedRepositoryBase<WellSectionPlanDto, WellSectionPlan>>();
services.AddTransient<IWellSectionPlanRepository, WellSectionPlanRepository>();
services.AddTransient<IWellOperationCategoryRepository, WellOperationCategoryRepository>();
services.AddTransient<IDetectedOperationRepository, DetectedOperationRepository>();
services.AddTransient<TrajectoryPlanParser>();
services.AddTransient<TrajectoryFactManualParser>();
services.AddTransient<ProcessMapPlanRotorParser>();
services.AddTransient<ProcessMapPlanSlideParser>();
services.AddTransient<ProcessMapPlanReamParser>();
services.AddTransient<ProcessMapPlanReamingRotorParser>();
services.AddTransient<ProcessMapPlanReamingSlideParser>();
services.AddTransient<ProcessMapPlanLoadCapacityParser>();
services.AddTransient<ProcessMapPlanRecordingStaticMeasurementParser>();
services.AddTransient<ProcessMapPlanPositioningOffTheBottomParser>();
services.AddTransient<ProcessMapPlanOscillationAnglesParser>();
services.AddTransient<ProcessMapPlanTFOrientationParser>();
services.AddTransient<ProcessMapPlanSwitchingOffThePumpParser>();
services.AddTransient<ProcessMapPlanSwitchingToTheModeParser>();
services.AddTransient<ProcessMapPlanDrillTestParser>();
services.AddTransient<ProcessMapPlanShockTestParser>();
services.AddTransient<ProcessMapPlanDamperParser>();
services.AddTransient<ProcessMapPlanAutoHoldTFParser>();
services.AddTransient<ProcessMapPlanRotorRpmAccelerationParser>();
services.AddTransient<ProcessMapPlanUpdatingNoloadParametersParser>();
services.AddTransient<ProcessMapPlanOscillationParser>();
services.AddTransient<ProcessMapPlanAntiCrashRotationParser>();
services.AddTransient<ProcessMapPlanStaticMeasurementOutputParser>();
services.AddTransient<ProcessMapPlanRotorLoweringBitParser>();
services.AddTransient<ProcessMapPlanSlideLoweringBitParser>();
services.AddTransient<TrajectoryPlanExportService>();
services.AddTransient<TrajectoryFactManualExportService>();
services.AddTransient<TrajectoryFactNnbExportService>();
services.AddTransient<ProcessMapPlanRotorExportService>();
services.AddTransient<ProcessMapPlanSlideExportService>();
services.AddTransient<ProcessMapPlanReamExportService>();
services.AddTransient<ProcessMapPlanReamingRotorExportService>();
services.AddTransient<ProcessMapPlanReamingSlideExportService>();
services.AddTransient<ProcessMapPlanLoadCapacityExportService>();
services.AddTransient<ProcessMapPlanRecordingStaticMeasurementExportService>();
services.AddTransient<ProcessMapPlanPositioningOffTheBottomExportService>();
services.AddTransient<ProcessMapPlanOscillationAnglesExportService>();
services.AddTransient<ProcessMapPlanTFOrientationExportService>();
services.AddTransient<ProcessMapPlanSwitchingOffThePumpExportService>();
services.AddTransient<ProcessMapPlanSwitchingToTheModeExportService>();
services.AddTransient<ProcessMapPlanDrillTestExportService>();
services.AddTransient<ProcessMapPlanShockTestExportService>();
services.AddTransient<ProcessMapPlanDamperExportService>();
services.AddTransient<ProcessMapPlanAutoHoldTFExportService>();
services.AddTransient<ProcessMapPlanRotorRpmAccelerationExportService>();
services.AddTransient<ProcessMapPlanUpdatingNoloadParametersExportService>();
services.AddTransient<ProcessMapPlanOscillationExportService>();
services.AddTransient<ProcessMapPlanAntiCrashRotationExportService>();
services.AddTransient<ProcessMapPlanStaticMeasurementOutputExportService>();
services.AddTransient<ProcessMapPlanRotorLoweringBitExportService>();
services.AddTransient<ProcessMapPlanSlideLoweringBitExportService>();
services.AddTransient<WellOperationParserFactory>();
services.AddTransient<WellOperationExportServiceFactory>();
return services;
}
public static IServiceCollection AddProcessMaps(this IServiceCollection services, IConfiguration configuration)
{
services.AddTransient<
IChangeLogRepository<ProcessMapPlanRotorDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanRotor, ProcessMapPlanRotorDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanSlideDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanSlide, ProcessMapPlanSlideDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanReamDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanReam, ProcessMapPlanReamDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanReamingRotorDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanReamingRotor, ProcessMapPlanReamingRotorDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanReamingSlideDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanReamingSlide, ProcessMapPlanReamingSlideDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanLoadCapacityDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanLoadCapacity, ProcessMapPlanLoadCapacityDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanRecordingStaticMeasurementDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanRecordingStaticMeasurement, ProcessMapPlanRecordingStaticMeasurementDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanPositioningOffTheBottomDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanPositioningOffTheBottom, ProcessMapPlanPositioningOffTheBottomDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanOscillationAnglesDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanOscillationAngles, ProcessMapPlanOscillationAnglesDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanTFOrientationDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanTFOrientation, ProcessMapPlanTFOrientationDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanSwitchingOffThePumpDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanSwitchingOffThePump, ProcessMapPlanSwitchingOffThePumpDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanSwitchingToTheModeDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanSwitchingToTheMode, ProcessMapPlanSwitchingToTheModeDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanDrillTestDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanDrillTest, ProcessMapPlanDrillTestDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanShockTestDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanShockTest, ProcessMapPlanShockTestDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanDamperDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanDamper, ProcessMapPlanDamperDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanAutoHoldTFDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanAutoHoldTF, ProcessMapPlanAutoHoldTFDto>>();
services.AddTransient<
IChangeLogRepository<RotorRpmAccelerationDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanRotorRpmAcceleration, RotorRpmAccelerationDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanUpdatingNoloadParametersDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanUpdatingNoloadParameters, ProcessMapPlanUpdatingNoloadParametersDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanOscillationDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanOscillation, ProcessMapPlanOscillationDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanAntiCrashRotationDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanAntiCrashRotation, ProcessMapPlanAntiCrashRotationDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanStaticMeasurementOutputDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanStaticMeasurementOutput, ProcessMapPlanStaticMeasurementOutputDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanRotorLoweringBitDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanRotorLoweringBit, ProcessMapPlanRotorLoweringBitDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanSlideLoweringBitDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanSlideLoweringBit, ProcessMapPlanSlideLoweringBitDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanRotorDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSlideDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingRotorDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingSlideDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanLoadCapacityDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanRecordingStaticMeasurementDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanPositioningOffTheBottomDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOscillationAnglesDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanTFOrientationDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSwitchingOffThePumpDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSwitchingToTheModeDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanDrillTestDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanShockTestDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanDamperDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanAutoHoldTFDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<RotorRpmAccelerationDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanUpdatingNoloadParametersDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOscillationDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanAntiCrashRotationDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanStaticMeasurementOutputDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanRotorLoweringBitDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSlideLoweringBitDto>>();
return services;
}
}
}