refactor: add shared task model

This commit is contained in:
Mpho10111
2026-08-11 20:49:59 +02:00
parent f7efd57a85
commit 77fe7cfdac

23
types/task.ts Normal file
View File

@@ -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<TaskInput> & {
status?: TaskStatus;
};