Auto-populate activity log from timer events with edit and delete
- New GET /api/logs/timeline endpoint joins TimerEvent with block/subject/session data
- New PATCH and DELETE /api/logs/timeline/{id} endpoints for editing/removing events
- LogView redesigned as a chronological timeline grouped by date
- Edit inline: timer events support type + time correction; notes support text edit
- Delete works for both auto events and manual notes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from datetime import date
|
||||
from datetime import date, datetime
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
@@ -27,3 +27,21 @@ class ActivityLogOut(BaseModel):
|
||||
duration_minutes: int | None
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class TimelineEventUpdate(BaseModel):
|
||||
event_type: str | None = None
|
||||
occurred_at: datetime | None = None
|
||||
|
||||
|
||||
class TimelineEventOut(BaseModel):
|
||||
id: int
|
||||
event_type: str
|
||||
occurred_at: datetime
|
||||
session_date: date
|
||||
child_id: int
|
||||
child_name: str
|
||||
block_label: str | None = None
|
||||
subject_name: str | None = None
|
||||
subject_icon: str | None = None
|
||||
subject_color: str | None = None
|
||||
|
||||
Reference in New Issue
Block a user