# Itemized-deduction scenarios for the PolicyEngine oracle.
#
# FOR THE TYPESCRIPT ENGINE ONLY. The Python engine is frozen and never learned
# to itemize, so compare.py refuses these; gen_engine_oracle.py runs them into
# the frontend fixture. Design: docs/itemized-deductions-design.md (frontend).
#
# Each scenario sits on one threshold the engine has to get right. The state
# tax in SALT is STATED (`state_income_tax_paid`) rather than left to PE, so
# these check the federal itemizing math on its own; see build_pe_situation in
# compare.py for the three PE auto-fills an `itemized` block overrides.
#
# Schema, on top of scenarios.yaml's:
#   itemized:                     tax-unit totals; all optional, default 0
#     real_estate_taxes
#     mortgage_interest, mortgage_balance, mortgage_origination_year (default 2020)
#     medical_premiums            Medicare / insurance premiums
#     medical_expenses            everything else, LTC included
#     state_income_tax_paid       the state income tax inside SALT
#   people[].charitable_cash_donations   as in scenarios.yaml
#
# The 2026 single 65+ standard deduction is $18,150 ($16,100 + $2,050) before
# the OBBB senior deduction, which applies whether or not you itemize.

scenarios:

  - name: 'I01 - Single 67, mortgage + property tax + charity, itemizes (TX)'
    year: 2026
    state: TX
    filing_status: single
    default_tolerance: 1
    itemized:
      real_estate_taxes: 12000
      mortgage_interest: 14000
      mortgage_balance: 400000
      mortgage_origination_year: 2015
    people:
      - {age: 67, ira_distributions: 150000, charitable_cash_donations: 8000}

  - name: 'I02 - Single 67, itemized just BELOW the standard deduction (TX)'
    year: 2026
    state: TX
    filing_status: single
    default_tolerance: 1
    itemized:
      real_estate_taxes: 9000
    people:
      # 9,000 + (9,000 - 0.5% x 60,000) = 17,700 < 18,150
      - {age: 67, ira_distributions: 60000, charitable_cash_donations: 9000}

  - name: 'I03 - Single 67, itemized just ABOVE the standard deduction (TX)'
    year: 2026
    state: TX
    filing_status: single
    default_tolerance: 1
    itemized:
      real_estate_taxes: 9000
    people:
      # 9,000 + (9,800 - 300) = 18,500 > 18,150
      - {age: 67, ira_distributions: 60000, charitable_cash_donations: 9800}

  - name: 'I04 - MFJ 70/70, LTC year, medical over the 7.5% floor (FL)'
    year: 2026
    state: FL
    filing_status: mfj
    default_tolerance: 1
    itemized:
      real_estate_taxes: 6000
      medical_premiums: 5000
      medical_expenses: 40000
    people:
      - {age: 70, social_security_gross: 30000, ira_distributions: 120000, charitable_cash_donations: 5000}
      - {age: 70, social_security_gross: 20000}

  - name: 'I05 - Single 60, SALT over the $40,400 cap (CA)'
    year: 2026
    state: CA
    filing_status: single
    default_tolerance: 1
    itemized:
      real_estate_taxes: 20000
      state_income_tax_paid: 25000
    people:
      - {age: 60, wages: 300000}

  - name: 'I06 - MFJ 55/55, SALT cap phased down above $505k MAGI (NY)'
    year: 2026
    state: NY
    filing_status: mfj
    default_tolerance: 1
    itemized:
      real_estate_taxes: 25000
      state_income_tax_paid: 45000
    people:
      - {age: 55, wages: 400000}
      - {age: 55, wages: 200000}

  - name: 'I07 - Single 50, 37% bracket, the OBBB 2/37 limit (CA)'
    year: 2026
    state: CA
    filing_status: single
    default_tolerance: 1
    itemized:
      real_estate_taxes: 20000
      state_income_tax_paid: 60000
      mortgage_interest: 30000
      mortgage_balance: 700000
      mortgage_origination_year: 2019
    people:
      - {age: 50, wages: 900000, charitable_cash_donations: 50000}

  - name: 'I08 - MFJ 45/45, mortgage over the $750k cap (post-2017 loan) (TX)'
    year: 2026
    state: TX
    filing_status: mfj
    default_tolerance: 1
    itemized:
      real_estate_taxes: 15000
      mortgage_interest: 50000
      mortgage_balance: 1200000
      mortgage_origination_year: 2020
    people:
      - {age: 45, wages: 250000}
      - {age: 45}

  - name: 'I09 - MFJ 45/45, same loan taken out in 2015, $1M cap (TX)'
    year: 2026
    state: TX
    filing_status: mfj
    default_tolerance: 1
    itemized:
      real_estate_taxes: 15000
      mortgage_interest: 50000
      mortgage_balance: 1200000
      mortgage_origination_year: 2015
    people:
      - {age: 45, wages: 250000}
      - {age: 45}

  - name: 'I10 - Single 75, charity over the 60% of AGI ceiling (TX)'
    year: 2026
    state: TX
    filing_status: single
    default_tolerance: 1
    itemized:
      real_estate_taxes: 4000
    people:
      - {age: 75, ira_distributions: 50000, charitable_cash_donations: 40000}

  - name: 'I11 - Single 85, nursing-home year (FL)'
    year: 2026
    state: FL
    filing_status: single
    default_tolerance: 1
    itemized:
      medical_premiums: 2400
      medical_expenses: 90000
    people:
      - {age: 85, social_security_gross: 30000, ira_distributions: 80000}

  - name: 'I12 - Single 67, small gift, standard wins, non-itemizer charity (TX)'
    year: 2026
    state: TX
    filing_status: single
    default_tolerance: 1
    itemized:
      real_estate_taxes: 3000
    people:
      - {age: 67, ira_distributions: 70000, charitable_cash_donations: 1500}

  - name: 'I13 - Single 60, 2030, SALT cap back to $10,000 (CA)'
    year: 2030
    state: CA
    filing_status: single
    default_tolerance: 1
    itemized:
      real_estate_taxes: 10000
      state_income_tax_paid: 15000
      mortgage_interest: 12000
      mortgage_balance: 350000
    people:
      - {age: 60, wages: 200000}

  - name: 'I14 - Head of household 50, mortgage + SALT (VA)'
    year: 2026
    state: VA
    filing_status: hoh
    default_tolerance: 1
    itemized:
      real_estate_taxes: 8000
      state_income_tax_paid: 6000
      mortgage_interest: 15000
      mortgage_balance: 300000
    people:
      - {age: 50, wages: 120000}

  - name: 'I15 - MFJ 68/66, itemizing inside the senior-deduction phase-out (OR)'
    year: 2026
    state: OR
    filing_status: mfj
    default_tolerance: 1
    itemized:
      real_estate_taxes: 15000
      state_income_tax_paid: 10000
    people:
      - {age: 68, social_security_gross: 36000, ira_distributions: 200000, charitable_cash_donations: 10000}
      - {age: 66, social_security_gross: 24000}

  - name: 'I16 - MFJ 66/64, one senior, mortgage + SALT, itemizes (MN)'
    year: 2026
    state: MN
    filing_status: mfj
    default_tolerance: 1
    itemized:
      real_estate_taxes: 9000
      state_income_tax_paid: 8000
      mortgage_interest: 11000
      mortgage_balance: 280000
      medical_premiums: 2400
    people:
      - {age: 66, ira_distributions: 90000, social_security_gross: 30000, charitable_cash_donations: 6000}
      - {age: 64, wages: 40000}

  # Phase 2: states that follow the federal itemized deductions. Each is the
  # I01 household moved to that state, with $5,000 of state tax stated in SALT.
  # gen_engine_oracle.py also emits each one's STANDARD-deduction state tax, so
  # the frontend test checks the change itemizing makes, apart from any
  # pre-existing gap in the state's base model.
  - name: 'I17 - Colorado follows federal itemizing, adds back state tax (CO)'
    year: 2026
    state: CO
    filing_status: single
    default_tolerance: 1
    itemized: {real_estate_taxes: 12000, mortgage_interest: 14000, mortgage_balance: 400000, mortgage_origination_year: 2015, state_income_tax_paid: 5000}
    people:
      - {age: 67, ira_distributions: 150000, charitable_cash_donations: 8000}

  - name: 'I18 - North Dakota follows federal itemizing, no add-back (ND)'
    year: 2026
    state: ND
    filing_status: single
    default_tolerance: 1
    itemized: {real_estate_taxes: 12000, mortgage_interest: 14000, mortgage_balance: 400000, mortgage_origination_year: 2015, state_income_tax_paid: 5000}
    people:
      - {age: 67, ira_distributions: 150000, charitable_cash_donations: 8000}

  - name: 'I19 - Montana follows federal itemizing, adds back state tax (MT)'
    year: 2026
    state: MT
    filing_status: single
    default_tolerance: 1
    itemized: {real_estate_taxes: 12000, mortgage_interest: 14000, mortgage_balance: 400000, mortgage_origination_year: 2015, state_income_tax_paid: 5000}
    people:
      - {age: 67, ira_distributions: 150000, charitable_cash_donations: 8000}

  - name: 'I20 - Utah taxpayer credit on the itemized deduction (UT)'
    year: 2026
    state: UT
    filing_status: single
    default_tolerance: 1
    itemized: {real_estate_taxes: 12000, mortgage_interest: 14000, mortgage_balance: 400000, mortgage_origination_year: 2015, state_income_tax_paid: 5000}
    people:
      - {age: 67, ira_distributions: 150000, charitable_cash_donations: 8000}
