feat(postcodes/VN): bulk-import 63 Vietnam province postcodes via VNPost (#1039)#1457
Conversation
…ost (#1039) Source: VNPost province-level postcodes parsed from the navuitag/dvhcvn MySQL dump. Ships country-only by design — Vietnam's 2024-2025 administrative restructuring merged the source's 63 pre-2024 provinces into the post-merger 34 provinces represented in states.json, so a clean per-row state FK is no longer possible from this dataset (matches the SE/SI/ZA/GR precedent). Refs #1039. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CSC Validation ReportPR Format
Labels applied: Schema Validation (63 records)✅ All records passed validation Cross-Reference Validation✅ 63 reference(s) verified Source URL Verification✅ 2 source URL(s) accessible ✅ All checks passed | Status: Ready for review |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds province-level Vietnam postcodes (VNPost) to the contributions dataset and includes a script to (re)generate the JSON from the upstream navuitag/dvhcvn SQL dump.
Changes:
- Added
contributions/postcodes/VN.jsoncontaining 63 province-level postcode records. - Added
bin/scripts/sync/import_vietnam_postcodes.pyto fetch/parse the upstream SQL and writeVN.jsonidempotently.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| contributions/postcodes/VN.json | New Vietnam postcode dataset (country-only, province-level). |
| bin/scripts/sync/import_vietnam_postcodes.py | New importer script to generate/merge VN.json from upstream SQL. |
| "code": "390000", | ||
| "country_id": 240, | ||
| "country_code": "VN", | ||
| "locality_name": "Lai Châu", | ||
| "type": "full", | ||
| "source": "vnpost-via-navuitag" | ||
| }, | ||
| { | ||
| "code": "390000", | ||
| "country_id": 240, | ||
| "country_code": "VN", | ||
| "locality_name": "Điện Biên", | ||
| "type": "full", | ||
| "source": "vnpost-via-navuitag" | ||
| }, |
There was a problem hiding this comment.
There are duplicate postcodes assigned to different locality_name values (e.g., 390000 appears for both Lai Châu and Điện Biên). If consumers expect a unique mapping between province and postcode, this creates ambiguity and likely indicates an incorrect import/result. Recommend verifying the upstream values and correcting the conflicting entries, and/or enforcing a validation step in the importer that fails when the same code is emitted for multiple distinct provinces (unless duplicates are explicitly intended and documented).
| "code": "790000", | ||
| "country_id": 240, | ||
| "country_code": "VN", | ||
| "locality_name": "Bà Rịa - Vũng Tàu", | ||
| "type": "full", | ||
| "source": "vnpost-via-navuitag" | ||
| }, | ||
| { | ||
| "code": "790000", | ||
| "country_id": 240, | ||
| "country_code": "VN", | ||
| "locality_name": "Bắc Ninh", | ||
| "type": "full", | ||
| "source": "vnpost-via-navuitag" | ||
| }, |
There was a problem hiding this comment.
Another postcode duplication: 790000 is assigned to both Bà Rịa - Vũng Tàu and Bắc Ninh. Same concern as above—this likely breaks lookups keyed by code and suggests at least one of these rows is wrong. Please validate against the source and fix the conflicting code(s); consider adding an importer-side check to detect and error on duplicated code values across distinct locality_names.
Summary
Adds 63 Vietnam province-level postcodes parsed from the
navuitag/dvhcvnMySQL dump.6-digit code.
Why country-only
Vietnam's 2024-2025 administrative restructuring merged the source's
63 pre-2024 provinces into the post-merger 34 provinces represented
in CSC's
states.json. A clean per-row state FK is no longerpossible from this dataset — matches the SE/SI/ZA/GR precedent.
Source & licence
navuitag.
"source": "vnpost-via-navuitag"Validation
python3 -m py_compileclean.country.postal_code_regex(^(\d{6})$).id,created_at,updated_at,flag).Test plan
Refs #1039.
🤖 Generated with Claude Code