fix: update SCP baby bonus reform to use Person-level variable#1481
Merged
fix: update SCP baby bonus reform to use Person-level variable#1481
Conversation
The scottish_child_payment variable was refactored from BenUnit to Person entity, but the baby bonus reform was not updated to match. This caused a mismatch where applying the reform would try to replace a Person-level variable with a BenUnit-level variable. Changes: - Update reform to use Person entity instead of BenUnit - Use parameterized baby_bonus rates instead of hardcoded values - Leverage is_scp_eligible and would_claim_scp variables - Fix effective date to 2027-04-01 (fiscal year 2027-28) per Scottish Budget - Add unit tests for the reform Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
489332c to
28031c0
Compare
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.
Summary of Changes
scottish_child_payment_reform.pyin_effect.yamltruestarting2027-04-01(wasfalseforever)baby_bonus.yamlscottish_child_payment_baby_bonus.yamlchangelog_entry.yamlKey Fixes
Structural reform pattern: Reform now properly uses Person-level variable with
is_scp_eligibleandwould_claim_scp(was incorrectly using BenUnit entity). Reform entity type must match base variable entity type - verified against other reforms (CB_HITC,marriage_allowance) which all follow this pattern.Effective date: Policy only takes effect from fiscal year 2027-28 (April 2027) per the Scottish Budget 2026-27:
Test plan
policyengine-core test policyengine_uk/tests/policy/reforms/scp_baby_bonus -c policyengine_uk🤖 Generated with Claude Code