aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/Photo.ts31
-rw-r--r--models/Trip.ts46
-rw-r--r--models/index.ts4
3 files changed, 81 insertions, 0 deletions
diff --git a/models/Photo.ts b/models/Photo.ts
new file mode 100644
index 0000000..f40d492
--- /dev/null
+++ b/models/Photo.ts
@@ -0,0 +1,31 @@
+export default interface Photo {
+ /**
+ * Name of the photo or the file.
+ */
+ name: string;
+
+ /**
+ * Path to the photo.
+ */
+ src: string;
+
+ /**
+ * Latitude where the photo was taken.
+ */
+ latitude: number;
+
+ /**
+ * Logitude where the photo was taken.
+ */
+ longitude: number;
+
+ /**
+ * Date and time when the photo was taken.
+ */
+ time: string;
+
+ /**
+ * Photo thumnnail.
+ */
+ thumbnail: string;
+}
diff --git a/models/Trip.ts b/models/Trip.ts
new file mode 100644
index 0000000..cc01cda
--- /dev/null
+++ b/models/Trip.ts
@@ -0,0 +1,46 @@
+import { GeoJsonObject } from 'geojson';
+import Photo from './Photo';
+
+export default interface Trip {
+ /**
+ * Name of the trip.
+ */
+ name: string;
+
+ /**
+ * Total distance made during the trip.
+ */
+ distance: number;
+
+ /**
+ * Date and time of the beginning of the trip.
+ * This property is a string because Date is not serializable in Next.js.
+ */
+ start: string;
+
+ /**
+ * Date and time of the end of the trip.
+ * This property is a string because Date is not serializable in Next.js.
+ */
+ end: string;
+
+ /**
+ * Total duration of the trip in seconds.
+ */
+ duration: number;
+
+ /**
+ * Average speed in km/h.
+ */
+ speed: number;
+
+ /**
+ * GeoJSON object representing waypoints of the trip
+ */
+ track: GeoJsonObject;
+
+ /**
+ * Photos taken during the trip.
+ */
+ photos: Photo[];
+}
diff --git a/models/index.ts b/models/index.ts
new file mode 100644
index 0000000..764b342
--- /dev/null
+++ b/models/index.ts
@@ -0,0 +1,4 @@
+import Trip from './Trip';
+import Photo from './Photo';
+
+export type { Trip, Photo };