Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start supporting multi-valued "items" field #156

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Conversation

oyamauchi
Copy link
Member

Description

In preparation for rolling out more granular item values for things
like heat pumps and weatherization, incentives will need to support
multiple values items. This change starts reading from a new
array-valued items field if it's available.

Next step will be to deploy a backend change that adds the
multi-valued field to responses. Then, remove item from the
frontend. Then, remove item from the backend.

https://app.asana.com/0/1206661332626418/1206911030685282

Test Plan

Running calculations against a local backend that has the items
change applied succeeds; Cypress tests pass in that state.

## Description

In preparation for rolling out more granular `item` values for things
like heat pumps and weatherization, incentives will need to support
multiple values items. This change starts reading from a new
array-valued `items` field if it's available.

Next step will be to deploy a backend change that adds the
multi-valued field to responses. Then, remove `item` from the
frontend. Then, remove `item` from the backend.

https://app.asana.com/0/1206661332626418/1206911030685282

## Test Plan

Running calculations against a local backend that has the `items`
change applied succeeds; Cypress tests pass in that state.
Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
embed-rewiringamerica-org ✅ Ready (Inspect) Visit Preview Apr 25, 2024 10:03pm

oyamauchi added a commit to rewiringamerica/api.rewiringamerica.org that referenced this pull request Apr 25, 2024
## 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 `Item`s.

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.
oyamauchi added a commit to rewiringamerica/api.rewiringamerica.org that referenced this pull request Apr 29, 2024
## 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 `Item`s.

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.
oyamauchi added a commit to rewiringamerica/api.rewiringamerica.org that referenced this pull request Apr 29, 2024
## 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 `Item`s.

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.
@oyamauchi oyamauchi merged commit f17b2cf into main Apr 29, 2024
3 checks passed
@oyamauchi oyamauchi deleted the owen.multi-items branch April 29, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants