No reviewers
Labels
No labels
app/archiv
app/einkaufslisten
app/imap-client
app/wissensbasis
arch-answered
arch-question
area/api
area/auth
area/infra
area/mobile
area/shared
area/ui
area/web
portfolio-status
prio/high
prio/low
prio/medium
roadmap/public
size/l
size/m
size/s
size/xl
size/xs
status/blocked
status/needs-info
type/bug
type/chore
type/docs
type/feature
type/idea
type/refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
admin-mrrm/mrrmlabapp!367
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/366-habit-source"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Phase 4 von Epic #360 (Day-Planner Multi-Source-Todo).
Habits sind die erste zeitgetriebene Source — Mail/Tracking reagieren auf externe Ereignisse, Habits feuern wenn ein Termin in der Zukunft erreicht ist.
habitsmittitle,recurrenceDays,anchorDate,nextDueAt,lastSpawnedAt,completionPolicy(Migration0019)HabitsServicemit Owner-Check für list/create/update/deleteHabitsController—POST/GET/PATCH/DELETE /habitsHabitCandidateWriterService.spawnDueCandidates(now):nextDueAt <= nowcandidatemitsource='habit',sourceRef=${habitId}:${YYYY-MM-DD}(Idempotenz pro Habit pro Fälligkeitstag)ON CONFLICT DO NOTHING→ mehrfacher Cron-Run am selben Tag erzeugt keinen DuplicateHabitSpawnerCron(stündlich, abschaltbar viaHABIT_SPAWN_DISABLED=true, Cron-Expression überHABIT_SPAWN_CRON)Tests
HabitsService(7 Tests),HabitCandidateWriterService(5 Tests)nextDueAt-Advance, IdempotenzOut of scope (folgt später)
Bezug
Test plan
pnpm typecheck/pnpm lint/pnpm test(387 Tests) /pnpm test:integration(69 Tests) grünHABIT_SPAWN_DISABLED=truein Tests deaktivierbar🤖 Generated with Claude Code
Habits sind die erste zeitgetriebene Source: ein HabitSpawner-Cron findet faellige Habits (nextDueAt <= now) und schreibt einen Candidate pro Habit pro Faelligkeitstag. sourceRef = `${habitId}:${YYYY-MM-DD}` macht das idempotent gegen mehrfache Cron-Runs am selben Tag; nach erfolgreichem Insert wird nextDueAt um recurrenceDays vorgerueckt. - Neue Tabelle habits (Migration 0019): title, recurrenceDays, anchorDate, nextDueAt, lastSpawnedAt, completionPolicy - HabitsService mit list/create/update/delete (Owner-Check) - HabitsController (POST/GET/PATCH/DELETE /habits) - HabitCandidateWriterService.spawnDueCandidates(now) - HabitSpawnerCron mit HABIT_SPAWN_CRON / HABIT_SPAWN_DISABLED env-flags - 12 Unit-Tests, 5 Integration-Tests (End-to-End-Spawn + Idempotenz) Out of scope: Habit-UI, RRULE-faehige Recurrence, Suggestions aus Verhaltens-Memory. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>