feat: platform backbone and field capture complete (checkpoint)

Platform backbone (plan 2026-10-13-plattform-rueckgrat), all tasks reviewed:
- webhooks with delivery table, retries and stable delivery id
- calendar handlers; a finished task removes its Outlook event
- tasks, automations, inspections, varroa, treatments, feedings,
  harvests, colonies, wintering, stock and bottling record domain events
  in the same transaction; legacy post-commit calls removed
- row locks through one helper (lockRowForUpdate, lockRowsForShare,
  lockRowsForUpdate)
- job framework with JobRun, cli exit codes, cleanup, task templates,
  daily evaluation, hourly app-backup and the rekey job
- system API and page "Verwaltung > System" with retry
- @nestjs/schedule removed, guard tests against in-process schedulers

Field capture T3 (plan 2026-10-13-t3-erfassung-am-stand), all tasks reviewed:
- inspection photo offline without metadata
- bulk capture for treatments, feedings and varroa (backend + frontend)
- offline stand mode with service worker, offline pages and packs
- offline session, cold start and logout on shared devices

Docs: ARCHITECTURE.md assumptions and sections updated, TASKS.md.
Gates: backend lint, typecheck, 1770 unit, 420 e2e, build, no schema
drift; frontend lint, typecheck, 913 tests, build. Not rolled out.

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 11:36:38 +02:00
1 parent c01a38835a
commit cdd30cf3ee
288 files changed
+39165 -2853

No files matched your search

@@ -2,6 +2,8 @@ import { reportRequestOutcome } from "../offline/connectivity";
export const DEFAULT_TIMEOUT_MS = 4_000; // GET and writes with Idempotency-Key
export const NON_IDEMPOTENT_WRITE_TIMEOUT_MS = 15_000;
/** A bulk POST writes up to 100 records in one server transaction (15 s allowed there). */
export const BULK_WRITE_TIMEOUT_MS = 15_000;
export const UPLOAD_TIMEOUT_MS = 30_000;
export const DOWNLOAD_TIMEOUT_MS = 60_000;
@@ -12,6 +14,12 @@ export function timeoutFor(method: string, headers: HeadersInit | undefined): nu
return NON_IDEMPOTENT_WRITE_TIMEOUT_MS;
}
function isBulkPost(input: RequestInfo | URL, method: string | undefined): boolean {
if ((method ?? "GET").toUpperCase() !== "POST") return false;
const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
return /\/bulk(?:[?#]|$)/.test(url);
}
// Statuses that must not carry a body when a Response is rebuilt.
const NULL_BODY_STATUSES = new Set([101, 204, 205, 304]);
@@ -86,8 +94,11 @@ export async function fetchReportingOutcome(
input: RequestInfo | URL,
init: RequestInit & { timeoutMs: number },
): Promise<Response> {
const timeoutMs = isBulkPost(input, init.method)
? Math.max(init.timeoutMs, BULK_WRITE_TIMEOUT_MS)
: init.timeoutMs;
try {
const response = await fetchWithTimeout(input, init);
const response = await fetchWithTimeout(input, { ...init, timeoutMs });
reportRequestOutcome("reached-server");
return response;
} catch (error) {