Skip to content

feat: get_aged_balances, get_open_items_for_agent, get_discharge_candidates - #268

Merged
jfrench9 merged 1 commit into
mainfrom
feature/ar-ap-facades
Oct 20, 2026
Merged

jfrench9 merged 1 commit into
mainfrom
feature/ar-ap-facades

Conversation

@jfrench9

Copy link
Copy Markdown
Member

Summary

Adds LedgerClient methods for the AR/AP aging reads, matching the TypeScript client's getAgedBalances / getOpenItemsForAgent / getDischargeCandidates. The server fields shipped in robosystems #1886 and #1887, both merged and not yet in a release (v1.19.2 predates them). Against an older server these queries fail validation.

Changes

Hand-written

  • operations/ledger/: AgedReceivables.graphql, AgedPayables.graphql, OpenItemsForAgent.graphql, DischargeCandidates.graphql. Each is self-contained, with no cross-file fragments, since every document is validated on its own against schema.graphql.
  • LedgerClient:
    • get_aged_balances(graph_id, kind, *, as_of, entity_id, scope) routes to agedReceivables or agedPayables; both return the same fields.
    • get_open_items_for_agent(graph_id, agent_id, kind, *, as_of, entity_id).
    • get_discharge_candidates(graph_id, event_id), which returns None for no such event.
  • Recording a settlement needs no new method: update_event_block already takes discharge_allocations since the last regen.

Generated: graphql/generated/ (ariadne-codegen, hermetic from the checked-in schema.graphql): the four operation modules and the operations.py / client.py / __init__.py entries.

Compatibility

ADDITIVE: three new methods and generated modules. No signature, export or existing model changed.

Testing

  • just test-all: 707 passed, 17 skipped; ruff check and format clean; basedpyright 0 errors.
  • 4 new facade tests, plus the schema validation of the four new documents.

🤖 Generated with Claude Code

https://claude.ai/code/session_013UXnatpnbiixt1ZVHfdZAP

@jfrench9
jfrench9 merged commit 7d87d12 into main Oct 20, 2026
6 checks passed
@jfrench9
jfrench9 deleted the feature/ar-ap-facades branch October 20, 2026 17:48
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