-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtypes.d.ts
98 lines (87 loc) · 1.68 KB
/
types.d.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
interface AuthCredentails {
fullname: string;
email: string;
password: string;
universityId: number;
universityCard: string;
}
interface User {
id: string;
fullname: string;
email: string;
universityId: number;
universityCard: string;
status: "PENDING" | "APPROVED" | "REJECTED" | null;
role: "USER" | "ADMIN" | null;
lastActivityDate: string | null;
createdAt: Date | null;
}
interface Book {
id: string;
title: string;
author: string;
genre: string;
rating: number;
totalCopies: number;
availableCopies: number;
coverColor: string;
description?: string;
coverUrl: string;
videoUrl: string;
summary: string;
createdAt: Date | null;
}
interface BorrowRecord {
id: string;
userId: string;
bookId: string;
borrowDate: Date;
dueDate: string;
returnDate: string | null;
status: string;
}
interface BorrowedBook extends Book {
borrow: BorrowRecord;
user?: User;
}
interface BookParams {
title: string;
author: string;
genre: string;
rating: number;
coverUrl: string;
coverColor: string;
description: string;
totalCopies: number;
videoUrl: string;
summary: string;
}
interface BorrowBookParams {
bookId: string;
userId: string;
}
interface PageProps {
searchParams: Promise<{
query?: string;
sort?: string;
page?: number;
}>;
params: Promise<{ id: string }>;
}
interface QueryParams {
query?: string;
sort?: string;
page?: number;
limit?: number;
}
interface Metdata {
totalPages?: number;
hasNextPage?: boolean;
}
interface UpdateAccountStatusParams {
userId: string;
status: "PENDING" | "APPROVED" | "REJECTED";
}
interface UpdateBookParams extends BookParams {
bookId: string;
}