Skip to content

[BE-18] Add PaginationDto and standard paginated response wrapper in opsce module #826

@yusuftomilola

Description

@yusuftomilola

Problem

Every list endpoint currently returns a raw array. There is no consistent pagination contract (page, limit, total) across endpoints, making frontend integration inconsistent.

Proposed Solution

Create backend/src/opsce/common/dto/pagination.dto.ts and a PaginatedResponseDto<T> generic wrapper. Use these across all list endpoints.

Acceptance Criteria

  • PaginationDto has: page (default 1, min 1), limit (default 20, min 1, max 100) with @IsInt, @Min, @Max validators
  • PaginatedResponseDto<T> has: data: T[], total: number, page: number, limit: number, totalPages: number
  • Applied to: assets list, users list, departments list, locations list, audit log list
  • A paginate(query, paginationDto) helper function created to reduce boilerplate
  • All list endpoints tested to confirm they return the wrapper shape

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions