-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlanET Database.txt
251 lines (197 loc) · 4.62 KB
/
PlanET Database.txt
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
PlanET Database
User{
user_id:IDENTITY,
username:String,
name:String,
password:String,
email:String,
role:ENUM('tourist', 'tourguide', 'advertisor', 'governor', 'admin', 'seller'),
phone_number:String,
salt:String (used to hash password),
first_time_login: boolean,
status: String
}
Tourist{
tourist_id:IDENTITY,
user_id:int (ref to user),
bookmarks:[activity_id] (ref to activity),
date_of_birth:date, //greater than 18
job:String,
nation:String,
wallet:double (final:not editable),
loyality_points:double,
badge:ENUM(1,2,3 according to loyality_points),
addresses:[String],
cart: cart
}
Bookmark_notify{
bookmark_notify_id:IDENTITY,
activity_id:int (ref to activity),//get activity_id from front_end and search with it in activities in Tourist(bookmarks)
user_id:int (ref to user), //when activity booking flag is true.Get all user_ids related to this activity in this table and notify
}
Comment_rating{
comment_rating_id:IDENTITY,
user_id:int (ref to user),
comment:String,
rating:double
}
Previous_work{
previous_work_id:IDENTITY
title:String,
place:String,
from:date,
to:date
}
Tour_guide{
tour_guide_id:IDENTITY,
user_id:int (ref to user),
itineraries:[itinerary_id] (ref to itinerary),
comments:[comment_rating_id] (ref to comment_rating),
years_of_experience:int,//not required
previous_work_description:[previous_work_id] (ref to previous_work),
documents_required:[String],
logo:String,
approval:boolean
}
Advertisor{
advertisor_id:IDENTITY,
user_id:int (ref to user),
activities:[activity_id] (ref to activity),
documents_required:[String],
link_to_website:String,
hotline:String,
About:String,
logo:String,
approval:boolean
}
Seller{
seller_id:IDENTITY,
user_id:int (ref to user),
documents_required:[String],
logo:String,
description:String,
approval:boolean
}
Governor{
governor_id:IDENTITY,
user_id:int (ref to user),
histroical_locations:[historical_location_id] (ref to historical_location)
nation:String
}
Activity{
activity_id:IDENTITY,
category:category_id (ref to category) //admin only has access to category entity,
comment:[comment_rating_id] (ref to comment_rating),
name:String,
date:date,
time:time,
location:location,
price:double,
special_discount:double,
tags:[Strings],//Asking TA
booking_flag:boolean,//admin changes this flag if booking is notify when in bookmark of tourist
inappropriate_flag:boolean, //admin changes this flag if inapp shown to all users this change refund:ok
active_flag:boolean//show/hide activity from users refund:ok
}
Category{
category_id:IDENTITY,
type:String
}
Itinerary{
itinerary_id:IDENTITY,
activities:[activity_id] (ref to activity),
timeline:[slot_id] (ref to slot),
comments:[comment_rating_id] (ref to comment_rating),
locations:[location],
duration:time,//derived from slot
languages:[String],
price:double,
availale_dates:date,
accessibility:boolean,
pickup_loc:location,
drop_off_loc:location,
tags:[String],
active_flag:boolean,//Tour guide changes already booked:show,not booked:hide
inappropriate_flag:boolean,//same as activity flag
}
Slot{
slot_id:IDENTITY,
title:String,
description:String,
from:time,
to:time
}
Historical_location{
historical_location_id:IDENTITY,
governer_id:governor_id (ref to governor),
comments:[comment_rating_id] (ref to comment_rating),
name:String,
description:String,
images:[String],
location:location,
opening_hours_from:time,
opening_hours_to:time,
opening_days:[String],
native_price:double,
foreign_price:double,
student_price:double,
active_flag:boolean //governor only access and used when display upcoming events
tags:[String],//special tag
}
Product{
product_id:IDENTITY,
user_id:int (ref to user role=seller),
comments:[comment_rating_id] (ref to comment_rating),
name:String,
description:String,
image:String,
price:double,
quantity:double,
sales:int,
archieve_flag:boolean //Admin,seller hide from tourist certain product
}
Ticket{
ticket_id:IDENTITY,
user_id:int (ref to user),
type:ENUM(Itinerary,Activity),
booking_id:int (ref to itinerary_id or actvity_id depending on the type),
cancelled:boolean
}
Complaint{
complaint_d:IDENTITY,
user_id:int (ref to user),
title:String,
date:datetime,
status:ENUM(Pending,Resolved),
reply:String
}
Promo_code{
promo_code_id:IDENTITY,
code:String,
expiry_date:datetime,
discount:double
}
Order{
order_id:IDENTITY,
user_id:int (ref to user),
products:[cart_item_id],
date:datetime,
cost:double,
status:ENUM(pending,cancelled,deliverd),
payment_type:ENUM(credit card,cash)
}
Cart{
cart_id:IDENTITY,
items:[cart_items],
cost:double
}
Cart_item{
cart_item_id:IDENTITY,
product_id:int (ref to product),
quantity:int
}
Wishlist{
wishlist_id:IDENTITY,
user_id:int (ref to user),
products:[product_id] (ref to product)
}