-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Problem Description
The pattern for createAdresaCompleta() placement in the PHP data files is inconsistent across counties, leading to missing adresaCompleta fields in API responses.
Correct Pattern (used in ARGES)
createMunicipiu("NAME", [localities], createAdresaCompleta("municipiul NAME..."))
createOras("NAME", [localities], createAdresaCompleta("orasul NAME..."))
createComuna("NAME", [localities], createAdresaCompleta("comuna NAME..."))Incorrect Pattern (found in BOTOSANI)
createMunicipiu("NAME", [createAdresaCompleta("..."), ...localities...])The createAdresaCompleta() is passed as part of the $locuri array instead of as the 3rd parameter.
Root Cause
The functions createMunicipiu(), createOras(), and createComuna() in functions.php only set adresaCompleta if it's passed as the 3rd parameter:
function createMunicipiu($nume, $locuri = [], $adresaCompleta = null) {
$municipiu = new stdClass();
$municipiu->nume = $nume;
if (!empty($locuri)) {
$municipiu->localitate = $locuri;
}
if ($adresaCompleta !== null) { // Only sets if 3rd param provided
$municipiu->adresaCompleta = $adresaCompleta;
}
return $municipiu;
}Affected Counties
Need to audit all county data files to ensure consistent pattern:
- BOTOSANI - fixed in PR Fix BOTOSANI adresaCompleta field missing in API response #379
- Other counties (if any have the same issue)
Task List
- Audit all county PHP files for incorrect pattern
- Fix any other counties with the same issue
- Add test to prevent regression
References
- PR Fix BOTOSANI adresaCompleta field missing in API response #379 - BOTOSANI fix
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels