Repository navigation
Commit 7d87d12
authored
feat: get_aged_balances, get_open_items_for_agent, get_discharge_candidates (#268)
## 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.com/claude-code)
https://claude.ai/code/session_013UXnatpnbiixt1ZVHfdZAP13 files changed
Lines changed: 986 additions & 1 deletion
File tree
- robosystems_client
- clients
- graphql
- generated
- operations/ledger
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
471 | 484 | | |
472 | 485 | | |
473 | 486 | | |
| |||
513 | 526 | | |
514 | 527 | | |
515 | 528 | | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
516 | 533 | | |
517 | 534 | | |
518 | 535 | | |
| |||
2424 | 2441 | | |
2425 | 2442 | | |
2426 | 2443 | | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
2427 | 2506 | | |
2428 | 2507 | | |
2429 | 2508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
1 | 23 | | |
2 | 24 | | |
3 | 25 | | |
| |||
6 | 28 | | |
7 | 29 | | |
8 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
9 | 36 | | |
10 | 37 | | |
11 | 38 | | |
| |||
351 | 378 | | |
352 | 379 | | |
353 | 380 | | |
| 381 | + | |
354 | 382 | | |
| 383 | + | |
| 384 | + | |
355 | 385 | | |
| 386 | + | |
356 | 387 | | |
357 | 388 | | |
358 | 389 | | |
| |||
412 | 443 | | |
413 | 444 | | |
414 | 445 | | |
| 446 | + | |
415 | 447 | | |
416 | 448 | | |
417 | 449 | | |
| |||
422 | 454 | | |
423 | 455 | | |
424 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
425 | 477 | | |
426 | 478 | | |
427 | 479 | | |
428 | 480 | | |
429 | 481 | | |
430 | 482 | | |
431 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
432 | 488 | | |
433 | 489 | | |
434 | 490 | | |
| |||
742 | 798 | | |
743 | 799 | | |
744 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
745 | 804 | | |
746 | 805 | | |
747 | 806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
0 commit comments