Skip to content

fix: Populate possible_values for enum variables during seeding#90

Closed
SakshiKekre wants to merge 1 commit intomainfrom
fix/enum-possible-values
Closed

fix: Populate possible_values for enum variables during seeding#90
SakshiKekre wants to merge 1 commit intomainfrom
fix/enum-possible-values

Conversation

@SakshiKekre
Copy link
Contributor

Summary

  • Previously, all variables were seeded with possible_values = NULL, even for enum-type variables like state_code and filing_status
  • Now extracts possible_values from the policyengine package and stores them as JSON
  • Enables API consumers to know valid values for constrained variables (e.g., state dropdowns, filing status options)

Changes

  • scripts/seed.py: Use var.possible_values instead of hardcoding None

Impact

  • 89 variables (62 US + 27 UK) now have possible_values populated
  • Examples: state_code, filing_status, tenure_type, council_tax_band

Test plan

  • Verified with Python that policyengine package provides possible_values as list
  • Re-seeded local database and confirmed 89 variables have possible_values
  • Unit tests pass (26 tests)

🤖 Generated with Claude Code

@SakshiKekre SakshiKekre force-pushed the fix/enum-possible-values branch from 1530a88 to b144a99 Compare March 2, 2026 15:50
Previously, all variables were seeded with possible_values = NULL,
even for enum-type variables like state_code and filing_status.

Changes:
- seed.py: Extract possible_values from policyengine package and store as JSON
- variable.py: Fix type annotation from `str | None` to `list[str] | None`

This enables API consumers to know valid values for constrained
variables (e.g., state dropdowns, filing status options).

Affects 89 variables (62 US + 27 UK) that have enumerated values.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@SakshiKekre SakshiKekre force-pushed the fix/enum-possible-values branch from b144a99 to b81223c Compare March 2, 2026 15:54
@SakshiKekre
Copy link
Contributor Author

Superseded by #91 which targets app-v2-migration branch instead of main.

@SakshiKekre SakshiKekre closed this Mar 3, 2026
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