1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 13:59:36 +01:00

feat: Paginierung für alle GET-List-Endpoints (#61)

Einheitliches Paginierungs-Pattern mit page, size und Multi-Field sort
für alle 14 List-Endpoints. Response-Format ändert sich von [...] zu
{ content: [...], page: { number, size, totalElements, totalPages } }.

Backend:
- Shared Kernel: Page<T>, PageRequest, SortField, SortDirection
- PaginationHelper (SQL ORDER BY mit Whitelist), PageResponse DTO
- Paginated Methoden in allen 14 Domain-Repos + JDBC-Implementierungen
- Safety-Limit (500) für findAllBelowMinimumLevel/ExpiryRelevantBatches
- Alle List-Use-Cases akzeptieren PageRequest, liefern Page<T>
- Alle Controller mit page/size/sort Query-Params + PageResponse

Frontend:
- PagedResponse<T> Type auf nested page-Format aktualisiert
- Alle 14 API-Client-Resourcen liefern PagedResponse mit PaginationParams
- Alle Hooks mit Pagination-State (currentPage, totalPages, pageSize)
- Alle List-Screens mit Seiten-Navigation (Pfeiltasten) und Footer

Loadtest:
- Podman-Support im justfile (DOCKER_HOST auto-detect)
- Verschärfte Performance-Schwellwerte basierend auf Ist-Werten
This commit is contained in:
Sebastian Frick 2026-03-20 16:33:20 +01:00
parent fc4faafd57
commit 72979c9537
151 changed files with 2880 additions and 1120 deletions

View file

@ -11,6 +11,8 @@ import type {
TemperatureRangeDTO,
CreateStorageLocationRequest,
UpdateStorageLocationRequest,
PaginationParams,
PagedResponse,
} from '@effigenix/types';
export type StorageType = 'COLD_ROOM' | 'FREEZER' | 'DRY_STORAGE' | 'DISPLAY_COUNTER' | 'PRODUCTION_AREA';
@ -41,11 +43,14 @@ const BASE = '/api/inventory/storage-locations';
export function createStorageLocationsResource(client: AxiosInstance) {
return {
async list(filter?: StorageLocationFilter): Promise<StorageLocationDTO[]> {
const params: Record<string, string> = {};
async list(filter?: StorageLocationFilter, pagination?: PaginationParams): Promise<PagedResponse<StorageLocationDTO>> {
const params: Record<string, string | string[]> = {};
if (filter?.storageType) params['storageType'] = filter.storageType;
if (filter?.active !== undefined) params['active'] = String(filter.active);
const res = await client.get<StorageLocationDTO[]>(BASE, { params });
if (pagination?.page != null) params.page = String(pagination.page);
if (pagination?.size != null) params.size = String(pagination.size);
if (pagination?.sort) params.sort = pagination.sort;
const res = await client.get<PagedResponse<StorageLocationDTO>>(BASE, { params });
return res.data;
},