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>
This commit is contained in:
Ullrich Schäfer 2026-06-12 14:11:41 +02:00
parent ee76945f20
commit 2cb32cd2d3
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
25 changed files with 328 additions and 18 deletions

View file

@ -365,6 +365,28 @@ export default {
delete: "Aktivität löschen",
deleteConfirm: "Möchtest du diese Aktivität wirklich löschen?",
importedFrom: "Importiert von {{provider}}",
sport: {
label: "Sportart",
unspecified: "Nicht angegeben",
hike: "Wandern",
walk: "Gehen",
run: "Laufen",
ride: "Radfahren",
gravel: "Gravel",
mtb: "Mountainbike",
ski: "Ski",
other: "Sonstiges",
verb: {
hike: "war wandern",
walk: "war spazieren",
run: "war laufen",
ride: "war Rad fahren",
gravel: "war Gravel fahren",
mtb: "war Mountainbiken",
ski: "war Ski fahren",
other: "hat eine Aktivität erfasst",
},
},
sortByDate: "Aktivitätsdatum",
sortByAdded: "Hinzugefügt am",
visibility: {

View file

@ -365,6 +365,28 @@ export default {
delete: "Delete Activity",
deleteConfirm: "Are you sure you want to delete this activity?",
importedFrom: "Imported from {{provider}}",
sport: {
label: "Sport",
unspecified: "Unspecified",
hike: "Hike",
walk: "Walk",
run: "Run",
ride: "Ride",
gravel: "Gravel",
mtb: "Mountain bike",
ski: "Ski",
other: "Other",
verb: {
hike: "went hiking",
walk: "went for a walk",
run: "went for a run",
ride: "went for a ride",
gravel: "went gravel riding",
mtb: "went mountain biking",
ski: "went skiing",
other: "logged an activity",
},
},
sortByDate: "Activity date",
sortByAdded: "Date added",
visibility: {