RED-78: Pre-Close Checklist for Project Closure#162
RED-78: Pre-Close Checklist for Project Closure#162fs21co049adityawaghule wants to merge 10 commits into
Conversation
- Added workspaceId to all analytics functions (funnel.ts, validation.ts) - All SQL queries now scoped by workspace_id - Added date validation via resolveDateRange (returns 400 on invalid) - Routes pass session.workspaceId to analytics functions - Enforced ordered stage progression in funnel paths
- Resolved conflicts with origin/feature/LIN-55-comment-first-mode - Kept ttfv functionality and dateRange tests
- Redesigned homepage with Problem → Workflow → Proof → CTA hierarchy - Created modular components: HeroSection, ProblemSection, WorkflowSection, ProofSection, FeaturesSection, CTASection - Added outcome-first headline: Find Viral Reddit Content in Minutes - Added SEO metadata (title, description, openGraph) - Included metrics and testimonials for social proof
- Created PreCloseValidator service with validation logic - Added validation API endpoint: GET /api/projects/[id]/validate-close - Added close API endpoint: POST /api/projects/[id]/close - Created PreCloseChecklist UI component for project settings - Validates: tasks complete, roadmaps complete, no blocked tasks - Supports force archive option for admins
RED-78 RED-78: Pre-close checklist for RED-64
Pre-close checklist for RED-64: |
Summary
Changes
Service Layer
src/lib/services/preCloseValidator.ts- Core validation logicvalidateProjectClosure()- Validates project can be closedgetProjectCompletionStats()- Returns completion metricsAPI Endpoints
GET /api/projects/[id]/validate-close- Returns checklist statusPOST /api/projects/[id]/close- Closes project (with optional force)UI Component
src/components/projects/PreCloseChecklist.tsx- React componentChecklist Items
API Usage
Example Response
{ "valid": false, "checklist": [ { "id": "roadmaps-complete", "label": "All roadmaps completed", "status": "pass" }, { "id": "tasks-complete", "label": "All tasks completed", "status": "fail", "message": "5 pending" }, { "id": "no-blocked-tasks", "label": "No blocked tasks", "status": "pass" } ], "errors": ["Not all tasks are completed"], "stats": { "completionPercentage": 75, "completedTasks": 15, "pendingTasks": 5 } }Testing
Related