Skip to content

feat: add pagination support to all list endpoints MAPCO-9304#263

Open
ronenkapelian wants to merge 1 commit into
masterfrom
feature/pagination-support
Open

feat: add pagination support to all list endpoints MAPCO-9304#263
ronenkapelian wants to merge 1 commit into
masterfrom
feature/pagination-support

Conversation

@ronenkapelian

Copy link
Copy Markdown
Collaborator

Adds page / page_size query parameters to all 5 list endpoints. Response shape changes from a raw array to { total, items }.

Endpoints affected

  • GET /v1/jobs
  • GET /v1/stages
  • GET /v1/jobs/:jobId/stages
  • GET /v1/tasks
  • GET /v1/stages/:stageId/tasks

Changes

  • openapi_v1.yaml — source of truth updated with pagination params and paginated response schemas; openapi3.yaml and src/openapi.d.ts regenerated
  • src/common/utils/pagination.ts — shared paginationParamsToTakeAndSkip() utility
  • Managers — all 3 managers run findMany + count in parallel and return { total, items }
  • eslint.config.mjs — allowlist for page_size snake_case destructuring
  • Tests — all existing tests updated; 15 new pagination edge-case tests added (page slicing, beyond-last-page)

Breaking change

T[]{ total: number; items: T[] } on all 5 endpoints.

Consumer migration:

  • responseresponse.items
  • response.lengthresponse.total

Release as 0.3.0.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

🎫 Related Jira Issue: MAPCO-9304

@ronenkapelian
ronenkapelian requested a review from CptSchnitz July 22, 2026 13:48
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 80%) 736 / 736
🟢 Statements 100% (🎯 80%) 744 / 744
🟢 Functions 100% (🎯 80%) 112 / 112
🟢 Branches 100% (🎯 80%) 219 / 219
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/api/v1/stages/controller.ts 100% 100% 100% 100%
src/api/v1/tasks/controller.ts 100% 100% 100% 100%
src/common/utils/pagination.ts 100% 100% 100% 100%
src/jobs/models/manager.ts 100% 100% 100% 100%
src/stages/models/manager.ts 100% 100% 100% 100%
src/tasks/models/manager.ts 100% 100% 100% 100%
Generated in workflow #767 for commit fbf4151 by the Vitest Coverage Report Action

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