@vulog/aima-booking 1.2.29 → 1.2.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +465 -0
- package/dist/index.d.cts +362 -0
- package/dist/index.d.mts +288 -262
- package/dist/index.mjs +399 -548
- package/package.json +20 -7
- package/src/cancelBookingRequest.test.ts +1 -3
- package/src/getAvailableVehicles.ts +30 -0
- package/src/getBookingRequest.test.ts +27 -35
- package/src/getBookingRequests.test.ts +3 -5
- package/src/getBookingRequestsByUserId.test.ts +2 -6
- package/src/getSATBookingRequests.test.ts +3 -3
- package/src/getStation.test.ts +93 -88
- package/src/index.ts +1 -0
- package/src/releaseBRPayment.test.ts +9 -15
- package/src/triggerBRPayment.test.ts +4 -6
- package/src/types.ts +12 -0
- package/{tsup.config.ts → tsdown.config.ts} +1 -1
- package/dist/index.d.ts +0 -336
- package/dist/index.js +0 -626
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,574 +1,425 @@
|
|
|
1
|
-
// src/getBookingRequests.ts
|
|
2
1
|
import { createPaginableOptionsSchema } from "@vulog/aima-core";
|
|
3
2
|
import { isNumber } from "es-toolkit/compat";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
import z$1, { z } from "zod";
|
|
4
|
+
//#region src/getBookingRequests.ts
|
|
5
|
+
const BookingRequestStatusSchema = z.enum([
|
|
6
|
+
"ALERT",
|
|
7
|
+
"UPCOMING",
|
|
8
|
+
"ONGOING",
|
|
9
|
+
"COMPLETED",
|
|
10
|
+
"CANCELLED",
|
|
11
|
+
"PENDING_APPROVAL",
|
|
12
|
+
"CONFIRMED",
|
|
13
|
+
"PENDING",
|
|
14
|
+
"LATE"
|
|
15
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
|
-
|
|
16
|
+
const ServiceTypeSchema = z.enum([
|
|
17
|
+
"SUBSCRIPTION",
|
|
18
|
+
"ROUND_TRIP_BOOKING",
|
|
19
|
+
"SCHEDULED_BOOKING_STATION"
|
|
20
|
+
]);
|
|
21
|
+
const getBookingRequests = async (client, status, options) => {
|
|
22
|
+
const preparedOptions = options ? {
|
|
23
|
+
...options,
|
|
24
|
+
filters: options.filters || {}
|
|
25
|
+
} : { filters: {} };
|
|
26
|
+
const resultStatus = BookingRequestStatusSchema.safeParse(status);
|
|
27
|
+
if (!resultStatus.success) throw new TypeError("Invalid status", { cause: resultStatus.error.issues });
|
|
28
|
+
const date = /* @__PURE__ */ new Date();
|
|
29
|
+
date.setMilliseconds(0);
|
|
30
|
+
const startDate = date.toISOString().replace(".000Z", "Z");
|
|
31
|
+
date.setMonth(date.getMonth() + 2);
|
|
32
|
+
const endDate = date.toISOString().replace(".000Z", "Z");
|
|
33
|
+
const resultOptions = createPaginableOptionsSchema(z.object({
|
|
34
|
+
serviceTypes: z.array(ServiceTypeSchema).optional(),
|
|
35
|
+
serviceIds: z.array(z.string().uuid()).optional(),
|
|
36
|
+
userId: z.string().uuid().optional(),
|
|
37
|
+
modelId: z.number().positive().optional(),
|
|
38
|
+
vehicleId: z.string().uuid().optional(),
|
|
39
|
+
stationId: z.string().uuid().optional(),
|
|
40
|
+
creationDate: z.string().date().optional(),
|
|
41
|
+
startDate: z.string().datetime({
|
|
42
|
+
offset: false,
|
|
43
|
+
precision: 0
|
|
44
|
+
}).default(startDate),
|
|
45
|
+
endDate: z.string().datetime({
|
|
46
|
+
offset: false,
|
|
47
|
+
precision: 0
|
|
48
|
+
}).default(endDate),
|
|
49
|
+
includeProducts: z.enum(["true", "false"]).optional()
|
|
50
|
+
}).default({})).default({}).safeParse(preparedOptions);
|
|
51
|
+
if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
|
|
52
|
+
const finalOptions = resultOptions.data;
|
|
53
|
+
const searchParams = new URLSearchParams();
|
|
54
|
+
searchParams.append("page", finalOptions.page.toString());
|
|
55
|
+
searchParams.append("size", finalOptions.pageSize.toString());
|
|
56
|
+
Object.entries(finalOptions.filters).forEach(([key, value]) => {
|
|
57
|
+
if (value === void 0) return;
|
|
58
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
59
|
+
searchParams.append(key, value.join(","));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (isNumber(value)) {
|
|
63
|
+
searchParams.append(key, value.toString());
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
searchParams.append(key, value);
|
|
67
|
+
});
|
|
68
|
+
return client.get(`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/status/${status}/filters?${searchParams.toString()}`).then(({ data, headers }) => {
|
|
69
|
+
return {
|
|
70
|
+
data,
|
|
71
|
+
page: headers.number,
|
|
72
|
+
pageSize: headers.size,
|
|
73
|
+
total: headers.totalelements,
|
|
74
|
+
totalPages: headers.totalpages
|
|
75
|
+
};
|
|
76
|
+
});
|
|
76
77
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
const getScheduleBookingRequests = async (client, status, options) => {
|
|
79
|
+
return getBookingRequests(client, status, {
|
|
80
|
+
...options,
|
|
81
|
+
filters: {
|
|
82
|
+
...options?.filters,
|
|
83
|
+
serviceTypes: ["ROUND_TRIP_BOOKING", "SCHEDULED_BOOKING_STATION"]
|
|
84
|
+
}
|
|
85
|
+
});
|
|
85
86
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
const getSubscriptionBookingRequests = async (client, status, options) => {
|
|
88
|
+
return getBookingRequests(client, status, {
|
|
89
|
+
...options,
|
|
90
|
+
filters: {
|
|
91
|
+
...options?.filters,
|
|
92
|
+
serviceTypes: ["SUBSCRIPTION"]
|
|
93
|
+
}
|
|
94
|
+
});
|
|
94
95
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"UPCOMING_ALLOCATED",
|
|
109
|
-
"UPCOMING_NOT_ALLOCATED"
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/getSATBookingRequests.ts
|
|
98
|
+
const SATBookingRequestStatusSchema = z.enum([
|
|
99
|
+
"ALERT",
|
|
100
|
+
"CANCELLED",
|
|
101
|
+
"COMPLETED",
|
|
102
|
+
"CONFIRMED",
|
|
103
|
+
"LATE_RETURN",
|
|
104
|
+
"ONGOING",
|
|
105
|
+
"PENDING_PAYMENT",
|
|
106
|
+
"PENDING",
|
|
107
|
+
"UPCOMING_ALLOCATED",
|
|
108
|
+
"UPCOMING_NOT_ALLOCATED"
|
|
110
109
|
]);
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
searchParams.append("size", finalOptions.pageSize.toString());
|
|
132
|
-
}
|
|
133
|
-
if (finalOptions.sortDirection && finalOptions.sort) {
|
|
134
|
-
searchParams.append("sort", `${finalOptions.sort},${finalOptions.sortDirection}`);
|
|
135
|
-
}
|
|
136
|
-
if (finalOptions.sort && !finalOptions.sortDirection) {
|
|
137
|
-
searchParams.append("sort", finalOptions.sort);
|
|
138
|
-
}
|
|
139
|
-
return client.get(`/boapi/proxy/user/scheduleATrip/fleets/${client.clientOptions.fleetId}/bookingrequests/status/${status}?${searchParams.toString()}`).then(({ data, headers }) => {
|
|
140
|
-
return {
|
|
141
|
-
data,
|
|
142
|
-
page: headers.number,
|
|
143
|
-
pageSize: headers.size,
|
|
144
|
-
total: headers.totalelements,
|
|
145
|
-
totalPages: headers.totalpages
|
|
146
|
-
};
|
|
147
|
-
});
|
|
110
|
+
const getSATBookingRequests = async (client, status, options) => {
|
|
111
|
+
const resultStatus = SATBookingRequestStatusSchema.safeParse(status);
|
|
112
|
+
if (!resultStatus.success) throw new TypeError("Invalid status", { cause: resultStatus.error.issues });
|
|
113
|
+
const resultOptions = createPaginableOptionsSchema().default({}).safeParse(options);
|
|
114
|
+
if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
|
|
115
|
+
const finalOptions = resultOptions.data;
|
|
116
|
+
const searchParams = new URLSearchParams();
|
|
117
|
+
if (finalOptions.page) searchParams.append("page", finalOptions.page.toString());
|
|
118
|
+
if (finalOptions.pageSize) searchParams.append("size", finalOptions.pageSize.toString());
|
|
119
|
+
if (finalOptions.sortDirection && finalOptions.sort) searchParams.append("sort", `${finalOptions.sort},${finalOptions.sortDirection}`);
|
|
120
|
+
if (finalOptions.sort && !finalOptions.sortDirection) searchParams.append("sort", finalOptions.sort);
|
|
121
|
+
return client.get(`/boapi/proxy/user/scheduleATrip/fleets/${client.clientOptions.fleetId}/bookingrequests/status/${status}?${searchParams.toString()}`).then(({ data, headers }) => {
|
|
122
|
+
return {
|
|
123
|
+
data,
|
|
124
|
+
page: headers.number,
|
|
125
|
+
pageSize: headers.size,
|
|
126
|
+
total: headers.totalelements,
|
|
127
|
+
totalPages: headers.totalpages
|
|
128
|
+
};
|
|
129
|
+
});
|
|
148
130
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
throw new TypeError("Invalid id", {
|
|
156
|
-
cause: result.error.issues
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
return client.get(
|
|
160
|
-
`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/${id}`
|
|
161
|
-
).then(({ data }) => data);
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/getBookingRequest.ts
|
|
133
|
+
const getBookingRequestById = async (client, id) => {
|
|
134
|
+
const result = z.string().trim().min(1).uuid().safeParse(id);
|
|
135
|
+
if (!result.success) throw new TypeError("Invalid id", { cause: result.error.issues });
|
|
136
|
+
return client.get(`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/${id}`).then(({ data }) => data);
|
|
162
137
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
cause: result.error.issues
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
return client.get(
|
|
171
|
-
`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/trip/${tripId}`
|
|
172
|
-
).then(({ data }) => data);
|
|
138
|
+
const getBookingRequestByTrip = async (client, tripId) => {
|
|
139
|
+
const result = z.string().trim().min(1).safeParse(tripId);
|
|
140
|
+
if (!result.success) throw new TypeError("Invalid tripId", { cause: result.error.issues });
|
|
141
|
+
return client.get(`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/trip/${tripId}`).then(({ data }) => data);
|
|
173
142
|
};
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return client.get(
|
|
182
|
-
`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/subscription/bookingrequests/${id}`
|
|
183
|
-
).then(({ data: { stationId, ...data } }) => ({ station: stationId, ...data }));
|
|
143
|
+
const getSubscriptionBookingRequestById = async (client, id) => {
|
|
144
|
+
const result = z.string().trim().min(1).uuid().safeParse(id);
|
|
145
|
+
if (!result.success) throw new TypeError("Invalid id", { cause: result.error.issues });
|
|
146
|
+
return client.get(`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/subscription/bookingrequests/${id}`).then(({ data: { stationId, ...data } }) => ({
|
|
147
|
+
station: stationId,
|
|
148
|
+
...data
|
|
149
|
+
}));
|
|
184
150
|
};
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
const stations = await client.get(`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/stations${searchParams.size > 0 ? `?${searchParams.toString()}` : ""}`).then(
|
|
202
|
-
({ data }) => data.map(
|
|
203
|
-
(station) => Object.keys(station).reduce((acc, key) => {
|
|
204
|
-
if (key === "stationTimetableDTO") {
|
|
205
|
-
if (station.stationTimetableDTO?.stationId) {
|
|
206
|
-
acc.openingHours = {
|
|
207
|
-
alwaysOpen: station.stationTimetableDTO.alwaysOpen,
|
|
208
|
-
timetable: Object.keys(station.stationTimetableDTO.timetable).reduce(
|
|
209
|
-
(timetable, val) => {
|
|
210
|
-
timetable[val] = station.stationTimetableDTO.timetable[val].map(
|
|
211
|
-
(day) => ({
|
|
212
|
-
id: day.id,
|
|
213
|
-
closed: day.closed,
|
|
214
|
-
openAt: day.openAt,
|
|
215
|
-
closeAt: day.closeAt
|
|
216
|
-
})
|
|
217
|
-
);
|
|
218
|
-
return timetable;
|
|
219
|
-
},
|
|
220
|
-
{}
|
|
221
|
-
)
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
return acc;
|
|
225
|
-
}
|
|
226
|
-
acc[key] = station[key];
|
|
227
|
-
return acc;
|
|
228
|
-
}, {})
|
|
229
|
-
)
|
|
230
|
-
);
|
|
231
|
-
if (includes.includes("INFO")) {
|
|
232
|
-
const pois = await client.get(`/boapi/proxy/geoloc/fleets/${client.clientOptions.fleetId}/pois`, {
|
|
233
|
-
headers: { accept: "application/vnd.geo+json" }
|
|
234
|
-
}).then(
|
|
235
|
-
({ data }) => data.features.reduce((acc, poi) => {
|
|
236
|
-
const {
|
|
237
|
-
geometry: {
|
|
238
|
-
coordinates: [longitude, latitude]
|
|
239
|
-
},
|
|
240
|
-
properties
|
|
241
|
-
} = poi;
|
|
242
|
-
acc[properties.poiId] = {
|
|
243
|
-
name: properties.name,
|
|
244
|
-
coordinates: { latitude, longitude },
|
|
245
|
-
geoProperties: properties
|
|
246
|
-
};
|
|
247
|
-
return acc;
|
|
248
|
-
}, {})
|
|
249
|
-
);
|
|
250
|
-
stations.forEach((station) => {
|
|
251
|
-
if (station.poiId && pois[station.poiId]) {
|
|
252
|
-
Object.assign(station, pois[station.poiId]);
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
if (includes.includes("SERVICES")) {
|
|
257
|
-
const services = await client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/stations/details?size=1000`).then(
|
|
258
|
-
({ data }) => data.stations.reduce((acc, service) => {
|
|
259
|
-
if (!acc[service.station.id]) {
|
|
260
|
-
acc[service.station.id] = { services: [] };
|
|
261
|
-
}
|
|
262
|
-
acc[service.station.id].services.push({
|
|
263
|
-
id: service.serviceId,
|
|
264
|
-
models: service.station.models
|
|
265
|
-
});
|
|
266
|
-
return acc;
|
|
267
|
-
}, {})
|
|
268
|
-
);
|
|
269
|
-
stations.forEach((station) => {
|
|
270
|
-
if (services[station.id]) {
|
|
271
|
-
Object.assign(station, services[station.id]);
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
return stations;
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/getAvailableVehicles.ts
|
|
153
|
+
/** ISO date-time without milliseconds (e.g. 2025-02-10T12:00:00Z or 2025-02-10T12:00:00+01:00). */
|
|
154
|
+
const isoDateTimeNoMs = z.string().trim().datetime({ precision: 0 });
|
|
155
|
+
const getAvailableVehiclesSchema = z.object({
|
|
156
|
+
stationId: z.string().trim().min(1),
|
|
157
|
+
startDate: isoDateTimeNoMs
|
|
158
|
+
});
|
|
159
|
+
const getAvailableVehicles = async (client, stationId, startDate) => {
|
|
160
|
+
const result = getAvailableVehiclesSchema.safeParse({
|
|
161
|
+
stationId,
|
|
162
|
+
startDate
|
|
163
|
+
});
|
|
164
|
+
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
165
|
+
return client.get(`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/subscription/stations/${stationId}/vehicles/available?startDate=${startDate}`).then(({ data }) => data);
|
|
276
166
|
};
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
coordinates: [longitude, latitude]
|
|
341
|
-
},
|
|
342
|
-
properties
|
|
343
|
-
} = current;
|
|
344
|
-
return {
|
|
345
|
-
version: current.properties.Version,
|
|
346
|
-
name: properties.name,
|
|
347
|
-
coordinates: { latitude, longitude },
|
|
348
|
-
geoProperties: properties
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
return max;
|
|
352
|
-
},
|
|
353
|
-
{ version: -1 }
|
|
354
|
-
)
|
|
355
|
-
);
|
|
356
|
-
if (station.poiId && poi) {
|
|
357
|
-
poi.version = void 0;
|
|
358
|
-
Object.assign(station, poi);
|
|
359
|
-
station.name = station.geoProperties?.name;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
if (station && includes.includes("SERVICES")) {
|
|
363
|
-
const services = await client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/stations/details?showTimetable=false`).then(
|
|
364
|
-
({ data }) => data.stations.reduce((acc, service) => {
|
|
365
|
-
if (!acc[service.station.id]) {
|
|
366
|
-
acc[service.station.id] = { services: [] };
|
|
367
|
-
}
|
|
368
|
-
acc[service.station.id].services.push({
|
|
369
|
-
id: service.serviceId,
|
|
370
|
-
models: service.station.models
|
|
371
|
-
});
|
|
372
|
-
return acc;
|
|
373
|
-
}, {})
|
|
374
|
-
);
|
|
375
|
-
if (services[station.id]) {
|
|
376
|
-
Object.assign(station, services[station.id]);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
return station;
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/getStations.ts
|
|
169
|
+
const IncludeSchema$1 = z.enum([
|
|
170
|
+
"INFO",
|
|
171
|
+
"OPEN_HOUR",
|
|
172
|
+
"SERVICES"
|
|
173
|
+
]);
|
|
174
|
+
const IncludesSchema$1 = z.array(IncludeSchema$1);
|
|
175
|
+
const getStations = async (client, includes = []) => {
|
|
176
|
+
const resultIncludes = IncludesSchema$1.safeParse(includes);
|
|
177
|
+
if (!resultIncludes.success) throw new TypeError("Invalid includes", { cause: resultIncludes.error.issues });
|
|
178
|
+
const searchParams = new URLSearchParams();
|
|
179
|
+
if (includes.includes("OPEN_HOUR")) searchParams.append("showTimetable", "true");
|
|
180
|
+
const stations = await client.get(`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/stations${searchParams.size > 0 ? `?${searchParams.toString()}` : ""}`).then(({ data }) => data.map((station) => Object.keys(station).reduce((acc, key) => {
|
|
181
|
+
if (key === "stationTimetableDTO") {
|
|
182
|
+
if (station.stationTimetableDTO?.stationId) acc.openingHours = {
|
|
183
|
+
alwaysOpen: station.stationTimetableDTO.alwaysOpen,
|
|
184
|
+
timetable: Object.keys(station.stationTimetableDTO.timetable).reduce((timetable, val) => {
|
|
185
|
+
timetable[val] = station.stationTimetableDTO.timetable[val].map((day) => ({
|
|
186
|
+
id: day.id,
|
|
187
|
+
closed: day.closed,
|
|
188
|
+
openAt: day.openAt,
|
|
189
|
+
closeAt: day.closeAt
|
|
190
|
+
}));
|
|
191
|
+
return timetable;
|
|
192
|
+
}, {})
|
|
193
|
+
};
|
|
194
|
+
return acc;
|
|
195
|
+
}
|
|
196
|
+
acc[key] = station[key];
|
|
197
|
+
return acc;
|
|
198
|
+
}, {})));
|
|
199
|
+
if (includes.includes("INFO")) {
|
|
200
|
+
const pois = await client.get(`/boapi/proxy/geoloc/fleets/${client.clientOptions.fleetId}/pois`, { headers: { accept: "application/vnd.geo+json" } }).then(({ data }) => data.features.reduce((acc, poi) => {
|
|
201
|
+
const { geometry: { coordinates: [longitude, latitude] }, properties } = poi;
|
|
202
|
+
acc[properties.poiId] = {
|
|
203
|
+
name: properties.name,
|
|
204
|
+
coordinates: {
|
|
205
|
+
latitude,
|
|
206
|
+
longitude
|
|
207
|
+
},
|
|
208
|
+
geoProperties: properties
|
|
209
|
+
};
|
|
210
|
+
return acc;
|
|
211
|
+
}, {}));
|
|
212
|
+
stations.forEach((station) => {
|
|
213
|
+
if (station.poiId && pois[station.poiId]) Object.assign(station, pois[station.poiId]);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
if (includes.includes("SERVICES")) {
|
|
217
|
+
const services = await client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/stations/details?size=1000`).then(({ data }) => data.stations.reduce((acc, service) => {
|
|
218
|
+
if (!acc[service.station.id]) acc[service.station.id] = { services: [] };
|
|
219
|
+
acc[service.station.id].services.push({
|
|
220
|
+
id: service.serviceId,
|
|
221
|
+
models: service.station.models
|
|
222
|
+
});
|
|
223
|
+
return acc;
|
|
224
|
+
}, {}));
|
|
225
|
+
stations.forEach((station) => {
|
|
226
|
+
if (services[station.id]) Object.assign(station, services[station.id]);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
return stations;
|
|
380
230
|
};
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
})
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/getStation.ts
|
|
233
|
+
const IncludeSchema = z.enum(["INFO", "SERVICES"]);
|
|
234
|
+
const IncludesSchema = z.array(IncludeSchema);
|
|
235
|
+
const getStationById = async (client, id, includes = []) => {
|
|
236
|
+
const resultIncludes = IncludesSchema.safeParse(includes);
|
|
237
|
+
if (!resultIncludes.success) throw new TypeError("Invalid includes", { cause: resultIncludes.error.issues });
|
|
238
|
+
const station = await client.get(`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/stations/${id}`).then(({ data, status }) => {
|
|
239
|
+
if (status === 200) return Object.keys(data).reduce((acc, key) => {
|
|
240
|
+
if (key === "stationTimetableDTO") {
|
|
241
|
+
if (data.stationTimetableDTO?.stationId) acc.openingHours = {
|
|
242
|
+
alwaysOpen: data.stationTimetableDTO.alwaysOpen,
|
|
243
|
+
timetable: Object.keys(data.stationTimetableDTO.timetable).reduce((timetable, val) => {
|
|
244
|
+
timetable[val] = data.stationTimetableDTO.timetable[val].map((day) => ({
|
|
245
|
+
id: day.id,
|
|
246
|
+
closed: day.closed,
|
|
247
|
+
openAt: day.openAt,
|
|
248
|
+
closeAt: day.closeAt
|
|
249
|
+
}));
|
|
250
|
+
return timetable;
|
|
251
|
+
}, {})
|
|
252
|
+
};
|
|
253
|
+
return acc;
|
|
254
|
+
}
|
|
255
|
+
acc[key] = data[key];
|
|
256
|
+
return acc;
|
|
257
|
+
}, {});
|
|
258
|
+
if (status === 400) return null;
|
|
259
|
+
return null;
|
|
260
|
+
}).catch((error) => {
|
|
261
|
+
if (error.formattedError?.status === 400) return null;
|
|
262
|
+
throw error;
|
|
263
|
+
});
|
|
264
|
+
if (station && includes.includes("INFO")) {
|
|
265
|
+
const poi = await client.get(`/boapi/proxy/geoloc/fleets/${client.clientOptions.fleetId}/pois/${station.poiId}`, { headers: { accept: "application/vnd.geo+json" } }).then(({ data }) => data.features.reduce((max, current) => {
|
|
266
|
+
if (current.properties.Version > max.version) {
|
|
267
|
+
const { geometry: { coordinates: [longitude, latitude] }, properties } = current;
|
|
268
|
+
return {
|
|
269
|
+
version: current.properties.Version,
|
|
270
|
+
name: properties.name,
|
|
271
|
+
coordinates: {
|
|
272
|
+
latitude,
|
|
273
|
+
longitude
|
|
274
|
+
},
|
|
275
|
+
geoProperties: properties
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
return max;
|
|
279
|
+
}, { version: -1 }));
|
|
280
|
+
if (station.poiId && poi) {
|
|
281
|
+
poi.version = void 0;
|
|
282
|
+
Object.assign(station, poi);
|
|
283
|
+
station.name = station.geoProperties?.name;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (station && includes.includes("SERVICES")) {
|
|
287
|
+
const services = await client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/stations/details?showTimetable=false`).then(({ data }) => data.stations.reduce((acc, service) => {
|
|
288
|
+
if (!acc[service.station.id]) acc[service.station.id] = { services: [] };
|
|
289
|
+
acc[service.station.id].services.push({
|
|
290
|
+
id: service.serviceId,
|
|
291
|
+
models: service.station.models
|
|
292
|
+
});
|
|
293
|
+
return acc;
|
|
294
|
+
}, {}));
|
|
295
|
+
if (services[station.id]) Object.assign(station, services[station.id]);
|
|
296
|
+
}
|
|
297
|
+
return station;
|
|
399
298
|
};
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/allocateVehicle.ts
|
|
301
|
+
const allocateVehicleSchema = z$1.object({
|
|
302
|
+
bookingRequestId: z$1.string().uuid(),
|
|
303
|
+
vehicleId: z$1.string().uuid(),
|
|
304
|
+
serviceId: z$1.string().uuid()
|
|
406
305
|
});
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
`boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/${bookingRequestId}/vehicles/${vehicleId}`
|
|
416
|
-
).then(({ data }) => data);
|
|
306
|
+
const allocateVehicle = async (client, bookingRequestId, vehicleId, serviceId) => {
|
|
307
|
+
const resultPayload = allocateVehicleSchema.safeParse({
|
|
308
|
+
bookingRequestId,
|
|
309
|
+
vehicleId,
|
|
310
|
+
serviceId
|
|
311
|
+
});
|
|
312
|
+
if (!resultPayload.success) throw new TypeError("Invalid args", { cause: resultPayload.error.issues });
|
|
313
|
+
return client.post(`boapi/proxy/user/scheduleATrip/fleets/${client.clientOptions.fleetId}/bookingrequests/${bookingRequestId}/allocate/${vehicleId}?serviceId=${serviceId}`).then(({ data }) => data);
|
|
417
314
|
};
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
startDate: z8.string().refine((date) => !Number.isNaN(Date.parse(date)), {
|
|
424
|
-
message: "Invalid date"
|
|
425
|
-
}).optional(),
|
|
426
|
-
latitude: z8.number().min(-90).max(90).optional(),
|
|
427
|
-
longitude: z8.number().min(-180).max(180).optional(),
|
|
428
|
-
radius: z8.number().min(0).optional(),
|
|
429
|
-
userId: z8.string().optional(),
|
|
430
|
-
status: z8.enum(["CONFIRMED", "CANCELLED", "PENDING"]).optional(),
|
|
431
|
-
cityId: z8.string().optional(),
|
|
432
|
-
profileId: z8.string().optional(),
|
|
433
|
-
serviceId: z8.string().optional(),
|
|
434
|
-
warning: z8.string().optional(),
|
|
435
|
-
modelId: z8.number().optional(),
|
|
436
|
-
notes: z8.string().optional(),
|
|
437
|
-
bookingReferenceId: z8.string().optional(),
|
|
438
|
-
plannedReturnDate: z8.string().refine((date) => !Number.isNaN(Date.parse(date)), {
|
|
439
|
-
message: "Invalid date"
|
|
440
|
-
}).optional()
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/deallocateVehicle.ts
|
|
317
|
+
const deallocateVehicleSchema = z$1.object({
|
|
318
|
+
bookingRequestId: z$1.string().uuid(),
|
|
319
|
+
vehicleId: z$1.string().uuid()
|
|
441
320
|
});
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
return client.post(
|
|
450
|
-
`/boapi/proxy/user/scheduleATrip/fleets/${client.clientOptions.fleetId}/bookingrequests/${bookingRequestId}`,
|
|
451
|
-
updateData
|
|
452
|
-
).then(({ data }) => data);
|
|
321
|
+
const deallocateVehicle = async (client, bookingRequestId, vehicleId) => {
|
|
322
|
+
const resultPayload = deallocateVehicleSchema.safeParse({
|
|
323
|
+
bookingRequestId,
|
|
324
|
+
vehicleId
|
|
325
|
+
});
|
|
326
|
+
if (!resultPayload.success) throw new TypeError("Invalid args", { cause: resultPayload.error.issues });
|
|
327
|
+
return client.delete(`boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/${bookingRequestId}/vehicles/${vehicleId}`).then(({ data }) => data);
|
|
453
328
|
};
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region src/updateScheduleBooking.ts
|
|
331
|
+
const schema$2 = z$1.object({
|
|
332
|
+
id: z$1.string(),
|
|
333
|
+
startDate: z$1.string().refine((date) => !Number.isNaN(Date.parse(date)), { message: "Invalid date" }).optional(),
|
|
334
|
+
latitude: z$1.number().min(-90).max(90).optional(),
|
|
335
|
+
longitude: z$1.number().min(-180).max(180).optional(),
|
|
336
|
+
radius: z$1.number().min(0).optional(),
|
|
337
|
+
userId: z$1.string().optional(),
|
|
338
|
+
status: z$1.enum([
|
|
339
|
+
"CONFIRMED",
|
|
340
|
+
"CANCELLED",
|
|
341
|
+
"PENDING"
|
|
342
|
+
]).optional(),
|
|
343
|
+
cityId: z$1.string().optional(),
|
|
344
|
+
profileId: z$1.string().optional(),
|
|
345
|
+
serviceId: z$1.string().optional(),
|
|
346
|
+
warning: z$1.string().optional(),
|
|
347
|
+
modelId: z$1.number().optional(),
|
|
348
|
+
notes: z$1.string().optional(),
|
|
349
|
+
bookingReferenceId: z$1.string().optional(),
|
|
350
|
+
plannedReturnDate: z$1.string().refine((date) => !Number.isNaN(Date.parse(date)), { message: "Invalid date" }).optional()
|
|
473
351
|
});
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
return client.post(
|
|
482
|
-
`boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/${bookingRequestId}/payment`,
|
|
483
|
-
resultPayload.data.body
|
|
484
|
-
).then(({ data }) => data).catch((error) => {
|
|
485
|
-
throw new TypeError("Failed to trigger booking request payment", {
|
|
486
|
-
cause: error
|
|
487
|
-
});
|
|
488
|
-
});
|
|
352
|
+
const updateScheduleBooking = async (client, bookingRequestId, updateData) => {
|
|
353
|
+
const result = schema$2.safeParse({
|
|
354
|
+
id: bookingRequestId,
|
|
355
|
+
...updateData
|
|
356
|
+
});
|
|
357
|
+
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
358
|
+
return client.post(`/boapi/proxy/user/scheduleATrip/fleets/${client.clientOptions.fleetId}/bookingrequests/${bookingRequestId}`, updateData).then(({ data }) => data);
|
|
489
359
|
};
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/triggerBRPayment.ts
|
|
362
|
+
const triggerBRPaymentSchema = z$1.object({
|
|
363
|
+
bookingRequestId: z$1.string().uuid(),
|
|
364
|
+
body: z$1.object({
|
|
365
|
+
scope: z$1.enum(["RENTAL", "DEPOSIT"]),
|
|
366
|
+
requiresActionReturnURL: z$1.string().url().optional(),
|
|
367
|
+
online: z$1.boolean(),
|
|
368
|
+
amountType: z$1.enum(["FIXED", "PERCENTAGE"]),
|
|
369
|
+
amountValue: z$1.number().nonnegative(),
|
|
370
|
+
preferredPaymentMethods: z$1.array(z$1.object({
|
|
371
|
+
pspReference: z$1.string(),
|
|
372
|
+
amount: z$1.number().default(0)
|
|
373
|
+
})).optional(),
|
|
374
|
+
profileId: z$1.string().uuid()
|
|
375
|
+
})
|
|
495
376
|
});
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
).then(({ data }) => data).catch((error) => {
|
|
506
|
-
if (error.formattedError?.status === 404) {
|
|
507
|
-
return [];
|
|
508
|
-
}
|
|
509
|
-
throw error;
|
|
510
|
-
});
|
|
377
|
+
const triggerBRPayment = async (client, bookingRequestId, body) => {
|
|
378
|
+
const resultPayload = triggerBRPaymentSchema.safeParse({
|
|
379
|
+
bookingRequestId,
|
|
380
|
+
body
|
|
381
|
+
});
|
|
382
|
+
if (!resultPayload.success) throw new TypeError("Invalid args", { cause: resultPayload.error.issues });
|
|
383
|
+
return client.post(`boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/${bookingRequestId}/payment`, resultPayload.data.body).then(({ data }) => data).catch((error) => {
|
|
384
|
+
throw new TypeError("Failed to trigger booking request payment", { cause: error });
|
|
385
|
+
});
|
|
511
386
|
};
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
})
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
throw new TypeError("Invalid args", {
|
|
523
|
-
cause: resultPayload.error.issues
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
return client.post(
|
|
527
|
-
`boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/${bookingRequestId}/paymentintent/${pspReference}/cancel`,
|
|
528
|
-
{}
|
|
529
|
-
).then(({ data }) => data).catch((error) => {
|
|
530
|
-
throw new TypeError("Failed to release booking request payment", {
|
|
531
|
-
cause: error
|
|
532
|
-
});
|
|
533
|
-
});
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/getBookingRequestsByUserId.ts
|
|
389
|
+
const schema$1 = z.object({ userId: z.string().trim().min(1).uuid() });
|
|
390
|
+
const getBookingRequestsByUserId = async (client, userId) => {
|
|
391
|
+
const result = schema$1.safeParse({ userId });
|
|
392
|
+
if (!result.success) throw new TypeError("Invalid userId", { cause: result.error.issues });
|
|
393
|
+
return client.get(`/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/users/${userId}`).then(({ data }) => data).catch((error) => {
|
|
394
|
+
if (error.formattedError?.status === 404) return [];
|
|
395
|
+
throw error;
|
|
396
|
+
});
|
|
534
397
|
};
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/releaseBRPayment.ts
|
|
400
|
+
const releaseBRPaymentSchema = z$1.object({
|
|
401
|
+
bookingRequestId: z$1.string().uuid(),
|
|
402
|
+
pspReference: z$1.string().uuid()
|
|
540
403
|
});
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
{}
|
|
551
|
-
).then(({ data }) => data).catch((error) => {
|
|
552
|
-
throw new TypeError("Failed to cancel booking request", {
|
|
553
|
-
cause: error
|
|
554
|
-
});
|
|
555
|
-
});
|
|
404
|
+
const releaseBRPayment = async (client, bookingRequestId, pspReference) => {
|
|
405
|
+
const resultPayload = releaseBRPaymentSchema.safeParse({
|
|
406
|
+
bookingRequestId,
|
|
407
|
+
pspReference
|
|
408
|
+
});
|
|
409
|
+
if (!resultPayload.success) throw new TypeError("Invalid args", { cause: resultPayload.error.issues });
|
|
410
|
+
return client.post(`boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/${bookingRequestId}/paymentintent/${pspReference}/cancel`, {}).then(({ data }) => data).catch((error) => {
|
|
411
|
+
throw new TypeError("Failed to release booking request payment", { cause: error });
|
|
412
|
+
});
|
|
556
413
|
};
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
getScheduleBookingRequests,
|
|
567
|
-
getStationById,
|
|
568
|
-
getStations,
|
|
569
|
-
getSubscriptionBookingRequestById,
|
|
570
|
-
getSubscriptionBookingRequests,
|
|
571
|
-
releaseBRPayment,
|
|
572
|
-
triggerBRPayment,
|
|
573
|
-
updateScheduleBooking
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/cancelBookingRequest.ts
|
|
416
|
+
const schema = z$1.object({ id: z$1.string().uuid() });
|
|
417
|
+
const cancelBookingRequest = async (client, id) => {
|
|
418
|
+
const result = schema.safeParse({ id });
|
|
419
|
+
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
420
|
+
return client.post(`/boapi/proxy/user/scheduledBooking/fleets/${client.clientOptions.fleetId}/bookingrequests/cancel/${id}`, {}).then(({ data }) => data).catch((error) => {
|
|
421
|
+
throw new TypeError("Failed to cancel booking request", { cause: error });
|
|
422
|
+
});
|
|
574
423
|
};
|
|
424
|
+
//#endregion
|
|
425
|
+
export { allocateVehicle, cancelBookingRequest, deallocateVehicle, getAvailableVehicles, getBookingRequestById, getBookingRequestByTrip, getBookingRequests, getBookingRequestsByUserId, getSATBookingRequests, getScheduleBookingRequests, getStationById, getStations, getSubscriptionBookingRequestById, getSubscriptionBookingRequests, releaseBRPayment, triggerBRPayment, updateScheduleBooking };
|