feat: UX improvements, webhooks, invite management

- Photo lightbox: ArrowLeft/Right/Escape keyboard navigation
- Growth chart: persistent WHO percentile legend (not hover-only)
- Sleep stats: configurable window selector (18h/19h/20h/21h)
- Quick-add FAB: now visible on desktop (bottom-right corner)
- Invite code reset button in settings (non-admin, PARENT role only)
- Pending email invites: tracked per-token with 7-day expiry, revocable
  from settings UI; new /auth/invite/t/[token] accept page
- Webhooks: Prisma model, CRUD API, HMAC-SHA256 dispatcher wired into
  event.created / growth.created / doctor_note.created; settings UI
- Docker cron service: medication reminders every 15min, milk-expiry
  and daily-digest daily; secured with CRON_SECRET
- Photo uploads persist across redeploys via Docker named volume

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 23:14:28 +02:00
parent 3f08313bc2
commit 41170d9155
21 changed files with 795 additions and 18 deletions
+8
View File
@@ -1,6 +1,7 @@
import { NextResponse } from "next/server";
import { auth } from "@/lib/auth";
import { prisma } from "@/lib/prisma";
import { dispatchWebhook } from "@/lib/webhooks";
export async function GET(req: Request) {
const session = await auth();
@@ -39,5 +40,12 @@ export async function POST(req: Request) {
},
});
const familyId = (session.user as { familyId?: string }).familyId;
if (familyId) {
dispatchWebhook(familyId, "growth.created", {
log: { id: log.id, babyId: log.babyId, date: log.date, weight: log.weight, height: log.height },
}).catch(() => {});
}
return NextResponse.json(log, { status: 201 });
}