mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-21 06:26:26 +00:00
2203ff3a2e
A city walk now shows, at each stop, when the walk gets there, until when the stay lasts, and what the stop's opening hours say about that visit. The same lines appear under each stop row in the planner and under each stop in the walk's detail, in the user's 12 or 24 hour format. A conflict names the stop, the arrival, the end of the stay and the hours it was checked against, for instance "Lenbachhaus closes at 18:00, during the stay from 17:20 to 18:20 (open 10:00 to 18:00)", in the warning colour. Nothing is changed by these hints: no stop, order or route moves. The times belong to one day the walk is on. Opened from a day of the plan, the detail keeps that day, and checking stops off stays bound to it. Opened otherwise, and in the planner, a small pill above the stops names the day and its start, and the walk's other days can be picked from it; it starts on the first day with a start time. The pick is only what is looked at and is never saved, and another day never takes over the times quietly. Without a day, a date or a start time the line says what is missing and no arrival is shown. TREK keeps no time zone on a trip, so start, arrivals and opening hours are all read as the local time of the plan, and an arrival after midnight is said to be on the next day without being checked. Opening hours come from the trip place a stop stands for, as the travellers entered them, and otherwise from OpenStreetMap; a pill at each stop names the source, and a notice says the hours are a hint to check. A stop without hours stays unknown and is never shown as open, hours that are not in a plain form are shown as written, and an arrival that is only a lower bound, because a stay before it is not entered yet, is not judged unless no later arrival could escape the conflict. A trip place that a stop stands for also gives the stop its name before "Stop N". The arrival at a stop is found where the route passes it in the walk's order, so the end of a loop and a stop passed on the way out and back get the right time. The rules live once in the shared package, for the server to give the same answers. The walk's detail reads its stops again after a save, its own or a teammate's.
146 lines
6.2 KiB
TypeScript
146 lines
6.2 KiB
TypeScript
/**
|
|
* @trek/shared — single source of truth for TREK's API contracts.
|
|
*
|
|
* Zod schemas defined here are consumed by BOTH the server (validation +
|
|
* inferred DTO types) and the client (typed requests/responses). A route is
|
|
* only considered "migrated" once its contract lives in this package.
|
|
*
|
|
* Layout: one folder per domain (e.g. src/trip/trip.schema.ts), plus the
|
|
* domain-agnostic primitives below. See the board card "Module blueprint".
|
|
*/
|
|
export * from './common/primitives.schema';
|
|
export * from './common/pagination.schema';
|
|
export * from './common/compare';
|
|
|
|
// Domain contracts
|
|
export * from './weather/weather.schema';
|
|
export * from './weather/wind.schema';
|
|
export * from './paddle/paddle-obstacles.schema';
|
|
export * from './paddle/paddle-route-relation';
|
|
export * from './paddle/paddle-regions.schema';
|
|
export * from './paddle/paddle-route.schema';
|
|
export * from './public-api/public-api.schema';
|
|
export * from './airport/airport.schema';
|
|
export * from './config/config.schema';
|
|
export * from './system-notice/system-notice.schema';
|
|
export * from './maps/maps.schema';
|
|
export * from './maps/place-shadow.schema';
|
|
export * from './maps/route-usage.schema';
|
|
export * from './category/category.schema';
|
|
export * from './tag/tag.schema';
|
|
export * from './notification/notification.schema';
|
|
export * from './memories/memories.schema';
|
|
export * from './atlas/atlas.schema';
|
|
export * from './vacay/vacay.schema';
|
|
export * from './packing/packing.schema';
|
|
export * from './packing/packed-count';
|
|
export * from './todo/todo.schema';
|
|
export * from './budget/budget.schema';
|
|
export * from './budget/receipt-scan.schema';
|
|
export * from './reservation/reservation.schema';
|
|
export * from './reservation/reservation-types';
|
|
export * from './reservation/ki-reservation.schema';
|
|
export * from './datetime/datetime-normalize';
|
|
export * from './airtrail/airtrail.schema';
|
|
export * from './dawarich/dawarich.schema';
|
|
export * from './docsync/docsync.schema';
|
|
export * from './day/day.schema';
|
|
export * from './day/note-colors';
|
|
export * from './day/chrono-order';
|
|
export * from './day/stay-bookends';
|
|
export * from './assignment/assignment.schema';
|
|
export * from './place/place.schema';
|
|
export * from './place/place-match';
|
|
export * from './place/place-website';
|
|
export * from './roadtrip/roadtrip.schema';
|
|
export * from './place/track-colors';
|
|
export * from './tours/tours.schema';
|
|
export * from './tours/tour-provenance.schema';
|
|
export * from './tours/tour-library.schema';
|
|
export * from './tours/tour-poi-search.schema';
|
|
export * from './tours/tour-trail-grade.schema';
|
|
export * from './tours/tour-walk.schema';
|
|
export * from './tours/tour-walk';
|
|
export * from './tours/walk-hours';
|
|
export * from './tours/tours.metrics';
|
|
export * from './tours/tour-gpx-import.schema';
|
|
export * from './tours/paddle-plan.schema';
|
|
export * from './tours/paddle-plan';
|
|
export * from './tours/paddle-check.schema';
|
|
export * from './tours/paddle-check-basis';
|
|
export * from './tours/paddle-check';
|
|
export * from './tours/route-corridor';
|
|
export * from './wanderer/wanderer.schema';
|
|
export * from './geo/haversine';
|
|
export * from './collection/collection.schema';
|
|
export * from './collection/collection-file.schema';
|
|
export * from './trip/trip.schema';
|
|
export * from './place/place-hours';
|
|
export * from './trip/day-grid';
|
|
export * from './trip-invite/trip-invite.schema';
|
|
export * from './collab/collab.schema';
|
|
export * from './file/file.schema';
|
|
export * from './journey/journey.schema';
|
|
export * from './journey/trip-journal-link.schema';
|
|
export * from './book/book.schema';
|
|
export * from './book/journey-stats.schema';
|
|
export * from './book/book-store.schema';
|
|
export * from './share/share.schema';
|
|
export * from './storage/storage.schema';
|
|
export * from './settings/settings.schema';
|
|
export * from './appearance/appearance.schema';
|
|
export * from './backup/backup.schema';
|
|
export * from './auth/auth.schema';
|
|
export * from './auth/password-policy';
|
|
export * from './sessions/sessions.schema';
|
|
export * from './oidc/oidc.schema';
|
|
export * from './oauth/oauth.schema';
|
|
export * from './admin/admin.schema';
|
|
|
|
// Realtime WS event contract registry (event names + payload schemas)
|
|
export * from './realtime/events.schema';
|
|
export * from './roadtrip/day-boundary.schema';
|
|
|
|
// HTML escaping. The DOMPurify sanitisers live behind `@trek/shared/sanitize`
|
|
// instead (see sanitize/sanitize.ts): on Node they build a jsdom window when
|
|
// they load, and this barrel is what the server imports.
|
|
export * from './sanitize/escape';
|
|
|
|
// WGS-84 ⇄ GCJ-02. Shared because the two boundaries that need it sit on
|
|
// opposite sides: the Amap provider on the server, the Leaflet CRS on the client.
|
|
export * from './geo/gcj02';
|
|
|
|
// i18n registry (language list + pure helpers — no locale data)
|
|
export * from './i18n/languages';
|
|
export * from './i18n/plural';
|
|
|
|
// Plugin permission list, generated from the host's protocol/envelope.ts
|
|
// (server/scripts/gen-plugin-facts.ts). The admin consent screens render from it.
|
|
export * from './plugin-permissions';
|
|
// Plugin settings contracts: the settings-field descriptor + admin instance-config wire shapes.
|
|
export * from './plugins/plugins.schema';
|
|
// Plugin POI categories (#1781): the declared category, the icon allow-list and GET /api/plugin-pois.
|
|
export * from './plugins/plugin-poi-facts';
|
|
export * from './plugins/plugin-poi.schema';
|
|
// Plugin search providers (#2221): the row GET /api/plugin-search and its typed-ahead twin answer with.
|
|
export * from './plugins/plugin-search.schema';
|
|
export * from './roadtrip/preferences.schema';
|
|
export * from './roadtrip/hazards.schema';
|
|
export * from './roadtrip/planning.schema';
|
|
export * from './roadtrip/search.schema';
|
|
export * from './roadtrip/google-import.schema';
|
|
export * from './roadtrip/charging.schema';
|
|
|
|
export * from './vacay/school-holiday-catalog.schema';
|
|
|
|
// Money arithmetic in whole hundredths (sums, equal splits, currency precision).
|
|
export * from './money/money';
|
|
|
|
// Trip permission catalog (keys, levels, defaults) and the rule that decides a check.
|
|
export * from './permissions/permissions';
|
|
|
|
// Via ferratas around a trip, from OpenStreetMap through Overpass (GET /api/trips/:tripId/ferratas).
|
|
export * from './ferratas/ferratas.schema';
|
|
// The 0.05 degree tile grid both ends load, cache and persist the layer on.
|
|
export * from './ferratas/ferrataGrid';
|