mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 01:28:55 +00:00
Trip members can rate a place 1-5 stars; the place shows the average, with a who-voted custom tooltip and a star-sort toggle in the places sidebar. Saved collection places are ratable too (plus a min-rating filter), and ratings travel with a place copied between a trip and a collection — carrying only the votes of users who belong to both sides. Adds a full Collections MCP surface (list/get, CRUD lists + places, status, rate_collection_place, labels, sharing, copy-to-trip) under a new collections:read/collections:write scope, plus rate_place for trip places; rating aggregates flow through the existing place outputs. Mobile trip + collection place sheets gain the rating row. New UI strings translated across all 22 locales.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { placeCategorySchema } from '../place/place.schema';
|
||||
import { placeCategorySchema, placeRatingVoteSchema } from '../place/place.schema';
|
||||
import { tagSchema } from '../tag/tag.schema';
|
||||
|
||||
import { z } from 'zod';
|
||||
@@ -70,6 +70,10 @@ export const collectionPlaceSchema = z.object({
|
||||
tags: z.array(tagSchema.partial()).optional(),
|
||||
/** Ids of the per-collection labels assigned to this place. */
|
||||
label_ids: z.array(z.number()).optional(),
|
||||
// Collaborative ratings (#1435): every member's vote + the displayed aggregate.
|
||||
ratings: z.array(placeRatingVoteSchema).optional(),
|
||||
rating_avg: z.number().nullable().optional(),
|
||||
rating_count: z.number().optional(),
|
||||
});
|
||||
export type CollectionPlace = z.infer<typeof collectionPlaceSchema>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user