feat: implement Event Log Projection & View (Step 8.2)

- Add migration 0008 for event_log_by_location table with cap trigger
- Create EventLogProjection for location-scoped event summaries
- Add GET /event-log route with location_id filtering
- Create event log templates with timeline styling
- Register EventLogProjection in eggs, feed, and move routes
- Cap events at 500 per location (trigger removes oldest)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-30 15:15:06 +00:00
parent 8e155080e4
commit bce4d099c9
14 changed files with 1355 additions and 10 deletions

14
PLAN.md
View File

@@ -317,13 +317,13 @@ Check off items as completed. Each phase builds on the previous.
- [x] **Commit checkpoint**
### Step 8.2: Event Log Projection & View
- [ ] Create migration for event_log_by_location table with cap trigger
- [ ] Create `projections/event_log.py` for event summaries
- [ ] Create `web/routes/events.py`:
- [ ] GET /event-log?location_id=...
- [ ] Create `web/templates/events.py`
- [ ] Write tests: events appear, capped at 500, ordered by ts_utc DESC
- [ ] **Commit checkpoint**
- [x] Create migration for event_log_by_location table with cap trigger
- [x] Create `projections/event_log.py` for event summaries
- [x] Create `web/routes/events.py`:
- [x] GET /event-log?location_id=...
- [x] Create `web/templates/events.py`
- [x] Write tests: events appear, capped at 500, ordered by ts_utc DESC
- [x] **Commit checkpoint**
### Step 8.3: Animal Detail Drawer
- [ ] Create `web/routes/animals.py`: