mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 09:38:54 +00:00
1bc82f97fd
Paddle tours are planned on the water by TREK's own router: a water network per paddle region, built from the same Geofabrik extract as the obstacles and searched in a worker thread of the server (no sidecar). Rivers, canals and lakes (direct or along the shore), portages round weirs, locks by policy, whitewater by boat, gaps marked. Found portages and locks become points of their own; an unplannable leg says why and offers a way out. - Shaping points: a click on the line sets a point that steers the route without being a stop (hikes and paddle tours); recompute a single leg. - Lake style direct/shore, suggested from the wind forecast. - Regions load by themselves where a paddler plans (admin setting: automatic, on request, off; size cap and a daily count), with requests for the admins, a notification, and the load followed on the leg. - Portage from the last point, portages follow footways via the walking router (or stay straight), "put in here" on slipways and put-ins. - MCP plan_paddle_route with the REST route's rules.
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import { ToursBoatType, ToursPaddleLakeStyle, ToursWaterContext } from '../../../src/db/entities/Tours.entity';
|
|
import { paddleBoatTypeSchema, paddleLakeStyleSchema, paddleWaterContextSchema } from '@trek/shared';
|
|
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
/**
|
|
* The boat, water and lake style columns hold a CHECK list (migrations 043900
|
|
* and 044600) that the
|
|
* entity carries as its enum, and the contract holds its own list. A value
|
|
* one side knows and the other refuses would be a tour the planner can save
|
|
* and the database cannot store, or the other way round.
|
|
*/
|
|
describe('paddle columns match the contract', () => {
|
|
it('knows the same boats as the paddle contract', () => {
|
|
expect(Object.values(ToursBoatType).sort()).toEqual([...paddleBoatTypeSchema.options].sort());
|
|
});
|
|
|
|
it('knows the same waters as the paddle contract', () => {
|
|
expect(Object.values(ToursWaterContext).sort()).toEqual([...paddleWaterContextSchema.options].sort());
|
|
});
|
|
|
|
it('knows the same lake styles as the paddle contract (PAD-11)', () => {
|
|
expect(Object.values(ToursPaddleLakeStyle).sort()).toEqual([...paddleLakeStyleSchema.options].sort());
|
|
});
|
|
});
|