-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude IRA rebates; add ability to show generic info about HEAR/HER
## Description This excludes all federal non-tax-credit incentives that come from the API, and adds in these visually-distinct cards with less-specific info about HEAR rebates if the API response indicates the user is below 150% AMI. One slight difference from the design spec is that the description text is grey-500, rather than 400, which fails the a11y test for not having enough contrast with the yellow background. I can't even see the difference at a glance, so I think it's fine. (As a drive-by, I fixed a couple places where we had `gray` instead of `grey`.) Once we settle on copy, I'll start the translation workflow. We don't have any state-specific logic yet, but there's a clear place to add it once we figure out what exactly we want for each state. Some states will want us to show nothing at all (either because they don't want to commit to anything or because they already have actual HEAR programs represented in the API), some states may want semi-specific info in advance of rolling out actual programs, some may tell us they're going to exclude certain items, etc. All that can be built on this foundation. As background, I don't want to put this in the API because the kind of info we want for HEAR just doesn't fit within the current API shape: it's too vague and uncertain. I don't want to extend the API shape to encompass stuff like this because I think it's valuable, on principle, to hold the line that the API only returns concrete, actionable incentives that are certain, or close to certain, to be available. https://app.asana.com/0/1206661332626418/1206925887004341 ## Test Plan Cypress tests pass.
- Loading branch information
Showing
7 changed files
with
303 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { str } from './i18n/str'; | ||
import { MsgFn } from './i18n/use-translated'; | ||
import { Project } from './projects'; | ||
|
||
export type IRARebate = { | ||
project: Project; | ||
headline: string; | ||
program: string; | ||
description: string; | ||
url: string; | ||
}; | ||
|
||
const hearRebates: { | ||
project: Project; | ||
getHeadline: (msg: MsgFn) => string; | ||
maxAmount: number; | ||
}[] = [ | ||
{ | ||
project: 'wiring', | ||
getHeadline: msg => msg('Discount off an electric panel'), | ||
maxAmount: 4000, | ||
}, | ||
{ | ||
project: 'cooking', | ||
getHeadline: msg => msg('Discount off an electric stove'), | ||
maxAmount: 840, | ||
}, | ||
{ | ||
project: 'wiring', | ||
getHeadline: msg => msg('Discount off electric wiring'), | ||
maxAmount: 2500, | ||
}, | ||
{ | ||
project: 'heat_pump_water_heater', | ||
getHeadline: msg => msg('Discount off a heat pump water heater'), | ||
maxAmount: 1750, | ||
}, | ||
{ | ||
project: 'hvac', | ||
getHeadline: msg => msg('Discount off a heat pump'), | ||
maxAmount: 8000, | ||
}, | ||
{ | ||
project: 'heat_pump_clothes_dryer', | ||
getHeadline: msg => msg('Discount off a heat pump clothes dryer'), | ||
maxAmount: 840, | ||
}, | ||
{ | ||
project: 'weatherization_and_efficiency', | ||
getHeadline: msg => msg('Discount off weatherization'), | ||
maxAmount: 1600, | ||
}, | ||
]; | ||
|
||
/* @ts-expect-error(6133) we will condition logic on state in future. */ | ||
export function getRebatesFor(state: string, msg: MsgFn): IRARebate[] { | ||
const disclaimerText = msg( | ||
'However, rebates will be implemented differently in each state, so we cannot guarantee final amounts, eligibility, or timeline.', | ||
); | ||
return hearRebates.map(rebate => ({ | ||
project: rebate.project, | ||
headline: rebate.getHeadline(msg), | ||
program: msg('Federal Home Electrification and Appliance Rebates (HEAR)'), | ||
description: | ||
msg( | ||
str`The federal guidelines allot a discount of up to $${rebate.maxAmount.toLocaleString()}.`, | ||
) + | ||
' ' + | ||
disclaimerText, | ||
url: msg( | ||
'https://homes.rewiringamerica.org/federal-incentives/home-electrification-appliance-rebates', | ||
), | ||
})); | ||
} |
Oops, something went wrong.