@php $qcGenCatalog = $qcGeneralCheckCatalog ?? ['domains' => [], 'activities' => [], 'checks' => []]; /** @var \Illuminate\Support\Collection $qcChecksById */ $qcChecksById = $qcChecksById ?? collect(); $domainsCol = collect($qcGenCatalog['domains'] ?? []); $activitiesCol = collect($qcGenCatalog['activities'] ?? []); $checksCol = collect($qcGenCatalog['checks'] ?? []); $rowsOld = report_wizard_rows('part_c.general_check.rows', [[ 'report_qc_domain_id' => '', 'report_qc_check_definition_id' => '', 'readings_yn' => '', 'found_places' => '', 'remarks' => '', ]], $reportPayload ?? null); // Plain arrays so scripts always receive id / report_qc_domain_id / report_qc_activity_id (no Model JSON quirks). $reportC1CatalogForJs = [ 'domains' => $domainsCol->map(fn ($d) => [ 'id' => (int) $d->id, 'name' => (string) $d->name, ])->values()->all(), 'activities' => $activitiesCol->map(fn ($a) => [ 'id' => (int) $a->id, 'report_qc_domain_id' => (int) $a->report_qc_domain_id, 'name' => (string) $a->name, ])->values()->all(), 'checks' => $checksCol->map(fn ($c) => [ 'id' => (int) $c->id, 'report_qc_activity_id' => (int) $c->report_qc_activity_id, 'name' => (string) $c->name, 'standard' => $c->standard !== null ? (string) $c->standard : null, 'found_places_hint' => $c->found_places_hint !== null ? (string) $c->found_places_hint : null, ])->values()->all(), ]; @endphp {{-- Part C §1 — General Check: QB-style rows; Domain → Activity → Name of test; + ADD ROW --}} @if ($domainsCol->isEmpty())
General Check catalog has no rows in the database. Run php artisan db:seed --class=ReportQualityCatalogSeeder (or full db:seed), then reload.
| Domain | Activity / Material | Name of the Test | Readings Actual at Site (YES/NO) | Found in # of Places | Standard | Remarks (+ / -) | |
|---|---|---|---|---|---|---|---|
| @error($dotBase.'report_qc_domain_id') {{ $message }} @enderror | @error($dotBase.'report_qc_check_definition_id') {{ $message }} @enderror | @error($dotBase.'readings_yn') {{ $message }} @enderror | {{ $checkDef && $checkDef->found_places_hint ? $checkDef->found_places_hint : '' }} @error($dotBase.'found_places') {{ $message }} @enderror | {{ $checkDef ? ($checkDef->standard ?: '—') : '—' }} | @error($dotBase.'remarks') {{ $message }} @enderror |