Skip to content

Rebuilt Bolivia countryData and added a test for the postal code handler function#697

Open
kaio-donadelli wants to merge 9 commits into
mainfrom
l10n_fix-BOL
Open

Rebuilt Bolivia countryData and added a test for the postal code handler function#697
kaio-donadelli wants to merge 9 commits into
mainfrom
l10n_fix-BOL

Conversation

@kaio-donadelli

@kaio-donadelli kaio-donadelli commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

Fix missing and incorrect Bolivia postal code and location data using INE 2024 Census sources, and ensure geolocation resolves the correct 5-digit postal code from the department → province → municipality hierarchy.

Summary

  • Rebuilt BOL country data (BOL.json + BOL.ts) from INE 2024
  • Extracted shared createPostalCodeFromHierarchyHandler; migrated BOL, COL, CRI, PER, CHL
  • Added explicit postal code map types to PostalCodeRules
  • Added unit and BOL integration tests for the geolocation postal code handler

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

Related

@kaio-donadelli kaio-donadelli requested a review from a team as a code owner June 18, 2026 12:03
@vtex-io-ci-cd

vtex-io-ci-cd Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@fdaciuk fdaciuk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ver comentários inline.

Comment thread react/country/data/BOL.json Outdated
Comment thread react/country/BOL.ts Outdated
Comment thread react/country/BOL.ts Outdated
Comment thread react/__tests__/helpers/geolocationPostalCodeHandler.ts Outdated
Comment thread react/__tests__/helpers/geolocationPostalCodeHandler.ts Outdated
Comment thread react/__tests__/geolocationPostalCodeHandler.test.ts Outdated
Correct Tarija Avilez OEP codes, make the handler immutable and strict-safe,
harden geolocation test helpers, and exclude helpers from Jest discovery.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vtex-pr-sentinel

vtex-pr-sentinel Bot commented Jul 1, 2026

Copy link
Copy Markdown

🛡️ SDD Check — action required

I couldn't detect an SDD in this PR. Please check one option below (requires write access to the repo):

  • SDD lives in another PR — paste the SDD PR URL here:
  • This PR doesn't need an SDD
  • SDD applies, but I'm not adopting it in this PR

@kaio-donadelli kaio-donadelli requested review from Lurian and fdaciuk July 1, 2026 13:23

@fdaciuk fdaciuk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Achados que valem correção antes do merge: tipagem quebrada no novo helper de teste, escopo do teste genérico demais e duplicação de lógica do handler entre países.

Comment thread react/country/BOL.ts Outdated
Comment thread react/__tests__/helpers/geolocationPostalCodeHandler.ts
Comment thread react/__tests__/helpers/geolocationPostalCodeHandler.ts
Comment thread react/__tests__/geolocationPostalCodeHandler.test.ts Outdated
kaio-donadelli and others added 3 commits July 1, 2026 12:45
Migrate BOL, COL, CRI, PER, and CHL to createPostalCodeFromHierarchyHandler
with immutable postal code resolution from administrative hierarchy.

Co-authored-by: Cursor <cursoragent@cursor.com>
Export typed postal code hierarchy maps from postalCodes transform and
reference them directly in PostalCodeRules instead of ReturnType inference.

Co-authored-by: Cursor <cursoragent@cursor.com>
Scope integration tests to Bolivia only and remove cross-country discovery
helpers so unrelated country changes cannot break this PR's test suite.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kaio-donadelli kaio-donadelli requested a review from fdaciuk July 1, 2026 18:14
Search explicitly for two administrative paths whose postal codes differ
instead of assuming the first municipality of two provinces always differs.

Co-authored-by: Cursor <cursoragent@cursor.com>

@fdaciuk fdaciuk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Threads anteriores resolvidos e confirmados. Restam 3 pontos novos encontrados nesta rodada, um deles quebrando tsc --noEmit.

Comment thread react/transforms/geolocationPostalCodeFromHierarchy.test.ts Outdated
Comment thread react/transforms/geolocationPostalCodeFromHierarchy.ts
Comment thread react/__tests__/geolocationPostalCodeHandler.test.ts Outdated
kaio-donadelli and others added 3 commits July 1, 2026 17:00
Fixes tsc TS2322 by avoiding keyof AddressWithValidation assignment.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace manual nested traversal with lodash/get, matching AddressContainer.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace conditional test registration with expect(alternateSample).not.toBeNull().

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonar-workflows

Copy link
Copy Markdown

@fdaciuk fdaciuk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants