Add Ledger API, Document Management, and Search endpoints to client library#70
Merged
Add Ledger API, Document Management, and Search endpoints to client library#70
Conversation
## Summary This commit introduces several new data models to the `robosystems_client` library, enhancing the API's capabilities for handling account and ledger-related information. ## Key Accomplishments - **New Account Models**: Added `AccountListResponse`, `AccountResponse`, `AccountTreeNode`, and `AccountTreeResponse` to support account-related data structures. - **New Ledger Models**: Introduced `LedgerEntryResponse`, `LedgerLineItemResponse`, `LedgerSummaryResponse`, `LedgerTransactionDetailResponse`, `LedgerTransactionListResponse`, and `LedgerTransactionSummaryResponse` for comprehensive ledger management. - **Pagination Support**: Included `PaginationInfo` to facilitate paginated responses in API calls. - **Trial Balance Models**: Added `TrialBalanceResponse` and `TrialBalanceRow` to support trial balance reporting. ## Changes Breakdown - Updated `__init__.py` to include new models in the public API. ## Testing Notes - Ensure that the new models are correctly integrated and accessible within the client library. ## Infrastructure Considerations - No breaking changes introduced; existing functionality remains intact.
…BalanceRow models ## Summary This commit enhances the `AccountResponse`, `AccountTreeNode`, and `TrialBalanceRow` models by introducing a new `account_type` field, allowing for better categorization and management of account-related data. ## Key Accomplishments - **New Field Addition**: Added `account_type` to `AccountResponse`, `AccountTreeNode`, and `TrialBalanceRow` models, providing additional context for account classification. - **Updated Serialization Logic**: Adjusted serialization and deserialization methods to handle the new `account_type` field appropriately. ## Changes Breakdown - Modified `account_response.py`, `account_tree_node.py`, and `trial_balance_row.py` to include the new field and its associated logic. - Updated `__init__.py` to ensure the new models are included in the public API. ## Testing Notes - Verify that the new `account_type` field is correctly serialized and deserialized in API responses. - Ensure backward compatibility with existing data structures that do not include the `account_type` field. ## Infrastructure Considerations - No breaking changes introduced; existing functionality remains intact.
## Summary This commit enhances the `RoboSystemsExtensions` class by integrating the `DocumentClient`, allowing for improved document management capabilities within the client library. ## Key Accomplishments - **New Client Integration**: Added `DocumentClient` to the `RoboSystemsExtensions` class, enabling access to document-related functionalities. - **Resource Management**: Updated the `close` method to ensure proper resource management for the new `documents` attribute. ## Changes Breakdown - Modified `extensions.py` to include the `DocumentClient` and updated the initialization and cleanup logic accordingly. ## Testing Notes - Verify that the `DocumentClient` is correctly instantiated and that resources are properly released during the `close` operation. ## Infrastructure Considerations - No breaking changes introduced; existing functionality remains intact.
## Summary This commit refactors the `DocumentClient` class to utilize dedicated API endpoints for document upload, search, and retrieval, enhancing the overall functionality and maintainability of the client. ## Key Accomplishments - **API Integration**: Replaced direct HTTP client calls with API functions for document upload, search, and retrieval, improving code clarity and reducing redundancy. - **Data Model Updates**: Changed return types for upload and search methods to use new response models, ensuring consistency with API responses. - **Error Handling**: Improved error handling during document upload to provide clearer feedback on failures. ## Changes Breakdown - Removed outdated dataclass definitions and replaced them with API model imports. - Updated method signatures and return types in `DocumentClient` to align with new API response structures. ## Testing Notes - Verify that document upload and search functionalities work as expected with the new API integration. - Ensure that error handling provides appropriate feedback for failed operations. ## Infrastructure Considerations - No breaking changes introduced; existing functionality remains intact.
…ring options ## Summary This commit updates the `DocumentClient` and `SearchRequest` classes to include new optional parameters for enhanced search capabilities. ## Key Accomplishments - **New Parameters**: Added `element`, `fiscal_year`, `date_from`, and `date_to` parameters to the `DocumentClient` search method, allowing for more granular filtering of search results. - **Documentation Updates**: Improved docstrings for the `DocumentClient` and `SearchRequest` classes to reflect the new parameters and their usage. ## Changes Breakdown - Updated method signatures and docstrings in `document_client.py` to include new filtering options. - Removed the `semantic` parameter from `SearchRequest` as it is no longer utilized. ## Testing Notes - Verify that the new parameters function correctly in search queries and return expected results. - Ensure that existing functionality remains intact and that the removal of the `semantic` parameter does not affect current implementations. ## Infrastructure Considerations - No breaking changes introduced; existing functionality remains intact.
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 comprehensive client library support for the Ledger API, Document Management, and Search functionality. It adds 40 new files (6,629 lines) spanning API endpoint definitions, data models, and a high-level
DocumentClientextension for simplified document operations.Key Accomplishments
Ledger API (
api/ledger/)AccountResponse,AccountTreeNode,LedgerEntryResponse,LedgerLineItemResponse,LedgerSummaryResponse,LedgerTransactionDetailResponse,LedgerTransactionSummaryResponse,TrialBalanceRow, and associated list/response wrappersaccount_typefield toAccountResponse,AccountTreeNode, andTrialBalanceRowmodelsDocument Management (
api/documents/)DocumentClientextension: High-level client that wraps raw API endpoints for ergonomic document management, integrated intoRoboSystemsExtensionsDocumentListItem,DocumentUploadRequest,BulkDocumentUploadRequest, and corresponding response models including error handling typesSearch API (
api/search/)SearchRequestmodel supporting additional filtering optionsSearchHit,SearchRequest,SearchResponse,DocumentSectionShared Infrastructure
PaginationInfomodel for consistent paginated responses across all endpointsmodels/__init__.pyfor clean public API surfaceBreaking Changes
None. This is a purely additive feature branch — no existing files were removed or had breaking modifications. The only modified files (
extensions.pyandmodels/__init__.py) received additive changes (new imports/registrations).Testing Notes
DocumentClientextension methods (upload, bulk upload, list, delete) end-to-endSearchRequestadditional filtering options work as expectedaccount_typefield is correctly populated across account and trial balance modelsInfrastructure Considerations
🤖 Generated with Claude Code
Branch Info:
feature/ledger-apimainCo-Authored-By: Claude noreply@anthropic.com