-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtypes.d.ts
More file actions
91 lines (86 loc) · 1.92 KB
/
types.d.ts
File metadata and controls
91 lines (86 loc) · 1.92 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Custom Session type for NextAuth
interface SessionUser {
id?: string;
name?: string | null;
email?: string | null;
role?: string; // User role (USER or ADMIN) for authorization checks
}
interface Session {
user?: SessionUser;
expires?: string;
}
interface Book {
id: string;
title: string;
author: string;
genre: string;
rating: number;
totalCopies: number;
availableCopies: number;
description: string;
coverColor: string;
coverUrl: string;
videoUrl: string;
summary: string;
// Enhanced tracking and control fields
isbn?: string | null;
publicationYear?: number | null;
publisher?: string | null;
language?: string | null;
pageCount?: number | null;
edition?: string | null;
isActive: boolean;
updatedAt: Date | null;
updatedBy?: string | null;
createdAt: Date | null;
}
interface AuthCredentials {
fullName: string;
email: string;
password: string;
universityId: number;
universityCard: string;
}
interface BookParams {
title: string;
author: string;
genre: string;
rating: number;
coverUrl: string;
coverColor: string;
description: string;
totalCopies: number;
videoUrl: string;
summary: string;
// Enhanced optional fields
isbn?: string;
publicationYear?: number;
publisher?: string;
language?: string;
pageCount?: number;
edition?: string;
isActive?: boolean;
}
interface BorrowBookParams {
bookId: string;
userId: string;
}
interface BorrowRecord {
id: string;
userId: string;
bookId: string;
borrowDate: Date;
dueDate: Date | null; // Can be null for pending requests
returnDate?: Date | null;
status: "PENDING" | "BORROWED" | "RETURNED";
// Enhanced tracking and control fields
borrowedBy?: string | null;
returnedBy?: string | null;
fineAmount: number;
notes?: string | null;
renewalCount: number;
lastReminderSent?: Date | null;
updatedAt: Date | null;
updatedBy?: string | null;
createdAt: Date | null;
}