diff --git a/VEZA_INTEGRATION_PERFECTION_TODOLIST_TEMPLATE.json b/VEZA_INTEGRATION_PERFECTION_TODOLIST_TEMPLATE.json index 2b262e634..de8de57f8 100644 --- a/VEZA_INTEGRATION_PERFECTION_TODOLIST_TEMPLATE.json +++ b/VEZA_INTEGRATION_PERFECTION_TODOLIST_TEMPLATE.json @@ -385,7 +385,8 @@ "description": "Créer un type générique pour les réponses paginées aligné avec le format backend.", "priority": "P1", "priority_rank": 10, - "status": "todo", + "status": "completed", + "completed_at": "2025-01-27T14:00:00Z", "estimated_hours": 1, "side": "frontend_only", "files_to_modify": [ @@ -1091,13 +1092,13 @@ }, "progress_tracking": { "total_tasks": 32, - "completed": 9, + "completed": 10, "in_progress": 0, - "todo": 23, + "todo": 22, "blocked": 0, - "completion_percentage": 28, - "last_updated": "2025-01-27T13:45:00Z", + "completion_percentage": 31, + "last_updated": "2025-01-27T14:00:00Z", "estimated_completion_date": null, - "estimated_hours_remaining": 34.5 + "estimated_hours_remaining": 33.5 } } diff --git a/apps/web/src/types/api.ts b/apps/web/src/types/api.ts index e5994c546..3e8cc8b21 100644 --- a/apps/web/src/types/api.ts +++ b/apps/web/src/types/api.ts @@ -230,6 +230,8 @@ export interface PaginationParams { cursor?: string; } +// INT-TYPE-007: PaginationData aligned with backend PaginationData (handlers/common.go) +// Backend format: { page, limit, total, total_pages, has_next, has_prev, next_cursor?, prev_cursor? } export interface PaginationData { page: number; limit: number; @@ -268,11 +270,26 @@ export interface ApiError { retry_after?: number; // Nombre de secondes avant de pouvoir réessayer (pour 429) } +// INT-TYPE-007: ListResponse generic type - backend returns { list: T[], pagination: PaginationData } export interface ListResponse { - items: T[]; + items: T[]; // Backend uses 'list' but we standardize to 'items' for consistency pagination: PaginationData; } +// INT-TYPE-007: PaginatedResponse generic type - alternative format with flattened fields +// Use this when the response is unwrapped and pagination fields are at the root level +export interface PaginatedResponse { + items: T[]; + total: number; + page: number; + limit: number; + total_pages: number; + has_next: boolean; + has_prev: boolean; + next_cursor?: string; + prev_cursor?: string; +} + // Types pour les requêtes de liste export interface ListUsersRequest extends PaginationParams { query?: string; diff --git a/apps/web/src/types/index.ts b/apps/web/src/types/index.ts index 759ed2954..bdeb01072 100644 --- a/apps/web/src/types/index.ts +++ b/apps/web/src/types/index.ts @@ -113,13 +113,19 @@ export interface ApiError { retry_after?: number; // Nombre de secondes avant de pouvoir réessayer (pour 429) } +// INT-TYPE-007: PaginatedResponse generic type aligned with backend format +// Backend format: { success: true, data: { list: T[], pagination: PaginationData } } +// PaginationData: { page, limit, total, total_pages, has_next, has_prev, next_cursor?, prev_cursor? } export interface PaginatedResponse { - data: T[]; + items: T[]; // Backend uses 'list' but we standardize to 'items' for consistency total: number; page: number; limit: number; + total_pages: number; has_next: boolean; has_prev: boolean; + next_cursor?: string; + prev_cursor?: string; } // WebSocket Events