ptitlutins/app/types/index.ts
2025-10-07 00:20:32 +02:00

86 lines
1.3 KiB
TypeScript

export interface VoyageData {
title: string
description: string
}
export interface Voyage {
id: string
title: string
description: string
}
export interface Permission {
view: boolean
Change: boolean
}
export interface VoyageLink {
id: string
voyage: Voyage
permission: Permission
}
export type VoyageEntity = Event | Trip | Need | Location
export enum VoyageEntitiesNames {
EVENT = "events",
TRIP = "trips",
NEED = "needs",
LOCATION = "locations",
}
export interface Location {
id: string
name: string
postalAddress?: string
latitude?: number
longitude?: number
osmId?: string
}
export interface User {
id: string
userName: string
}
export interface Event {
id: string
title: string
startDate?: Date
endDate?: Date
location?: Location
location_id?: number
note?: string
parent?: Event
previous?: Event
participants?: User[]
}
export enum TransportMode {
CAR = "car",
TRAIN = "train",
PLANE = "plane",
BIKE = "bike",
WALK = "walk",
BUS = "bus",
TRAM = "tram",
METRO = "metro",
TAXI = "taxi",
BOAT = "boat",
OTHER = "other",
}
export interface Trip {
id: string
eventStart: Event
eventEnd: Event
mode: TransportMode
itinerary: String
}
export interface Need {
id: string
item: string
proposed_by: User
event: Event
}