Migrate household handling to API v2 alpha structures#622
Draft
anth-volk wants to merge 3 commits intomove-to-api-v2from
Draft
Migrate household handling to API v2 alpha structures#622anth-volk wants to merge 3 commits intomove-to-api-v2from
anth-volk wants to merge 3 commits intomove-to-api-v2from
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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