Skip to content
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
tomer-tgp merged 1 commit into
developfrom
eng-10325-filing-office-contact
Jun 7, 2026
Merged

tomer-tgp merged 1 commit into
developfrom
eng-10325-filing-office-contact

Conversation

@tomer-tgp

@tomer-tgp tomer-tgp commented Jun 7, 2026 •

Copy link
Copy Markdown
Contributor

What

Extends the GET /races/by-br-hash-id/:brHashId/filing-fee endpoint to also return the structured filing-office contact already stored on the Race model:

  • filingOfficeAddress
  • filingPhoneNumber
  • paperworkInstructions

These columns are ingested from BallotReady but were never selected/returned. findFilingFeeByBrHashId now selects them and returns them on a widened FilingDetailsByBrHashResult alongside 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 on Race. 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-fee so gp-api can show filing-office contact on the Pro-upgrade filing-instructions screen, without new BallotReady calls.

findFilingFeeByBrHashId now selects filingOfficeAddress, filingPhoneNumber, and paperworkInstructions from the same deterministically ordered Race row used for fee extraction, and returns them on a new FilingDetailsByBrHashResult (extends existing fee fields). No-match responses include those three fields as null. 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.

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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tomer-tgp

Copy link
Copy Markdown
Contributor Author

@delegate-reviewer delegate-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@tomer-tgp
tomer-tgp merged commit 98e5c7b into develop Jun 7, 2026
6 checks passed
@tomer-tgp
tomer-tgp deleted the eng-10325-filing-office-contact branch June 7, 2026 07:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant