Skip to content

Comments

feat: Add default_value and value_type to Variable class#228

Merged
anth-volk merged 4 commits intoapp-v2-migrationfrom
feat/variable-default-value
Feb 16, 2026
Merged

feat: Add default_value and value_type to Variable class#228
anth-volk merged 4 commits intoapp-v2-migrationfrom
feat/variable-default-value

Conversation

@anth-volk
Copy link
Contributor

Fixes #226

Summary

  • Add default_value and value_type fields to the Variable class in policyengine.py
  • Update US and UK model files to serialize default_value for JSON compatibility:
    • Enum values are converted to their .name string (e.g., "SINGLE")
    • datetime.date values are converted to ISO format string
    • Primitives (bool, int, float, str) are kept as-is
  • value_type preserves the original type for downstream consumers

Test plan

  • Verify variables have default_value populated correctly
  • Verify enum default values are serialized as strings
  • Verify bool, int, float default values are preserved correctly

🤖 Generated with Claude Code

anth-volk and others added 2 commits February 7, 2026 01:23
- Add default_value (Any) and value_type (type) fields to Variable model
- Update US and UK models to serialize default_value for JSON compatibility:
  - Enum values converted to their .name string
  - datetime.date values converted to ISO format string
  - Primitives (bool, int, float, str) kept as-is
- value_type preserves the original type for downstream consumers

Closes #226

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add tests verifying US age variable has default_value of 40
- Add tests verifying enum variables have string default_value
- Add tests verifying variables have value_type set
- Add tests verifying UK model variable default_value

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@anth-volk anth-volk marked this pull request as ready for review February 7, 2026 00:50
@anth-volk anth-volk marked this pull request as draft February 11, 2026 19:32
@anth-volk
Copy link
Contributor Author

Converting to draft. Need to make modifications to simulation class for US.

anth-volk and others added 2 commits February 16, 2026 20:44
Allow PR checks to run for PRs targeting any branch, not just main.

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 February 16, 2026 22:31
@anth-volk anth-volk merged commit 0529376 into app-v2-migration Feb 16, 2026
2 checks passed
@anth-volk anth-volk deleted the feat/variable-default-value branch February 16, 2026 22:32
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