Skip to content

fix(protests): decode the real GetProtest payload; add delisted_at to SLED presets - #8

Merged
vdavez merged 1 commit into
mainfrom
fix/api-parity-5.0
Sep 23, 2026
Merged

vdavez merged 1 commit into
mainfrom
fix/api-parity-5.0

Conversation

@makegov-mark

@makegov-mark makegov-mark Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

What

  • GetProtest now decodes a real response. ProtestRecord.Agency and .Protester were map[string]any, but the API returns strings, so any response carrying them (every unshaped call) failed with json: cannot unmarshal string into Go struct field ProtestRecord.protester.
  • ProtestRecord now mirrors the API's protest case fields: Agency / Protester are strings, Docket (tagged docket) becomes Dockets (tagged dockets, the API's name), and the missing fields are added: Title, SolicitationNumber, PostedDate, DueDate, DocketURL, DecisionURL, Organization, Decisions, plus the opt-in ChallengedParty, NaicsCode, SizeStandard, OutcomeReason, Judge, Digest, DecisionText.
  • ListProtestsOptions.NaicsCode added (SBA OHA size and NAICS appeals).
  • GetProtest docs: the route takes the UUID case_id, not a case number; look a case up by number via ListProtests + CaseNumber. Protest docs now name GAO, COFC and SBA OHA.
  • ShapeSledOpportunitiesMinimal / ShapeSledOpportunitiesComprehensive include delisted_at, matching the API's default SLED shapes.

Breaking

ProtestRecord.Agency, .Protester change type and .Docket is renamed .Dockets.
Callers reading those fields must update; since the old types could never decode a real response, working code is unlikely to depend on them.
Noted under [Unreleased] → Changed in the CHANGELOG.

Testing

  • New TestGetProtestDecodesDetailPayload decodes a realistic detail payload (string agency / protester, a dockets array, decisions, resolved_agency, nulls).
  • Against the previous struct, a decode-only version of that test fails with tango: decode response; with this change it passes.
  • go vet ./..., go test -race ./... and golangci-lint v1.64.8 (the CI line) are clean.

Relationship to other open PRs

🤖 Generated with Claude Code

…n presets

GetProtest could not decode any response carrying agency or protester, because ProtestRecord typed them as maps while the API returns strings.
ProtestRecord now mirrors the API's protest case fields: Agency and Protester are strings, Docket becomes Dockets (tagged dockets), and the missing scalar fields plus the organization, decisions and resolved_* expands are added.
This is a breaking change for callers that read the old map fields or Docket.

Also:
- ListProtestsOptions gains NaicsCode (SBA OHA size and NAICS appeals).
- GetProtest docs say the route takes the UUID case_id, not a case number; protest docs name GAO, COFC and SBA OHA.
- The SLED opportunity presets include delisted_at, matching the API's default shapes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@makegov-mark makegov-mark Bot added the bug Something isn't working label Sep 23, 2026
@vdavez
vdavez marked this pull request as ready for review September 23, 2026 13:50
@vdavez
vdavez merged commit 036a3e1 into main Sep 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant