This repository was archived by the owner on Jun 9, 2026. It is now read-only.
feat(races): surface filing office contact on by-br-hash-id endpoint (ENG-10325) - #191
Merged
Merged
Conversation
Extend findFilingFeeByBrHashId to select and return the structured filing-office contact already stored on the Race model (filingOfficeAddress, filingPhoneNumber, paperworkInstructions), alongside the existing extracted filing fee. Powers the filing-office block on the gp-api Pro-upgrade filing-instructions screen (ENG-10325). All three fields are nullable — BallotReady leaves them blank for many races. No new query path; the data rides the existing race-hash lookup.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Contributor
Author
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the
GET /races/by-br-hash-id/:brHashId/filing-feeendpoint to also return the structured filing-office contact already stored on theRacemodel:filingOfficeAddressfilingPhoneNumberpaperworkInstructionsThese columns are ingested from BallotReady but were never selected/returned.
findFilingFeeByBrHashIdnow selects them and returns them on a widenedFilingDetailsByBrHashResultalongside the existing extracted filing fee. All three are nullable (BR leaves them blank for many races).Why
Powers the "filing office" block on the gp-api Pro-upgrade filing-instructions screen (ENG-10325, task 04). The companion gp-api PR consumes these fields onto
RaceTargetMetrics.Spike note
This confirmed BallotReady does expose structured filing-office contact (
Position.filingAddress/filingPhone/paperworkInstructions), and election-api already persists it onRace. No new query path or vendor call — the data rides the existing race-hash lookup.Testing
src/races/races.service.test.ts— updated the select/empty-result assertions and added two tests (office fields mapped through when present; null when BR has none). 10/10 pass.🤖 Generated with Claude Code
Note
Low Risk
Additive API fields on an existing lookup route; fee extraction and race selection logic are unchanged aside from extra selected columns.
Overview
Extends
GET /races/by-br-hash-id/:brHashId/filing-feeso gp-api can show filing-office contact on the Pro-upgrade filing-instructions screen, without new BallotReady calls.findFilingFeeByBrHashIdnow selectsfilingOfficeAddress,filingPhoneNumber, andpaperworkInstructionsfrom the same deterministically orderedRacerow used for fee extraction, and returns them on a newFilingDetailsByBrHashResult(extends existing fee fields). No-match responses include those three fields asnull. Controller return type updated accordingly.Tests assert the widened Prisma
select, empty-result shape, and pass-through vs null office fields while fee extraction behavior stays unchanged.Reviewed by Cursor Bugbot for commit bbfe851. Configure here.