From 77fe7cfdaca0ec9de978db78f02ae292819b18fb Mon Sep 17 00:00:00 2001 From: Mpho10111 Date: Tue, 11 Aug 2026 20:49:59 +0200 Subject: [PATCH] refactor: add shared task model --- types/task.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 types/task.ts diff --git a/types/task.ts b/types/task.ts new file mode 100644 index 0000000..ec7980a --- /dev/null +++ b/types/task.ts @@ -0,0 +1,23 @@ +export type TaskStatus = "Todo" | "In-Progress" | "Complete"; + +export type TaskSort = "createdAt" | "topic" | "status" | "dueDate"; + +export type TaskInput = { + title: string; + description: string; + dueDate: string; + topic: string; +}; + +export type Task = TaskInput & { + id: number; + status: TaskStatus; + archivedAt: string | null; + createdAt: string; + updatedAt: string; + isOverdue: boolean; +}; + +export type TaskUpdate = Partial & { + status?: TaskStatus; +};