-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
72 lines (63 loc) · 1.23 KB
/
types.ts
File metadata and controls
72 lines (63 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
export type User = {
name?: string | null;
email?: string | null;
image?: string | null;
};
export type Board = {
boardId: string;
title: string;
shortName: string;
createdAt: Date;
updatedAt: Date;
userId: string;
tasks?: Task[];
};
export type Task = {
taskId: string;
title: string;
description: string;
createdAt: Date;
updatedAt: Date;
status: TaskStatus;
priority: TaskPriority;
dueDate: Date | null;
boardId: string;
};
export type TaskColumn = Omit<Task, "status" | "priority"> & {
status: keyof typeof TaskStatus;
priority: keyof typeof TaskPriority;
};
export enum TaskStatus {
TODO = "TODO",
IN_PROGRESS = "IN_PROGRESS",
COMPLETED = "COMPLETED",
CANCELED = "CANCELED",
}
export enum TaskPriority {
LOW = "LOW",
MEDIUM = "MEDIUM",
HIGH = "HIGH",
}
type PartialTask = {
taskId: string;
status: keyof typeof TaskStatus;
};
export type BoardWithPartialTasks = Omit<Board, "tasks"> & {
tasks: PartialTask[];
};
export type KanbanColumn = {
tasks: Task[];
status: string;
};
export type BoardsData = ({
tasks: {
status: keyof typeof TaskStatus;
}[];
} & {
boardId: string;
title: string;
shortName: string;
createdAt: Date;
updatedAt: Date;
userId: string;
})[];