Feat: Adding Backfill Skus to the Migrate Import Job

This commit is contained in:
2026-09-22 14:55:18 +03:00
parent 050204f063
commit 37b49963f6
3 changed files with 81 additions and 23 deletions
+12 -1
View File
@@ -7,6 +7,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Modules\Core\Catalog\Services\SkuBackfillService;
class RunMigrateImportJob implements ShouldQueue
{
@@ -20,9 +21,19 @@ class RunMigrateImportJob implements ShouldQueue
) {
}
public function handle(): void
public function handle(SkuBackfillService $skuBackfill): void
{
$importer = ImporterFactory::make($this->spec);
$importer->import($this->spec);
// Only Shopify's importer creates ProductVariant rows at all (see
// Shopify\ShopifyExportImporter) — JudgeMe never touches products,
// so running this for that source would just be a guaranteed
// no-op query every time. Source CSV rows genuinely can have no
// `Variant SKU` value; see SkuBackfillService's own docblock for
// why that's synthesized rather than treated as an importer bug.
if ($this->spec->source === 'shopify') {
$skuBackfill->backfill();
}
}
}