db()); $integrationRepository = new AllegroIntegrationRepository( $app->db(), (string) $app->config('app.integrations.secret', '') ); $oauthClient = new AllegroOAuthClient(); $apiClient = new AllegroApiClient(); $statusMappingRepository = new AllegroStatusMappingRepository($app->db()); $orderImportService = new AllegroOrderImportService( $integrationRepository, $oauthClient, $apiClient, new OrderImportRepository($app->db()), $statusMappingRepository, new OrdersRepository($app->db()) ); $ordersSyncService = new AllegroOrdersSyncService( $integrationRepository, new AllegroOrderSyncStateRepository($app->db()), $oauthClient, $apiClient, $orderImportService ); $shopproSyncService = new ShopproOrdersSyncService( new ShopproIntegrationsRepository( $app->db(), (string) $app->config('app.integrations.secret', '') ), new AllegroOrderSyncStateRepository($app->db()), new ShopproApiClient(), new OrderImportRepository($app->db()), new ShopproStatusMappingRepository($app->db()), new OrdersRepository($app->db()) ); $shopproStatusSyncService = new ShopproStatusSyncService( new ShopproIntegrationsRepository( $app->db(), (string) $app->config('app.integrations.secret', '') ), $shopproSyncService ); $shopproPaymentSyncService = new ShopproPaymentStatusSyncService( new ShopproIntegrationsRepository( $app->db(), (string) $app->config('app.integrations.secret', '') ), new ShopproApiClient(), new OrdersRepository($app->db()), $app->db() ); $runner = new CronRunner( $cronRepository, $app->logger(), [ 'allegro_token_refresh' => new AllegroTokenRefreshHandler( $integrationRepository, $oauthClient ), 'allegro_orders_import' => new AllegroOrdersImportHandler( $ordersSyncService ), 'allegro_status_sync' => new AllegroStatusSyncHandler( new AllegroStatusSyncService( $cronRepository, $orderImportService, $app->db() ) ), 'shoppro_orders_import' => new ShopproOrdersImportHandler( $shopproSyncService ), 'shoppro_order_status_sync' => new ShopproStatusSyncHandler( $shopproStatusSyncService ), 'shoppro_payment_status_sync' => new ShopproPaymentStatusSyncHandler( $shopproPaymentSyncService ), ] ); $result = $runner->run($limit); fwrite(STDOUT, json_encode($result, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL);