Introduce a CodeResolverService to classify user login codes, complete with detailed resolution logic and usability checks. Extend the sync system to handle conflicts via last-write-wins arbitration, with detailed conflict tracking for review. Update file permissions and runtime isolation in Docker to enhance security.
- ChatChannelType.GRUPPE: created by Leitungsteam (any KC) or a Gemeinde
Verantwortliche/r (own KC), mixing team users and guests/Konfis as
explicit ChatParticipant rows (unlike GEMEINDE_GRUPPE, membership is
not derived from Gemeinde)
- POST /chat/:kcId/gruppen to create, GET participant-candidates, and
POST/DELETE /chat/gruppen/:channelId/participants to manage membership
(creator, LT, or Verantwortliche/r of that KC)
- ChatGateway broadcasts chat:participants-changed on membership change
- PushService updated for nullable ChatParticipant.userId + new
guestAccountId column
- SyncService now replicates ChatParticipant
- Prisma migration + 14 new unit tests (75/75 passing), tsc clean
- CI: add .gitea/workflows/cybedefend-scan.yml + .cybedefend project config
- New VerantwortlicheInvite model: LT-issued invites so a person can
register as Gemeinde Verantwortliche(r) for a specific Gemeinde,
skipping the self-registration approval step.
- Wahl/Workshop/Teilnehmer gain phase support (phasenAnzahl,
beschreibung), mirroring the WP plugin's multi-phase elections.
Teilnehmer unique constraint now scoped per phase.
- Auth: team login + guest auth adjustments, spec coverage.
- sync.service.ts: register VerantwortlicheInvite as a synced model.
- wahl.service.ts: submitTeilnehmer updated for the new phase-scoped
unique key.
- client: login/home screen rework, new theme.dart, FCM web tweaks.
- .gitignore: ignore .DS_Store.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
New global push/ module mirroring mail/ and files/storage/:
- PushProvider abstraction; default LogPushProvider (no delivery, logs),
PUSH_PROVIDER=fcm switches to FcmPushProvider — Firebase Cloud Messaging
HTTP v1, authenticated by a service-account JWT exchanged for an OAuth
token (no extra dependency; jsonwebtoken does the signing). Prunes tokens
FCM reports as invalid.
- DeviceToken model (token + platform, bound to a User or GuestAccount),
migration + added to the sync log.
- POST /api/push/register + /unregister (any of the three token kinds).
- PushService.notifyChannel() resolves a channel's readable audience
(DIREKT participants / LT / Gemeinde members + guests / whole KC for
broadcast), looks up their device tokens (minus the sender), sends.
- ChatService.sendMessage() fires it best-effort after persisting.
New env: PUSH_PROVIDER, FCM_PROJECT_ID (default konfi-castle-app),
GOOGLE_APPLICATION_CREDENTIALS.
Verified against local Postgres: register a token, send a Gemeinde-group
chat message from another member -> log-push logs "would push ... to 1
device". Real FCM send needs the service-account JSON. npm test 56.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Generated with a real local PostgreSQL 16 and applied cleanly
(prisma migrate dev --name init). Covers the full current schema:
Kc, Gemeinde, Role/MembershipStatus enums, User (authentikSub nullable,
passwordHash, kcId, isLeitungsteam), Membership.status, GuestAccount,
TeamerInvite, Wahl/Workshop/Teilnehmer/ForceZuteilung/Zuteilung, File,
Chat*, Sync* .
Backend boots against the real DB and the smoke-tested routes (/, guest
login, onboarding invite lookup, protected /api/kc) behave correctly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>