You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6e8fc75
Browse filesBrowse the repository at this point in the historyBrowse files
feat(ledger): list_reports takes a lifecycle filter and returns filing_status (#222)
## Summary
The API's `reports` GraphQL query now takes a `lifecycle` filter, and by
default it leaves archived reports out
(RoboFinSystems/robosystems#1519). This PR gives
`LedgerClient.list_reports` an optional `lifecycle` argument so callers
can ask for archived or all reports, and adds `filing_status` to the
listed reports. It matches the TypeScript client's `listReports(graphId,
{ lifecycle })`.
## Changes
**Hand-written facade** (`clients/ledger_client.py`)
- `list_reports(graph_id, lifecycle=None)` accepts `"current"` /
`"archived"` / `"all"` (or the enum names) and forwards them
upper-cased. With no argument it sends no variable, so the server's
default (`CURRENT`) applies.
- The `transition_filing_status` docstring now describes `filed ↔
archived`, including unarchiving with `target_status="filed"`.
**GraphQL operation**
(`graphql/operations/ledger/ListLedgerReports.graphql`)
- Takes `$lifecycle: ReportLifecycle` and selects `filingStatus`. The
variable is declared nullable on purpose. Declared `!`, ariadne-codegen
made the generated `Client.list_ledger_reports` require the argument.
Nullable is valid there because the server argument has its own default.
Checked against a running API with the variable left out and with
`ARCHIVED`.
**Regenerated** (`graphql/schema.graphql`, `graphql/generated/`, `api/`,
`models/`)
- Schema refresh from the API: the `reports(lifecycle:)` argument and
the `ReportLifecycle` enum, plus the updated `transition-filing-status`
and Tavi download descriptions (docstring-only changes in `api/` and
`models/`).
- Generated: the `ReportLifecycle` enum, `filing_status` on
`ListLedgerReportsReportsReports`, and an optional `lifecycle` on
`Client.list_ledger_reports`.
There is no async variant of `list_reports`, so only the sync path
exists.
## Compatibility
ADDITIVE. The generated `Client.list_ledger_reports` gains an optional
parameter and the list model gains a `filing_status` field; no existing
call changes shape. One behavior change comes from the API rather than
this package: once #1519 is deployed, `list_reports(graph_id)` with no
argument no longer includes archived reports. Pass `lifecycle="all"` for
the old result.
**Release after #1519 is deployed.** The list query now always sends
`reports(lifecycle: …)`, and an API without that argument would reject
it.
## Testing
- `just test-all`: 595 passed, 17 skipped. ruff check and format are
clean, basedpyright reports 0 errors.
- New tests: calling `list_reports` with no argument sends no lifecycle
variable and the query selects `filingStatus`; `archived`, `ALL` and
`current` are forwarded as their enum names.
- Ran `just generate-graphql` after the operation change, so the
checked-in generated code matches the operations.
- Against the local API running #1519: `list_reports` with no argument,
`"archived"` and `"all"` returned the expected filing statuses.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Jaz7hXqfysytKc57zpyWY6
Copy file name to clipboardExpand all lines: robosystems_client/graphql/schema.graphql
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -463,8 +463,13 @@ type Query {
463
463
"""
464
464
closingBookStructures: ClosingBookStructures
465
465
466
-
"""List all report definitions for this graph."""
467
-
reports: ReportList
466
+
"""List report definitions for this graph, newest first."""
467
+
reports(
468
+
"""
469
+
`CURRENT` (the default) leaves out archived reports, `ARCHIVED` returns only those, `ALL` returns every report.
470
+
"""
471
+
lifecycle: ReportLifecycle! = CURRENT
472
+
): ReportList
468
473
469
474
"""Single report definition with structures + entity name."""
470
475
report(
@@ -2453,6 +2458,12 @@ type StructureSummary {
2453
2458
blockType: String!
2454
2459
}
2455
2460
2461
+
enumReportLifecycle {
2462
+
CURRENT
2463
+
ARCHIVED
2464
+
ALL
2465
+
}
2466
+
2456
2467
typeReportPackage {
2457
2468
id: ID!
2458
2469
name: String!
@@ -3000,7 +3011,7 @@ type ReportBundleDownload {
3000
3011
generationCount: Int!
3001
3012
3002
3013
"""
3003
-
Content the Report carries that this flavor does not. `disclosure_notes`: the XBRL 2.1 zip ships statements only — tenant-authored disclosure notes render on screen and ride the Tavi and holon flavors, but are excluded from this file. The Tavi compiled model carries the statementsand notes but has no home for `ib_envelopes` (the per-Network Information Block payloads), `definition_links` (equivalence, general-special, essence-alias and mapping arcs), `reporting_style`, `framework_pins`, `fact_sets` (the FactSet partition and each fact's structure pin) or `filing_lifecycle` (filing status, supersession, share provenance); all of it rides the holon flavor.
3014
+
Content the Report carries that this flavor does not. `disclosure_notes`: the XBRL 2.1 zip ships statements only — tenant-authored disclosure notes render on screen and ride the Tavi and holon flavors, but are excluded from this file. The Tavi compiled model carries the statements, notes, reporting style and FactSet partition but has no home for `ib_envelopes` (the per-Network Information Block payloads), `definition_links` (equivalence, general-special, essence-alias and mapping arcs), `framework_pins` or `filing_lifecycle` (filing status, supersession, share provenance); all of it rides the holon flavor.
0 commit comments