-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.ts
102 lines (90 loc) · 1.65 KB
/
models.ts
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// User type
export interface User {
id: string;
username: string;
email: string;
emailVerified: boolean;
avatarKey: string | null;
role: string;
score: number;
level: number;
currency: number;
createdAt: number;
hasMatrix: boolean;
isAdmin: boolean;
authMethods: Array<"password" | "google">;
}
// Task type
export interface Task {
id: string;
categoryId: string;
name: string;
difficulty: string;
priority: string;
}
export interface UserTask {
id: string;
categoryId: string;
name: string;
difficulty: string;
priority: string;
isCompleted: boolean;
}
export interface CompletedTask {
id: string;
userId: string;
taskId: string;
completedAt: number;
}
export interface UserComment {
id: string;
creatorId: string;
description: string;
emotionalState: string;
createdAt: number;
}
export interface Comment {
id: string;
creatorId: string;
description: string;
emotionalState: string;
createdAt: Date;
}
export interface HabitCategory {
id: string;
name: string;
tasks: UserTask[];
}
export interface CategoryTask {
id: string;
name: string;
tasks: Task[];
}
export interface Category {
id: string;
name: string;
}
export const TASK_DIFFICULTY = {
EASY: "EASY",
MEDIUM: "MEDIUM",
HARD: "HARD",
} as const;
export const TASK_PRIORITY = {
LOW: "LOW",
MEDIUM: "MEDIUM",
HIGH: "HIGH",
} as const;
export const EMOTIONAL_STATE = {
VERY_BAD: "VERY_BAD",
BAD: "BAD",
NEUTRAL: "NEUTRAL",
GOOD: "GOOD",
VERY_GOOD: "VERY_GOOD",
} as const;
export interface PagingObject<T> {
items: T[];
totalItems: number;
currentPage: number;
lastPage: number;
pageSize: number;
}