Skip to content

feat: restore transboundary flag as is_transboundary column / 越境遺産フラグの復活 - #582

Open
zigzagdev wants to merge 6 commits into
mainfrom
feat/restore-transboundary-flag
Open

feat: restore transboundary flag as is_transboundary column / 越境遺産フラグの復活#582
zigzagdev wants to merge 6 commits into
mainfrom
feat/restore-transboundary-flag

Conversation

@zigzagdev

Copy link
Copy Markdown
Owner

Motivation / 目的

UNESCO's own dataset already flags whether a site is transboundary (spans multiple countries via a serial nomination), but this project fetched that value and then silently discarded it during import. This restores it as a real column.

UNESCOのデータセット自体が「越境遺産かどうか」を示す真偽値を既に持っていますが、これまでは取得しておきながらインポート処理の途中で捨てていました。実カラムとして復活させます。

What I have done / 実施内容

  • Added is_transboundary (boolean, default false) column to world_heritage_sites via migration
  • SplitWorldHeritageJson::normalizeSiteRowImportReady() / mergeSiteRowPreferExisting() now carry transboundary from the raw UNESCO dump through to the normalized site record (same pattern as the existing is_endangered handling)
  • ImportWorldHeritageSiteFromSplitFile now persists is_transboundary to the DB
  • Added is_transboundary to WorldHeritage::$fillable
  • Re-shipped the checked-in storage/app/private/unesco/normalized/world_heritage_sites.json snapshot with is_transboundary populated for all 1248 sites (same precedent as the earlier main_image_url backfill)

Verification / 検証

Ran the full pipeline (split → import) end to end against the real UNESCO dump and confirmed in the DB:

  • Known transnational serial sites (1133 Ancient and Primeval Beech Forests, 1321 The Architectural Work of Le Corbusier, 1363 Prehistoric Pile Dwellings around the Alps, 1613 The Great Spa Towns of Europe) → is_transboundary = true
  • A single-country site (1000) → is_transboundary = false

Full WorldHeritage-related test suite (63 tests) re-run with no regressions.

Scope / スコープ

This PR stops at the DB layer as agreed. Exposing is_transboundary via the API/DTO or as an Algolia facet is intentionally out of scope here and will be a separate follow-up once a concrete feature (e.g. a transnational-sites filter) needs it.

Closes #581

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.02%. Comparing base (905138c) to head (62d7f01).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #582      +/-   ##
============================================
+ Coverage     64.66%   67.02%   +2.36%     
- Complexity     1694     1707      +13     
============================================
  Files           147      149       +2     
  Lines          8858     8929      +71     
============================================
+ Hits           5728     5985     +257     
+ Misses         3130     2944     -186     
Files with missing lines Coverage Δ
.../Commands/ImportWorldHeritageSiteFromSplitFile.php 73.19% <100.00%> (+73.19%) ⬆️
...rc/app/Console/Commands/SplitWorldHeritageJson.php 14.58% <100.00%> (+14.58%) ⬆️
src/app/Models/WorldHeritage.php 100.00% <100.00%> (ø)
...ldHeritageSiteFromSplitFileIsTransboundaryTest.php 100.00% <100.00%> (ø)
...ests/SplitWorldHeritageJsonIsTransboundaryTest.php 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: restore transboundary flag as is_transboundary column on world_heritage_sites / 越境遺産フラグの復活

1 participant