Skip to content

Add get/update document endpoints and supporting models#77

Merged
jfrench9 merged 1 commit intomainfrom
feature/document-platform-crud
Apr 2, 2026
Merged

Add get/update document endpoints and supporting models#77
jfrench9 merged 1 commit intomainfrom
feature/document-platform-crud

Conversation

@jfrench9
Copy link
Copy Markdown
Member

@jfrench9 jfrench9 commented Apr 2, 2026

Summary

Enhances the document management API client with full CRUD capabilities by adding new endpoints for retrieving and updating individual documents, along with corresponding request/response models and high-level client methods.

Key Accomplishments

New API Endpoints

  • get_document – Retrieve a single document's details by ID, returning the new DocumentDetailResponse model
  • update_document – Update document metadata/properties via a DocumentUpdateRequest payload

New Models

  • DocumentDetailResponse – Rich response model for individual document retrieval, providing more comprehensive document information than the list-level representation
  • DocumentUpdateRequest – Request model encapsulating fields that can be modified on an existing document

Updated Existing Components

  • document_client.py – Extended the high-level DocumentClient with convenience methods for get and update operations, completing the CRUD surface
  • DocumentListItem – Expanded with additional fields/attributes to align with backend API changes
  • DocumentUploadResponse – Minor additions to capture extra response data
  • Existing endpoints (delete_document, list_documents, upload_document, upload_documents_bulk) – Minor adjustments for consistency across the API layer
  • models/__init__.py – Exported new models for public consumption

Breaking Changes

  • DocumentListItem model changes – Fields have been added and potentially restructured. Consumers that rely on strict field enumeration or serialization of this model should verify compatibility.
  • Modifications to existing endpoint files (delete, list, upload, bulk upload) may include signature or behavior adjustments — review call sites for any downstream impact.

Testing Notes

  • Verify all four CRUD operations (create/upload, read/get, update, delete) function end-to-end against a running API instance
  • Confirm DocumentDetailResponse correctly deserializes all fields returned by the get endpoint
  • Validate that DocumentUpdateRequest properly serializes partial updates (ensure optional/unset fields are omitted rather than sent as null, if applicable)
  • Test error handling for invalid document IDs on get and update paths
  • Ensure the updated DocumentListItem model remains backward-compatible with existing list responses

Infrastructure Considerations

  • No new dependencies or infrastructure changes required
  • The new endpoints assume corresponding backend API routes are deployed and available
  • Client consumers will need to update their installed package version to access the new models and methods

🤖 Generated with Claude Code

Branch Info:

  • Source: feature/document-platform-crud
  • Target: main
  • Type: feature

Co-Authored-By: Claude noreply@anthropic.com

- Updated the delete document functionality to specify deletion from PostgreSQL and OpenSearch.
- Introduced new `get_document` and `update_document` endpoints for retrieving and updating document details, respectively.
- Enhanced the `list_documents` endpoint to clarify that it lists documents from PostgreSQL.
- Added new models: `DocumentDetailResponse` and `DocumentUpdateRequest` for handling document details and update requests.
- Updated existing models to include new fields for better data representation.

These changes improve the document management capabilities and provide a more comprehensive API for users.
@jfrench9 jfrench9 merged commit 138b982 into main Apr 2, 2026
1 check passed
@jfrench9 jfrench9 deleted the feature/document-platform-crud branch April 2, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant