Skip to content

feat: add backend pagination to list endpoints (Phase 4.5)#288

Merged
nbhansen merged 1 commit intoaau-giraf:dev-mainfrom
nbhansen:feature/phase4.5-pagination
Feb 8, 2026
Merged

feat: add backend pagination to list endpoints (Phase 4.5)#288
nbhansen merged 1 commit intoaau-giraf:dev-mainfrom
nbhansen:feature/phase4.5-pagination

Conversation

@nbhansen
Copy link
Contributor

@nbhansen nbhansen commented Feb 8, 2026

Adds optional skip/take query parameters to all list endpoints, with a generic PaginatedResponse<T> wrapper.

Changes

New files

  • DTOs/PaginationDTO.csPaginatedResponse<T> with Items, TotalCount, Skip, Take
  • Extensions/PaginationExtensions.csToPaginatedAsync() IQueryable extension (default 50, max 200)

Updated controllers (11 endpoints across 6 controllers)

  • AdminControllerGET caregivers, children, admins, pairings
  • UsersControllerGET users
  • ArtefactsControllerGET artefacts
  • BoardsControllerGET boards, GET boards/list
  • CategoriesControllerGET categories
  • RelationControllerGET pairings, GET caregiver/{id}

Updated services

  • IArtefactService / ArtefactServiceGetArtefactsForUserAsync(skip, take)
  • IBoardService / BoardServiceGetBoardsForUserAsync(skip, take), GetBoardListAsync(skip, take)
  • IRelationService / RelationServiceGetAllPairingsAsync(skip, take), GetPairingsForCaregiverAsync(skip, take)

Backward-compatible

Callers that don't pass skip/take get the default page size (50). Existing tests updated to handle new response shape.

Tests

  • ✅ VTA.Tests: 98/98
  • ✅ SyncService.Tests: 25/25

- Add PaginatedResponse<T> DTO with Items, TotalCount, Skip, Take
- Add PaginationExtensions.ToPaginatedAsync() IQueryable extension
- Update 11 list endpoints across 6 controllers with optional skip/take params:
  AdminController (caregivers, children, admins, pairings),
  UsersController (users), ArtefactsController (artefacts),
  BoardsController (boards, boards/list), CategoriesController (categories),
  RelationController (pairings, caregiver pairings)
- Update ArtefactService, BoardService, RelationService interfaces + impls
- Default page size: 50, max: 200, backward-compatible
- Fix CategoriesControllerTests to deserialize PaginatedResponse
- All tests pass: 98/98 VTA.Tests, 25/25 SyncService.Tests
@nbhansen nbhansen merged commit 1de0fa4 into aau-giraf:dev-main Feb 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant