Skip to content

Default metadata endpoints to latest model version and add version filtering#99

Draft
anth-volk wants to merge 3 commits intomainfrom
fix/version-filter-metadata
Draft

Default metadata endpoints to latest model version and add version filtering#99
anth-volk wants to merge 3 commits intomainfrom
fix/version-filter-metadata

Conversation

@anth-volk
Copy link
Contributor

Summary

  • Add resolve_model_version_id() service helper that resolves tax_benefit_model_name to the latest version and validates explicit tax_benefit_model_version_id
  • All metadata endpoints (/parameters/, /variables/, /parameter-values/, /parameters/by-name, /parameters/children, /variables/by-name) now default to the latest model version when tax_benefit_model_name is provided
  • Add optional tax_benefit_model_version_id query/body param to all endpoints for pinning to a specific older version
  • Replace country_id with tax_benefit_model_name in /parameters/by-name, /parameters/children, /variables/by-name for consistency

Test plan

  • 108 unit tests covering all endpoints — version filtering, model isolation, pagination, validation, edge cases
  • Shared test fixtures in test_fixtures/fixtures_version_filter.py
  • All tests pass on Python 3.13

Closes #98

🤖 Generated with Claude Code

anth-volk and others added 3 commits March 4, 2026 20:18
…_model_name consistently

All metadata endpoints now default to the latest model version when
tax_benefit_model_name is provided, and accept an optional
tax_benefit_model_version_id for pinning to a specific older version.

The by-name and children endpoints now accept tax_benefit_model_name
instead of country_id for consistency with the other metadata endpoints.

Closes #98

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move all inline model/version/parameter/variable factories into
test_fixtures/fixtures_version_filter.py and rewrite test files to
import from there. Add new test_parameter_values.py covering CRUD,
filtering, pagination, and version filtering for parameter values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@anth-volk anth-volk marked this pull request as ready for review March 4, 2026 21:14
@anth-volk anth-volk requested a review from SakshiKekre March 4, 2026 21:14
Base automatically changed from app-v2-migration to main March 5, 2026 18:54
@anth-volk anth-volk marked this pull request as draft March 9, 2026 09:25
@anth-volk
Copy link
Contributor Author

Converting to draft; this doesn't yet fully migrate, causing us to create three different ways of querying for tax-benefit model version.

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.

Default metadata endpoints to latest model version and add version filtering

1 participant