-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathIntegrationDoc.txt
More file actions
241 lines (203 loc) · 3.9 KB
/
Copy pathIntegrationDoc.txt
File metadata and controls
241 lines (203 loc) · 3.9 KB
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
*All the Admin or merchant api endpoint starts with the /api *
*To add the City to the DB*
URL: /api/city
Method: POST
Request:
{
"name":"Bengaluru",
"pincode":"590056",
"state":"Karnataka"
}
Response:
{
"name": "Bengaluru",
"state": "Karnataka",
"id": 2,
"pincode": "590056"
}
*To add theater to the BD *
here theater reference to the key_id of the city as primary key so make sure to pass the valid city id
URL: /api/{CityID}/theater
Method: POST
Request:
{
"name":"Finox mall",
"area":"Koramangala"
}
Response:
{
"t_name": "Finox",
"t_area": "Kormangala",
"t_id": 3
}
*To add the Movie to the DB *
URL: /api/movie
Method: POST
Request Body:
{
"_name":"WAR 3",
"_director":"WAR 3 directors",
"_description":"description about the WAR 3 movie here"
}
Response Body:
{
"_name": "WAR 3",
"_director": "WAR 3 directors",
"_description": "description about the WAR 3 movie here",
"_id": 6
}
* TO add a show pass the theater Id and Movie id as a URL parma and the show time in the request body *
URL: /api/{theater_id}/{movie_id}/show
Method: POST
Request:
{
"time":"4/4/2020 - 3:30 PM"
}
Response:
{
"show_Id": 8,
"show_time": "1/4/2020 - 3:30 PM "
}
*All the End user api will start with the /user *
When user comes to the app make a get call to below API to fetch the name of city available on the app
URL: /user/city
Method: GET
Response Body:
[
{
"name": "Munavalli",
"state": "Karnataka",
"id": 1,
"pincode": "591117"
},
{
"name": "Bengaluru",
"state": "Karnataka",
"id": 2,
"pincode": "590056"
}
]
To get the list of Theaters Available on the city using the city id got in the previous call
URL: /user/{cityID}/theater
Method: GET
Response Body:
[
{
"t_name": "Finox",
"t_area": "Kormangala",
"t_id": 3
},
{
"t_name": "Bhoda theater",
"t_area": "Kengeri",
"t_id": 5
}
]
* after user selects the theater pass the theater id to the below api and in return you'll get a list of movie available for the movie *
URL: /user/theater/{theaterID}/movie
Method: GET
Response Body:
[
[
6,
"WAR 3",
"description about the WAR 3 movie here"
]
]
* Get a list of show available agist a Movie using the movie ID got in the previous step
URL: /user/movie/{id}/show
Method: GET
Response Body:
{
"show_Id": 12,
"show_time": "4/4/2020 - 09:00 AM"
},
{
"show_Id": 21,
"show_time": "4/4/2020 - 9:00 PM"
},
{
"show_Id": 22,
"show_time": "4/4/2020 - 9:00 PM"
},
{
"show_Id": 33,
"show_time": "4/4/2020 - 6:00 PM"
},
{
"show_Id": 34,
"show_time": "4/4/2020 - 6:00 PM"
},
{
"show_Id": 35,
"show_time": "4/4/2020 - 6:00 PM"
},
{
"show_Id": 36,
"show_time": "4/4/2020 - 6:00 PM"
}
]
* Pass the show id to the below API to get the available seat for the movie/show
URL: /user/show/{ID}
Method: GET
Response Body:
{
"show_id": 35,
"a4": 0,
"a5": 0,
"b1": 0,
"a1": 0,
"a2": 0,
"a3": 0,
"b2": 0,
"b3": 0,
"b4": 0,
"b5": 0,
"c1": 0,
"c2": 0,
"c3": 0,
"c4": 0,
"c5": 0,
"hibernateLazyInitializer": {}
}
* Book a ticket for the show using the available seat for the response got in previous API call.
URL: /user/show/{ID}/bookings
Method: POST
Request body:
{
"show_id": 35,
"a4": 1,
"a5": 0,
"b1": 1,
"a1": 0,
"a2": 0,
"a3": 0,
"b2": 0,
"b3": 0,
"b4": 0,
"b5": 0,
"c1": 0,
"c2": 0,
"c3": 0,
"c4": 0,
"c5": 0
}
Response Body:
{
"show_id": 35,
"a4": 1,
"a5": 0,
"b1": 1,
"a1": 0,
"a2": 0,
"a3": 0,
"b2": 0,
"b3": 0,
"b4": 0,
"b5": 0,
"c1": 0,
"c2": 0,
"c3": 0,
"c4": 0,
"c5": 0
}