Skip to content

feat: Migrate geographies to API v2 alpha#658

Merged
anth-volk merged 17 commits intomove-to-api-v2from
feat/migrate-geographies-to-v2
Feb 17, 2026
Merged

feat: Migrate geographies to API v2 alpha#658
anth-volk merged 17 commits intomove-to-api-v2from
feat/migrate-geographies-to-v2

Conversation

@anth-volk
Copy link
Collaborator

@anth-volk anth-volk commented Feb 11, 2026

Fixes #657

Summary

Migrate geography/region functionality to use the new API v2 alpha regions endpoint, removing user-specific geography associations.

Dependencies

This PR requires the following to be merged first:

Repo PR Status
policyengine.py #231 - Add ability to run impacts over subnational regions Open
policyengine-api-v2-alpha #82 - Add regions support for geographic analysis Draft

Changes

  • Fetch regions from /regions/ endpoint instead of user-scoped APIs
  • Remove UserGeographicStore pattern
  • Update types to use system Region instead of UserGeographyPopulation
  • Remove custom geography naming features
  • Update geography selection components

Test plan

  • Verify region list loads from API v2 alpha
  • Verify subnational simulation works with selected region
  • Verify no user-specific geography data is created/stored

🤖 Generated with Claude Code

@vercel
Copy link

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment Feb 17, 2026 10:05pm
policyengine-calculator Ready Ready Preview, Comment Feb 17, 2026 10:05pm

Request Review

@anth-volk anth-volk changed the base branch from main to move-to-api-v2 February 16, 2026 18:52
@anth-volk anth-volk marked this pull request as ready for review February 16, 2026 19:22
anth-volk and others added 15 commits February 17, 2026 22:42
- Add V2 regions API client (fetchRegions, fetchRegionByCode)
- Add RegionsAdapter to convert V2 API response to frontend format
- Update useRegions hook to fetch from V2 API using React Query
- Remove year parameter from useRegions/useRegionsList (API handles versioning)
- Update all call sites to use new single-argument signature
- Remove unused CURRENT_YEAR imports from updated files
- Add regionKeys to queryKeys for React Query cache management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allow PR checks to run for PRs targeting any branch, not just main/master.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After rebasing onto move-to-api-v2 (which includes the policy v2 migration),
countryId became required on UserPolicy and ShareableUserPolicy. Updated all
fixtures and useSaveSharedReport to include countryId. Also ran Prettier on
files that needed formatting after the rebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The page now uses useUserId() (from the policy v2 migration) instead of
MOCK_USER_ID directly. Added mock to return MOCK_USER_ID so the test
assertion matches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@anth-volk anth-volk merged commit 4595b03 into move-to-api-v2 Feb 17, 2026
7 checks passed
@anth-volk anth-volk deleted the feat/migrate-geographies-to-v2 branch February 17, 2026 22:06
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.

Migrate geographies to API v2 alpha

1 participant