Skip to content

WIP: feat: financial-assistance award endpoints - #18

Draft
makegov-hal[bot] wants to merge 1 commit into
mainfrom
feat/assistance-awards
Draft

makegov-hal[bot] wants to merge 1 commit into
mainfrom
feat/assistance-awards

Conversation

@makegov-hal

@makegov-hal makegov-hal Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

What

Adds Tango's financial-assistance award endpoints (API 5.12.0): /api/assistance/grants/, /loans/, /direct_payments/ and /other/. Each group gets the same five methods, so the four read alike:

Group List / iterate Get (typed) Sub-routes (typed rows)
Grants ListAssistanceGrants, IterateAssistanceGrants GetAssistanceGrant ListAssistanceGrantTransactions, ListAssistanceGrantListings
Loans ListAssistanceLoans, IterateAssistanceLoans GetAssistanceLoan ListAssistanceLoanTransactions, ListAssistanceLoanListings
Direct payments ListAssistanceDirectPayments, IterateAssistanceDirectPayments GetAssistanceDirectPayment ListAssistanceDirectPaymentTransactions, ListAssistanceDirectPaymentListings
Other ListAssistanceOther, IterateAssistanceOther GetAssistanceOther ListAssistanceOtherTransactions, ListAssistanceOtherListings
  • ListAssistanceAwardsOptions (shared by the four lists) names every query parameter the prod OpenAPI schema lists for them: the contract filters assistance inherits (key, uei, recipient, awarding_agency, funding_agency, the award-date, fiscal-year and period-of-performance ranges, obligated_gte/_lte, search, ordering) plus fain, uri, cfda_number, assistance_type, record_type, business_funds_indicator, disaster_emergency_fund_code, funding_opportunity_number, pop_state, pop_country, pop_zip and joiner. It embeds ListOptions for limit, cursor, shape and flat, like ListContractsOptions.
  • Lists return Record, like every other list in the SDK, since a shape changes the row.
  • Get… returns *AssistanceAwardRecord, typed to the default shape (key through period_of_performance(start_date,current_end_date)), with nested AssistanceTypeRef, AssistanceListingRef, AwardOffice, AssistanceRecipient (+ AssistanceRecipientOwner, AssistanceRecipientBusinessType), AssistancePlaceOfPerformance and AssistancePeriodOfPerformance. Same pointer + Extra pattern as ContractAppealRecord, so anything a shape adds lands in Extra.
  • The sub-routes return typed rows (AssistanceTransaction, AssistanceAwardListing), because their schema is fixed. They take AssistanceSubresourceOptions (Page, Limit) rather than ListOptions, because prod rejects a shape on them with a 400.
  • ObligationsByFiscalYear godoc now covers assistance rows; it works on AssistanceAwardRecord.Extra unchanged.
  • CHANGELOG (Unreleased), README, docs/API_REFERENCE.md and docs/ARCHITECTURE.md updated.

Why

Assistance awards went live in Tango API 5.12.0 and the public docs say the SDKs don't expose them yet.

Decisions worth a look

  • Typed Get, untyped list. This follows the GetContractAppeal / GetProtest precedent. GetContract itself still returns Record, so this is the one place the PR departs from contracts.
  • assistance_type is both a leaf and an expand. shape=assistance_type returns the bare code string ("F001"), not the object. AssistanceTypeRef.UnmarshalJSON accepts both, so a Get with that shape doesn't fail to decode.
  • No SDK-friendly aliases (Keyword, RecipientName, Sort/Order, …). ListContractsOptions carries them to mirror older Node/Python names; a new resource gets the API's names only.
  • No Shape* preset. The API's default shape is what Get is typed to; nothing else needed one.
  • exact=true (documented, but absent from the OpenAPI params) and show_shapes aren't first-classed; both go through Extra.

Testing

  • go vet, go test -race ./..., coverage: every function in the new files is at 100%.
  • golangci-lint v1.64.8 (what CI's golangci-lint-action@v6 with version: latest resolves to) under Go 1.23: clean, and the pre-push hook ran it.
  • Unit tests: every filter's wire key, all 16 routes (with key path-escaping), the empty-key ValidationError on all 12 keyed methods, a real prod loan row decoded into the typed struct, shaped extras landing in Extra, the bare-code assistance_type, typed transactions and listings, sub-route queries carrying only page/limit, and the iterator following the cursor without sending page.
  • Live against prod (go test -tags integration -run Assistance ./tests/integration/, new file): list → get → transactions → listings for all four groups, with an assertion that the default shape leaves Extra empty (every default field maps onto the struct), plus a cursor walk across a page boundary. All pass.
  • Every one of the 31 filter keys sent to prod's grants list returns 200; an unknown key returns 400.

Checklist

  • make ci is green locally (vet, race, cover, lint)
  • New exported identifiers have godoc
  • CHANGELOG.md updated under ## [Unreleased]
  • Docs and README.md updated
  • No new external runtime dependencies

🤖 Generated with Claude Code

Adds the four Tango API 5.12.0 assistance award resources: grants, loans, direct payments and other, each with List / Iterate / Get and the transactions and listings sub-routes.
ListAssistanceAwardsOptions names every query parameter the live schema lists for the four lists, and Get returns a typed AssistanceAwardRecord built from the default shape, with any shaped extras in Extra.
The sub-routes return typed AssistanceTransaction and AssistanceAwardListing rows and take Page and Limit only, because they reject a shape with a 400.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@makegov-hal makegov-hal Bot added the enhancement New feature or request label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant