Implement complete flow management system with CRUD operations, computed counts, and alias management capabilities for organizing generation chains. **Core Service:** - **FlowService**: Complete flow lifecycle management - Create flows with initial empty aliases - CRUD operations (create, read, update, delete) - Computed counts for generations and images per flow - Alias management (add, update, remove) - Get flow's generations and images with pagination - No soft delete (flows use hard delete) **v1 API Routes:** - `POST /api/v1/flows` - Create new flow - `GET /api/v1/flows` - List flows with pagination and counts - `GET /api/v1/flows/:id` - Get single flow with computed counts - `GET /api/v1/flows/:id/generations` - List flow's generations - `GET /api/v1/flows/:id/images` - List flow's images - `PUT /api/v1/flows/:id/aliases` - Update flow aliases (add/modify) - `DELETE /api/v1/flows/:id/aliases/:alias` - Remove specific alias - `DELETE /api/v1/flows/:id` - Delete flow (hard delete) **Route Features:** - Authentication via validateApiKey middleware - Project key requirement - Request validation with pagination - Error handling with proper status codes - Response transformation with toFlowResponse converter - Project ownership verification for all operations **Type Updates:** - Added ListFlowGenerationsResponse and ListFlowImagesResponse - Updated GetFlowResponse to return FlowResponse (not FlowWithDetailsResponse) - FlowService methods return FlowWithCounts where appropriate **Technical Notes:** - Flows don't have deletedAt column (no soft delete support) - All count queries filter active generations/images only - Alias updates are merged with existing aliases - Empty flows return generationCount: 0, imageCount: 0 - All Phase 3 code is fully type-safe with zero TypeScript errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| _tests | ||
| src | ||
| .env | ||
| .prettier.config.js | ||
| Dockerfile | ||
| NETWORK_ERROR_DETECTION.md | ||
| docker-compose.yml | ||
| eslint.config.js | ||
| package.json | ||
| secrets.env.example | ||
| test-network-error-detector.ts | ||
| tsconfig.json | ||