feat(pagination): raise the page-size ceiling to 500

Rows-per-page was capped at 100 in three independent places: @Max on
PaginationQueryDto, the same @Max repeated on ListWagonsQueryDto (which does
not extend the base), and MAX_PAGE_SIZE in pagination.util. The first two
reject with a 400, the third silently truncates, so a larger page size had to
be lifted in all three or the endpoints that opted in would refuse it --
train schedules, routes, locomotives, wagons, audit, rule engine, built
trains, batch board and the rest.

No service overrides maxPageSize, so the util constant is the effective cap
everywhere it is reached.

Adds a spec pinning the three together: 500 validates, 501 rejects, and the
util returns take: 500 rather than truncating. A fourth copy of the number
lives in the backoffice data-table footer and is noted there.
This commit is contained in:
Nathnael
2026-08-20 09:05:54 +00:00
parent 54cf0c2944
commit ac8f03f69a
4 changed files with 50 additions and 5 deletions

View File

@@ -72,12 +72,14 @@ export class ListWagonsQueryDto {
@Min(1)
page?: number;
@ApiPropertyOptional({ default: 10, minimum: 1, maximum: 100 })
// 500 to match PaginationQueryDto — this DTO doesn't extend it, so the
// ceiling has to be repeated here or the wagons list alone rejects at 100.
@ApiPropertyOptional({ default: 10, minimum: 1, maximum: 500 })
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(100)
@Max(500)
pageSize?: number;
@ApiPropertyOptional({ description: 'Registered on or after this day (YYYY-MM-DD)' })