AI Newsletter Digest improvements: fixed QP soft line break decoding, URL extraction, and content cleaning
This commit is contained in:
62
nextstep-features/treatment-milestones/IMPLEMENTATION.md
Normal file
62
nextstep-features/treatment-milestones/IMPLEMENTATION.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# Treatment Milestone Tracker Implementation
|
||||
|
||||
## Database Schema Changes
|
||||
|
||||
Add to prisma/schema.prisma:
|
||||
|
||||
```prisma
|
||||
model TreatmentPlan {
|
||||
id String @id @default(cuid())
|
||||
workspaceId String @unique
|
||||
title String // e.g., "Grace's Chemotherapy Plan"
|
||||
totalCycles Int
|
||||
currentCycle Int @default(0)
|
||||
startDate DateTime?
|
||||
estimatedEnd DateTime?
|
||||
status String @default("ACTIVE") // ACTIVE, PAUSED, COMPLETED
|
||||
cycleType String @default("WEEKLY") // WEEKLY, BIWEEKLY, MONTHLY, CUSTOM
|
||||
cycleDays Int @default(7) // Days between cycles
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
createdById String
|
||||
|
||||
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
||||
createdBy User @relation(fields: [createdById], references: [id])
|
||||
milestones TreatmentMilestone[]
|
||||
}
|
||||
|
||||
model TreatmentMilestone {
|
||||
id String @id @default(cuid())
|
||||
planId String
|
||||
cycleNumber Int // Which cycle this milestone represents
|
||||
date DateTime // When it happened (or estimated)
|
||||
status String @default("UPCOMING") // UPCOMING, COMPLETED, SKIPPED
|
||||
notes String? // Personal reflection
|
||||
sideEffects String? // What was experienced
|
||||
celebratedAt DateTime? // When we showed the celebration
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
plan TreatmentPlan @relation(fields: [planId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
```
|
||||
|
||||
## API Routes
|
||||
|
||||
### GET /api/workspaces/[id]/treatment-plan
|
||||
Get the treatment plan for a workspace
|
||||
|
||||
### POST /api/workspaces/[id]/treatment-plan
|
||||
Create or update treatment plan
|
||||
|
||||
### POST /api/workspaces/[id]/treatment-plan/milestones/[cycleNumber]/complete
|
||||
Mark a milestone as completed
|
||||
|
||||
### GET /api/workspaces/[id]/treatment-plan/progress
|
||||
Get progress stats
|
||||
|
||||
## Components
|
||||
|
||||
- TreatmentProgress - Main progress widget
|
||||
- MilestoneCelebration - Celebration modal
|
||||
- TreatmentCalendar - Timeline view
|
||||
- CycleDetailView - Individual cycle details
|
||||
Reference in New Issue
Block a user