diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e0bf5a..abeeafa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,12 +21,17 @@ This project follows [Semantic Versioning](https://semver.org/). - **Budget account categories and source anomalies** (Tango API 5.7.0). `/api/budget/accounts/` now serves `account_category` (`budgetary` or `credit_financing` today; an open string) and `source_anomalies` (a list of source-data problems, `[]` when clean) in its default shape. `ListBudgetAccountsOptions` gains `AccountCategory` and `AccountCategoryIn`. `BudgetSourceAnomalies(row)` decodes the list into `[]BudgetSourceAnomaly`, with `BudgetSourceAnomalySource` and `BudgetSourceAnomalyRow` for the source rows behind it; every field is optional and unknown keys land in `Extra`. Constants name today's categories (`BudgetAccountCategory*`) and anomaly codes (`BudgetAnomaly*`). - **Budget account `data_through_period`** (Tango API 5.8.0). `/api/budget/accounts/` now serves `data_through_period` in its default shape, right after `fiscal_year`: the File A fiscal period (1–12) an account-year's figures run through, so the latest fiscal year is partial until it reaches 12; null when the row has no File A data. `BudgetDataThroughPeriod(row)` reads it as `(period, ok)`, and `ListBudgetAccountsOptions` gains `DataThroughPeriod`, `DataThroughPeriodGte`, `DataThroughPeriodLte` and `DataThroughPeriodIsNull`. +- **Vehicle company counts** (Tango API 5.8.0): `ShapeVehiclesMinimal` and `ShapeVehiclesComprehensive` now request `holder_count` (distinct companies holding one of the vehicle's IDVs) and `order_winner_count` (distinct companies that have won a task order under it), next to `awardee_count`. ### Changed - `ShapeBudgetAccountsMinimal` now includes `data_through_period`, `account_category` and `source_anomalies`, so a capped `contract_obligated` arrives with the anomaly that explains it. - The API's default ordering for `/api/budget/accounts/` now puts null `enacted_ba` (credit financing accounts) last within each fiscal year. No SDK change is needed; pass `Ordering` to sort otherwise. +### Deprecated + +- **`awardee_count` on vehicles** is deprecated by the Tango API as an alias of `order_winner_count`, and is removed at the API's next major version. The vehicle shapes still request it so existing readers keep working; read `order_winner_count` instead. + ## [0.2.0] - 2026-09-23 Pre-1.0 (SemVer 0.x): the breaking changes below ship without a deprecation cycle, and each is marked **Breaking**. diff --git a/docs/SHAPES.md b/docs/SHAPES.md index ae2d382..44103fb 100644 --- a/docs/SHAPES.md +++ b/docs/SHAPES.md @@ -82,7 +82,7 @@ All 21 constants live in `shapes.go`. They mirror the `ShapeConfig.*` enums in ` | `ShapeGrantsMinimal` | `ListGrants` | grant_id, opportunity_number, title, status, agency_code | | `ShapeIDVsMinimal` | `ListIDVs` | key, piid, award_date, recipient (name+UEI), value, obligated, idv_type | | `ShapeIDVsComprehensive` | `GetIDV` | full IDV envelope incl. competition, legislative_mandates, transactions, subawards summary | -| `ShapeVehiclesMinimal` | `ListVehicles` | uuid, solicitation_identifier, program_acronym, organization, vehicle_type, totals | +| `ShapeVehiclesMinimal` | `ListVehicles` | uuid, solicitation_identifier, program_acronym, organization, vehicle_type, counts (IDVs, holders, order winners, orders), totals | | `ShapeVehiclesComprehensive` | `GetVehicle` | full vehicle envelope incl. metrics | | `ShapeVehicleAwardeesMinimal` | `ListVehicleAwardees` | uuid, key, piid, award_date, order_count, obligations, recipient (name+UEI) | | `ShapeVehicleOrdersMinimal` | `ListVehicleOrders` | key, piid, award_date, obligated, value, description, recipient (name+UEI) | diff --git a/shapes.go b/shapes.go index ab80e84..4bf7310 100644 --- a/shapes.go +++ b/shapes.go @@ -73,7 +73,7 @@ const ( // ShapeVehiclesMinimal — default for ListVehicles. ShapeVehiclesMinimal = "uuid,solicitation_identifier,is_synthetic_solicitation,program_acronym," + "organization_id,organization,vehicle_type,description," + - "idv_count,awardee_count,order_count,total_obligated," + + "idv_count,awardee_count,holder_count,order_winner_count,order_count,total_obligated," + "vehicle_obligations,vehicle_contracts_value,latest_award_date," + "solicitation_title,solicitation_date" @@ -83,7 +83,7 @@ const ( "solicitation_title,solicitation_description,solicitation_date,opportunity_id," + "naics_code,psc_code,set_aside," + "fiscal_year,award_date,latest_award_date,last_date_to_order," + - "description,idv_count,awardee_count,order_count,total_obligated," + + "description,idv_count,awardee_count,holder_count,order_winner_count,order_count,total_obligated," + "vehicle_obligations,vehicle_contracts_value," + "type_of_idc,contract_type,metrics(*)" diff --git a/vehicles_test.go b/vehicles_test.go index 7b285e9..2bc9a59 100644 --- a/vehicles_test.go +++ b/vehicles_test.go @@ -3,6 +3,7 @@ package tango import ( "context" "errors" + "strings" "testing" ) @@ -138,3 +139,24 @@ func TestIterateVehiclesNilOpts(t *testing.T) { t.Fatal("expected non-nil iterator") } } + +func TestVehicleShapesCarryCompanyCounts(t *testing.T) { + for name, shape := range map[string]string{ + "ShapeVehiclesMinimal": ShapeVehiclesMinimal, + "ShapeVehiclesComprehensive": ShapeVehiclesComprehensive, + } { + fields := strings.Split(shape, ",") + for _, want := range []string{"awardee_count", "holder_count", "order_winner_count"} { + found := false + for _, f := range fields { + if f == want { + found = true + break + } + } + if !found { + t.Errorf("%s should carry %q: %q", name, want, shape) + } + } + } +}