refactor: add shared task model
This commit is contained in:
23
types/task.ts
Normal file
23
types/task.ts
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user