Files
ketopath/apps/api/package.json
T
lucianoandClaude Opus 4.7 83bab7b6d5 feat: §5.2 finale — aderenza piano + export PDF
§5.2.5 Aderenza al piano alimentare
- MealSlot.consumed Boolean + consumedAt DateTime? (migration)
- POST /me/meal-plans/slots/:id/consumed (toggle, idempotente con body opzionale)
- @ketopath/shared/planner/adherence: computeAdherence() su slot dei giorni
  passati, free-meal contati come "rispettati"
- /plan: bottone ✓ in ogni SlotCard (oliva quando attivo) + 5° card nel
  summary settimanale "Aderenza: X% (n/m)"

§5.2.6 Export PDF per medico/nutrizionista
- pdfkit (Node, no headless Chrome) + @types/pdfkit
- GET /me/tracking/export.pdf: profilo, storico peso (30 entries),
  piano corrente con aderenza, footer con disclaimer medico
- Proxy Next.js /api/tracking-export per same-origin + cookie sessione
- /tracking: link "Esporta PDF per medico/nutrizionista" sotto subtitle

Schema migration: add_meal_slot_consumed.

81/81 unit test verdi. Lint, typecheck verdi.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:01:28 +02:00

41 lines
1.0 KiB
JSON

{
"name": "@ketopath/api",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "tsx watch --env-file=.env src/server.ts",
"build": "tsc",
"start": "node dist/server.js",
"typecheck": "tsc --noEmit",
"lint": "eslint src --max-warnings=0"
},
"dependencies": {
"@fastify/cors": "^9.0.1",
"@fastify/helmet": "^11.1.1",
"@fastify/rate-limit": "^9.1.0",
"@fastify/sensible": "^5.6.0",
"@ketopath/auth": "workspace:*",
"@ketopath/db": "workspace:*",
"@ketopath/shared": "workspace:*",
"@sentry/node": "^8.30.0",
"better-auth": "^1.0.21",
"fastify": "^4.28.1",
"fastify-plugin": "^4.5.1",
"node-cron": "^3.0",
"pdfkit": "^0.15",
"web-push": "^3.6",
"zod": "^3.23.8"
},
"devDependencies": {
"@ketopath/eslint-config": "workspace:*",
"@ketopath/tsconfig": "workspace:*",
"@types/node": "^20.12.7",
"@types/node-cron": "^3.0",
"@types/pdfkit": "^0.13",
"@types/web-push": "^3.6",
"pino-pretty": "^11.2.1",
"tsx": "^4.16.2"
}
}