-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.js
65 lines (57 loc) · 1.27 KB
/
classes.js
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
class Stadium {
constructor(stadiumName, vendors) {
this.stadiumName = stadiumName;
this.vendors = vendors;
}
addVendor(vendor) {
this.vendors.push(vendor);
}
}
class Customer {
constructor(firstName, lastName, phoneNumber) {
this.firstName = firstName;
this.lastName = lastName;
this.phoneNumber = phoneNumber;
}
order(vendor, order) {
vendor.addOrder(order);
}
}
class FoodItem {
constructor(name, price, amount) {
this.name = name;
this.price = price;
this.amount = amount;
}
}
class Order {
constructor(customer, foodItems) {
this.customer = customer;
this.foodItems = foodItems;
}
addFood(foodItem) {
this.foodItems.push(foodItem);
}
}
class Vendor {
constructor(vendName, foodItems){
this.vendName = vendName;
this.foodItems = foodItems;
this.orders = [];
}
addFood(foodItem) {
this.foodItems.push(foodItem);
}
addOrder(order) {
this.orders.push(order);
// start timer
// notify customer through twilio
}
}
module.exports = {
Stadium: Stadium,
Customer: Customer,
FoodItem: FoodItem,
Order: Order,
Vendor: Vendor
}