This commit is contained in:
2026-04-07 22:39:16 +02:00
parent 8fa9ca6439
commit 40644eb362
31 changed files with 4972 additions and 71 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Modules\Settings;
use App\Core\Support\StringHelper;
use App\Modules\Automation\AutomationService;
use App\Modules\Orders\OrderImportRepository;
use App\Modules\Orders\OrdersRepository;
use DateTimeImmutable;
@@ -20,7 +21,8 @@ final class ShopproOrdersSyncService
private readonly OrdersRepository $orders,
private readonly ShopproOrderMapper $mapper,
private readonly ShopproProductImageResolver $imageResolver,
private readonly ?ShopproPullStatusMappingRepository $pullStatusMappings = null
private readonly ?ShopproPullStatusMappingRepository $pullStatusMappings = null,
private readonly ?AutomationService $automationService = null
) {
}
@@ -267,6 +269,14 @@ final class ShopproOrdersSyncService
'shopPRO'
);
}
if ($savedOrderId > 0 && !$wasPaymentTransition && $this->automationService !== null) {
$this->automationService->trigger('order.imported', $savedOrderId, [
'source' => 'shoppro',
'created' => $wasCreated,
'integration_id' => $integrationId,
]);
}
} catch (Throwable $exception) {
$result['failed'] = (int) $result['failed'] + 1;
$errors = is_array($result['errors']) ? $result['errors'] : [];