Repository navigation
WIP: feat: financial-assistance award endpoints - #35
Draft
makegov-hal[bot] wants to merge 1 commit into
Draft
makegov-hal[bot] wants to merge 1 commit into
makegov-hal[bot] wants to merge 1 commit into
Conversation
Adds USAspending's grant, loan, direct-payment and other assistance awards under /api/assistance/ (Tango API 5.12.0). Each group gets a cursor-paginated list with all 30 of the API's filters typed under their own names, a get by key, and the award's page-numbered /transactions/ and /listings/ sub-routes, plus an iterate* method per group. The four groups share one AssistanceAward model interface and shape schema, and ASSISTANCE_AWARDS_MINIMAL, the API's own default shape. Re-vendors the API contract from 5.11.0 to 5.12.1, whose only difference is the four assistance resources; both conformance gates pass with no baseline growth and the shape overlay regenerates unchanged. Integration cassettes are recorded against the live API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adds Tango's financial-assistance award endpoints (Tango API 5.12.0) to the Node SDK: USAspending's grant, loan, direct-payment and other assistance awards under
/api/assistance/.Per group (
Grant(s),Loan(s),DirectPayment(s),Other):GET /api/assistance/{group}/listAssistanceGrants(options)— cursor-paginated, shaped, every filter typedGET /api/assistance/{group}/{key}/getAssistanceGrant(key, options)— shapedGET /api/assistance/{group}/{key}/transactions/listAssistanceGrantTransactions(key, options)— page-numbered, 100 default / 500 maxGET /api/assistance/{group}/{key}/listings/listAssistanceGrantListings(key, options)— page-numbered, 100 maxiterateAssistanceGrants(options)ListAssistanceAwardsOptionstypes all 30 of the API's filters under the API's own names: the contract filters assistance inherits (key,uei,recipient,awarding_agency,funding_agency, theaward_date/fiscal_year/pop_start_date/pop_end_dateranges) plusfain,uri,cfda_number,assistance_type,record_type,business_funds_indicator,disaster_emergency_fund_code,funding_opportunity_number,pop_state,pop_country,pop_zip,obligated_gte/obligated_lte,searchandordering. No SDK-side aliases (nokeyword/recipient_uei/sort+orderremaps like the legacy contract options carry).AssistanceAwardmodel interface (plusAssistanceRecipient,AssistanceTransaction,AssistanceAwardListing, etc.) and one registered shape schema serve all four groups, since the API gives them one shape. It covers every field and expand in the contract.ShapeConfig.ASSISTANCE_AWARDS_MINIMALis the API's own default shape, character for character.contracts/filter_shape_contract.jsonfrom 5.11.0 to 5.12.1 (tangomain, matching prod). The four assistance resources are the only difference.list*, likelistIdvTransactions/listEntityContracts), not the oldergetContractTransactions.Why
The assistance API is live in prod at 5.12.1 and the SDK had no way to reach it.
Testing
npx vitest run: 621 passed across 56 files, including 43 new unit tests (tests/unit/client.assistance.test.ts) and 4 new cassette-replayed integration tests (tests/integration/assistance.test.ts, cassettes recorded against prod).npm run lint,npm run typecheck,npm run build: clean.npm run check-conformance: 0 errors, and no assistance warnings (every filter is a typed member, so none fall back to the index signature).npm run check-shape-coverage: 0 new gaps, no baseline growth. Mutation-checked: a fake field injected into the assistance shape trees is reported as a new gap.npm run generate-shape-overlay: regenerates with no diff.Risks
transactions[].action_date_fiscal_year: a number on the/transactions/sub-route, a string ("2027") inside thetransactions(...)expand. OpenAPI says integer. The SDK types itnumber | stringand passes it through as served.disaster_emergency_fund_code=Lmatched an award whosedisaster_emergency_fund_codesis"AAK: Emergency P.L. 118-158": the API's whole-code regex treats theLinP.L.as a code. That's an API-side filter bug, not an SDK one; the field itself is free text, not a list, and the SDK types it as a string.Next steps
🤖 Generated with Claude Code