summaryrefslogtreecommitdiff
path: root/frontend/src/types
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/types')
-rw-r--r--frontend/src/types/error.ts4
-rw-r--r--frontend/src/types/login.ts7
-rw-r--r--frontend/src/types/robot.ts20
3 files changed, 25 insertions, 6 deletions
diff --git a/frontend/src/types/error.ts b/frontend/src/types/error.ts
new file mode 100644
index 0000000..c848e34
--- /dev/null
+++ b/frontend/src/types/error.ts
@@ -0,0 +1,4 @@
+export type ErrorResponse = {
+ message: string;
+ error?: unknown;
+};
diff --git a/frontend/src/types/login.ts b/frontend/src/types/login.ts
index 73168be..f0cdd8d 100644
--- a/frontend/src/types/login.ts
+++ b/frontend/src/types/login.ts
@@ -1,7 +1,7 @@
export type AuthorizedUser = {
id: number;
email: string;
- createdAt: Date;
+ createdAt: string;
};
export type LoginFormData = {
@@ -14,8 +14,3 @@ export type LoginResponse = {
user: AuthorizedUser;
token: string;
};
-
-export type ErrorResponse = {
- message: string;
- error?: unknown;
-};
diff --git a/frontend/src/types/robot.ts b/frontend/src/types/robot.ts
new file mode 100644
index 0000000..40ce282
--- /dev/null
+++ b/frontend/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[];
+};