mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 01:28:55 +00:00
fix(atlas): correct Guangdong Province name in region bundle
This commit is contained in:
@@ -135,6 +135,8 @@ const ALLOWED_DESTRUCTIVE: Record<string, string> = {
|
||||
'Atlas enclave fix: DELETE ... WHERE place_id IN (places inside specific enclave boxes) — invalidate stale region cache; re-resolved on next request.',
|
||||
'DELETE FROM visited_regions':
|
||||
'Atlas geoBoundaries swap (#1119): DELETE ... WHERE id = ? — after UPDATE OR IGNORE re-codes a manually-marked region to its current code, drop only the single leftover row whose UNIQUE(user_id, region_code) collision caused the update to be skipped (a duplicate of a region the user already has).',
|
||||
'DELETE FROM hidden_regions':
|
||||
'Guangdong rename (#2284): DELETE ... WHERE region_code = the retired CN-GUANGZHOUPROVINCE, run right after an UPDATE OR IGNORE re-codes the tombstone. Only a row the update had to skip survives to here, and it can only be skipped because UNIQUE(user_id, region_code) already holds the same tombstone under the correct code, so the user keeps the region hidden either way.',
|
||||
'DELETE FROM reservation_day_positions':
|
||||
'DELETE ... WHERE the row joins a reservation and a day sitting on different trips. The table has no trip_id and its two foreign keys only require the ids to exist, so a pair that never belonged together was storable; the writer scopes to the trip now and this clears what earlier builds allowed. Bounded by the join — a row whose reservation and day agree on their trip is untouched.',
|
||||
};
|
||||
|
||||
@@ -78,4 +78,14 @@ describe('Atlas admin1 region bundle (#1217)', () => {
|
||||
expect(names.has(borough), `${borough} should be a region of its own`).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it('ATLAS-BUNDLE-006 — China ships Guangdong Province, not Guangzhou Province', () => {
|
||||
const cn = (features as unknown as { properties: { iso_a2: string | null; name?: string; iso_3166_2: string } }[])
|
||||
.filter(f => f.properties.iso_a2 === 'CN');
|
||||
const names = cn.map(f => f.properties.name);
|
||||
expect(names).toContain('Guangdong Province');
|
||||
expect(names).not.toContain('Guangzhou Province');
|
||||
expect(cn.some(f => f.properties.iso_3166_2 === 'CN-GUANGDONGPROVINCE')).toBe(true);
|
||||
expect(cn.some(f => f.properties.iso_3166_2 === 'CN-GUANGZHOUPROVINCE')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user