update
This commit is contained in:
@@ -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'] : [];
|
||||
|
||||
Reference in New Issue
Block a user