KSH settlement register – data model, build and matching
Storage of the settlement register and of address matches, the build and the matching scores, the permission keys and the background matching run.
Overview
The KSH settlement register (code, name, postcode, county, district, region, NUTS) and the matching of company addresses to it. The register is used to resolve county names in KSH data, by the property price report (county, NUTS) and by the company tiles.
Data model
Table names carry the installation's own prefix in the database.
| Table | Role | Main fields |
|---|---|---|
ksh_settlement | settlement register | code, name, normalised and ASCII name, postcode, county, district, region, NUTS, status |
address_ksh | address–settlement match | address, settlement, status, score, name hash |
address | address master (read only) | city |
Process
- Save: the name is required; the
kshlibrary builds a normalised and an ASCII name; with an empty code the code isAplus 12 characters of the SHA1 of the normalised name. - Build (
buildaddresses): upsert into the register from the distinct settlement names of the address master; county and NUTS are not overwritten; returns processed, new, updated and incomplete counts. - Matching (
match):info=1returns a summary, processing runs in batches of 200 (start,limit). By the normalised city name: a match with NUTS is status 1 (score 100), without NUTS status 2 (70), no match status 4 (0); upsert intoaddress_ksh. - Incomplete row: empty county or NUTS; the count is shown in the list header.
Permissions
list(content scope:ksh_settlement/ksh_settlement_idrules),edit(form), savecanSave(),status,delete,build,match,debug(last SQL of the list).
Background job
The cron/kshmatch entry point runs the same matching in batches of 500. It is a direct entry point, not part of the central job queue; no authentication check is visible in the controller.
Known limitations
- Deletion is physical, without checking the
address_kshmatches. - There is no endpoint for the
statusdeletekey. - The Hungarian caption of the name field reads "Kiegyenlítés" and the German menu item "Abrechnungen" — translation errors; the field holds the settlement name.