json((object) [], 201)->header('Location', $locationUrl); } protected function legacyError(int $status, array $globalErrors): JsonResponse { return response()->json(['global_errors' => $globalErrors], $status); } protected function legacyValidationError(ValidationException $exception): JsonResponse { return response()->json([ 'global_errors' => [], 'field_errors' => $exception->errors(), ], 422); } /** * Legacy-Land (country.id der Altportale) → ISO-Code des neuen Systems. * Häufigste IDs aus dem Prod-Snapshot; unbekannte → null (Feld leer). */ protected function legacyCountryCode(mixed $legacyCountryId): ?string { return match ((int) $legacyCountryId) { 177 => 'DE', 80 => 'AT', 196 => 'CH', 229 => 'US', 30 => 'GB', 165 => 'FR', 78 => 'IT', 2 => 'NL', 47 => 'ES', 108 => 'CY', 115 => 'LI', 117 => 'LU', 15 => 'AU', 89 => 'CA', default => null, }; } }