feat: maintenance banner, activities log, pinned note, event templates, weekly summary cron
Maintenance mode banner: - App layout reads SystemConfig maintenance_mode at server render time - Amber sticky banner for regular users, dimmed indicator for superadmin Baby activities (3 new event types): - BATH (Bath icon, sky, timer+duration) - WALK / Balade (Footprints icon, lime) - TUMMY_TIME (Baby icon, amber) - Added to EventType enum, EVENT_CONFIG, event-icon.tsx, dashboard quick-log Pinned family note: - Shared across all family members, shown at top of dashboard - Inline edit with author + timestamp; /api/family/pinned-note GET/PATCH - pinnedNote + pinnedNoteUpdatedAt + pinnedNoteAuthor fields on Family model Event templates: - Named quick-log presets per family (type + label + metadata) - Dashboard row: tap to open pre-filled EventModal; hover ✕ to delete - Dropdown to create new template; /api/event-templates GET/POST + /[id] PATCH/DELETE - EventTemplate model in schema Weekly summary cron: - POST /api/cron/weekly-summary — auth via Bearer cron_secret (SystemConfig or env) - Per family, per baby: feeds count, sleep total+avg, diaper count, latest weight - Sends Pushover to all family members with pushoverUserKey - Optional body.familyId to target one family Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+24
-6
@@ -85,12 +85,27 @@ model VerificationToken {
|
||||
}
|
||||
|
||||
model Family {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
inviteCode String @unique @default(cuid())
|
||||
users User[]
|
||||
babies Baby[]
|
||||
createdAt DateTime @default(now())
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
inviteCode String @unique @default(cuid())
|
||||
users User[]
|
||||
babies Baby[]
|
||||
eventTemplates EventTemplate[]
|
||||
pinnedNote String?
|
||||
pinnedNoteUpdatedAt DateTime?
|
||||
pinnedNoteAuthor String?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model EventTemplate {
|
||||
id String @id @default(cuid())
|
||||
familyId String
|
||||
family Family @relation(fields: [familyId], references: [id], onDelete: Cascade)
|
||||
label String
|
||||
type EventType
|
||||
metadata Json?
|
||||
sortOrder Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model Baby {
|
||||
@@ -136,6 +151,9 @@ enum EventType {
|
||||
NIGHT_SLEEP
|
||||
MEDICATION
|
||||
TEMPERATURE
|
||||
BATH
|
||||
WALK
|
||||
TUMMY_TIME
|
||||
}
|
||||
|
||||
model GrowthLog {
|
||||
|
||||
Reference in New Issue
Block a user