Files
pichunt/shared/types/map.ts
T
Pascal 61cc516f47
Docker Image CI / test (push) Failing after 41s
Docker Image CI / deploy (push) Skipped
Tests / unit (push) Failing after 36s
Tests / integration (push) Successful in 1m34s
feat(hunt): track walking distance via GPS, show live locations on map
Add foreground-only GPS distance tracking for hunts
2026-09-27 20:55:58 +02:00

59 lines
1017 B
TypeScript

/**
* Shared DTO shapes for the organizer live map. Both endpoints return plain
* JSON (no SuperJSON) with `Date` fields serialized as ISO strings and Prisma
* `Decimal` coordinates coerced to numbers.
*/
export type MapUser = {
id: number;
name: string;
email: string;
};
export type MapTeam = {
id: number;
name: string;
owner: MapUser;
members: MapUser[];
};
export type MapPosition = {
userId: number;
lat: number;
lon: number;
accuracy: number | null;
recordedAt: string;
};
export type MapAnswer = {
id: number;
lat: number;
lon: number;
createdAt: string;
memberId: number;
teamId: number;
pictureUrl: string | null;
quest: {
id: number;
title_de: string;
title_en: string;
};
};
export type HuntMapData = {
teams: MapTeam[];
positions: MapPosition[];
answers: MapAnswer[];
};
export type TrailPoint = {
lat: number;
lon: number;
accuracy: number | null;
recordedAt: string;
};
export type UserTrail = {
points: TrailPoint[];
};