# Phase 2: Plant Touch Points & IPM - Implementation Plan ## Goal Implement the "Plant Touch Points" system and "IPM Tracking" as defined in `specs/plant-touch-points-ipm.md`. We will break this into short, manageable sprints. --- ## 🏃 Sprint 1: Core Touch Point Foundation (Current Focus) **Objective**: Build the backend and basic UI to allow staff to record simple interactions (Water, Feed, Prune, etc.). ### Tasks 1. **Database**: - Update `schema.prisma` with `PlantTouchPoint` model and `TouchPointType` enum. - Run database migration. 2. **Backend**: - Create `PlantTouchPoint` controller with `create` and `list` endpoints. - Register routes. 3. **Frontend**: - Create API client functions for touch points. - Create a **"Quick Actions"** FAB (Floating Action Button) or Widget on the main dashboard. - Implement a simple form to record a touch point (Type + Notes). --- ## 🏃 Sprint 2: IPM Scheduling Engine **Objective**: Implement the 10-day root drench cycle logic and tracking. ### Tasks 1. **Database**: - Update `schema.prisma` with `IPMSchedule` model. - Run migration. 2. **Backend**: - Create logic to calculate next treatment dates (Day 0, 10, 20...). - Create endpoints to `getSchedules` and `logTreatment`. 3. **Frontend**: - Create **"IPM Status"** widget showing active schedules and "Due" badges. - Implement the "Record Treatment" flow (validating Pyganic 5.0 usage). --- ## 🏃 Sprint 3: History & Visualization **Objective**: Allow growers to view the history of interactions and style the UI. ### Tasks 1. **Frontend**: - Build **"Batch History"** view (timeline of touch points). - Refine UI with 777 Wolfpack branding (Palm Springs aesthetic). - Add icons/visuals for different touch types. --- ## ❓ Clarifications Needed 1. **Batches**: Do we already have a `Batch` model in the DB? The spec references `batchId`. If not, we might need a simple `Batch` model or allow `batchId` to be a loose string/placeholder for now. - *Self-correction*: I should check `schema.prisma` now to see if `Batch` exists.