Files
TREK/server/src/nest/integrations/dawarich.dto.ts
T
Maurice 218d8baf0a feat(server): read visits and recorded routes from Dawarich
A new `integrations/dawarich` domain behind its own addon. Each reader
connects their own instance; the API key is encrypted at rest and never
returned. Nothing is written back to Dawarich, and no raw position is
kept in TREK: the recorded route is fetched per request for the window
being looked at and thrown away again.

What it produces are suggestions, never facts. A recorded stay becomes a
proposed place or journal entry, a country or city becomes a proposed
Atlas mark, and a stay near a wish becomes a proposed tick-off; each one
waits for the reader to confirm it. Identity is (user, Dawarich visit),
so a second sync neither duplicates nor overwrites what was accepted,
and deleting the result puts the suggestion back on the list.

The sync runs as a job on the central scheduler, one user at a time,
guarded against overlapping runs.
2026-09-12 23:36:49 +02:00

20 lines
883 B
TypeScript

/**
* Server-side createZodDto wrappers over the @trek/shared Dawarich contracts,
* so the global ZodValidationPipe (APP_PIPE) validates bodies by metatype —
* the shared Zod schemas stay the single source of truth.
*/
import { createZodDto } from 'nestjs-zod';
import {
dawarichAcceptSchema,
dawarichAtlasAcceptSchema,
dawarichBucketConfirmSchema,
dawarichSettingsSchema,
dawarichSuggestionStateSchemaBody,
} from '@trek/shared';
export class DawarichSettingsDto extends createZodDto(dawarichSettingsSchema) {}
export class DawarichAcceptDto extends createZodDto(dawarichAcceptSchema) {}
export class DawarichSuggestionStateDto extends createZodDto(dawarichSuggestionStateSchemaBody) {}
export class DawarichBucketConfirmDto extends createZodDto(dawarichBucketConfirmSchema) {}
export class DawarichAtlasAcceptDto extends createZodDto(dawarichAtlasAcceptSchema) {}