vrsao 2
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-08 14:02:01 +02:00
parent bdd766c68a
commit 1106509116
354 changed files with 48275 additions and 24635 deletions
@@ -17,7 +17,7 @@ class ImportIndustrialParkCandidates extends Command
public function handle(): int
{
$document = json_decode(file_get_contents(database_path('data/industrial-park-candidate-drafts.json')), true, flags: JSON_THROW_ON_ERROR);
$document = json_decode($this->readSource(database_path('data/industrial-park-candidate-drafts.json')), true, flags: JSON_THROW_ON_ERROR);
if (($document['source_document_attached'] ?? null) !== true
|| ($document['source_document_reconciled'] ?? null) !== true) {
$this->error('The source document must be attached and reconciled before importing drafts. No records written.');
@@ -106,4 +106,14 @@ class ImportIndustrialParkCandidates extends Command
{
return Str::upper(Str::ascii(trim($value)));
}
private function readSource(string $path): string
{
$bytes = file_get_contents($path);
if ($bytes === false) {
throw new RuntimeException('Source file is unavailable: '.$path);
}
return $bytes;
}
}