mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 07:30:04 +00:00
c40d00b830
PAD-06 and PAD-09. The tours list carries the check bench of every paddle tour and the detail its whole checklist, worked out of the obstacle data along the tour's line and the decisions stored for it. The obstacle data is read along the line run by run and kept in memory under the line, the boat and the data version, so a list of a trip reads it once; a hike costs nothing. While the data cannot be read the checklist says so and keeps every decision visible. PUT /api/trips/:tripId/tours/:placeId/obstacle-reviews stores what the paddlers decided, each against the basis the user saw, and answers the detail. It needs place_edit, refuses a tour that is no paddle tour with a 400, waits with a 503 while the data cannot be read, and skips an obstacle no longer on the checklist instead of failing. A copied tour and a copied trip take their decisions along. The MCP read tools describe the new fields; there is no write tool, since a decision is a statement of the paddlers. The obstacle data keeps the dates of checks on site, covers a line by sampling it, and tells its version by its rows and regions.
24 lines
883 B
TypeScript
24 lines
883 B
TypeScript
/**
|
|
* A TourPaddleCheckService for suites that build ToursService by hand and are
|
|
* not about paddle checks: the list and the detail pass through as they are.
|
|
* It takes nothing in its constructor, so lint:test-new-service does not count
|
|
* it; the paddle checks have their own suites over the real service.
|
|
*/
|
|
import type { TourPaddleCheckService } from '../../src/nest/tours/tour-paddle-check.service';
|
|
import type { TourListItem } from '@trek/shared';
|
|
|
|
export class NoPaddleChecks {
|
|
async forTrip(_tripId: number, items: TourListItem[]): Promise<TourListItem[]> {
|
|
return items;
|
|
}
|
|
|
|
async forTour(item: TourListItem): Promise<{ item: TourListItem }> {
|
|
return { item };
|
|
}
|
|
}
|
|
|
|
/** The pass-through as the service ToursService takes. */
|
|
export function noPaddleChecks(): TourPaddleCheckService {
|
|
return new NoPaddleChecks() as unknown as TourPaddleCheckService;
|
|
}
|