Files
famapp/docs/tasks/22-activity-log.md
ginnoir b89690a9f2 Initial scaffold: tooling, plan, task briefs
- pnpm 10 workspace + TypeScript strict + ESLint flat + Prettier
- CLAUDE.md as canonical brief
- docs/tasks/ — 22 task briefs broken out by phase for sub-sessions
- docs/decisions/ — ADR scaffold

Implements task 01 (repo-init).
2026-05-06 00:05:50 -05:00

27 lines
983 B
Markdown

# 22 — Activity log
## Goal
Generic activity feed every module writes to and the dashboard reads from.
## Depends on
- 10, 11, 12
## Scope
- Schema: `activity_log` (`id`, `household_id`, `entity_type`, `entity_id`, `actor_id`, `action`, `payload` jsonb, `created_at`). Index on `(household_id, created_at desc)`.
- `_core` exports `logActivity({ entityType, entityId, action, payload })`. Reads `householdId` and `actorId` from current session.
- Calendar/lists/notes modules call it on create/update/delete.
- Dashboard widget `core.activity` shows last 20 entries with human-readable rendering. Each entity type's manifest provides a `renderActivity(entry)` function.
## Out of scope
- Per-user activity filters.
- Retention / pruning (no growth concerns at two-user scale).
## Acceptance criteria
- [ ] Every CRUD across the three core modules writes a row.
- [ ] Widget renders entries via the registry — no `if (entityType === ...)` branches in the widget itself.