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

Add disclaimer about residence location to city/county/other incentives #153

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/api/calculator-types-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ export type IncentiveType =
| 'rebate'
| 'account_credit'
| 'performance_rebate';
export type AuthorityType = 'federal' | 'state' | 'utility';
export type AuthorityType =
| 'federal'
| 'state'
| 'utility'
| 'city'
| 'county'
| 'other';

export type AmountType = 'dollar_amount' | 'percent' | 'dollars_per_unit';
export type AmountUnit =
Expand Down
1 change: 1 addition & 0 deletions src/i18n/strings/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const templates = {
s7a73c90a7c3b43b4: `un calentador de agua con bomba de calor`,
s7bd0de02e230dc75: `Calentador de agua`,
s7d340cf80adae3a4: `Misuri`,
s7f5b705d1bd02849: `La elegibilidad depende de la ubicación de residencia.`,
s8194d17164cbd6de: `Florida`,
s81aa671e64f2010e: `Dakota del Norte`,
s82397872ac9bddcf: `Tamaño del hogar`,
Expand Down
16 changes: 15 additions & 1 deletion src/state-incentive-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,20 @@ const IncentiveCard: FC<{ incentive: Incentive }> = ({ incentive }) => {
</>,
];
const futureStartYear = getStartYearIfInFuture(incentive);

// The API cannot precisely tell, from zip code alone, whether the user is in
// a specific city or county; it takes a permissive approach and returns
// incentives for localities the user *might* be in. So this indicates that
// the user should check for themselves.
//
// This is a blunt-instrument approach; in many cases there's actually no
// ambiguity as to which city or county a zip code is in, but the API
// currently doesn't take that into account.
const locationEligibilityText = ['city', 'county', 'other'].includes(
incentive.authority_type,
)
? msg('Eligibility depends on residence location.')
: null;
return (
<Card>
<div className="flex flex-col gap-4 h-full">
Expand All @@ -231,7 +245,7 @@ const IncentiveCard: FC<{ incentive: Incentive }> = ({ incentive }) => {
</div>
<Separator hideOnSmall={true} />
<div className="text-grey-400 leading-normal">
{incentive.short_description}
{incentive.short_description} {locationEligibilityText}
</div>
{futureStartYear && (
<Chip isWarning={true}>
Expand Down
4 changes: 4 additions & 0 deletions translations/es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@
<source>Expected in <x id="0" equiv-text="${futureStartYear}"/></source>
<target>Esperado en <x id="0" equiv-text="${futureStartYear}"/></target>
</trans-unit>
<trans-unit id="s7f5b705d1bd02849">
<source>Eligibility depends on residence location.</source>
<target>La elegibilidad depende de la ubicación de residencia.</target>
</trans-unit>
</body>
</file>
</xliff>
Loading