summaryrefslogtreecommitdiff
path: root/backend/src/types
diff options
context:
space:
mode:
authorArne Rief <riearn@proton.me>2025-12-20 14:09:20 +0100
committerArne Rief <riearn@proton.me>2025-12-20 14:09:20 +0100
commit237f8ae6c29bbf485c312b2fed4d5ab4f99a4eff (patch)
tree238e82a6dc22372c2f9bb8504ab9160be49bd4f3 /backend/src/types
parent655ec610fcce8dd7748f10772d520bdff4f7c78e (diff)
Map and loading robots
Diffstat (limited to 'backend/src/types')
-rw-r--r--backend/src/types/error.ts4
-rw-r--r--backend/src/types/robot.ts20
-rw-r--r--backend/src/types/user.ts6
3 files changed, 27 insertions, 3 deletions
diff --git a/backend/src/types/error.ts b/backend/src/types/error.ts
new file mode 100644
index 0000000..c848e34
--- /dev/null
+++ b/backend/src/types/error.ts
@@ -0,0 +1,4 @@
+export type ErrorResponse = {
+ message: string;
+ error?: unknown;
+};
diff --git a/backend/src/types/robot.ts b/backend/src/types/robot.ts
new file mode 100644
index 0000000..40ce282
--- /dev/null
+++ b/backend/src/types/robot.ts
@@ -0,0 +1,20 @@
+export type RobotPosition = {
+ lat: number;
+ lon: number;
+};
+
+export type Robot = {
+ id: number;
+ name: string;
+ status: "idle" | "moving";
+ lat: number;
+ lon: number;
+ robot_positions: RobotPosition[];
+ created_at: string;
+ updated_at: string;
+};
+
+export type RobotsResponse = {
+ source: "cache" | "database";
+ data: Robot[];
+};
diff --git a/backend/src/types/user.ts b/backend/src/types/user.ts
index 875072c..b2c7ffc 100644
--- a/backend/src/types/user.ts
+++ b/backend/src/types/user.ts
@@ -1,18 +1,18 @@
export type AdminCreationResult = {
id: string;
email: string;
- created_at: Date;
+ created_at: string;
};
export type AuthorizedUser = {
id: string;
email: string;
- createdAt: Date;
+ createdAt: string;
};
export type DatabaseUser = {
id: string;
email: string;
password_hash: string;
- created_at: Date;
+ created_at: string;
};