trails/packages/api/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
..
activities.ts activity-sport-type: schema, contract, write/read paths, federation 2026-06-12 14:11:41 +02:00
auth.ts Modernise zod idioms to v4 2026-04-19 11:41:03 +02:00
discovery.ts Modernise zod idioms to v4 2026-04-19 11:41:03 +02:00
endpoints.ts Add @trails-cool/api package with Zod schemas for REST API contract 2026-04-12 22:49:30 +02:00
errors.ts fix: enforce Terms gate on bearer-token API requests 2026-05-08 01:59:28 +02:00
index.test.ts Standardize monorepo pipeline: test, lint, typecheck across all workspaces 2026-04-13 00:00:43 +02:00
index.ts activity-sport-type: schema, contract, write/read paths, federation 2026-06-12 14:11:41 +02:00
pagination.ts Add @trails-cool/api package with Zod schemas for REST API contract 2026-04-12 22:49:30 +02:00
routes.ts one source of truth for Route/Activity shapes; enforce api contracts 2026-06-10 07:39:50 +02:00
uploads.test.ts security: authorize and validate presigned upload requests 2026-06-10 22:23:14 +02:00
uploads.ts security: authorize and validate presigned upload requests 2026-06-10 22:23:14 +02:00
version.ts Add @trails-cool/api package with Zod schemas for REST API contract 2026-04-12 22:49:30 +02:00