Add plan_draft schedule drafting next week (Feature 20)
Register plan.Service.DraftSchedule() as the plan_draft schedule: at the
household's plan_draft_dow/time it runs StartScheduledDraft for the ISO
week after the fire date (period plan_draft:YYYY-Www of that week), which
enqueues the same draft_week job as POST /plans/{weekStart}/draft. A
stored draft emits plan_ready:{weekStart} from the job; an AI failure is
recorded in ai_runs and emits nothing. A week that already has a plan is
left as it is.
Fake-clock tests in internal/scheduler cover drafting when absent,
skipping when present, no duplicate after restart, the AI failure path
and a settings change without restart.
Maestro task 598184a8-56fe-4ed8-887b-7780c0aebf12.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -195,6 +195,9 @@ func run(cfg config.Config, logger *slog.Logger) error {
|
||||
if err := sched.Register(suggestSvc.WeeklySchedule()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := sched.Register(planSvc.DraftSchedule()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
router, err := server.NewRouter(logger, version, cfg.TrustedProxy, authFlow, sessions, settings, search, ai, chatSvc, dinnerSvc, suggestSvc, planSvc, shopSvc, googleSvc, pushSvc, ideasSvc, runner, photos, frontend.Assets())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user