-
-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathtask.ts
More file actions
55 lines (43 loc) · 1009 Bytes
/
task.ts
File metadata and controls
55 lines (43 loc) · 1009 Bytes
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
import type { DueDate } from "@/api/domain/dueDate";
import type { ProjectId } from "@/api/domain/project";
import type { SectionId } from "@/api/domain/section";
export type TaskId = string;
export type Deadline = {
date: string;
};
export type Task = {
id: TaskId;
createdAt: string;
content: string;
description: string;
projectId: ProjectId;
sectionId: SectionId | null;
parentId: TaskId | null;
labels: string[];
priority: Priority;
due: DueDate | null;
duration: Duration | null;
deadline: Deadline | null;
order: number;
};
export const Priorities = {
P4: 1,
P3: 2,
P2: 3,
P1: 4,
} as const;
export type Priority = (typeof Priorities)[keyof typeof Priorities];
export type CreateTaskParams = {
priority: Priority;
projectId: ProjectId;
description?: string;
sectionId?: SectionId;
dueDate?: string;
dueDatetime?: string;
labels?: string[];
deadlineDate?: string;
};
export type Duration = {
amount: number;
unit: "minute" | "day";
};