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

Fix bug with filtering items in IRA incentives #530

Closed oyamauchi closed 3 months ago

oyamauchi commented 3 months ago

Description

Reported in #525

The assumption that items is a singleton for IRA incentives was broken a while ago. This meant that some IRA incentives were incorrectly getting filtered out, because only items[0] was being checked for overlap with request.items, rather than all of them.

The first-party calculator wasn't affected by this, because it passes all the items in every query.

Test Plan

yarn test. This case was being exercised by an existing snapshot test. The bug was introduced in 77d0ff6c7 and I dutifully updated the snapshot there, but didn't notice the problem.