Skip to content

feat: Add adds/subtracts to variable metadata types and adapter#781

Open
anth-volk wants to merge 3 commits intomove-to-api-v2from
feat/add-adds-subtracts
Open

feat: Add adds/subtracts to variable metadata types and adapter#781
anth-volk wants to merge 3 commits intomove-to-api-v2from
feat/add-adds-subtracts

Conversation

@anth-volk
Copy link
Collaborator

@anth-volk anth-volk commented Mar 6, 2026

Fixes #780

Summary

  • Adds adds: string[] | null and subtracts: string[] | null to V2VariableMetadata type
  • Adds optional adds?: string[] and subtracts?: string[] to VariableMetadata type
  • Maps fields in MetadataAdapter.variableFromV2() with null → undefined conversion
  • Updates createMockVariable factory with adds: null, subtracts: null defaults
  • Adds 6 adapter tests covering null, array, combined, and empty cases

Test plan

  • given V2 variable with null adds then converts to undefined
  • given V2 variable with null subtracts then converts to undefined
  • given V2 variable with adds array then preserves array
  • given V2 variable with subtracts array then preserves array
  • given V2 variable with both adds and subtracts then preserves both
  • given V2 variable with empty adds array then preserves empty array

🤖 Generated with Claude Code

Map adds/subtracts from the v2 API through to VariableMetadata so
VariableArithmetic can render variable breakdown trees. Includes
adapter tests and mock factory updates.

Closes #780

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 6, 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 Mar 6, 2026 8:03pm
policyengine-calculator Ready Ready Preview, Comment Mar 6, 2026 8:03pm

Request Review

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant