Deploy Ladill Woo Manager / deploy (push) Successful in 39s
Auto-import catalog and orders after store activation, add manual order sync, and allow WooCommerce webhooks without CSRF tokens. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
739 B
PHP
35 lines
739 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\WooStore;
|
|
use App\Services\Woo\StoreSyncService;
|
|
use Illuminate\Foundation\Queue\Queueable;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class StoreBootstrapSync
|
|
{
|
|
use Queueable;
|
|
|
|
public function __construct(public int $storeId) {}
|
|
|
|
public function handle(StoreSyncService $sync): void
|
|
{
|
|
$store = WooStore::query()
|
|
->whereKey($this->storeId)
|
|
->where('status', WooStore::STATUS_ACTIVE)
|
|
->first();
|
|
|
|
if (! $store) {
|
|
return;
|
|
}
|
|
|
|
$counts = $sync->syncAll($store);
|
|
|
|
Log::info('Woo store bootstrap sync completed', [
|
|
'store_id' => $store->id,
|
|
'counts' => $counts,
|
|
]);
|
|
}
|
|
}
|