Repository navigation
Commit e91b25e
Add native accounting operations and enhance API error handling (#89)
## Summary
This PR introduces a comprehensive set of native accounting (RoboLedger)
CRUD operations and significantly enhances error handling and response
parsing across all RoboInvestor and GraphQL API operations in the
`robosystems_client`.
## Key Accomplishments
### New RoboLedger Operations (16 new endpoint modules)
- **Elements**: Create, update, and delete accounting elements with full
support for balance types, classifications, element types, period types,
and source enums
- **Journal Entries**: Create, update, delete, and reverse journal
entries with line item support
- **Associations**: Bulk create, update, and delete associations
(including bulk association items with typed association types)
- **Schedules**: Delete, update, and manage schedules (including
truncation)
- **Structures**: Delete and update organizational structures
- **Taxonomies**: Delete and update taxonomy definitions
### New Models (30+ new model files)
- Request models for all new operations (`CreateElementRequest`,
`CreateJournalEntryRequest`, `BulkCreateAssociationsRequest`, etc.)
- Supporting enum models for typed fields
(`CreateElementRequestBalanceType`, `CreateJournalEntryRequestType`,
`UpdateElementRequestClassificationType0`, etc.)
- `JournalEntryLineItemInput` for structured journal entry line items
- `OperationError` and `OperationErrorDetailType1` for standardized
error representation
- `OperationEnvelope` updates to support the new error structure
### Enhanced Error Handling & Response Parsing
- **All existing RoboInvestor operations** (9 modules:
create/update/delete for portfolio, position, security) updated with
improved error handling and richer response parsing
- **All existing RoboLedger operations** (20+ modules) updated with
consistent error handling patterns
- **GraphQL operations** (GET and POST handlers) enhanced with better
response parsing
- **Ledger client** (`ledger_client.py`) updated to integrate with new
operations
## Breaking Changes
- **`OperationEnvelope` model** has been updated — consumers relying on
the previous error field structure should update to use the new
`OperationError` model
- New operations may introduce additional required dependencies or
import paths in the `models/__init__.py` module
## Testing Notes
- Verify all new CRUD operations for elements, journal entries,
associations, schedules, structures, and taxonomies against the API
- Test error scenarios to validate the enhanced error handling produces
correctly structured `OperationError` responses across all modules
- Confirm backward compatibility of existing RoboInvestor and GraphQL
operations after the error handling refactor
- Validate enum models serialize/deserialize correctly for all typed
request fields (balance types, classifications, period types, etc.)
- Test the reverse journal entry flow end-to-end as it represents a new
business operation
## Infrastructure Considerations
- The significant number of new model and operation files (85 files
changed) suggests this was likely generated or scaffolded from an
updated API specification — ensure the code generation tooling and API
spec are version-tracked accordingly
- The `models/__init__.py` module has been updated to export all new
models; downstream consumers pulling from this package will pick up the
new types automatically
- No new external dependencies appear to be introduced; changes are
additive within the existing client architecture
---
🤖 Generated with [Claude Code](https://claude.ai/code)
**Branch Info:**
- Source: `feature/native-accounting-ops`
- Target: `main`
- Type: feature
Co-Authored-By: Claude <noreply@anthropic.com>90 files changed
Lines changed: 10854 additions & 365 deletions
File tree
- robosystems_client
- api
- extensions_graph_ql
- extensions_robo_investor
- extensions_robo_ledger
- extensions
- models
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
| |||
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
42 | 54 | | |
43 | 55 | | |
44 | 56 | | |
| |||
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
66 | 87 | | |
67 | 88 | | |
68 | 89 | | |
| |||
92 | 113 | | |
93 | 114 | | |
94 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
95 | 125 | | |
96 | 126 | | |
97 | 127 | | |
| |||
116 | 146 | | |
117 | 147 | | |
118 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
119 | 158 | | |
120 | 159 | | |
121 | 160 | | |
| |||
143 | 182 | | |
144 | 183 | | |
145 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
146 | 194 | | |
147 | 195 | | |
148 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
38 | 50 | | |
39 | 51 | | |
40 | 52 | | |
| |||
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
62 | 83 | | |
63 | 84 | | |
64 | 85 | | |
| |||
88 | 109 | | |
89 | 110 | | |
90 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
91 | 121 | | |
92 | 122 | | |
93 | 123 | | |
| |||
112 | 142 | | |
113 | 143 | | |
114 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
115 | 154 | | |
116 | 155 | | |
117 | 156 | | |
| |||
139 | 178 | | |
140 | 179 | | |
141 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
142 | 190 | | |
143 | 191 | | |
144 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
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 | + | |
48 | 72 | | |
49 | 73 | | |
50 | 74 | | |
51 | 75 | | |
52 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
53 | 85 | | |
54 | 86 | | |
55 | 87 | | |
| |||
58 | 90 | | |
59 | 91 | | |
60 | 92 | | |
61 | | - | |
| 93 | + | |
62 | 94 | | |
63 | 95 | | |
64 | 96 | | |
| |||
73 | 105 | | |
74 | 106 | | |
75 | 107 | | |
76 | | - | |
| 108 | + | |
77 | 109 | | |
78 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
79 | 116 | | |
80 | 117 | | |
81 | 118 | | |
| |||
86 | 123 | | |
87 | 124 | | |
88 | 125 | | |
89 | | - | |
| 126 | + | |
90 | 127 | | |
91 | 128 | | |
92 | 129 | | |
| |||
108 | 145 | | |
109 | 146 | | |
110 | 147 | | |
111 | | - | |
| 148 | + | |
112 | 149 | | |
113 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
114 | 156 | | |
115 | 157 | | |
116 | 158 | | |
| |||
121 | 163 | | |
122 | 164 | | |
123 | 165 | | |
124 | | - | |
| 166 | + | |
125 | 167 | | |
126 | 168 | | |
127 | 169 | | |
| |||
138 | 180 | | |
139 | 181 | | |
140 | 182 | | |
141 | | - | |
| 183 | + | |
142 | 184 | | |
143 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
144 | 191 | | |
145 | 192 | | |
146 | 193 | | |
| |||
151 | 198 | | |
152 | 199 | | |
153 | 200 | | |
154 | | - | |
| 201 | + | |
155 | 202 | | |
156 | 203 | | |
157 | 204 | | |
| |||
171 | 218 | | |
172 | 219 | | |
173 | 220 | | |
174 | | - | |
| 221 | + | |
175 | 222 | | |
176 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
177 | 229 | | |
178 | 230 | | |
179 | 231 | | |
| |||
184 | 236 | | |
185 | 237 | | |
186 | 238 | | |
187 | | - | |
| 239 | + | |
188 | 240 | | |
189 | 241 | | |
190 | 242 | | |
| |||
0 commit comments