@vulog/aima-booking 1.2.33 → 1.2.34
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/README.md +103 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -139,6 +139,109 @@ Get a specific station by ID.
|
|
|
139
139
|
const station = await getStationById(client, 'station-id-here', ['OPEN_HOUR', 'INFO']);
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
+
### Vehicle Allocation
|
|
143
|
+
|
|
144
|
+
#### allocateVehicle
|
|
145
|
+
|
|
146
|
+
Allocate a vehicle to a booking request.
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
import { allocateVehicle } from '@vulog/aima-booking';
|
|
150
|
+
|
|
151
|
+
const result = await allocateVehicle(client, 'booking-request-uuid', 'vehicle-uuid', 'service-uuid');
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### deallocateVehicle
|
|
155
|
+
|
|
156
|
+
Deallocate a vehicle from a booking request.
|
|
157
|
+
|
|
158
|
+
```javascript
|
|
159
|
+
import { deallocateVehicle } from '@vulog/aima-booking';
|
|
160
|
+
|
|
161
|
+
await deallocateVehicle(client, 'booking-request-uuid');
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Booking Actions
|
|
165
|
+
|
|
166
|
+
#### updateScheduleBooking
|
|
167
|
+
|
|
168
|
+
Update a scheduled booking.
|
|
169
|
+
|
|
170
|
+
```javascript
|
|
171
|
+
import { updateScheduleBooking } from '@vulog/aima-booking';
|
|
172
|
+
|
|
173
|
+
await updateScheduleBooking(client, 'booking-request-uuid', { endDate: '2024-02-15T00:00:00Z' });
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### cancelBookingRequest
|
|
177
|
+
|
|
178
|
+
Cancel a booking request.
|
|
179
|
+
|
|
180
|
+
```javascript
|
|
181
|
+
import { cancelBookingRequest } from '@vulog/aima-booking';
|
|
182
|
+
|
|
183
|
+
await cancelBookingRequest(client, 'booking-request-uuid');
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### triggerBRPayment / releaseBRPayment
|
|
187
|
+
|
|
188
|
+
Trigger or release payment for a booking request.
|
|
189
|
+
|
|
190
|
+
```javascript
|
|
191
|
+
import { triggerBRPayment, releaseBRPayment } from '@vulog/aima-booking';
|
|
192
|
+
|
|
193
|
+
await triggerBRPayment(client, 'booking-request-uuid');
|
|
194
|
+
await releaseBRPayment(client, 'booking-request-uuid');
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
#### getBookingRequestsByUserId
|
|
198
|
+
|
|
199
|
+
Get booking requests for a specific user.
|
|
200
|
+
|
|
201
|
+
```javascript
|
|
202
|
+
import { getBookingRequestsByUserId } from '@vulog/aima-booking';
|
|
203
|
+
|
|
204
|
+
const requests = await getBookingRequestsByUserId(client, 'user-uuid');
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Subscriptions
|
|
208
|
+
|
|
209
|
+
#### createSubscription
|
|
210
|
+
|
|
211
|
+
Create a new subscription booking request.
|
|
212
|
+
|
|
213
|
+
```javascript
|
|
214
|
+
import { createSubscription } from '@vulog/aima-booking';
|
|
215
|
+
|
|
216
|
+
const subscription = await createSubscription(client, {
|
|
217
|
+
userId: 'user-uuid',
|
|
218
|
+
profileId: 'profile-uuid',
|
|
219
|
+
startDate: '2024-01-15T00:00:00Z',
|
|
220
|
+
endDate: '2024-07-15T00:00:00Z',
|
|
221
|
+
vehicleId: 'vehicle-uuid',
|
|
222
|
+
modelId: 372,
|
|
223
|
+
station: 'station-uuid',
|
|
224
|
+
serviceId: 'service-uuid',
|
|
225
|
+
// optional fields
|
|
226
|
+
pricingId: 'pricing-uuid',
|
|
227
|
+
notes: 'VIP client',
|
|
228
|
+
isRollingContract: false,
|
|
229
|
+
additionalDriverInvitations: ['driver@example.com'],
|
|
230
|
+
});
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Available Vehicles
|
|
234
|
+
|
|
235
|
+
#### getAvailableVehicles
|
|
236
|
+
|
|
237
|
+
Get available vehicles for booking.
|
|
238
|
+
|
|
239
|
+
```javascript
|
|
240
|
+
import { getAvailableVehicles } from '@vulog/aima-booking';
|
|
241
|
+
|
|
242
|
+
const vehicles = await getAvailableVehicles(client);
|
|
243
|
+
```
|
|
244
|
+
|
|
142
245
|
## Types
|
|
143
246
|
|
|
144
247
|
### BookingRequest
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-booking",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.34",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.cts",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"author": "Vulog",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vulog/aima-client": "1.2.
|
|
36
|
-
"@vulog/aima-core": "1.2.
|
|
35
|
+
"@vulog/aima-client": "1.2.34",
|
|
36
|
+
"@vulog/aima-core": "1.2.34"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"es-toolkit": "^1.39.9",
|