trails/packages/db/src
Ullrich Schäfer 2cb32cd2d3
activity-sport-type: schema, contract, write/read paths, federation
Implements the activity-sport-type change (specs/activity-sport-type):

- db: nullable `sport_type` column on journal.activities + SportType /
  SPORT_TYPES (text().$type<> convention).
- api: optional sportType on the activity read + create schemas (mirrored
  SPORT_TYPES; @trails-cool/api stays zod-only).
- write: ActivityInput + createActivity persist it; mapSportType() normalizes
  provider strings (Komoot bulk import passes tour.sport; Garmin unset);
  threaded through the unified importActivity.
- read/display: sportType added to the detail/feed/profile loaders and the v1
  REST endpoints; shared SportBadge (glyph + i18n label) on detail, feed, and
  profile; sport-aware feed verb; create-form <select>.
- i18n: journal.activities.sport.* (labels + verbs) in en + de.
- federation: `sport` PropertyValue on the Note when set.

Tests: mapSportType unit table; federation asserts the sport attachment is
present when set and omitted when unset. typecheck + lint + unit all green.
E2E (create→badge) still to add.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 14:11:41 +02:00
..
schema activity-sport-type: schema, contract, write/read paths, federation 2026-06-12 14:11:41 +02:00
get-database-url.test.ts fix(journal): fail loud in production when secrets are unset 2026-05-24 11:37:20 +02:00
index.test.ts Add tests to all packages, remove passWithNoTests 2026-04-13 00:48:27 +02:00
index.ts fix: add E2E opt-out for fail-loud secret/DB-URL guards 2026-05-24 11:45:09 +02:00
migrate-data.ts fix(journal): fail loud in production when secrets are unset 2026-05-24 11:37:20 +02:00