Skip to content

Commit 205dd6f

Browse files
committed
feat(ledger): list_reports takes a lifecycle filter and returns filing_status
The server's `reports` query now takes `lifecycle` (CURRENT by default, which leaves archived reports out; ARCHIVED; ALL). `list_reports` forwards it as an optional argument, and the list selects `filingStatus`. Additive. The refreshed schema and REST models carry the updated transition-filing-status copy (filed <-> archived). Claude-Session: https://claude.ai/code/session_01Jaz7hXqfysytKc57zpyWY6
1 parent ee933d4 commit 205dd6f

11 files changed

Lines changed: 118 additions & 48 deletions

File tree

‎robosystems_client/api/robo_ledger_reports/transition_filing_status.py‎

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ def sync_detailed(
111111
) -> Response[ErrorResponse | OperationEnvelopeReportResponse]:
112112
"""Transition Filing Status
113113
114-
Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed →
115-
archived). Use 'file-report' to reach 'filed' so audit fields land cleanly.
114+
Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed ↔
115+
archived). Archiving takes a filed report off the current list without deleting it; unarchiving
116+
returns it to 'filed'. Use 'file-report' to file a draft so audit fields land cleanly.
116117
117118
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
118119
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -123,10 +124,11 @@ def sync_detailed(
123124
body (TransitionFilingStatusRequest): Generic filing-status transition — escape hatch for
124125
non-file moves.
125126
126-
Used for `draft → under_review` (submit for review) and
127-
`filed → archived` (supersede / retire). Filing the package goes
128-
through :class:`FileReportRequest` so `filed_at` / `filed_by`
129-
audit fields land cleanly.
127+
Used for `draft ↔ under_review` (submit for review, or send back),
128+
`filed → archived` (take a filed report off the current list) and
129+
`archived → filed` (bring it back). Filing a draft goes through
130+
:class:`FileReportRequest` so `filed_at` / `filed_by` audit fields
131+
land cleanly.
130132
131133
Raises:
132134
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -158,8 +160,9 @@ def sync(
158160
) -> ErrorResponse | OperationEnvelopeReportResponse | None:
159161
"""Transition Filing Status
160162
161-
Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed →
162-
archived). Use 'file-report' to reach 'filed' so audit fields land cleanly.
163+
Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed ↔
164+
archived). Archiving takes a filed report off the current list without deleting it; unarchiving
165+
returns it to 'filed'. Use 'file-report' to file a draft so audit fields land cleanly.
163166
164167
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
165168
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -170,10 +173,11 @@ def sync(
170173
body (TransitionFilingStatusRequest): Generic filing-status transition — escape hatch for
171174
non-file moves.
172175
173-
Used for `draft → under_review` (submit for review) and
174-
`filed → archived` (supersede / retire). Filing the package goes
175-
through :class:`FileReportRequest` so `filed_at` / `filed_by`
176-
audit fields land cleanly.
176+
Used for `draft ↔ under_review` (submit for review, or send back),
177+
`filed → archived` (take a filed report off the current list) and
178+
`archived → filed` (bring it back). Filing a draft goes through
179+
:class:`FileReportRequest` so `filed_at` / `filed_by` audit fields
180+
land cleanly.
177181
178182
Raises:
179183
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -200,8 +204,9 @@ async def asyncio_detailed(
200204
) -> Response[ErrorResponse | OperationEnvelopeReportResponse]:
201205
"""Transition Filing Status
202206
203-
Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed →
204-
archived). Use 'file-report' to reach 'filed' so audit fields land cleanly.
207+
Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed ↔
208+
archived). Archiving takes a filed report off the current list without deleting it; unarchiving
209+
returns it to 'filed'. Use 'file-report' to file a draft so audit fields land cleanly.
205210
206211
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
207212
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -212,10 +217,11 @@ async def asyncio_detailed(
212217
body (TransitionFilingStatusRequest): Generic filing-status transition — escape hatch for
213218
non-file moves.
214219
215-
Used for `draft → under_review` (submit for review) and
216-
`filed → archived` (supersede / retire). Filing the package goes
217-
through :class:`FileReportRequest` so `filed_at` / `filed_by`
218-
audit fields land cleanly.
220+
Used for `draft ↔ under_review` (submit for review, or send back),
221+
`filed → archived` (take a filed report off the current list) and
222+
`archived → filed` (bring it back). Filing a draft goes through
223+
:class:`FileReportRequest` so `filed_at` / `filed_by` audit fields
224+
land cleanly.
219225
220226
Raises:
221227
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -245,8 +251,9 @@ async def asyncio(
245251
) -> ErrorResponse | OperationEnvelopeReportResponse | None:
246252
"""Transition Filing Status
247253
248-
Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed →
249-
archived). Use 'file-report' to reach 'filed' so audit fields land cleanly.
254+
Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed ↔
255+
archived). Archiving takes a filed report off the current list without deleting it; unarchiving
256+
returns it to 'filed'. Use 'file-report' to file a draft so audit fields land cleanly.
250257
251258
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
252259
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
@@ -257,10 +264,11 @@ async def asyncio(
257264
body (TransitionFilingStatusRequest): Generic filing-status transition — escape hatch for
258265
non-file moves.
259266
260-
Used for `draft → under_review` (submit for review) and
261-
`filed → archived` (supersede / retire). Filing the package goes
262-
through :class:`FileReportRequest` so `filed_at` / `filed_by`
263-
audit fields land cleanly.
267+
Used for `draft ↔ under_review` (submit for review, or send back),
268+
`filed → archived` (take a filed report off the current list) and
269+
`archived → filed` (bring it back). Filing a draft goes through
270+
:class:`FileReportRequest` so `filed_at` / `filed_by` audit fields
271+
land cleanly.
264272
265273
Raises:
266274
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

‎robosystems_client/clients/ledger_client.py‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,9 +2186,20 @@ def create_report(
21862186
envelope = self._call_op("Create report", response)
21872187
return self._typed_result("Create report", envelope, ReportResponse)
21882188

2189-
def list_reports(self, graph_id: str) -> list[ListLedgerReportsReportsReports]:
2190-
"""List all reports for a graph (includes received shared reports)."""
2191-
data = self._query(graph_id, LIST_LEDGER_REPORTS_GQL)
2189+
def list_reports(
2190+
self, graph_id: str, lifecycle: str | None = None
2191+
) -> list[ListLedgerReportsReportsReports]:
2192+
"""List reports for a graph (includes received shared reports).
2193+
2194+
Args:
2195+
graph_id: The graph to list.
2196+
lifecycle: ``"current"`` (the server default) leaves archived
2197+
reports out, ``"archived"`` returns only those, ``"all"`` every
2198+
report. The enum names ``"CURRENT"`` / ``"ARCHIVED"`` /
2199+
``"ALL"`` are also accepted.
2200+
"""
2201+
variables = {"lifecycle": lifecycle.upper()} if lifecycle else None
2202+
data = self._query(graph_id, LIST_LEDGER_REPORTS_GQL, variables)
21922203
page = ListLedgerReports.model_validate(data).reports
21932204
return page.reports if page else []
21942205

@@ -2372,9 +2383,11 @@ def transition_filing_status(
23722383
) -> ReportResponse:
23732384
"""Move a Report along the non-file legs of the filing lifecycle.
23742385
2375-
Use ``file_report()`` to reach 'filed' so audit fields land cleanly.
2376-
Other transitions (draft ↔ under_review, filed → archived) go through
2377-
here so the legal-transition graph stays in one place.
2386+
Use ``file_report()`` to file a draft so audit fields land cleanly.
2387+
Other transitions (draft ↔ under_review, filed ↔ archived) go through
2388+
here so the legal-transition graph stays in one place. Archiving takes
2389+
a filed report off the current list without deleting it; unarchiving
2390+
(``target_status="filed"``) brings it back.
23782391
"""
23792392
body = TransitionFilingStatusRequest(
23802393
report_id=report_id, target_status=target_status

‎robosystems_client/graphql/generated/__init__.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from .base_client import BaseClient
22
from .base_model import BaseModel, Upload
33
from .client import Client
4-
from .enums import ReportDownloadFormat
4+
from .enums import ReportDownloadFormat, ReportLifecycle
55
from .exceptions import (
66
GraphQLClientError,
77
GraphQLClientGraphQLError,
@@ -676,6 +676,7 @@
676676
"MappingCandidates",
677677
"MappingCandidatesMappingCandidates",
678678
"ReportDownloadFormat",
679+
"ReportLifecycle",
679680
"SEARCH_LIBRARY_ELEMENTS_GQL",
680681
"SearchLibraryElements",
681682
"SearchLibraryElementsSearchLibraryElements",

‎robosystems_client/graphql/generated/client.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from .base_client import BaseClient
44
from .base_model import UNSET, UnsetType
5-
from .enums import ReportDownloadFormat
5+
from .enums import ReportDownloadFormat, ReportLifecycle
66
from .get_information_block import GetInformationBlock
77
from .get_investor_holdings import GetInvestorHoldings
88
from .get_investor_portfolio_block import GetInvestorPortfolioBlock
@@ -768,8 +768,10 @@ def list_ledger_publish_lists(
768768
data = self.get_data(response)
769769
return ListLedgerPublishLists.model_validate(data)
770770

771-
def list_ledger_reports(self, **kwargs: Any) -> ListLedgerReports:
772-
variables: dict[str, object] = {}
771+
def list_ledger_reports(
772+
self, lifecycle: ReportLifecycle, **kwargs: Any
773+
) -> ListLedgerReports:
774+
variables: dict[str, object] = {"lifecycle": lifecycle}
773775
response = self.execute(
774776
query=LIST_LEDGER_REPORTS_GQL,
775777
operation_name="ListLedgerReports",

‎robosystems_client/graphql/generated/enums.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
from enum import Enum
22

33

4+
class ReportLifecycle(str, Enum):
5+
CURRENT = "CURRENT"
6+
ARCHIVED = "ARCHIVED"
7+
ALL = "ALL"
8+
9+
410
class ReportDownloadFormat(str, Enum):
511
HOLON_JSONLD = "HOLON_JSONLD"
612
XBRL_2_1 = "XBRL_2_1"

‎robosystems_client/graphql/generated/list_ledger_reports.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ListLedgerReportsReportsReports(BaseModel):
1818
name: str
1919
taxonomy_id: str = Field(alias="taxonomyId")
2020
generation_status: str = Field(alias="generationStatus")
21+
filing_status: str = Field(alias="filingStatus")
2122
period_type: str = Field(alias="periodType")
2223
period_start: Optional[str] = Field(alias="periodStart")
2324
period_end: Optional[str] = Field(alias="periodEnd")

‎robosystems_client/graphql/generated/operations.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,13 +1592,14 @@
15921592
"""
15931593

15941594
LIST_LEDGER_REPORTS_GQL = """
1595-
query ListLedgerReports {
1596-
reports {
1595+
query ListLedgerReports($lifecycle: ReportLifecycle! = CURRENT) {
1596+
reports(lifecycle: $lifecycle) {
15971597
reports {
15981598
id
15991599
name
16001600
taxonomyId
16011601
generationStatus
1602+
filingStatus
16021603
periodType
16031604
periodStart
16041605
periodEnd

‎robosystems_client/graphql/operations/ledger/ListLedgerReports.graphql‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
query ListLedgerReports {
2-
reports {
1+
query ListLedgerReports($lifecycle: ReportLifecycle! = CURRENT) {
2+
reports(lifecycle: $lifecycle) {
33
reports {
4-
id name taxonomyId generationStatus periodType
4+
id name taxonomyId generationStatus filingStatus periodType
55
periodStart periodEnd comparative mappingId aiGenerated
66
createdAt lastGenerated entityName
77
sourceGraphId sourceReportId sharedAt

‎robosystems_client/graphql/schema.graphql‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,13 @@ type Query {
463463
"""
464464
closingBookStructures: ClosingBookStructures
465465

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
468473

469474
"""Single report definition with structures + entity name."""
470475
report(
@@ -2453,6 +2458,12 @@ type StructureSummary {
24532458
blockType: String!
24542459
}
24552460

2461+
enum ReportLifecycle {
2462+
CURRENT
2463+
ARCHIVED
2464+
ALL
2465+
}
2466+
24562467
type ReportPackage {
24572468
id: ID!
24582469
name: String!
@@ -3000,7 +3011,7 @@ type ReportBundleDownload {
30003011
generationCount: Int!
30013012

30023013
"""
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 statements and 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.
30043015
"""
30053016
omittedContent: [String!]!
30063017
}

‎robosystems_client/models/transition_filing_status_request.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@
1313
class TransitionFilingStatusRequest:
1414
"""Generic filing-status transition — escape hatch for non-file moves.
1515
16-
Used for `draft → under_review` (submit for review) and
17-
`filed → archived` (supersede / retire). Filing the package goes
18-
through :class:`FileReportRequest` so `filed_at` / `filed_by`
19-
audit fields land cleanly.
16+
Used for `draft ↔ under_review` (submit for review, or send back),
17+
`filed → archived` (take a filed report off the current list) and
18+
`archived → filed` (bring it back). Filing a draft goes through
19+
:class:`FileReportRequest` so `filed_at` / `filed_by` audit fields
20+
land cleanly.
2021
2122
Attributes:
2223
report_id (str): The Report to transition.
23-
target_status (str): Target lifecycle state: `under_review` (submit a draft for review) or `archived` (supersede
24-
/ retire a filed report). Reaching `filed` goes through `file-report` so audit fields land cleanly.
24+
target_status (str): Target lifecycle state: `under_review` (submit a draft for review), `draft` (send it back),
25+
`archived` (take a filed report off the current list; it stays a record) or `filed` (unarchive). Filing a draft
26+
goes through `file-report` so audit fields land cleanly.
2527
"""
2628

2729
report_id: str

0 commit comments

Comments
 (0)