feat: pump tracker, photo log, milk stock, medication profiles, calendar, reminders, audit log, edit events
New pages: - /calendar — monthly grid with event dots, day detail on tap - /medications — CRUD for medication profiles (presets + custom, dose/unit/intervals/crisis mode) - /milk — milk stock management with location-based expiry, alerts, mark-as-used - /reminders — recurring medication reminder CRUD with Pushover notifications New APIs: - /api/medication-profiles — profiles CRUD + last-intakes endpoint (auto-seeds 10 presets per family) - /api/milk — milk stock CRUD with auto-calculated expiry - /api/reminders + /api/reminders/check — reminder CRUD + cron-callable check endpoint - /api/upload — multipart photo upload to public/uploads/ - /api/invite/send-email — email invitation with family invite link - /api/admin/audit — last 100 audit log entries (superadmin only) Event modal improvements: - PUMP event type (side selector + volume + timer) - MEDICATION: profile chip picker, next-dose timing status, crisis mode toggle - Photo attachment (upload + thumbnail preview) - Datetime inputs split into date + time (iOS Safari datetime-local fix) - Edit mode via initialEvent prop (pre-fills all fields, saves via PATCH) - Timer now shows h:mm:ss when >= 1 hour Timeline: - Modify button opens pre-filled edit modal per event - Photo thumbnail in expanded view Dashboard: - PUMP in quick-log - Medication status card (too-soon / available with next-dose time) Schema additions: MedicationProfile, MedcationReminder, MilkStock, AuditLog models Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+58
-3
@@ -104,9 +104,11 @@ model Baby {
|
||||
growthLogs GrowthLog[]
|
||||
doctorNotes DoctorNote[]
|
||||
journalNotes JournalNote[]
|
||||
milestones Milestone[]
|
||||
vaccinations Vaccination[]
|
||||
createdAt DateTime @default(now())
|
||||
milestones Milestone[]
|
||||
vaccinations Vaccination[]
|
||||
medicationReminders MedicationReminder[]
|
||||
milkStocks MilkStock[]
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model Event {
|
||||
@@ -127,6 +129,7 @@ model Event {
|
||||
enum EventType {
|
||||
BREASTFEED
|
||||
BOTTLE
|
||||
PUMP
|
||||
DIAPER_WET
|
||||
DIAPER_STOOL
|
||||
NAP
|
||||
@@ -192,3 +195,55 @@ model Vaccination {
|
||||
done Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model AuditLog {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
userName String
|
||||
action String
|
||||
targetId String?
|
||||
familyId String?
|
||||
detail String?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model MedicationProfile {
|
||||
id String @id @default(cuid())
|
||||
familyId String
|
||||
name String
|
||||
molecule String?
|
||||
defaultDose String?
|
||||
unit String @default("mL")
|
||||
intervalHours Float @default(6)
|
||||
minIntervalHours Float?
|
||||
isPreset Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model MilkStock {
|
||||
id String @id @default(cuid())
|
||||
babyId String
|
||||
baby Baby @relation(fields: [babyId], references: [id], onDelete: Cascade)
|
||||
volume Float
|
||||
storedAt DateTime @default(now())
|
||||
expiresAt DateTime
|
||||
location String @default("fridge")
|
||||
notes String?
|
||||
used Boolean @default(false)
|
||||
usedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model MedicationReminder {
|
||||
id String @id @default(cuid())
|
||||
babyId String
|
||||
baby Baby @relation(fields: [babyId], references: [id], onDelete: Cascade)
|
||||
name String
|
||||
dose String?
|
||||
unit String?
|
||||
intervalHours Float
|
||||
startAt DateTime
|
||||
enabled Boolean @default(true)
|
||||
lastSentAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user