GET /documents/ currently returns the full list for one workspace via ensure_workspace_for_user. Business users need personal and company docs; lists will grow with Drive sync — need pagination, search, and sort.
API changes
GET /documents/ (or scoped variant) should support:
Pagination — page / page_size (or limit/offset); response includes total count
Search — filter by filename / remote name (case-insensitive)
Sort — columns at least: name, date uploaded (created), processed, active
Scope — query param e.g. workspace=personal|company (or workspace id)
Personal plan / non-company users: personal only
Company members: can list personal workspace docs and company workspace docs separately
Enforce auth: company scope only if user belongs to that company; uploads/mutations stay correctly scoped
Acceptance
Paginated response (not unbounded dump)
Search by name works
Sort by supported columns (asc/desc)
Personal vs company scope filter for business users
Tests for pagination, search, sort, and scope isolation
Parent epic: [chat_backend#42](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/42)
Related: [#46](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/46)
Related FE: [chat_web_app#93](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/93)
## Summary
`GET /documents/` currently returns the full list for one workspace via `ensure_workspace_for_user`. Business users need personal **and** company docs; lists will grow with Drive sync — need pagination, search, and sort.
## API changes
`GET /documents/` (or scoped variant) should support:
- **Pagination** — page / page_size (or limit/offset); response includes total count
- **Search** — filter by filename / remote name (case-insensitive)
- **Sort** — columns at least: name, date uploaded (`created`), processed, active
- **Scope** — query param e.g. `workspace=personal|company` (or workspace id)
- Personal plan / non-company users: personal only
- Company members: can list personal workspace docs and company workspace docs separately
- Enforce auth: company scope only if user belongs to that company; uploads/mutations stay correctly scoped
## Acceptance
- [ ] Paginated response (not unbounded dump)
- [ ] Search by name works
- [ ] Sort by supported columns (asc/desc)
- [ ] Personal vs company scope filter for business users
- [ ] Tests for pagination, search, sort, and scope isolation
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent epic: chat_backend#42
Related: #46
Related FE: chat_web_app#93
Summary
GET /documents/currently returns the full list for one workspace viaensure_workspace_for_user. Business users need personal and company docs; lists will grow with Drive sync — need pagination, search, and sort.API changes
GET /documents/(or scoped variant) should support:created), processed, activeworkspace=personal|company(or workspace id)Acceptance