feat(journal): add per-user mood journal module (task 86)

Ship journal entries with mood tracking, insights, and Recharts charts.

Adds v1 API endpoints per ADR 0005 and migration 0020_journal_entries.
This commit is contained in:
ginnoir
2026-07-04 19:41:15 -05:00
parent 8e2ddd6b72
commit 04ae809e07
34 changed files with 1889 additions and 6 deletions
+90
View File
@@ -152,6 +152,32 @@ components:
pinned: { type: boolean, default: false }
remindAt: { type: string, format: date-time, nullable: true }
JournalEntry:
type: object
properties:
id: { type: string, format: uuid }
householdId: { type: string, format: uuid }
userId: { type: string, format: uuid }
recordedAt: { type: string, format: date-time }
title: { type: string, nullable: true }
body: { type: string }
moods: { type: array, items: { type: string } }
stress: { type: integer, minimum: 1, maximum: 10, nullable: true }
pillsTaken: { type: boolean, nullable: true }
createdAt: { type: string, format: date-time }
updatedAt: { type: string, format: date-time }
JournalEntryInput:
type: object
required: [recordedAt]
properties:
recordedAt: { type: string, format: date-time }
title: { type: string, nullable: true }
body: { type: string, default: "" }
moods: { type: array, items: { type: string }, default: [] }
stress: { type: integer, minimum: 1, maximum: 10, nullable: true }
pillsTaken: { type: boolean, nullable: true }
GardenContainer:
type: object
properties:
@@ -820,10 +846,74 @@ paths:
application/json:
schema: { $ref: "#/components/schemas/OkResponse" }
/api/v1/journal/entries:
get:
summary: List journal entries for the authenticated user
tags: [Journal]
responses:
"200":
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/JournalEntry" }
post:
summary: Create journal entry
tags: [Journal]
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/JournalEntryInput" }
responses:
"201":
content:
application/json:
schema: { $ref: "#/components/schemas/JournalEntry" }
/api/v1/journal/entries/{id}:
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
get:
summary: Get journal entry
tags: [Journal]
responses:
"200":
content:
application/json:
schema: { $ref: "#/components/schemas/JournalEntry" }
patch:
summary: Update journal entry
tags: [Journal]
requestBody:
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/JournalEntryInput"
description: All fields optional
responses:
"200":
content:
application/json:
schema: { $ref: "#/components/schemas/JournalEntry" }
delete:
summary: Delete journal entry
tags: [Journal]
responses:
"200":
content:
application/json:
schema: { $ref: "#/components/schemas/OkResponse" }
tags:
- name: Calendars
- name: Events
- name: Lists
- name: Notes
- name: Journal
- name: Garden
- name: Bangs