feat: dedicated, versioned shop-sync feed for Wabenhain

GET /api/v1/shop-sync returns exactly the data ApiCore releases to the
shop: harvest facts, article master data and bottlings with their
harvest ids. Every query uses an explicit select, so notes, colonies,
treatments and fields added to the models later never leave ApiCore
unless deliberately added to the allowlist.

- New permission shop-sync:read (granted to ADMIN automatically, to no
  other role): the shop's service account needs nothing else, in
  particular no access to harvest or extraction records with notes.
- contractVersion 1; only breaking changes bump it.
- Always the full set: small volume, and a full comparison heals missed
  runs by itself.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Opus 5.5 committed 2026-09-27 20:31:46 +02:00
1 parent 3c7ff1e0b7
commit ede86c062a
7 files changed
+357 -1

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@ Umgesetzt in Wabenhain `d38f430` (AT: Entscheidungslogik; CR: DB-Ablauf der Serv
## Nächste Schritte
1. ~~Zuständigkeit pro Feld im Sync~~ – erledigt.
2. Eigene, versionierte Sync-Schnittstelle in ApiCore (`GET /api/v1/sync/…`, nur freigegebene Felder, „geändert seit“).
2. ~~Eigene, versionierte Sync-Schnittstelle~~ – erledigt: `GET /api/v1/shop-sync` (Vertragsversion 1, Feld-Allowlist, Berechtigung `shop-sync:read`). Bewusst ohne „geändert seit“: kleine Datenmenge, Voll-Abgleich heilt verpasste Läufe selbst. Wabenhain nutzt sie seit `5642f0c`, mit Rückfall auf die alten Endpunkte bei HTTP 404.
3. Nur-Lese-API-Schlüssel statt Passwort-Login des Service-Kontos.
4. Ende-zu-Ende-Test beider Systeme gegen Test-Instanzen.
5. Merge/Push.