-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
60 lines (54 loc) · 1.06 KB
/
types.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
export type Product = {
description: string;
id: string;
price: number;
student_price: number;
title: string;
};
// define cartProduct export type which have quantity and product details
export type cartProduct = {
quantity: number;
product: Product;
};
export type User = {
id: string;
username: string;
student?: {
id: string;
enrolled_year: number;
major: string;
name: string;
}
joined_date: string;
role: { id: string };
}
export type StateType = {
search: string;
auth: {
username: string;
token: string;
role: string;
};
productList: Product[];
cart: cartProduct[];
filteredList: Product[];
};
export type Transaction = {
id: string;
user: {
username: string;
role: string;
}
cart: cartProduct[];
transaction_timestamp: string;
}
export type LoginRecord = {
id: string;
user: {
username: string;
}
login_date: string;
login_ip: string;
success: boolean;
remarks: string;
}