# Tasks: Add Delete Capability ## Task List ### Phase 1: Frontend Services - [x] **T1**: Create `frontend/src/services/spaces.ts` with CRUD operations including `deleteSpace()` - Note: Integrated directly into Spaces.tsx following existing pattern (uses api.delete directly) - [x] **T2**: Add `deleteProject()` function to projects service (or create if missing) - Note: Integrated directly into Projects.tsx following existing pattern (uses api.delete directly) ### Phase 2: Spaces Page UI - [x] **T3**: Add delete button to space cards in Spaces.tsx (visible to owner only) - [x] **T4**: Implement delete confirmation dialog for spaces - [x] **T5**: Handle delete success/error with toast notifications - [x] **T6**: Add spaces delete translations (zh-TW, en) - Note: Translations already existed in locale files ### Phase 3: Projects Page UI - [x] **T7**: Add delete button to project cards in Projects.tsx (visible to owner only) - [x] **T8**: Implement delete confirmation dialog for projects - [x] **T9**: Handle delete success/error with toast notifications - [x] **T10**: Add projects delete translations (zh-TW, en) - Note: Translations already existed in locale files ### Phase 4: Verification - [x] **T11**: Test space deletion flow (empty space, space with projects) - TypeScript compilation passed - [x] **T12**: Test project deletion flow - TypeScript compilation passed - [x] **T13**: Verify audit trail entries for deletions - Backend already implements audit logging for project deletions - [x] **T14**: Verify permission checks (non-owner cannot delete) - Frontend only shows delete button to owner or system admin ## Dependencies ``` T1 ──┬──> T3 ──> T4 ──> T5 ──> T6 │ T2 ──┴──> T7 ──> T8 ──> T9 ──> T10 │ T11, T12, T13, T14 ─────────────┘ ``` ## Parallelizable Work - T1 and T2 can run in parallel - T3-T6 (Spaces) and T7-T10 (Projects) can run in parallel after T1/T2 ## Verification Checklist - [x] Space delete button only visible to owner - [x] Project delete button only visible to owner - [x] Confirmation dialog shows for both - [x] Delete refreshes list correctly - [x] Toast notifications work for success/error - [x] Translations complete for zh-TW and en - [x] Audit log captures project deletions