I noticed Sen. Rick Scott wasn't appearing in location searches, and discovered an issue with how we query legislators by term date. In the example below, Sen. Scott is scenario C, because his term started later than most and extends past the end date of the session. Right now we are only returning scenarios B and D. I believe scenario A should still be returned and the front-end can decide whether or not to show legislators who have ended their term early.
Since end dates of a term are equal to start dates of the next term, I wrote the query so that it excludes terms that end on the first day of a session or terms that start on the last day of a session.
Here's a little sketch of different scenarios to cover, where the ones in red (A, B, C, D) are the ones I believe we should return.
I noticed Sen. Rick Scott wasn't appearing in location searches, and discovered an issue with how we query legislators by term date. In the example below, Sen. Scott is scenario C, because his term started later than most and extends past the end date of the session. Right now we are only returning scenarios B and D. I believe scenario A should still be returned and the front-end can decide whether or not to show legislators who have ended their term early.
Since end dates of a term are equal to start dates of the next term, I wrote the query so that it excludes terms that end on the first day of a session or terms that start on the last day of a session.
Here's a little sketch of different scenarios to cover, where the ones in red (A, B, C, D) are the ones I believe we should return.