Skip to content

feat(budget): account_category filter and typed source_anomalies - #10

Merged
vdavez merged 2 commits into
mainfrom
feat/budget-account-anomalies-category
Oct 19, 2026
Merged

vdavez merged 2 commits into
mainfrom
feat/budget-account-anomalies-category

Conversation

@makegov-mark

@makegov-mark makegov-mark Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What

Support for the Tango API 5.7.0 and 5.8.0 budget-account contract changes: account_category, source_anomalies, and data_through_period (the File A fiscal period, 1–12, an account-year's figures run through; null with no File A data), read with BudgetDataThroughPeriod and filtered with DataThroughPeriod / Gte / Lte / IsNull.

  • /api/budget/accounts/ now serves account_category (budgetary | credit_financing today, an open string) and source_anomalies (a list of source-data problems, [] when clean) in its default shape.
  • ListBudgetAccountsOptions gains AccountCategory (account_category) and AccountCategoryIn (account_category__in, comma-joined).
  • BudgetSourceAnomalies(row Record) ([]BudgetSourceAnomaly, error) decodes the list. BudgetSourceAnomaly, BudgetSourceAnomalySource and BudgetSourceAnomalyRow follow the SDK's typed-model pattern: every field optional (pointer or slice), unknown keys in Extra. It returns nil when the key is absent or null and an empty slice when the row is clean.
  • Constants for today's categories (BudgetAccountCategory*) and anomaly codes (BudgetAnomaly*).
  • ShapeBudgetAccountsMinimal now names account_category and source_anomalies, so a capped contract_obligated arrives with the anomaly explaining it.
  • The API's default ordering now puts null enacted_ba last; documented, no code change needed. There is no anomaly filter.

Testing

  • go vet ./... and go test -race ./... pass.
  • New tests cover the filter mapping, a list response decoded through BudgetSourceAnomalies (full element, nested source rows, unknown keys in Extra, a clean [] row), absent/null keys, and a malformed value.
  • golangci-lint: the locally installed v2 cannot read the repo's v1 config; run with a migrated copy, it reports only pre-existing findings and nothing in the changed lines. CI lint runs the repo's own config.

🤖 Generated with Claude Code

@vdavez
vdavez marked this pull request as ready for review October 19, 2026 18:39
vdavez and others added 2 commits October 19, 2026 14:47
Tango API 5.7.0 adds `account_category` and `source_anomalies` to the default shape of `/api/budget/accounts/`.

- `ListBudgetAccountsOptions` gains `AccountCategory` and `AccountCategoryIn`.
- `BudgetSourceAnomalies(row)` decodes `source_anomalies` into `[]BudgetSourceAnomaly` (pointer fields, `Extra` for unknown keys), with typed source and source-row structs.
- Constants name today's categories and anomaly codes; both stay open strings.
- `ShapeBudgetAccountsMinimal` now names both fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tango API 5.8.0 adds `data_through_period` to the default shape of `/api/budget/accounts/`: the File A fiscal period (1-12) an account-year's figures run through, null with no File A data.

- `ListBudgetAccountsOptions` gains `DataThroughPeriod`, `DataThroughPeriodGte`, `DataThroughPeriodLte` and `DataThroughPeriodIsNull`.
- `BudgetDataThroughPeriod(row)` reads the field as `(period, ok)`.
- `ShapeBudgetAccountsMinimal` names it right after `fiscal_year`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vdavez
vdavez force-pushed the feat/budget-account-anomalies-category branch from a4e75b7 to 20a6026 Compare October 19, 2026 19:48
@vdavez
vdavez merged commit fdf3192 into main Oct 19, 2026
5 checks passed
@vdavez
vdavez deleted the feat/budget-account-anomalies-category branch October 19, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant