Skip to content

Implement UK situation builder #61

@MaxGhenis

Description

@MaxGhenis

Summary

Create a UK-specific situation builder function similar to create_situation() for US.

Implementation

Create givecalc/uk/situation.py with:

  • create_uk_situation() function that builds a PolicyEngine-UK compatible situation dictionary
  • Support for key UK inputs:
    • employment_income (wages/salary)
    • self_employment_income
    • gift_aid (main charitable donation mechanism)
    • charitable_investment_gifts (donations of stocks/property)
    • is_married (affects tax calculations)
    • region (England, Scotland, Wales, NI - affects income tax rates)
    • num_children (affects child benefit)
  • Create donation axes (sweep gift_aid from 0 to income)
  • Use UK entity structure: Person → BenUnit → Household

UK Entity Mapping

{
    "people": {"person": {...}},
    "benunits": {"benunit": {"members": ["person"]}},
    "households": {"household": {"members": ["person"]}}
}

Acceptance Criteria

  • TDD: Tests written first
  • create_uk_situation() creates valid PolicyEngine-UK situations
  • Axes correctly sweep gift_aid donations
  • Handles single person and married couple scenarios
  • Handles all 4 UK nations

Part of #59

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions