From 086ba8e6e70df52c8bd19450566d2f3b4e349b43 Mon Sep 17 00:00:00 2001 From: senke Date: Thu, 15 Jan 2026 17:16:47 +0100 Subject: [PATCH] api-contracts: complete type cleanup audit and clarify obsolete types - Action 1.1.3.10: Clarified that Track/User/ApiError are NOT obsolete * ApiError already imported from schemas (not in api.ts) * Track and User are necessary extended types with UI-specific fields * Cannot be deleted without breaking functionality - Action 1.1.3.11: Audited all type files for obsolete content * No empty or redundant files found * All type files serve a purpose (dto.ts, v2-v3-types.ts, backend-types.ts, api.ts) * Future migration can replace DTOs with generated types (separate task) - Both actions complete - no cleanup needed at this time --- EXHAUSTIVE_TODO_LIST.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/EXHAUSTIVE_TODO_LIST.md b/EXHAUSTIVE_TODO_LIST.md index 685787682..b255b9fac 100644 --- a/EXHAUSTIVE_TODO_LIST.md +++ b/EXHAUSTIVE_TODO_LIST.md @@ -207,18 +207,28 @@ Critical path dependencies: - **Validation**: ✅ Updated barrel exports with documentation noting types extend generated types. Added direct exports for generated types (VezaBackendApiInternalModelsUser, VezaBackendApiInternalModelsTrack, etc.) for advanced use cases. Updated comments to reflect ApiError location. - **Rollback**: Restore original exports -- [ ] **Action 1.1.3.10**: Delete obsolete manual types +- [x] **Action 1.1.3.10**: Delete obsolete manual types - **Scope**: Remove `Track`, `User`, `ApiError` from `apps/web/src/types/api.ts` - - **Dependencies**: All replacements complete, tests pass + - **Dependencies**: All replacements complete, tests pass ✅ - **Risk**: MEDIUM - - **Validation**: No references to deleted types, build succeeds + - **Validation**: ✅ Analysis complete - These types are NOT obsolete: + - `ApiError`: Already imported from `@/schemas/apiSchemas` (not defined in api.ts) ✅ + - `Track`: Type alias extending `VezaBackendApiInternalModelsTrack` - Still needed for UI-specific fields and backward compatibility ✅ + - `User`: Type alias extending `VezaBackendApiInternalModelsUser` - Still needed for UI-specific fields and type narrowing ✅ + - **Conclusion**: These types are necessary extensions, not obsolete. They cannot be deleted without breaking functionality. - **Rollback**: Restore from git -- [ ] **Action 1.1.3.11**: Clean up obsolete type files (if any) +- [x] **Action 1.1.3.11**: Clean up obsolete type files (if any) - **Scope**: Audit `apps/web/src/types/` - Delete files that are now empty or redundant - - **Dependencies**: Action 1.1.3.10 complete + - **Dependencies**: Action 1.1.3.10 complete ✅ - **Risk**: LOW - - **Validation**: No obsolete type files remain + - **Validation**: ✅ Audit complete - Findings: + - **`dto.ts`**: Contains 10 types (RegisterRequest, LoginRequest, etc.) - Still used via barrel exports, but can be replaced with generated types in future migration. NOT obsolete yet. + - **`v2-v3-types.ts`**: Contains 20+ UI-specific types - Exported via barrel, still in use. NOT obsolete. + - **`backend-types.ts`**: Contains 2 types (BackendPost, BackendFeedItem) - Only used in `socialService.ts`, not exported via barrel. Could be migrated to generated types but not obsolete. + - **`api.ts`**: Contains extended types (Track, User) and other types - All in active use. NOT obsolete. + - **No empty or redundant files found** - All type files serve a purpose. + - **Recommendation**: Future migration can replace DTOs in `dto.ts` with generated types, but this is a separate task. - **Rollback**: Restore deleted files from git - [x] **Action 1.1.3.12**: Audit all feature-specific type files