M9.1: wire sync logging into all mutation paths

- Add LogClosedDayDelete and LogClosedWeekDelete to SyncStore
- Inject syncStore into EntryService; log Start, Stop, StopByID,
  Update, CreateInterval, Delete, AutoStopStalledEntries
- Inject syncStore into DayService; log CloseDay, MarkDay, ReopenDay,
  and the recomputeWeek closed-week upsert
- Inject syncStore into SettingsService; log Upsert, UpdateSettings,
  DeleteSettings
- Add LogClosedWeek/LogClosedWeekDelete calls in WeekService.CloseWeek
  and ReopenWeek
- Update main.go and all service test helpers for new constructor signatures
- All Go tests and 19 Vitest tests pass
This commit is contained in:
2026-04-30 22:57:02 +02:00
parent d8366f5c25
commit a8a4ea0d4f
9 changed files with 82 additions and 30 deletions

View File

@@ -238,6 +238,7 @@ func (s *WeekService) CloseWeek(ctx context.Context, weekKey string) (*domain.Cl
if err := s.closedWeeks.Upsert(ctx, cw); err != nil {
return nil, err
}
_ = s.syncStore.LogClosedWeek(ctx, cw)
return cw, nil
}
@@ -254,7 +255,11 @@ func (s *WeekService) ReopenWeek(ctx context.Context, weekKey string) error {
if existing == nil {
return ErrWeekNotClosed
}
return s.closedWeeks.Delete(ctx, weekKey)
if err := s.closedWeeks.Delete(ctx, weekKey); err != nil {
return err
}
_ = s.syncStore.LogClosedWeekDelete(ctx, weekKey)
return nil
}
// ListWeeks returns closed weeks within a range.