hellth-hub/packages
Sebastian Mayer 2dfc770950 Feature: Fremdprofil-API (publicProfileByHandle) + Handle-Slug-Helfer
Backend fuer oeffentliche Community-Fremdprofile (Stufe 2 der Roadmap).

handle.ts:
- handleToSlug: KochHeld#A23B -> KochHeld-A23B (URL-tauglich, '#' geht
  nicht im Pfad).
- parseHandleSlug: zerlegt am LETZTEN Bindestrich (Username darf Bindestriche
  enthalten), validiert Username + Discriminator gegen das Alphabet.

users.publicProfileByHandle (protectedProcedure):
- DATENSCHUTZ: liefert nur bei profileVisible=true, sonst NOT_FOUND (privates
  und nicht existierendes Profil sind von aussen ununterscheidbar).
- Strikte Feld-Whitelist: handle, username, discriminator, bio, image.
  NIEMALS Art.-9-Daten (Gewicht/Kalorien/Ziele), keine Kontakt-/Auth-Felder.
- Aggregat-Punkte gesamt + 30 Tage aus activity_logs.points, plus
  anonymisierte Aktivitaets-Streak (distinkte aktive Tage der letzten 7).

Tests (node:test): 9 Slug-Tests + 6 Endpoint-Tests (sichtbar, Leak-Schutz,
NOT_FOUND bei privat/unbekannt/ungueltigem Slug, Auth-Pflicht).
Verifiziert: 75 API-Tests gruen, Typecheck 3/3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 12:50:50 +02:00
..
api Feature: Fremdprofil-API (publicProfileByHandle) + Handle-Slug-Helfer 2026-05-30 12:50:50 +02:00
db Feature: Community-Profil-Fundament (Handle, Bio, Sichtbarkeit) - Backend 2026-05-30 11:57:24 +02:00