| | | 1 | | using Microsoft.AspNetCore.Server.Kestrel.Core; |
| | | 2 | | using Microsoft.AspNetCore.Http.Features; |
| | | 3 | | using System.Linq; |
| | | 4 | | using Services.LabelServices; |
| | | 5 | | using SlqStudio.Application.Services.AppSettingsServices; |
| | | 6 | | using SlqStudio.Application.Services.EmailService; |
| | | 7 | | using SlqStudio.Application.Services.EmailService.Implementation; |
| | | 8 | | using SlqStudio.Application.Services.EmailService.Models; |
| | | 9 | | using Services.EmailRoutingServices; |
| | | 10 | | using Services.HangfireService; |
| | | 11 | | using Services.TransactionUtilsServices; |
| | | 12 | | using Services.BackgroundJobsServices; |
| | | 13 | | using Services.ChannelTaskServices; |
| | | 14 | | using Services.BitrixStockServices; |
| | | 15 | | using Services.FileStorageServices; |
| | | 16 | | using Services.StockSyncServices; |
| | | 17 | | using Services.TransactionCommentAi; |
| | | 18 | | using Services.SearchServices.OrderSearch; |
| | | 19 | | using Services.SupplierStatusServices; |
| | | 20 | | using Services.SupplierStatusServices.Providers; |
| | | 21 | | using Services.CacheServices.CommercialCategoryLookup; |
| | | 22 | | using OzonRepositories.Data; |
| | | 23 | | using OzonOrdersWeb.WebServices.JobLogs; |
| | | 24 | | using OzonOrdersWeb.WebServices.SystemAlerts; |
| | | 25 | | using OzonOrdersWeb.TransactionServices; |
| | | 26 | | using OzonOrdersWeb.WebServices.OrderSearch; |
| | | 27 | | using OzonOrdersWeb.WebServices.Currency; |
| | | 28 | | using OzonOrdersWeb.WebServices.Orders; |
| | | 29 | | using OzonOrdersWeb.WebServices.Orders.Grid; |
| | | 30 | | using OzonOrdersWeb.WebServices.Transactions.Grid.Commit; |
| | | 31 | | using OzonOrdersWeb.WebServices.Transactions.Grid.Commit.Steps; |
| | | 32 | | using OzonOrdersWeb.WebServices.Transactions.Grid.Definitions; |
| | | 33 | | using OzonOrdersWeb.WebServices.Transactions.Grid.Load; |
| | | 34 | | using OzonOrdersWeb.WebServices.Transactions.Grid.Preview; |
| | | 35 | | using OzonOrdersWeb.WebServices.Transactions.Grid.SupplierCarts; |
| | | 36 | | using OzonOrdersWeb.WebServices.Sidebar; |
| | | 37 | | using OzonOrdersWeb.WebServices.TransactionTimeTracking; |
| | | 38 | | using Services.OrderControlServices; |
| | | 39 | | using Services.YandexServices; |
| | | 40 | | using Services.OrderDailySummaryServices; |
| | | 41 | | using Services.SystemMonitoringServices; |
| | | 42 | | using Services.ApiServices._1CApi.Stock; |
| | | 43 | | |
| | | 44 | | namespace OzonOrdersWeb.Extensions; |
| | | 45 | | |
| | | 46 | | public static class ApplicationServicesExtensions |
| | | 47 | | { |
| | | 48 | | public static void AddApplicationServices(this IServiceCollection services, IConfiguration configuration, bool isPro |
| | | 49 | | { |
| | 0 | 50 | | services.AddScoped<OzonOrdersWeb.WebServices.Transactions.ArmtekReceiptOriginService>(); |
| | 0 | 51 | | services.AddScoped<OzonOrdersWeb.WebServices.Transactions.ArmtekInvoiceNumberSuggestService>(); |
| | 0 | 52 | | services.Configure<IISServerOptions>(options => |
| | 0 | 53 | | { |
| | 0 | 54 | | options.MaxRequestBodySize = int.MaxValue; |
| | 0 | 55 | | }); |
| | | 56 | | |
| | 0 | 57 | | services.Configure<KestrelServerOptions>(options => |
| | 0 | 58 | | { |
| | 0 | 59 | | options.Limits.MaxRequestBodySize = 314572800; |
| | 0 | 60 | | }); |
| | | 61 | | |
| | 0 | 62 | | services.Configure<FormOptions>(options => |
| | 0 | 63 | | { |
| | 0 | 64 | | options.ValueCountLimit = 4096 * 4; |
| | 0 | 65 | | }); |
| | | 66 | | |
| | 0 | 67 | | services.Configure<SmtpSettings>(configuration.GetSection("SmtpSettings")); |
| | 0 | 68 | | services.Configure<ImapSettings>(configuration.GetSection("ImapSettings")); |
| | 0 | 69 | | services.Configure<EmailRoutingExecutionOptions>(configuration.GetSection("EmailRouting")); |
| | 0 | 70 | | services.Configure<SystemAlertsOptions>(configuration.GetSection(SystemAlertsOptions.SectionName)); |
| | 0 | 71 | | services.Configure<ServerFileStorageOptions>(configuration.GetSection(ServerFileStorageOptions.SectionName)); |
| | 0 | 72 | | services.AddSingleton<IServerFileStorage, ServerFileStorage>(); |
| | 0 | 73 | | services.Configure<LabelStorageOptions>(configuration.GetSection(LabelStorageOptions.SectionName)); |
| | 0 | 74 | | services.AddSingleton<ILabelCatalogCache, LabelCatalogCache>(); |
| | 0 | 75 | | services.AddSingleton<ILabelFileStorage, LabelFileStorage>(); |
| | 0 | 76 | | services.AddScoped<ILabelCatalogService, LabelCatalogService>(); |
| | 0 | 77 | | services.AddScoped<ILabelPrintLogService, LabelPrintLogService>(); |
| | 0 | 78 | | var stockSyncSection = ResolveStockSyncSection(configuration, isProd); |
| | 0 | 79 | | services.Configure<GoogleSheetsStockSyncOptions>(stockSyncSection); |
| | 0 | 80 | | services.AddTransient<IEmailService, EmailService>(); |
| | 0 | 81 | | services.AddTransient<IHtmlEmailSender, HtmlEmailSender>(); |
| | 0 | 82 | | services.AddTransient<IEmailInboxClient, ImapEmailInboxClient>(); |
| | 0 | 83 | | services.AddSingleton<IImapSettingsStore, FileImapSettingsStore>(); |
| | 0 | 84 | | services.AddTransient<IRoutingRuleEvaluator, RoutingRuleEvaluator>(); |
| | 0 | 85 | | services.AddScoped<IFileDeduplicationService, FileDeduplicationService>(); |
| | 0 | 86 | | services.AddTransient<IDropboxFileRouter, DropboxFileRouter>(); |
| | 0 | 87 | | services.AddTransient<IOrderEmailImportService, OrderEmailImportService>(); |
| | 0 | 88 | | services.AddTransient<IEmailAttachmentRoutingService, EmailAttachmentRoutingService>(); |
| | 0 | 89 | | services.AddScoped<IEmailRoutingJobRunService, EmailRoutingJobRunService>(); |
| | 0 | 90 | | services.AddSingleton<IEmailRoutingSchedulerStore, FileEmailRoutingSchedulerStore>(); |
| | 0 | 91 | | services.AddTransient<EmailAttachmentRoutingJob>(); |
| | 0 | 92 | | services.AddTransient<TransactionTimeTrackingCleanupJob>(); |
| | 0 | 93 | | services.AddScoped<IOrderControlService, OrderControlService>(); |
| | 0 | 94 | | services.AddScoped<IOrderDailySummaryService, OrderDailySummaryService>(); |
| | 0 | 95 | | services.AddScoped<Services.DailyWorkSummaryServices.IDailyWorkSummaryService, Services.DailyWorkSummaryServices |
| | 0 | 96 | | services.AddTransient<OzonOrdersWeb.WebServices.DailySummary.DailyWorkSummaryJob>(); |
| | 0 | 97 | | services.AddScoped<IOrderDeliveryStatusSynchronizer, OrderDeliveryStatusSynchronizer>(); |
| | 0 | 98 | | services.AddScoped<IYandexOrderStatusSyncService, YandexOrderStatusSyncService>(); |
| | 0 | 99 | | services.AddTransient<OrderControlEvaluationJob>(); |
| | | 100 | | |
| | | 101 | | // Elasticsearch-поиск по заказам (docs/orders-search-elasticsearch.md) |
| | 0 | 102 | | services.AddSingleton<IOrderSearchDiagnosticsStore, OrderSearchDiagnosticsStore>(); |
| | 0 | 103 | | services.AddScoped<IOrderSearchDiagnosticsService, OrderSearchDiagnosticsService>(); |
| | 0 | 104 | | services.AddSingleton<IOrderSearchService, OrderElasticsearchService>(); |
| | 0 | 105 | | services.AddSingleton<IOrderSearchDriftMetricsReporter, OrderSearchDriftPrometheusReporter>(); |
| | 0 | 106 | | services.AddSingleton<IOrderSearchIndexOperationLock, OrderSearchIndexOperationLock>(); |
| | 0 | 107 | | services.AddScoped<IOrderSearchDriftChecker, OrderSearchDriftChecker>(); |
| | 0 | 108 | | services.AddScoped<IOrderSearchSyncService, OrderSearchSyncService>(); |
| | 0 | 109 | | services.AddScoped<IOrderChangeNotifier, OrderChangeNotifier>(); |
| | 0 | 110 | | services.AddTransient<OrderSearchIncrementalSyncJob>(); |
| | 0 | 111 | | services.AddTransient<OrderSearchFullReindexJob>(); |
| | 0 | 112 | | services.AddTransient<OrderSearchDriftCheckJob>(); |
| | 0 | 113 | | services.AddTransient<OrderSearchDriftRepairJob>(); |
| | 0 | 114 | | services.AddTransient<LabelsFolderIndexRefreshJob>(); |
| | 0 | 115 | | services.AddTransient<DropboxToServerFileStorageMigrationJob>(); |
| | 0 | 116 | | services.AddTransient<WarehouseStockSyncJob>(); |
| | 0 | 117 | | services.AddTransient<RunAllPresetsJob>(); |
| | 0 | 118 | | services.AddTransient<SendSyncReportEmailJob>(); |
| | 0 | 119 | | services.AddTransient<ITransactionTimeTrackingService, TransactionTimeTrackingService>(); |
| | 0 | 120 | | services.AddScoped<OzonOrdersWeb.WebServices.Transactions.TransactionProgressReporter>(); |
| | 0 | 121 | | services.AddScoped<IWarehouseStockSyncService, WarehouseStockSyncService>(); |
| | 0 | 122 | | services.AddScoped<IWarehouseStockLookupService, WarehouseStockLookupService>(); |
| | 0 | 123 | | services.AddScoped<ICommercialCategoryLookupService, CommercialCategoryLookupService>(); |
| | 0 | 124 | | services.AddScoped<OrderToSupplierOzonShipService>(); |
| | | 125 | | |
| | 0 | 126 | | services.Configure<TransactionCommentAiOptions>( |
| | 0 | 127 | | configuration.GetSection(TransactionCommentAiOptions.SectionName)); |
| | 0 | 128 | | services.AddTransient<TransactionCommentAiService>(); |
| | 0 | 129 | | services.AddSingleton<ITransactionCommentAiEnqueuer, TransactionCommentAiEnqueuer>(); |
| | 0 | 130 | | services.AddTransient<TransactionCommentAiJob>(); |
| | | 131 | | |
| | 0 | 132 | | services.AddSingleton<IAppSettingsService, AppSettingsService>(); |
| | 0 | 133 | | services.AddSingleton<AppSettingsBuilder>(); |
| | | 134 | | |
| | 0 | 135 | | services.AddSingleton<BarcodeLabelService>(); |
| | 0 | 136 | | services.AddSingleton<ArticleLabelService>(); |
| | 0 | 137 | | services.AddScoped<IOrderScanitStore, OrderScanitStore>(); |
| | 0 | 138 | | services.AddScoped<IOzonLabelPrintService, OzonLabelPrintService>(); |
| | 0 | 139 | | services.AddScoped<IOrdersOzonShipService, OrdersOzonShipService>(); |
| | 0 | 140 | | services.AddScoped<IOzonExemplarService, OzonExemplarService>(); |
| | 0 | 141 | | services.AddSingleton<ILabelExistenceService, LabelExistenceService>(); |
| | | 142 | | |
| | | 143 | | // Background Jobs System |
| | 0 | 144 | | services.AddScoped<IBackgroundJobLoggingService, BackgroundJobLoggingService>(); |
| | 0 | 145 | | services.AddScoped<IBackgroundJobScheduleService, BackgroundJobScheduleService>(); |
| | 0 | 146 | | services.AddScoped<ITransactionTimeTrackingReportQueryService, TransactionTimeTrackingReportQueryService>(); |
| | 0 | 147 | | services.AddScoped<IOzonReportLoaderService, OzonReportLoaderService>(); |
| | 0 | 148 | | services.AddScoped<ITransactionJobRetryScheduler, TransactionJobRetryScheduler>(); |
| | 0 | 149 | | services.AddScoped<IAutomatedTransactionProcessingService, AutomatedTransactionProcessingService>(); |
| | 0 | 150 | | services.AddTransient<IBitrixStockClearJobService, BitrixStockClearJobService>(); |
| | 0 | 151 | | services.AddTransient<IBitrixStockArchiveJobService, BitrixStockArchiveJobService>(); |
| | 0 | 152 | | services.AddTransient<IBitrixStockUnarchiveJobService, BitrixStockUnarchiveJobService>(); |
| | 0 | 153 | | services.AddTransient<IBitrixStockPushJobService, BitrixStockPushJobService>(); |
| | 0 | 154 | | services.AddScoped<IBitrixStockInventoryService, BitrixStockInventoryService>(); |
| | 0 | 155 | | services.AddScoped<IWarehouseStockBitrixViewService, WarehouseStockBitrixViewService>(); |
| | 0 | 156 | | services.AddScoped<IBitrixOzonLinkedStockApiSyncService, BitrixOzonLinkedStockApiSyncService>(); |
| | 0 | 157 | | services.AddScoped<IBitrixStockAutoScheduleService, BitrixStockAutoScheduleService>(); |
| | 0 | 158 | | services.AddSingleton<BitrixStockSyncReportStore>(); |
| | 0 | 159 | | services.AddSingleton<BitrixStockActiveStageStore>(); |
| | 0 | 160 | | services.AddScoped<IBitrixStockSyncReportService, BitrixStockSyncReportService>(); |
| | 0 | 161 | | services.AddScoped<IBitrixStockSyncReportGridService, BitrixStockSyncReportGridService>(); |
| | 0 | 162 | | services.AddSingleton<OzonOrdersWeb.Areas.Studio2.AnalysisServices.ProductAnalysisCache>(); |
| | 0 | 163 | | services.AddScoped<OzonOrdersWeb.Areas.Studio2.AnalysisServices.ProductAnalysisGridService>(); |
| | 0 | 164 | | services.AddScoped<OzonOrdersWeb.Areas.Studio2.AnalysisServices.ProductAnalysisReportService>(); |
| | 0 | 165 | | services.AddSingleton<OzonOrdersWeb.Areas.Studio2.AnalysisServices.SalesForecastService>(); |
| | 0 | 166 | | services.AddSingleton<OzonOrdersWeb.Areas.Studio2.AnalysisServices.TrendAnalysisService>(); |
| | 0 | 167 | | services.AddSingleton<OzonOrdersWeb.Areas.Studio2.AnalysisServices.PurchaseRecommendationService>(); |
| | 0 | 168 | | services.AddScoped<OzonOrdersWeb.Areas.Studio2.AnalysisServices.OzonErrorLinksService>(); |
| | 0 | 169 | | services.AddScoped<IBitrixStockSyncReportApplyService, BitrixStockSyncReportApplyService>(); |
| | 0 | 170 | | services.AddScoped<IBitrixStockLiveStockGuard, BitrixStockLiveStockGuard>(); |
| | 0 | 171 | | services.AddScoped<IBitrixStockLiveStockComparer, BitrixStockLiveStockComparer>(); |
| | 0 | 172 | | services.Configure<BitrixStockLiveStockOptions>(configuration.GetSection(BitrixStockLiveStockOptions.SectionName |
| | 0 | 173 | | services.AddScoped<IBitrixStockSyncReportCleanupService, BitrixStockSyncReportCleanupService>(); |
| | 0 | 174 | | services.AddScoped<IBitrixStockSyncReportPricePushService, BitrixStockSyncReportPricePushService>(); |
| | 0 | 175 | | services.AddScoped<IBitrixStockOzonOrphanCleanupService, BitrixStockOzonOrphanCleanupService>(); |
| | 0 | 176 | | services.AddScoped<IOzonProductsCatalogService, OzonProductsCatalogService>(); |
| | 0 | 177 | | services.AddScoped<IOzonCatalogStockEnricher, OzonCatalogStockEnricher>(); |
| | 0 | 178 | | services.AddScoped<IBitrixStockSyncPipelineOrchestrator, BitrixStockSyncPipelineOrchestrator>(); |
| | 0 | 179 | | services.Configure<BitrixStockRunLoggingOptions>(configuration.GetSection(BitrixStockRunLoggingOptions.SectionNa |
| | 0 | 180 | | services.AddSingleton<IBitrixStockRunFileLogger, BitrixStockRunFileLogger>(); |
| | 0 | 181 | | services.AddScoped<IBitrixStockSyncPresetService, BitrixStockSyncPresetService>(); |
| | 0 | 182 | | services.AddSingleton<ChannelTaskExecutor>(); |
| | 0 | 183 | | services.AddSingleton<ChannelTaskProcessor>(); |
| | 0 | 184 | | services.AddSingleton<IChannelTaskService>(sp => sp.GetRequiredService<ChannelTaskProcessor>()); |
| | 0 | 185 | | services.AddHostedService(sp => sp.GetRequiredService<ChannelTaskProcessor>()); |
| | 0 | 186 | | services.AddScoped<IBitrixStockExceptionService, BitrixStockExceptionService>(); |
| | 0 | 187 | | services.AddScoped<IBitrixStockSyncArticleHistoryService, BitrixStockSyncArticleHistoryService>(); |
| | 0 | 188 | | services.AddScoped<BitrixStockSyncApplyArticleLogService>(); |
| | 0 | 189 | | services.AddScoped<IJobLogsBadgeService, JobLogsBadgeService>(); |
| | 0 | 190 | | services.AddScoped<ISystemAlertSource, OzonSystemAlertSource>(); |
| | 0 | 191 | | services.AddScoped<ISystemAlertSource, JobLogsSystemAlertSource>(); |
| | 0 | 192 | | services.AddScoped<ISystemAlertSource, PassiveSystemAlertSource>(); |
| | 0 | 193 | | services.AddScoped<ISystemAlertSource, HangfireSystemAlertSource>(); |
| | 0 | 194 | | services.AddScoped<ISystemAlertSource, DiskSystemAlertSource>(); |
| | 0 | 195 | | services.AddScoped<ISystemAlertSource, ElasticsearchSystemAlertSource>(); |
| | 0 | 196 | | services.AddScoped<ISystemAlertSource, DatabaseSystemAlertSource>(); |
| | 0 | 197 | | services.AddScoped<SupplierOrdersSystemAlertSource>(); |
| | 0 | 198 | | services.AddScoped<ISystemAlertSource>(sp => sp.GetRequiredService<SupplierOrdersSystemAlertSource>()); |
| | 0 | 199 | | services.AddScoped<ISystemAlertSource, OrderOperationsSystemAlertSource>(); |
| | 0 | 200 | | services.AddScoped<ISystemAlertSource, StockAndOneCSystemAlertSource>(); |
| | 0 | 201 | | services.AddScoped<ISystemAlertSource, OzonStockApplyAlertSource>(); |
| | 0 | 202 | | services.AddHttpClient(ElasticsearchSystemAlertSource.HttpClientName); |
| | 0 | 203 | | services.AddSingleton<SystemAlertOrderIndex>(); |
| | 0 | 204 | | services.AddScoped<SystemAlertIncidentStore>(); |
| | 0 | 205 | | services.AddScoped<ISystemMonitoringSignalWriter, SystemMonitoringSignalWriter>(); |
| | 0 | 206 | | services.AddSingleton<Services.SystemMonitoringServices.IsolatedSystemMonitoringSignalWriter>(); |
| | 0 | 207 | | services.AddSingleton<IOneCStockAlertReporter, OneCStockAlertReporter>(); |
| | 0 | 208 | | services.AddScoped<SystemAlertFactory>(); |
| | 0 | 209 | | services.AddScoped<SystemAlertTelegramNotifier>(); |
| | 0 | 210 | | services.AddScoped<SystemAlertPinnedMessageService>(); |
| | 0 | 211 | | services.AddScoped<ISupplierOrderCanceller, SupplierOrderCanceller>(); |
| | 0 | 212 | | services.AddScoped<OzonCancelledSupplierOrderHandler>(); |
| | 0 | 213 | | services.AddScoped<SystemAlertEvaluationService>(); |
| | 0 | 214 | | services.AddTransient<SystemAlertEvaluationJob>(); |
| | 0 | 215 | | services.AddTransient<SystemMonitoringSignalCleanupJob>(); |
| | 0 | 216 | | services.AddSingleton<DatabaseIoRateTracker>(); |
| | 0 | 217 | | services.AddScoped<IServerDiagnosticsService, ServerDiagnosticsService>(); |
| | | 218 | | |
| | 0 | 219 | | services.AddSingleton<OrderDictionaryCache>(); |
| | 0 | 220 | | services.AddScoped<IOrderFilterListsService, OrderFilterListsService>(); |
| | 0 | 221 | | services.AddScoped<IOrderDataScopeQueryApplier, OrderDataScopeQueryApplier>(); |
| | 0 | 222 | | services.AddScoped<IOrdersIndexQueryService, OrdersIndexQueryService>(); |
| | 0 | 223 | | services.AddScoped<IOrderReturnInfoService, OrderReturnInfoService>(); |
| | 0 | 224 | | services.AddScoped<IOrdersIndexPageDetailsService, OrdersIndexPageDetailsService>(); |
| | 0 | 225 | | services.AddScoped<IOrdersClientStatusSyncService, OrdersClientStatusSyncService>(); |
| | 0 | 226 | | services.AddTransient<OrdersClientStatusRefreshJob>(); |
| | 0 | 227 | | services.AddTransient<OrdersClientStatusReconcileJob>(); |
| | 0 | 228 | | services.AddSingleton<OrdersStatusSyncHealthStore>(); |
| | 0 | 229 | | services.AddScoped<IOrderControlCandidateStatusSynchronizer, OrderControlCandidateStatusSynchronizer>(); |
| | 0 | 230 | | services.AddScoped<IOrdersIndexClientStatusRefreshService, OrdersIndexClientStatusRefreshService>(); |
| | 0 | 231 | | services.AddScoped<IOrdersIndexViewModelEnricher, OrdersIndexViewModelEnricher>(); |
| | 0 | 232 | | services.AddScoped<IOrdersIndexPageViewDataService, OrdersIndexPageViewDataService>(); |
| | 0 | 233 | | services.AddScoped<IOrderDataScopeIdFilterService, OrderDataScopeIdFilterService>(); |
| | 0 | 234 | | services.AddScoped<IOrderCreateFormService, OrderCreateFormService>(); |
| | 0 | 235 | | services.AddScoped<ICurrencyRatesViewBagService, CurrencyRatesViewBagService>(); |
| | | 236 | | |
| | | 237 | | // Страница заказов на AG Grid (/Studio2/OrdersGrid) — поверх того же конвейера списка. |
| | 0 | 238 | | services.AddScoped<IOrdersGridQueryService, OrdersGridQueryService>(); |
| | 0 | 239 | | services.AddScoped<IOrdersGridFilterOptionsService, OrdersGridFilterOptionsService>(); |
| | 0 | 240 | | services.AddScoped<IOrdersGridUserSettingsService, OrdersGridUserSettingsService>(); |
| | 0 | 241 | | services.AddScoped<IUserSidebarSettingsService, UserSidebarSettingsService>(); |
| | 0 | 242 | | services.AddScoped<IOrdersGridChangesService, OrdersGridChangesService>(); |
| | 0 | 243 | | services.AddScoped<IOrdersGridStatusRefreshService, OrdersGridStatusRefreshService>(); |
| | 0 | 244 | | services.AddScoped<IOrdersGridScopedQuery, OrdersGridScopedQuery>(); |
| | 0 | 245 | | services.AddScoped<IOrdersGridRowHydrator, OrdersGridRowHydrator>(); |
| | 0 | 246 | | services.AddScoped<IOrdersGridFacetsService, OrdersGridFacetsService>(); |
| | 0 | 247 | | services.AddScoped<IOrdersGridOrderCardService, OrdersGridOrderCardService>(); |
| | | 248 | | |
| | | 249 | | // Фид «цена и остатки» по артикулу: чтение через API Interparts одним снимком. |
| | 0 | 250 | | services.AddSingleton(new Services.FeedPriceServices.FeedPriceOptions()); |
| | 0 | 251 | | services.AddTransient<Services.FeedPriceServices.IFeedPriceReader, Services.FeedPriceServices.FidApiFeedPriceRea |
| | 0 | 252 | | services.AddScoped<Services.FeedPriceServices.IFeedPriceService, Services.FeedPriceServices.FeedPriceService>(); |
| | 0 | 253 | | services.AddTransient<Services.FeedPriceServices.IFeedExplanationReader, Services.FeedPriceServices.FidApiFeedEx |
| | 0 | 254 | | services.AddScoped<Services.FeedPriceServices.IFeedExplanationService, Services.FeedPriceServices.FeedExplanatio |
| | 0 | 255 | | services.AddScoped<IOrdersGridFeedPriceService, OrdersGridFeedPriceService>(); |
| | 0 | 256 | | services.AddScoped<IOrdersGridProductCardService, OrdersGridProductCardService>(); |
| | 0 | 257 | | services.AddScoped<IOrdersGridSidebarPresetsService, OrdersGridSidebarPresetsService>(); |
| | 0 | 258 | | services.AddScoped<IOrdersGridComputedResolver, OrdersGridComputedResolver>(); |
| | | 259 | | |
| | | 260 | | // Грид транзакций (/Studio2/TransactionsGrid): каталог определений ⊕ настройки админки, загрузка и конвейер про |
| | 0 | 261 | | services.AddScoped<ITransactionDefinitionProvider, TransactionDefinitionProvider>(); |
| | 0 | 262 | | services.AddScoped<ITransactionGridLoadService, TransactionGridLoadService>(); |
| | 0 | 263 | | services.AddScoped<ITransactionGridQuotationSourcesProvider, TransactionGridQuotationSourcesProvider>(); |
| | 0 | 264 | | services.AddScoped<ITransactionCommitService, TransactionCommitService>(); |
| | 0 | 265 | | services.AddScoped<AppStatusLookup>(); |
| | 0 | 266 | | services.AddScoped<ShipToSellerOneCPlanner>(); |
| | 0 | 267 | | services.AddScoped<IShipToSellerPreviewService, ShipToSellerPreviewService>(); |
| | 0 | 268 | | services.AddScoped<ITransactionCommitStep, ScopeAndLoadStep>(); |
| | 0 | 269 | | services.AddScoped<ITransactionCommitStep, ValidateSourceStatusStep>(); |
| | 0 | 270 | | services.AddScoped<ITransactionCommitStep, OzonCancelStep>(); |
| | 0 | 271 | | services.AddScoped<ITransactionCommitStep, OneCStockCheckStep>(); |
| | 0 | 272 | | services.AddScoped<ITransactionCommitStep, ApplyEditsStep>(); |
| | 0 | 273 | | services.AddScoped<ITransactionCommitStep, ZeroQuantityPolicyStep>(); |
| | 0 | 274 | | services.AddScoped<ITransactionCommitStep, OneCDocumentStep>(); |
| | 0 | 275 | | services.AddScoped<ITransactionCommitStep, QuantitySplitCancellationStep>(); |
| | 0 | 276 | | services.AddScoped<ITransactionCommitStep, ResolveTargetStatusStep>(); |
| | 0 | 277 | | services.AddScoped<ITransactionCommitStep, CreateTransactionStep>(); |
| | 0 | 278 | | services.AddScoped<ITransactionCommitStep, HistoryStep>(); |
| | 0 | 279 | | services.AddScoped<ITransactionCommitStep, CachesAndNotifyStep>(); |
| | 0 | 280 | | services.AddScoped<ITransactionCommitStep, ZasylExpensesSnapshotStep>(); |
| | 0 | 281 | | services.AddScoped<ITransactionCommitStep, TimeTrackingStep>(); |
| | 0 | 282 | | services.AddScoped<ITransactionCommitStep, AiCommentStep>(); |
| | 0 | 283 | | services.AddScoped<ITransactionCommitStep, SupplierCartsPreStep>(); |
| | 0 | 284 | | services.AddScoped<ITransactionCommitStep, SupplierCartsPostStep>(); |
| | 0 | 285 | | services.AddScoped<ITransactionCommitStep, SupplierVerificationStep>(); |
| | 0 | 286 | | services.AddScoped<SupplierCartsProcessor>(); |
| | | 287 | | |
| | 0 | 288 | | AddSupplierStatusServices(services); |
| | 0 | 289 | | } |
| | | 290 | | |
| | | 291 | | /// <summary> |
| | | 292 | | /// Отслеживание статусов заказов у API-поставщиков. Провайдеры регистрируются множественно — |
| | | 293 | | /// OrderSupplierStatusSyncService разбирает их по ProviderKey. |
| | | 294 | | /// </summary> |
| | | 295 | | private static void AddSupplierStatusServices(IServiceCollection services) |
| | | 296 | | { |
| | 0 | 297 | | services.AddScoped<ISupplierStatusResolver, SupplierStatusResolver>(); |
| | 0 | 298 | | services.AddScoped<IOrderSupplierStateService, OrderSupplierStateService>(); |
| | 0 | 299 | | services.AddScoped<IOrderSupplierStatusSyncService, OrderSupplierStatusSyncService>(); |
| | 0 | 300 | | services.AddScoped<ISupplierOrderVerificationService, SupplierOrderVerificationService>(); |
| | 0 | 301 | | services.AddScoped<IOrderSupplierStateInfoService, OrderSupplierStateInfoService>(); |
| | 0 | 302 | | services.AddScoped<IOrderProblemInfoService, OrderProblemInfoService>(); |
| | 0 | 303 | | services.AddScoped<ISupplierStatusDirectoryService, SupplierStatusDirectoryService>(); |
| | 0 | 304 | | services.AddScoped<LocalCartStatusReader>(); |
| | 0 | 305 | | services.AddScoped<SupplierOrderStatusSyncJob>(); |
| | | 306 | | |
| | 0 | 307 | | services.AddScoped<ISupplierStatusProvider, AvdSupplierStatusProvider>(); |
| | 0 | 308 | | services.AddScoped<ISupplierStatusProvider, JapartsSupplierStatusProvider>(); |
| | 0 | 309 | | services.AddScoped<ISupplierStatusProvider, BergSupplierStatusProvider>(); |
| | 0 | 310 | | services.AddScoped<ISupplierStatusProvider, ArmtekSupplierStatusProvider>(); |
| | 0 | 311 | | services.AddScoped<ISupplierStatusProvider, ArmtekBySupplierStatusProvider>(); |
| | 0 | 312 | | services.AddScoped<ISupplierStatusProvider, MlAutoSupplierStatusProvider>(); |
| | 0 | 313 | | services.AddScoped<ISupplierStatusProvider, MlAutoRuSupplierStatusProvider>(); |
| | 0 | 314 | | services.AddScoped<ISupplierStatusProvider, ForumAutoSupplierStatusProvider>(); |
| | 0 | 315 | | services.AddScoped<ISupplierStatusProvider, ForumAutoInterpartsSupplierStatusProvider>(); |
| | 0 | 316 | | services.AddScoped<ISupplierStatusProvider, ForumAutoPiterSupplierStatusProvider>(); |
| | 0 | 317 | | services.AddScoped<ISupplierStatusProvider, ForumAutoRostovSupplierStatusProvider>(); |
| | 0 | 318 | | services.AddScoped<ISupplierStatusProvider, ForumAutoIstraSupplierStatusProvider>(); |
| | 0 | 319 | | services.AddScoped<ISupplierStatusProvider, FavoritPartsSupplierStatusProvider>(); |
| | 0 | 320 | | services.AddScoped<ISupplierStatusProvider, FavoritPartsIstraSupplierStatusProvider>(); |
| | 0 | 321 | | services.AddScoped<ISupplierStatusProvider, FavoritPartsRostovSupplierStatusProvider>(); |
| | 0 | 322 | | services.AddScoped<ISupplierStatusProvider, MoskvorechieIstraSupplierStatusProvider>(); |
| | 0 | 323 | | services.AddScoped<ISupplierStatusProvider, ShateMSupplierStatusProvider>(); |
| | 0 | 324 | | services.AddScoped<ISupplierStatusProvider, ProfitLigaSupplierStatusProvider>(); |
| | 0 | 325 | | services.AddScoped<ISupplierStatusProvider, ZZapSupplierStatusProvider>(); |
| | 0 | 326 | | services.AddScoped<ISupplierStatusProvider, MikadoSupplierStatusProvider>(); |
| | 0 | 327 | | services.AddScoped<ISupplierStatusProvider, MotexSupplierStatusProvider>(); |
| | 0 | 328 | | } |
| | | 329 | | |
| | | 330 | | private static IConfigurationSection ResolveStockSyncSection(IConfiguration configuration, bool isProd) |
| | | 331 | | { |
| | 0 | 332 | | var paths = isProd |
| | 0 | 333 | | ? new[] { "GoogleSheetsStockSync:Prod", "GoogleSheetsStockSync:Local", "GoogleSheetsStockSync" } |
| | 0 | 334 | | : new[] { "GoogleSheetsStockSync:Local", "GoogleSheetsStockSync:Prod", "GoogleSheetsStockSync" }; |
| | | 335 | | |
| | 0 | 336 | | foreach (var path in paths) |
| | | 337 | | { |
| | 0 | 338 | | var section = configuration.GetSection(path); |
| | 0 | 339 | | if (!string.IsNullOrWhiteSpace(section["SpreadsheetId"])) |
| | 0 | 340 | | return section; |
| | | 341 | | } |
| | | 342 | | |
| | 0 | 343 | | return configuration.GetSection(isProd ? "GoogleSheetsStockSync:Prod" : "GoogleSheetsStockSync:Local"); |
| | | 344 | | } |
| | | 345 | | } |