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

@@ -6,6 +6,7 @@ import {
IsNumber,
IsOptional,
IsString,
Max,
Min,
} from 'class-validator';
import { VarroaMethod } from '../../../generated/prisma';
@@ -35,6 +36,18 @@ export class CreateVarroaMeasurementDto {
@Min(0)
miteCount?: number;
@ApiPropertyOptional({
description:
'Sample size in bees (powdered sugar, washing); the percentage is mites / sample * 100.',
minimum: 1,
maximum: 2000,
})
@IsOptional()
@IsInt()
@Min(1)
@Max(2000)
sampleBees?: number;
@ApiPropertyOptional()
@IsOptional()
@IsNumber()
@@ -0,0 +1,29 @@
import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsOptional, IsString, Matches, MaxLength } from 'class-validator';
const MAX_ID_LENGTH = 64;
const DAY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
/**
* GET /varroa-measurements/thresholds. The date is only shape-checked here;
* an impossible day (2026-02-30) is rejected by the service.
*/
export class VarroaThresholdsQuery {
@ApiPropertyOptional({
description: 'Volk, für dessen Typ die Bänder gelten',
})
@IsOptional()
@IsString()
@MaxLength(MAX_ID_LENGTH)
@Matches(/^[A-Za-z0-9_-]+$/, { message: 'colonyId ist ungültig' })
colonyId?: string;
@ApiPropertyOptional({
description: 'Messtag (JJJJ-MM-TT), ohne Angabe heute (Berlin)',
example: '2026-08-10',
})
@IsOptional()
@IsString()
@Matches(DAY_PATTERN, { message: 'date muss ein Tag (JJJJ-MM-TT) sein' })
date?: string;
}