rewiringamerica / api.rewiringamerica.org

A RESTful web API for federal, state, utility and local rebates, tax credits and other electrification incentives.
https://api.rewiringamerica.org
Apache License 2.0
7 stars 0 forks source link

Replace the "agi" fields with a new type of low-income threshold #500

Closed oyamauchi closed 4 months ago

oyamauchi commented 4 months ago

Description

The agi_max_limit and agi_min_limit fields are fundamentally about income qualification. As such, I think it makes sense to subsume it into the wider concept of low-income thresholds. That lets us get rid of the awkward duplication of incentives that's required to express different AGI thresholds for different filing statuses.

The filing_status field has no use other than mapping filing status to different AGI thresholds, so it's gone too. I'm leaving it as a "collected" field from spreadsheets so that I don't have to go update all the spreadsheets, but it's no longer in the actual incentives JSON.

In theory ami_qualification should get the same treatment, but I think it may not actually be long for the world -- the only incentives that use it are the generic IRA rebates, and those will be gone after v0 is shut down.

I haven't updated the VT spreadsheet yet, in case we decide to delay or drop this change.

I've made sure the embed frontend does not read these fields, and I've got rewiringamerica/consumer#1198 to remove them from PEP. (They weren't being used.)

Test Plan

yarn test. Had to update some tests and fixtures to fit the new regime.

oyamauchi commented 4 months ago

Added a check that min < max, and that they're both > 0. (Checking that a min/max pair is present for all filing statuses is done by the JSON Schema validation.)

oyamauchi commented 4 months ago

PEP change is deployed, so this is good to go.