Added PlantTouchPoint and IPMSchedule models. Implemented touch-points and IPM controllers/routes. Updated frontend with Dashboard feed and IPM widgets.
1.5 KiB
1.5 KiB
Phase 2: Plant Touch Points & IPM - Execution Plan
🚨 Status Check
Most of Phase 2 logic was scaffolded in the previous session but left unconnected. We have a critical bug on the Dashboard (calling a missing API method) and some missing backend endpoints.
🏃 Sprint 1: Fix Dashboard & Connect APIs (✅ COMPLETE)
Goal: Resolve the Dashboard crash and ensure the "Recent Use" feed works.
Tasks
- Backend (
touch-points.controller.ts):- ✅ Implement
getRecentTouchPointsto return the latest 50 touch points globally (across all batches).
- ✅ Implement
- Backend Routes:
- ✅ Verify
GET /api/touch-pointsmaps to this new controller method.
- ✅ Verify
- Frontend (
touchPointsApi.ts):- ✅ Add
getAll()method (orgetRecent()) to match the Dashboard's expectation.
- ✅ Add
- Backend Fixes:
- ✅ Fix typo
getShedule->getScheduleinipm.controller.ts.
- ✅ Fix typo
🏃 Sprint 2: IPM & Integrations
Goal: Verify the IPM scheduling loop works end-to-end.
Tasks
- Database:
- Ensure
PlantTouchPointandIPMScheduletables exist (runnpx prisma db pushto be safe).
- Ensure
- Frontend Verification:
- Test "Log Touch Point" from the Dashboard.
- Test "IPM Dashboard" loading due treatments.
- Logic Check:
- Verify treating a plant (
type: "IPM") correctly updates thenextTreatmentdate inIPMSchedule.
- Verify treating a plant (
❓ User Action Required
- None immediately. I will proceed with Sprint 1 to fix the Dashboard crash.