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

Add multi-valued "items" field #450

Closed oyamauchi closed 5 months ago

oyamauchi commented 5 months ago

Description

This is the beginning of the process of adding more granular item types for heat pumps and weatherization. Individual incentives will now pertain to multiple Items.

The process will be:

  1. Land and deploy this
  2. Land and deploy rewiringamerica/embed.rewiringamerica.org#156
  3. Land and deploy a PEP PR which is yet to come, similar to the embed one above (read from new field if available; fall back to existing one if not)
  4. Update the backend to stop including the old single-valued field in responses.
  5. Remove the support for the old field from the embed and PEP code
  6. Start updating the underlying data, this getting rid of the "synthesize items" bit from this PR.

I decided to ditch the human-friendly name. It was a holdover from v0, in which it was used to populate the table UIs of the old IRA and embed calculators. It's too frontend-coupled to make total sense in v1, and neither PEP nor the new embed calculator use it, so it's gone.

Throughout this I don't expect to proactively inform any external API clients of the changes, and certainly not to block on them. I believe anyone we've given v1 to has been warned that v1 will break without notice.

Test Plan

yarn test with updated fixtures. Tested the embed frontend from the above PR against this state running locally.