feat(events): PR-1 Events Core — schema + ORM + 최소 API #5

Merged
hyungi merged 1 commits from feat/events-core into main 2026-05-11 07:26:31 +09:00
Owner

개인 운영 로그 / 일정 / 할 일 / 회고용 1차 컨테이너 도메인 신설.
plan: ~/.claude/plans/beszel-tingly-sloth.md (라운드 12 v6).

Schema:

  • enum 5종 (event_kind / event_status / event_source / event_actor / history_change_kind)
  • events 테이블: kind(task|calendar_event|activity_log) + lifecycle 7-state status
  • events_history: lifecycle op 자동 기록, FK RESTRICT (이력은 시점 사실)
  • CHECK: calendar_event → start_at NOT NULL / activity_log → started_at|ended_at NOT NULL
  • partial unique (source, source_ref) — 외부 source dedup (PR-4 활용)
  • partial index (active status / activity_log timeline)

API:

  • POST /api/events (kind=activity_log shortcut: status=done + ended_at=now() default)
  • GET /api/events/{id} | /api/events?kind&status&from&to&project_tag&source
  • PATCH /api/events/{id} (extra=forbid + 시간 필드 변경 시 reschedule history)
  • POST /api/events/{id}/{complete,cancel,defer,reactivate} (history 자동)
  • GET /api/events/today (Asia/Seoul default, deferred 는 defer_until<=now() 만)
  • GET /api/events/inbox | /api/events/activity?from&to

제외 (PR-2~5 또는 백로그):

  • DELETE (회고 데이터 → /cancel 일관화)
  • log shortcut / upcoming endpoint (POST + GET ?from&to 로 흡수)
  • /ingest (PR-4 MailPlus forward 시 정확한 요구로 추가)
  • iCal export / ntfy 알림 / recurrence / 일반 edit history
개인 운영 로그 / 일정 / 할 일 / 회고용 1차 컨테이너 도메인 신설. plan: ~/.claude/plans/beszel-tingly-sloth.md (라운드 12 v6). Schema: - enum 5종 (event_kind / event_status / event_source / event_actor / history_change_kind) - events 테이블: kind(task|calendar_event|activity_log) + lifecycle 7-state status - events_history: lifecycle op 자동 기록, FK RESTRICT (이력은 시점 사실) - CHECK: calendar_event → start_at NOT NULL / activity_log → started_at|ended_at NOT NULL - partial unique (source, source_ref) — 외부 source dedup (PR-4 활용) - partial index (active status / activity_log timeline) API: - POST /api/events (kind=activity_log shortcut: status=done + ended_at=now() default) - GET /api/events/{id} | /api/events?kind&status&from&to&project_tag&source - PATCH /api/events/{id} (extra=forbid + 시간 필드 변경 시 reschedule history) - POST /api/events/{id}/{complete,cancel,defer,reactivate} (history 자동) - GET /api/events/today (Asia/Seoul default, deferred 는 defer_until<=now() 만) - GET /api/events/inbox | /api/events/activity?from&to 제외 (PR-2~5 또는 백로그): - DELETE (회고 데이터 → /cancel 일관화) - log shortcut / upcoming endpoint (POST + GET ?from&to 로 흡수) - /ingest (PR-4 MailPlus forward 시 정확한 요구로 추가) - iCal export / ntfy 알림 / recurrence / 일반 edit history
hyungi added 1 commit 2026-05-11 07:25:39 +09:00
개인 운영 로그 / 일정 / 할 일 / 회고용 1차 컨테이너 도메인 신설.
plan: ~/.claude/plans/beszel-tingly-sloth.md (라운드 12 v6).

Schema:
- enum 5종 (event_kind / event_status / event_source / event_actor / history_change_kind)
- events 테이블: kind(task|calendar_event|activity_log) + lifecycle 7-state status
- events_history: lifecycle op 자동 기록, FK RESTRICT (이력은 시점 사실)
- CHECK: calendar_event → start_at NOT NULL / activity_log → started_at|ended_at NOT NULL
- partial unique (source, source_ref) — 외부 source dedup (PR-4 활용)
- partial index (active status / activity_log timeline)

API:
- POST /api/events (kind=activity_log shortcut: status=done + ended_at=now() default)
- GET /api/events/{id} | /api/events?kind&status&from&to&project_tag&source
- PATCH /api/events/{id} (extra=forbid + 시간 필드 변경 시 reschedule history)
- POST /api/events/{id}/{complete,cancel,defer,reactivate} (history 자동)
- GET /api/events/today (Asia/Seoul default, deferred 는 defer_until<=now() 만)
- GET /api/events/inbox | /api/events/activity?from&to

제외 (PR-2~5 또는 백로그):
- DELETE (회고 데이터 → /cancel 일관화)
- log shortcut / upcoming endpoint (POST + GET ?from&to 로 흡수)
- /ingest (PR-4 MailPlus forward 시 정확한 요구로 추가)
- iCal export / ntfy 알림 / recurrence / 일반 edit history
hyungi merged commit dc96d2b298 into main 2026-05-11 07:26:31 +09:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hyungi/hyungi_document_server#5