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 1f9e7fa
Browse filesBrowse the repository at this point in the historyBrowse files
feat: the workbook download and the entity request changes (#313)
## Summary
One regeneration for two merged API changes: a published report can be
downloaded as an Excel workbook, and the entity request models take a
fixed list of legal forms and no longer take `uri` or `fiscal_year_end`.
## Changes
**Regenerated** (`just generate-sdk`, `just generate-graphql`, against a
local stack built from robosystems `main`)
- `robosystems_client/models/`: the four entity request models and
`LedgerEntityResponse`, and four new enum modules for `entity_type`. Net
effect is listed under Compatibility.
- `robosystems_client/graphql/schema.graphql` and `generated/enums.py`:
`WORKBOOK` on `ReportDownloadFormat`, and reworded descriptions.
**Hand-written**
- `LedgerClient.download_report_bundle`: accepts `format="workbook"`
(and `"WORKBOOK"`), and names the file `.xlsx` when the server sends no
filename.
- `GraphClient`'s `InitialEntityData` dataclass: `uri` is now optional
and is sent only when set, matching the API.
**Tests**
- The workbook alias, its content type and its fallback filename;
`InitialEntityData` with a name alone.
## Compatibility
Generated tier only, plus additions to the facades. Under the two-tier
contract this is a **client minor**; the removals below belong in the
release notes.
**Removed or narrowed in the generated tier** (REST request models; from
robosystems #2136):
- `entity_type` narrows from a string to a fixed list (`corporation`,
`llc`, `partnership`, `sole_proprietorship`, `non_profit`) on
`CreateEntityRequest`, `UpdateEntityRequest`,
`InitializeChartOfAccountsRequest` and `InitialEntityData`.
- `uri` is removed from `CreateEntityRequest` and `UpdateEntityRequest`.
On `InitialEntityData` it goes from required to optional and now means
the entity's website; the entity's own URI is assigned by RoboSystems.
- `fiscal_year_end` is removed from `CreateEntityRequest`,
`UpdateEntityRequest` and `InitialEntityData`. On `LedgerEntityResponse`
the field stays and is now read from the entity's fiscal calendar as
MM-DD, or null.
- `lei`, `cik` and `address_country` are now checked for shape on
create-entity and update-entity, and `cik` on `InitialEntityData`: an
LEI is 20 characters ending in two digits, a CIK is up to 10 digits, a
country is an ISO alpha-2 code. Values are uppercased and a blank means
none. The generated types stay strings, but a malformed value that used
to be stored is now refused with a 422.
**Added** (from robosystems #2135):
- `WORKBOOK` on the GraphQL `ReportDownloadFormat` enum: a published
report as an Excel file.
**Unchanged:** the stable tier. No facade signature, root export, error
class or auth option changes, and nothing the integration template's
emit path imports is touched.
**Waits on the server.** Both changes are merged to robosystems `main`
and not yet released: they ship in the first robosystems release after
v1.24.4. Against an older API, `WORKBOOK` is refused as an unknown enum
value, and the entity requests still accept the fields this client no
longer types.
Python specifics: `LedgerClient.create_entity` and `update_entity` take
a dict. A dict that still carries `uri` or `fiscal_year_end` is no
longer mapped to a model field and goes out as an extra key, which the
API accepts and drops: the call succeeds and nothing is stored for
either. `initialize_chart_of_accounts(entity_type=...)` still takes a
string; the API trims and lowercases it and refuses a form outside the
list with a 422.
Twin PR: the TypeScript client carries the same regeneration.
## Testing
`just test-all`: 760 passed, 17 skipped; ruff and basedpyright clean.
The regeneration ran in this session against a local stack rebuilt from
robosystems `main` at the merge of #2136.
Not run: any call against a deployed API.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
0 commit comments