feat(ledger): listReports takes a lifecycle filter and returns filingStatus - #236
Merged
Merged
Conversation
…Status The server's `reports` query now takes `lifecycle` (CURRENT by default, which leaves archived reports out; ARCHIVED; ALL). The facade forwards it as an optional option, and the list selects `filingStatus` so a caller can show it. Additive. The regenerated SDK carries the updated transition-filing-status copy (filed <-> archived). Claude-Session: https://claude.ai/code/session_01Jaz7hXqfysytKc57zpyWY6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The API's
reportsGraphQL query now takes alifecyclefilter, and by default it leaves archived reports out (RoboFinSystems/robosystems#1519). This PR givesLedgerClient.listReportsan optional{ lifecycle }so callers can ask for archived or all reports, and addsfilingStatusto the listed reports. roboledger-app's Archived view and Filing column depend on both. The Python client has the matching change in RoboFinSystems/robosystems-python-client#222.Changes
Hand-written facade (
clients/LedgerClient.ts)listReports(graphId, { lifecycle? }): with no option it sends no variable, so the server's default (CURRENT) applies;'ARCHIVED'/'ALL'/'CURRENT'are forwarded.ReportLifecycletype.transitionFilingStatusdoc comment now describesfiled ↔ archived.GraphQL operation (
clients/graphql/queries/ledger/reports.ts)ListLedgerReportstakes$lifecycleand selectsfilingStatus.Regenerated
clients/graphql/generated/graphql.ts: theReportLifecycletype, an optionallifecyclevariable, andfilingStatuson the list item.sdk/: updatedtransition-filing-statusdescriptions (doc comments only).Compatibility
ADDITIVE.
listReportsgains an optional second argument andReportListItemgainsfilingStatus; existing calls are unchanged. One behavior change comes from the API rather than this package: once #1519 is deployed,listReports(graphId)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
npm run test:all(format check, lint, typecheck, tests, build): 338 tests passed.listReportssends no lifecycle by default and the query carriesreports(lifecycle: $lifecycle)andfilingStatus;{ lifecycle: 'ARCHIVED' }is forwarded as a variable.🤖 Generated with Claude Code
https://claude.ai/code/session_01Jaz7hXqfysytKc57zpyWY6