- Added AllegroOrderSyncStateRepository for managing sync state with Allegro orders. - Introduced AllegroOrdersSyncService to handle the synchronization of orders from Allegro. - Created AllegroStatusDiscoveryService to discover and store order statuses from Allegro. - Developed AllegroStatusMappingRepository for managing status mappings between Allegro and OrderPro. - Implemented AllegroStatusSyncService to facilitate status synchronization. - Added CronSettingsController for managing cron job settings related to Allegro integration.
27 lines
665 B
PHP
27 lines
665 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Cron;
|
|
|
|
use App\Modules\Settings\AllegroOrdersSyncService;
|
|
|
|
final class AllegroOrdersImportHandler
|
|
{
|
|
public function __construct(private readonly AllegroOrdersSyncService $syncService)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $payload
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function handle(array $payload): array
|
|
{
|
|
return $this->syncService->sync([
|
|
'max_pages' => (int) ($payload['max_pages'] ?? 5),
|
|
'page_limit' => (int) ($payload['page_limit'] ?? 50),
|
|
'max_orders' => (int) ($payload['max_orders'] ?? 200),
|
|
]);
|
|
}
|
|
}
|