feat: T4 wave 3 - notifications per user, suggestions API, varroa bands, split/queen events

- Schema III: per-user notifications (broadcast fan-out migration,
  category, link, requiredPermissions filter), notification preferences
  and settings endpoints, calendar withdrawal switch, occupiedFrames
- Suggestions API: list/summary with permission visibility and paging,
  accept/dismiss/reopen incl. bulk, SuggestionView on all responses
- Varroa traffic light by season and method, young colonies, treatment
  effect window, sample-based percentage; shared withdrawal-window helper
  on Berlin calendar days; GET /varroa-measurements/thresholds
- ColonySplit and QueenAssigned domain events with calendar and webhook
  handlers
- Outbox claims compare against now() rounded to timestamp(3); fixes the
  flaky e2e claims of rows written with SQL now()

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Opus 5.5 committed 2026-10-14 14:25:24 +02:00
1 parent d99a697739
commit f468dc5f75
87 files changed
+6022 -510

No files matched your search

@@ -174,10 +174,10 @@ describe('daily evaluation rules', () => {
}),
).toBe('2026-10-12'));
it('ends on the treatment day itself without a waiting time and ignores the time of day', () =>
it('ends on the treatment day itself without a waiting time and uses the Berlin day, ignoring the time of day', () =>
expect(
withdrawalEndDay({
date: new Date('2026-09-28T22:15:00.000Z'),
date: new Date('2026-09-28T22:15:00+02:00'),
endDate: null,
withdrawalPeriodDays: 0,
}),
@@ -12,6 +12,7 @@ import { inspectionDueOn } from '../season/inspection-due';
import { isQueenAged } from '../season/queen-age';
import type { SeasonService } from '../season/season.service';
import { varroaMeasurementDue } from '../season/varroa-due';
import { withdrawalUntilDay } from '../treatments/withdrawal-window';
/** How many days back a run still records an occurrence it missed. */
export const CATCH_UP_DAYS = 7;
@@ -82,10 +83,7 @@ function dayAfter(date: Date, days: number): Date {
export function withdrawalEndDay(
t: Pick<Treatment, 'date' | 'endDate' | 'withdrawalPeriodDays'>,
): string | null {
if (t.withdrawalPeriodDays === null) {
return null;
}
return utcDay(dayAfter(t.endDate ?? t.date, t.withdrawalPeriodDays));
return withdrawalUntilDay(t);
}
/** True for a 'YYYY-MM-DD' day from today − CATCH_UP_DAYS up to today. */