-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroute.http
More file actions
155 lines (128 loc) · 3.35 KB
/
Copy pathroute.http
File metadata and controls
155 lines (128 loc) · 3.35 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
### Variables
@baseURL = http://localhost:8080
@token = eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJvdXJidXN3YXkyMDI1QG91dGxvb2suY29tIiwiaWRlbnRpZmllciI6ImQ2NDUyOWU0LWE1OTMtNDk3MS1iOGEyLThmNzllNWNmMWU1YyIsInJvbGUiOiJBRE1JTklTVFJBVE9SIiwidXNlcm5hbWUiOiJvdXJidXN3YXkyMDI1QG91dGxvb2suY29tIiwiZXhwIjoxNzY0MzIzNDUwLCJpYXQiOjE3NjQyODAyNTB9.Fh7fVCBvTkjhCvGmOG8CU1aWOp2JqHp_p-zP7SANhZu-uOKFQ20fczhAhsgydprOSeySAoguqeN92KuGJqLiRQ
@routeId = r2
@stationId = st1
@tripId = t1
############################################################
### STATIONS
############################################################
###
### 1.Get All Stations (paged)
GET {{baseURL}}/routeMgtApi/stations?page=0&size=10
Authorization: Bearer {{token}}
Accept: application/json
###
### 2.Get Station by ID
GET {{baseURL}}/routeMgtApi/stations/{{stationId}}
Authorization: Bearer {{token}}
Accept: application/json
###
### 3.Add Station
POST {{baseURL}}/routeMgtApi/stations
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "stationTest",
"code": "St_test",
"active": true,
"address": "test test"
}
###
### 4.Update Station (PATCH)
PATCH {{baseURL}}/routeMgtApi/stations/{{stationId}}
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "updated station2"
}
############################################################
### ROUTES
############################################################
###
### 1. Get All Routes (paged)
GET {{baseURL}}/routeMgtApi/routes?page=0&size=10
Authorization: Bearer {{token}}
Accept: application/json
###
### 2. Get Route by ID
GET {{baseURL}}/routeMgtApi/routes/{{routeId}}
Authorization: Bearer {{token}}
Accept: application/json
###
### 3️. Add Route
POST {{baseURL}}/routeMgtApi/routes
Authorization: Bearer {{token}}
Content-Type: application/json
{
"number": "L12",
"name": "Al Irfane – Temara",
"description": "Fast route connecting Al Irfane to Temara",
"active": true,
"startStation": "Al Irfane",
"endStation": "Temara Centre",
"distance": 18.7,
"estimatedDuration": 35,
"price": 12.50,
"config": {
"ruleType": "DAILY",
"frequencyMinutes": 20,
"enabled": true,
"busCount": 5,
"firstDeparture": "06:00"
},
"stationIds": [
"st1",
"st4",
"st5"
]
}
###
### 4. Update Route
PATCH {{baseURL}}/routeMgtApi/routes/{{routeId}}
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "New Downtown Express",
"config": {
"frequencyMinutes": 15,
"busCount": 6,
"firstDeparture": "05:30"
},
"stationIds": [
"st2",
"st3",
"st1"
]
}
############################################################
### Trips
############################################################
###
### 1. Start Trip
POST {{baseURL}}/routeMgtApi/trips/startTrip
Authorization: Bearer {{token}}
Content-Type: application/json
{
"routeId": "r2",
"busId": "bus45",
"startTime": "2025-01-15T08:30:00"
}
###
### 2. Add Inspector to Trip (Inspector scans QR)
PATCH {{baseURL}}/routeMgtApi/trips/addInspector/{{tripId}}
Authorization: Bearer {{token}}
Accept: application/json
###
### 3. End Trip
PATCH {{baseURL}}/routeMgtApi/trips/endTrip/{{tripId}}
Authorization: Bearer {{token}}
Content-Type: application/json
{
"endTime": "2025-01-15T09:30:00"
}
###
### 1. Start Trip
GET {{baseURL}}/routeMgtApi/trips/{{tripId}}
Authorization: Bearer {{token}}
Content-Type: application/json