forked from amywilkie/crabmans-crabshack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscenario
104 lines (87 loc) · 1.81 KB
/
scenario
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
Wenguins Pairing Test
You are required to create a single-page javascript app for the swanky new restaurant Crabman's Crabshack. Each table at Crabman's Crabshack has a tablet device running Chrome, into which customers can order their food and bevarages. The app needs to be able to display the menu and send an order and it should keep the customer updated with the status of their order. Please see Crabman's Crabshack's API below:
GET /api/menu-items
[
{
id: 1,
name: 'Prawn Cocktail',
type: 'starter',
description: 'A modern starter for the modern man',
price: '3.99'
},
{
id: 2,
name: 'Claw of Crabulon',
type: 'main',
description: 'Keep calm and Crabulon',
price: '12.85'
},
{
id: 3,
name: 'Crabman Sundae',
type: 'dessert',
description: 'Ground up crabs with animal fat ice cream. A variety of sauces available.',
price: '4.90'
},
{
id: 4,
name: 'Alcoholic milkshake',
type: 'beverage',
description: 'The best alcoholic milkshake you will taste this side of the Atlantic.',
price: '3.99'
}
]
Possible Responses:
200: OK
POST /api/orders
body:
{
tableNumber: 1,
orderItems: [
{
id: 3,
quantity: 1
},
{
id: 4,
quantity: 10
}
]
}
Possible Responses
201: Order created
404: Table not found
400: Bad request
GET /api/table/1
{
orderItems: [
{
id: 3,
status: 'cooking'
},
{
id: 4,
status: 'preparing'
},
{
id: 4,
status: 'delivered'
}
],
total: '44.80'
}
Possible Responses
200: OK
404: Table not found
POST /api/payments
body:
{
table: 1,
cardNumber: 4751300036472337,
securityCode: 213,
expiryDate: '03/16'
}
Possible Response:
200: Successful payment
400: Card details wrong format
502: Card declined / bank problem