Feat: Restructuring MigrateImport, Dispatching a per product job for import

This commit is contained in:
2026-09-24 22:50:41 +03:00
parent a9b993182b
commit 8f4156cfe8
22 changed files with 209 additions and 96 deletions
@@ -0,0 +1,31 @@
<?php
namespace Modules\Core\MigrateImport\JudgeMe\Services;
use RuntimeException;
class JudgeMeCsvReader
{
/**
* @return array<int, array<string, string>>
*/
public function read(string $csvPath): array
{
$handle = fopen($csvPath, 'r');
if ($handle === false) {
throw new RuntimeException("Could not open CSV file: {$csvPath}");
}
$headers = fgetcsv($handle);
$rows = [];
while (($row = fgetcsv($handle)) !== false) {
$rows[] = array_combine($headers, $row);
}
fclose($handle);
return $rows;
}
}