Migrate household handling to API v2 alpha structures#622
Merged
anth-volk merged 18 commits intomove-to-api-v2from Feb 17, 2026
Merged
Migrate household handling to API v2 alpha structures#622anth-volk merged 18 commits intomove-to-api-v2from
anth-volk merged 18 commits intomove-to-api-v2from
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Fix VariableResolver.getVariableInfo() to read variable.default_value (snake_case) instead of variable.defaultValue (camelCase) - Update test fixtures to use default_value to match API response format The API returns default_value in snake_case, and MetadataAdapter preserves this naming. The VariableInfo interface still uses camelCase defaultValue for consistency with the rest of the frontend code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add test fixtures for variable input mocking in fixtures/components/household/ - Add VariableInput tests for hideLabel prop, data type rendering, disabled state - Add VariableRow tests for label display, remove button, disabled state 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Delete migrationService.ts and its tests entirely. Remove migration functions (isMigrationComplete, markMigrationComplete, clearMigrationFlag) and MIGRATION_COMPLETE storage key from userIdentity. Migration functionality will be built separately once all ingredient APIs are properly set up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a4c16e5 to
8e5353c
Compare
…ebase Remove unused imports (useRegionsList, CURRENT_YEAR, useMemo, useEntities), add missing Household type import, fix jsx-boolean-value lint errors, and format 30 files with Prettier. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #621
Summary
legacyConversion.tsas an anti-corruption layer at the API boundary (v1↔v2 conversion) so all code below the API layer is pure v2_yearparameter threadingWhat changed
Householdinterface withtax_benefit_model_name,year,people: HouseholdPerson[], array-based entity groupslegacyConversion.ts— 4 call sites insrc/api/and hooks; to be deleted when API v2 endpoints shipHouseholdAdapterupdated for v2 formatHouseholdBuilder,HouseholdQueries,HouseholdValidation,householdValues,VariableResolver, and others rewritten for arraysuseCreateHousehold,useUserHousehold,useHouseholdVariationupdatedHouseholdBuilderForm,VariableInput,VariableRow, entity display components updatedisHousehold/isGeographytype guards, removed_yearprop threading, deleted dead v1 test fixtures and mock JSONRequires API v2 alpha changes
This PR introduces a
legacyConversion.tsanti-corruption layer because the API v1 endpoints are still live. New endpoints must be created in policyengine-api-v2-alpha to accept and return the v2 household format. Once those endpoints are available,legacyConversion.tsand its 4 call sites can be deleted entirely.Test plan
npx tsc --noEmit)npx vitest run)🤖 Generated with Claude Code