Repository navigation
WIP: feat: financial-assistance award endpoints - #18
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 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>
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 (API 5.12.0):
/api/assistance/grants/,/loans/,/direct_payments/and/other/. Each group gets the same five methods, so the four read alike:ListAssistanceGrants,IterateAssistanceGrantsGetAssistanceGrantListAssistanceGrantTransactions,ListAssistanceGrantListingsListAssistanceLoans,IterateAssistanceLoansGetAssistanceLoanListAssistanceLoanTransactions,ListAssistanceLoanListingsListAssistanceDirectPayments,IterateAssistanceDirectPaymentsGetAssistanceDirectPaymentListAssistanceDirectPaymentTransactions,ListAssistanceDirectPaymentListingsListAssistanceOther,IterateAssistanceOtherGetAssistanceOtherListAssistanceOtherTransactions,ListAssistanceOtherListingsListAssistanceAwardsOptions(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) plusfain,uri,cfda_number,assistance_type,record_type,business_funds_indicator,disaster_emergency_fund_code,funding_opportunity_number,pop_state,pop_country,pop_zipandjoiner. It embedsListOptionsfor limit, cursor, shape and flat, likeListContractsOptions.Record, like every other list in the SDK, since a shape changes the row.Get…returns*AssistanceAwardRecord, typed to the default shape (keythroughperiod_of_performance(start_date,current_end_date)), with nestedAssistanceTypeRef,AssistanceListingRef,AwardOffice,AssistanceRecipient(+AssistanceRecipientOwner,AssistanceRecipientBusinessType),AssistancePlaceOfPerformanceandAssistancePeriodOfPerformance. Same pointer +Extrapattern asContractAppealRecord, so anything a shape adds lands inExtra.AssistanceTransaction,AssistanceAwardListing), because their schema is fixed. They takeAssistanceSubresourceOptions(Page,Limit) rather thanListOptions, because prod rejects ashapeon them with a 400.ObligationsByFiscalYeargodoc now covers assistance rows; it works onAssistanceAwardRecord.Extraunchanged.docs/API_REFERENCE.mdanddocs/ARCHITECTURE.mdupdated.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
Get, untyped list. This follows theGetContractAppeal/GetProtestprecedent.GetContractitself still returnsRecord, so this is the one place the PR departs from contracts.assistance_typeis both a leaf and an expand.shape=assistance_typereturns the bare code string ("F001"), not the object.AssistanceTypeRef.UnmarshalJSONaccepts both, so aGetwith that shape doesn't fail to decode.Keyword,RecipientName,Sort/Order, …).ListContractsOptionscarries them to mirror older Node/Python names; a new resource gets the API's names only.Shape*preset. The API's default shape is whatGetis typed to; nothing else needed one.exact=true(documented, but absent from the OpenAPI params) andshow_shapesaren't first-classed; both go throughExtra.Testing
go vet,go test -race ./..., coverage: every function in the new files is at 100%.golangci-lint-action@v6withversion: latestresolves to) under Go 1.23: clean, and the pre-push hook ran it.ValidationErroron all 12 keyed methods, a real prod loan row decoded into the typed struct, shaped extras landing inExtra, the bare-codeassistance_type, typed transactions and listings, sub-route queries carrying onlypage/limit, and the iterator following the cursor without sendingpage.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 leavesExtraempty (every default field maps onto the struct), plus a cursor walk across a page boundary. All pass.Checklist
make ciis green locally (vet, race, cover, lint)CHANGELOG.mdupdated under## [Unreleased]README.mdupdated🤖 Generated with Claude Code