Add native accounting operations and enhance API error handling#89
Merged
Add native accounting operations and enhance API error handling#89
Conversation
…QL API operations - Added handling for additional HTTP status codes (401, 403, 429, 400, 404, 409, 500) across various operations in the RoboInvestor API, improving robustness in error management. - Updated response parsing functions to return appropriate error models (OperationError) for specific status codes, ensuring clearer communication of issues to clients. - Enhanced documentation in method docstrings to clarify authentication requirements and error code handling, improving user guidance on API usage. These changes improve the overall reliability and user experience of the API by providing more informative error responses and clearer documentation.
- Modified the `CreateJournalEntryRequest` to default to `status='draft'` for ongoing entries, with an option to set `status='posted'` for historical data imports. - Enhanced documentation to clarify the workflow for creating journal entries and the implications of different statuses. - Added `CreateJournalEntryRequestStatus` model to manage entry statuses, improving code organization and clarity. - Updated imports in `__init__.py` to include the new status model. These changes improve the flexibility and clarity of journal entry creation in the API.
- Introduced a new test class `TestJournalEntries` to cover various scenarios for creating, updating, deleting, and reversing journal entries, ensuring proper handling of entry statuses and idempotency keys. - Added a test class `TestLinkEntityTaxonomy` to validate the linking of entity taxonomies, including error handling for missing entities. - Implemented additional tests in `TestLedgerReadsAdditional` to verify the summary retrieval functionality, enhancing overall test coverage for ledger operations. These additions improve the reliability and robustness of the ledger client by ensuring comprehensive testing of key functionalities.
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
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)
New Models (30+ new model files)
CreateElementRequest,CreateJournalEntryRequest,BulkCreateAssociationsRequest, etc.)CreateElementRequestBalanceType,CreateJournalEntryRequestType,UpdateElementRequestClassificationType0, etc.)JournalEntryLineItemInputfor structured journal entry line itemsOperationErrorandOperationErrorDetailType1for standardized error representationOperationEnvelopeupdates to support the new error structureEnhanced Error Handling & Response Parsing
ledger_client.py) updated to integrate with new operationsBreaking Changes
OperationEnvelopemodel has been updated — consumers relying on the previous error field structure should update to use the newOperationErrormodelmodels/__init__.pymoduleTesting Notes
OperationErrorresponses across all modulesInfrastructure Considerations
models/__init__.pymodule has been updated to export all new models; downstream consumers pulling from this package will pick up the new types automatically🤖 Generated with Claude Code
Branch Info:
feature/native-accounting-opsmainCo-Authored-By: Claude noreply@anthropic.com