feat(api): paginate every list handler (PMS-127) #65
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-127-pagination"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
list_*handler across 18 modules throughutils/pagination.rs. 53 handlers now acceptQuery<PaginationParams>, ask the service for(Vec<T>, u64), and serialize viaPaginatedResponse::from_params. Closes cross-cutting issue #7 fromdev-docs/codebase-state.md.list_tenantsservice signature normalized to&PaginationParams(the one inconsistent shape left in the tree).calendar::who_is_on_call_nowstaysJson<Vec<OnCallNowResponse>>because it is a point-in-time resolver, not a paginated list.assets::list_asset_audit_logpreviously hard-capped atLIMIT 500; that cap is dropped in favour of the standard pagination clamps.(items, total)to keep theResult<Vec<_>>::collect()step intact.Breaking change
Every list endpoint that was previously returning a bare JSON array now returns the
{"data": [...], "meta": {...}}envelope. Client (mokosh-clients/mokosh-apps) must be updated in lock-step to readbody.data. Endpoints already paginated before this change (tenants/list, contacts/companies, contacts/contacts, tickets/list, billing/invoices, billing/payments, projects/list, time_tracking/time_entries, audit/list, portal/list_*) are unaffected.Test plan
cargo fmt --all --checkcargo clippy --all-targets -- -D warningscargo check --all-targetscargo test --lib+ every integration test still passes (work-types and inbox tests updated to readbody["data"]).?page=2&per_page=10return the requested page with correctmeta.total.Closes PMS-127.