feat(places): tags on places, owned by the trip

A place keeps its one category, which decides its marker, and can now carry
any number of tags as extra labels to filter by.

- Tags belong to the trip (tags.trip_id): every member sees the same list and
  whoever may edit the trip's places adds, renames and deletes. Personal tags
  stay what they were.
- The place form picks them on desktop and mobile through one shared hook,
  usePlaceTags, and can add a new tag to the trip on the spot.
- The existing category filter of the places list lists the tags as well.
- Tags show on the place (inspector pills, phone place sheet); the marker is
  untouched.
- MCP: create_place, create_and_assign_place and update_place take `tags`,
  and list/create/update/delete_trip_tag manage a trip's tags.
- /api/trips/:tripId/tags and the tripTags:changed event keep every client
  of the trip in step.
This commit is contained in:
Mariano
2026-11-17 06:35:09 +00:00
committed by Maurice
parent e952586f60
commit 33d074c786
108 changed files with 3634 additions and 118 deletions
+11
View File
@@ -0,0 +1,11 @@
import type { TripTagCreateRequest, TripTagListResponse, TripTagResponse } from '@trek/shared';
import apiClient from './client';
/** The tags a trip owns: every member reads them, and whoever may edit its places adds one. */
export const tripTagsApi = {
list: (tripId: number | string): Promise<TripTagListResponse> =>
apiClient.get(`/trips/${tripId}/tags`).then((r) => r.data),
/** Answers the trip's existing tag when it already has one of that name. */
create: (tripId: number | string, body: TripTagCreateRequest): Promise<TripTagResponse> =>
apiClient.post(`/trips/${tripId}/tags`, body).then((r) => r.data),
};