forked from AnnLe4869/dormit-second-prototype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
61 lines (55 loc) · 1.18 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
61
type Product = Array<{
id: string;
inventory_remain: number;
name: string;
description: string;
category: string;
isDeal: boolean;
image_url: string
}>;
type Deals = Array<string>;
type Alert = {
type: "ERROR" | "INFO";
message: string;
is_active: boolean;
};
type User = {
// these shall be available from the start of app
id: string;
// cart is reset to null when an order is made
cart: Array<{
id: string;
quantity: number;
}> | null;
is_authenticated: boolean;
checkout: {
payment: {
CC_info: string;
CC_number: number;
};
delivery_address: string
};
// these should be fetched when needed only
current_order: Array<{
id: string;
items: Array<{ id: string; quantity: number }>;
order_time: string;
is_cancel: boolean;
delivery_address: string;
process: number; // how much processing has been done on the order
}>;
past_order: Array<{
id: string;
items: Array<{ id: string; quantity: number }>;
delivery_day: string;
}>;
default_payment: {
CC_info: string;
CC_number: number;
};
profile: {
first_name: string;
last_name: string;
avatar: string;
};
};