@movalib/movalib-commons 1.59.36 → 1.59.38
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/src/MovaLogin.js +6 -5
- package/dist/src/assets/images/logo/header_logo_admin.png +0 -0
- package/dist/src/assets/images/logo/logo_admin_large.png +0 -0
- package/dist/src/components/vehicle/VehicleFullCard.d.ts +5 -5
- package/dist/src/components/vehicle/VehicleFullCard.js +101 -82
- package/dist/src/helpers/ApiHelper.js +5 -0
- package/dist/src/helpers/CookieUtils.d.ts +1 -0
- package/dist/src/helpers/CookieUtils.js +2 -1
- package/dist/src/helpers/Enums.d.ts +7 -6
- package/dist/src/helpers/Enums.js +6 -5
- package/dist/src/models/Document.d.ts +2 -1
- package/dist/src/models/Document.js +3 -5
- package/dist/src/models/Event.d.ts +12 -1
- package/dist/src/models/Event.js +2 -1
- package/dist/src/models/Product.d.ts +2 -1
- package/dist/src/models/Product.js +2 -1
- package/dist/src/services/AuthenticationService.d.ts +1 -1
- package/dist/src/services/AuthenticationService.js +38 -9
- package/dist/src/services/GarageService.d.ts +3 -1
- package/dist/src/services/GarageService.js +18 -4
- package/package.json +1 -1
- package/src/MovaLogin.tsx +6 -5
- package/src/assets/images/logo/header_logo_admin.png +0 -0
- package/src/assets/images/logo/logo_admin_large.png +0 -0
- package/src/components/vehicle/VehicleFullCard.tsx +847 -559
- package/src/helpers/ApiHelper.ts +6 -1
- package/src/helpers/CookieUtils.ts +1 -0
- package/src/helpers/Enums.ts +216 -217
- package/src/models/Document.ts +42 -37
- package/src/models/Event.ts +13 -1
- package/src/models/Product.ts +40 -26
- package/src/services/AuthenticationService.ts +31 -6
- package/src/services/GarageService.ts +667 -621
|
@@ -5,117 +5,135 @@ import Garage from "../models/Garage";
|
|
|
5
5
|
import Operation from "../models/Operation";
|
|
6
6
|
import Product from "../models/Product";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
AddCustomerVehicleParams,
|
|
9
|
+
DeleteCustomerVehicleParams,
|
|
10
10
|
} from "./GarageService.types";
|
|
11
11
|
|
|
12
12
|
export default class GarageService {
|
|
13
|
+
static updatePaymentAuthorization(
|
|
14
|
+
garageId: string,
|
|
15
|
+
req: any
|
|
16
|
+
): Promise<APIResponse<string>> {
|
|
17
|
+
return request({
|
|
18
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/payment-authorization/update`,
|
|
19
|
+
method: APIMethod.PATCH,
|
|
20
|
+
appType: MovaAppType.GARAGE,
|
|
21
|
+
body: JSON.stringify(req),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static toogleGaragePaymentAuthorization(
|
|
26
|
+
garageId: string
|
|
27
|
+
): Promise<APIResponse<string>> {
|
|
28
|
+
return request({
|
|
29
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/payment-authorization`,
|
|
30
|
+
method: APIMethod.PATCH,
|
|
31
|
+
appType: MovaAppType.GARAGE,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static toogleEventVehicleReceived(
|
|
36
|
+
garageId: string,
|
|
37
|
+
eventId: string
|
|
38
|
+
): Promise<APIResponse<string>> {
|
|
39
|
+
return request({
|
|
40
|
+
url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/vehicle-received`,
|
|
41
|
+
method: APIMethod.PATCH,
|
|
42
|
+
appType: MovaAppType.GARAGE,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static setOrderedEvent(
|
|
47
|
+
garageId: string,
|
|
48
|
+
eventId: string,
|
|
49
|
+
req: any
|
|
50
|
+
): Promise<APIResponse<string>> {
|
|
51
|
+
return request({
|
|
52
|
+
url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/ordered`,
|
|
53
|
+
method: APIMethod.POST,
|
|
54
|
+
appType: MovaAppType.GARAGE,
|
|
55
|
+
body: JSON.stringify(req),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
13
58
|
|
|
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
|
-
method: APIMethod.PATCH,
|
|
43
|
-
appType: MovaAppType.GARAGE,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
static setOrderedEvent(
|
|
48
|
-
garageId: string,
|
|
49
|
-
eventId: string,
|
|
50
|
-
req: any,
|
|
51
|
-
): Promise<APIResponse<string>> {
|
|
52
|
-
return request({
|
|
53
|
-
url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/ordered`,
|
|
54
|
-
method: APIMethod.POST,
|
|
55
|
-
appType: MovaAppType.GARAGE,
|
|
56
|
-
body: JSON.stringify(req),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
static deleteEventEmployee(
|
|
61
|
-
garageId: string,
|
|
62
|
-
eventId: string,
|
|
63
|
-
): Promise<APIResponse<string>> {
|
|
64
|
-
return request({
|
|
65
|
-
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/employees`,
|
|
66
|
-
method: APIMethod.DELETE,
|
|
67
|
-
appType: MovaAppType.GARAGE,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
static updateEventEmployee(
|
|
72
|
-
garageId: string,
|
|
73
|
-
eventId: string,
|
|
74
|
-
employeeId: string,
|
|
75
|
-
): Promise<APIResponse<string>> {
|
|
76
|
-
return request({
|
|
77
|
-
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/employees/${employeeId}`,
|
|
78
|
-
method: APIMethod.PATCH,
|
|
79
|
-
appType: MovaAppType.GARAGE,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
static updateColorPrestationCategory(garageId: string, categoryCode: string, color: string): Promise<APIResponse<string>> {
|
|
59
|
+
static deleteEventEmployee(
|
|
60
|
+
garageId: string,
|
|
61
|
+
eventId: string
|
|
62
|
+
): Promise<APIResponse<string>> {
|
|
63
|
+
return request({
|
|
64
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/employees`,
|
|
65
|
+
method: APIMethod.DELETE,
|
|
66
|
+
appType: MovaAppType.GARAGE,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static updateEventEmployee(
|
|
71
|
+
garageId: string,
|
|
72
|
+
eventId: string,
|
|
73
|
+
employeeId: string
|
|
74
|
+
): Promise<APIResponse<string>> {
|
|
75
|
+
return request({
|
|
76
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/employees/${employeeId}`,
|
|
77
|
+
method: APIMethod.PATCH,
|
|
78
|
+
appType: MovaAppType.GARAGE,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static updateColorPrestationCategory(
|
|
83
|
+
garageId: string,
|
|
84
|
+
categoryCode: string,
|
|
85
|
+
color: string
|
|
86
|
+
): Promise<APIResponse<string>> {
|
|
84
87
|
return request({
|
|
85
88
|
url: `${API_BASE_URL}/garage/${garageId}/prestation-category/${categoryCode}/color`,
|
|
86
89
|
method: APIMethod.PATCH,
|
|
87
90
|
appType: MovaAppType.GARAGE,
|
|
88
|
-
body: JSON.stringify({ color })
|
|
91
|
+
body: JSON.stringify({ color }),
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
|
-
static updateGarageEventColor(
|
|
94
|
+
static updateGarageEventColor(
|
|
95
|
+
garageId: string,
|
|
96
|
+
eventId: string,
|
|
97
|
+
color: string
|
|
98
|
+
): Promise<APIResponse<string>> {
|
|
92
99
|
return request({
|
|
93
100
|
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/color`,
|
|
94
101
|
method: APIMethod.PATCH,
|
|
95
102
|
appType: MovaAppType.GARAGE,
|
|
96
|
-
body: JSON.stringify({ color })
|
|
103
|
+
body: JSON.stringify({ color }),
|
|
97
104
|
});
|
|
98
105
|
}
|
|
99
|
-
static updateVehicleGarageEvent(
|
|
100
|
-
|
|
106
|
+
static updateVehicleGarageEvent(
|
|
107
|
+
garageId: string,
|
|
108
|
+
eventId: string,
|
|
109
|
+
req: any
|
|
110
|
+
): Promise<APIResponse<string>> {
|
|
101
111
|
return request({
|
|
102
112
|
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicle`,
|
|
103
113
|
method: APIMethod.PATCH,
|
|
104
114
|
appType: MovaAppType.GARAGE,
|
|
105
|
-
body: JSON.stringify(req)
|
|
115
|
+
body: JSON.stringify(req),
|
|
106
116
|
});
|
|
107
117
|
}
|
|
108
118
|
|
|
109
|
-
static uploadEventDocument(
|
|
119
|
+
static uploadEventDocument(
|
|
120
|
+
garageId: string,
|
|
121
|
+
eventId: string,
|
|
122
|
+
req: FormData
|
|
123
|
+
): Promise<APIResponse<string>> {
|
|
110
124
|
return request({
|
|
111
125
|
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/documents`,
|
|
112
126
|
method: APIMethod.POST,
|
|
113
127
|
appType: MovaAppType.GARAGE,
|
|
114
|
-
body: req
|
|
128
|
+
body: req,
|
|
115
129
|
});
|
|
116
|
-
}
|
|
130
|
+
}
|
|
117
131
|
|
|
118
|
-
static deleteEventDocument(
|
|
132
|
+
static deleteEventDocument(
|
|
133
|
+
garageId: string,
|
|
134
|
+
eventId: string,
|
|
135
|
+
docId: string
|
|
136
|
+
): Promise<APIResponse<string>> {
|
|
119
137
|
return request({
|
|
120
138
|
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/documents/${docId}`,
|
|
121
139
|
appType: MovaAppType.GARAGE,
|
|
@@ -123,543 +141,571 @@ export default class GarageService {
|
|
|
123
141
|
});
|
|
124
142
|
}
|
|
125
143
|
|
|
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
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
144
|
+
static sendGarageMandate(garageId: string): Promise<APIResponse<string>> {
|
|
145
|
+
return request({
|
|
146
|
+
url: `${API_BASE_URL}/garage/${garageId}/subscription-mandate`,
|
|
147
|
+
method: APIMethod.POST,
|
|
148
|
+
appType: MovaAppType.GARAGE,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
static getGarageAllData(garageId: string): Promise<APIResponse<Garage>> {
|
|
153
|
+
return request({
|
|
154
|
+
url: `${API_BASE_URL}/garage/${garageId}/all-data`,
|
|
155
|
+
method: APIMethod.GET,
|
|
156
|
+
appType: MovaAppType.GARAGE,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
static createGaragePrestationRequest(
|
|
161
|
+
garageId: string,
|
|
162
|
+
req: any
|
|
163
|
+
): Promise<APIResponse<string>> {
|
|
164
|
+
return request({
|
|
165
|
+
url: `${API_BASE_URL}/garage/${garageId}/prestations/request`,
|
|
166
|
+
method: APIMethod.POST,
|
|
167
|
+
appType: MovaAppType.GARAGE,
|
|
168
|
+
body: JSON.stringify(req),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
static getGarageSettings({
|
|
173
|
+
garageId,
|
|
174
|
+
}: {
|
|
175
|
+
garageId: string;
|
|
176
|
+
}): Promise<APIResponse<Garage>> {
|
|
177
|
+
return request({
|
|
178
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings`,
|
|
179
|
+
method: APIMethod.GET,
|
|
180
|
+
appType: MovaAppType.GARAGE,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
static uploadLogo(
|
|
185
|
+
garageId: string,
|
|
186
|
+
formData: FormData
|
|
187
|
+
): Promise<APIResponse<string>> {
|
|
188
|
+
return request({
|
|
189
|
+
url: `${API_BASE_URL}/garage/${garageId}/logo`,
|
|
190
|
+
method: APIMethod.PATCH,
|
|
191
|
+
appType: MovaAppType.GARAGE,
|
|
192
|
+
body: formData,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
static sendInterventionEnd(
|
|
197
|
+
garageId: string,
|
|
198
|
+
eventId: string
|
|
199
|
+
): Promise<APIResponse<string>> {
|
|
200
|
+
return request({
|
|
201
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/intervention-end`,
|
|
202
|
+
method: APIMethod.POST,
|
|
203
|
+
appType: MovaAppType.GARAGE,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
static sendAppointmentVehicleAvailable(
|
|
208
|
+
garageId: string,
|
|
209
|
+
eventId: string
|
|
210
|
+
): Promise<APIResponse<string>> {
|
|
211
|
+
return request({
|
|
212
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicle-available`,
|
|
213
|
+
method: APIMethod.POST,
|
|
214
|
+
appType: MovaAppType.GARAGE,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
static enableGaragePrestation(
|
|
219
|
+
garageId: string,
|
|
220
|
+
prestationId: string
|
|
221
|
+
): Promise<APIResponse<string>> {
|
|
222
|
+
return request({
|
|
223
|
+
url: `${API_BASE_URL}/garage/${garageId}/prestations/${prestationId}/enable`,
|
|
224
|
+
method: APIMethod.PATCH,
|
|
225
|
+
appType: MovaAppType.GARAGE,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
static disableGaragePrestation(
|
|
230
|
+
garageId: string,
|
|
231
|
+
prestationId: string
|
|
232
|
+
): Promise<APIResponse<string>> {
|
|
233
|
+
return request({
|
|
234
|
+
url: `${API_BASE_URL}/garage/${garageId}/prestations/${prestationId}/disable`,
|
|
235
|
+
method: APIMethod.PATCH,
|
|
236
|
+
appType: MovaAppType.GARAGE,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
static getEmployeeDetails(
|
|
241
|
+
garageId: string,
|
|
242
|
+
employeeId: string
|
|
243
|
+
): Promise<APIResponse<Employee>> {
|
|
244
|
+
return request({
|
|
245
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}`,
|
|
246
|
+
method: APIMethod.GET,
|
|
247
|
+
appType: MovaAppType.GARAGE,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
static updateGaragePrestation(
|
|
252
|
+
garageId: string,
|
|
253
|
+
prestationId: string,
|
|
254
|
+
req: any
|
|
255
|
+
): Promise<APIResponse<string>> {
|
|
256
|
+
return request({
|
|
257
|
+
url: `${API_BASE_URL}/garage/${garageId}/prestations/${prestationId}`,
|
|
258
|
+
method: APIMethod.PATCH,
|
|
259
|
+
appType: MovaAppType.GARAGE,
|
|
260
|
+
body: JSON.stringify(req),
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
static deleteGarageEmployeePrestation(
|
|
265
|
+
garageId: string,
|
|
266
|
+
employeeId: string,
|
|
267
|
+
prestationId: string
|
|
268
|
+
): Promise<APIResponse<string>> {
|
|
269
|
+
return request({
|
|
270
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/prestations/${prestationId}`,
|
|
271
|
+
method: APIMethod.DELETE,
|
|
272
|
+
appType: MovaAppType.GARAGE,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
static createGarageEmployeePrestation(
|
|
277
|
+
garageId: string,
|
|
278
|
+
employeeId: string,
|
|
279
|
+
prestationId: string
|
|
280
|
+
): Promise<APIResponse<string>> {
|
|
281
|
+
return request({
|
|
282
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/prestations/${prestationId}`,
|
|
283
|
+
method: APIMethod.POST,
|
|
284
|
+
appType: MovaAppType.GARAGE,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
static deleteGarageEmployeeAbsence(
|
|
289
|
+
garageId: string,
|
|
290
|
+
employeeId: string,
|
|
291
|
+
absenceId: string
|
|
292
|
+
): Promise<APIResponse<string>> {
|
|
293
|
+
return request({
|
|
294
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/absences/${absenceId}`,
|
|
295
|
+
method: APIMethod.DELETE,
|
|
296
|
+
appType: MovaAppType.GARAGE,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
static createGarageEmployeeAbsence(
|
|
301
|
+
garageId: string,
|
|
302
|
+
employeeId: string,
|
|
303
|
+
req: any
|
|
304
|
+
): Promise<APIResponse<string>> {
|
|
305
|
+
return request({
|
|
306
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/absences`,
|
|
307
|
+
method: APIMethod.POST,
|
|
308
|
+
appType: MovaAppType.GARAGE,
|
|
309
|
+
body: JSON.stringify(req),
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
static updateGarageEmployee(
|
|
314
|
+
garageId: string,
|
|
315
|
+
employeeId: string,
|
|
316
|
+
req: any
|
|
317
|
+
): Promise<APIResponse<string>> {
|
|
318
|
+
return request({
|
|
319
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}`,
|
|
320
|
+
method: APIMethod.PATCH,
|
|
321
|
+
appType: MovaAppType.GARAGE,
|
|
322
|
+
body: JSON.stringify(req),
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
static updateGarageEmployeeSchedules(
|
|
327
|
+
garageId: string,
|
|
328
|
+
employeeId: string,
|
|
329
|
+
req: any
|
|
330
|
+
): Promise<APIResponse<string>> {
|
|
331
|
+
return request({
|
|
332
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/schedules`,
|
|
333
|
+
method: APIMethod.PATCH,
|
|
334
|
+
appType: MovaAppType.GARAGE,
|
|
335
|
+
body: JSON.stringify(req),
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
static deleteGarageEmployee(
|
|
340
|
+
garageId: string,
|
|
341
|
+
employeeId: string
|
|
342
|
+
): Promise<APIResponse<string>> {
|
|
343
|
+
return request({
|
|
344
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}`,
|
|
345
|
+
method: APIMethod.DELETE,
|
|
346
|
+
appType: MovaAppType.GARAGE,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
static createGarageEmployee(
|
|
351
|
+
garageId: string,
|
|
352
|
+
req: any
|
|
353
|
+
): Promise<APIResponse<string>> {
|
|
354
|
+
return request({
|
|
355
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees`,
|
|
356
|
+
method: APIMethod.POST,
|
|
357
|
+
appType: MovaAppType.GARAGE,
|
|
358
|
+
body: JSON.stringify(req),
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
static getEmployees(garageId: string): Promise<APIResponse<Employee[]>> {
|
|
363
|
+
return request({
|
|
364
|
+
url: `${API_BASE_URL}/garage/${garageId}/employees`,
|
|
365
|
+
method: APIMethod.GET,
|
|
366
|
+
appType: MovaAppType.GARAGE,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
static activateGarage(garageId: string): Promise<APIResponse<string>> {
|
|
371
|
+
return request({
|
|
372
|
+
url: `${API_BASE_URL}/garage/${garageId}/activate`,
|
|
373
|
+
method: APIMethod.PATCH,
|
|
374
|
+
appType: MovaAppType.GARAGE,
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
static salesSignUp(formData: FormData): Promise<APIResponse<number>> {
|
|
379
|
+
return request({
|
|
380
|
+
url: `${API_BASE_URL}/garage/sales-signup`,
|
|
381
|
+
method: APIMethod.POST,
|
|
382
|
+
appType: MovaAppType.GARAGE,
|
|
383
|
+
body: formData,
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
static sendNewEventQuote(
|
|
388
|
+
garageId: string,
|
|
389
|
+
eventId: string,
|
|
390
|
+
formData: FormData
|
|
391
|
+
): Promise<APIResponse<string>> {
|
|
392
|
+
return request({
|
|
393
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/quote`,
|
|
394
|
+
method: APIMethod.PATCH,
|
|
395
|
+
appType: MovaAppType.GARAGE,
|
|
396
|
+
body: formData,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
static sendCustomerReminder(
|
|
401
|
+
garageId: string,
|
|
402
|
+
eventId: string,
|
|
403
|
+
message: string
|
|
404
|
+
): Promise<APIResponse<string>> {
|
|
405
|
+
return request({
|
|
406
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/customer-reminder`,
|
|
407
|
+
method: APIMethod.POST,
|
|
408
|
+
appType: MovaAppType.GARAGE,
|
|
409
|
+
body: message,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
static updateGarageEvent(
|
|
414
|
+
garageId: string,
|
|
415
|
+
eventId: string,
|
|
416
|
+
req: any
|
|
417
|
+
): Promise<APIResponse<string>> {
|
|
418
|
+
return request({
|
|
419
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}`,
|
|
420
|
+
method: APIMethod.PATCH,
|
|
421
|
+
appType: MovaAppType.GARAGE,
|
|
422
|
+
body: JSON.stringify(req),
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
static sendSupplierRequest(
|
|
427
|
+
garageId: string,
|
|
428
|
+
eventId: string,
|
|
429
|
+
req: any
|
|
430
|
+
): Promise<APIResponse<string>> {
|
|
431
|
+
return request({
|
|
432
|
+
url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/supplierRequest`,
|
|
433
|
+
method: APIMethod.POST,
|
|
434
|
+
appType: MovaAppType.GARAGE,
|
|
435
|
+
body: JSON.stringify(req),
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
static deleteSupplierRequest(orderId: string): Promise<APIResponse<string>> {
|
|
440
|
+
return request({
|
|
441
|
+
url: `${API_BASE_URL}/order/${orderId}`,
|
|
442
|
+
method: APIMethod.DELETE,
|
|
443
|
+
appType: MovaAppType.GARAGE,
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
static receiveSupplierRequest(orderId: string): Promise<APIResponse<string>> {
|
|
448
|
+
return request({
|
|
449
|
+
url: `${API_BASE_URL}/order/${orderId}/receive`,
|
|
450
|
+
method: APIMethod.PATCH,
|
|
451
|
+
appType: MovaAppType.GARAGE,
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
static deleteGarageSupplier(
|
|
456
|
+
garageId: string,
|
|
457
|
+
supplierId: string
|
|
458
|
+
): Promise<APIResponse<string>> {
|
|
459
|
+
return request({
|
|
460
|
+
url: `${API_BASE_URL}/garage/${garageId}/suppliers/${supplierId}`,
|
|
461
|
+
method: APIMethod.DELETE,
|
|
462
|
+
appType: MovaAppType.GARAGE,
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
static createGarageSupplier(
|
|
467
|
+
garageId: string,
|
|
468
|
+
req: any
|
|
469
|
+
): Promise<APIResponse<string>> {
|
|
470
|
+
return request({
|
|
471
|
+
url: `${API_BASE_URL}/garage/${garageId}/suppliers`,
|
|
472
|
+
method: APIMethod.POST,
|
|
473
|
+
appType: MovaAppType.GARAGE,
|
|
474
|
+
body: JSON.stringify(req),
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
static updateGarageSupplier(
|
|
479
|
+
garageId: string,
|
|
480
|
+
supplierId: number,
|
|
481
|
+
req: any
|
|
482
|
+
): Promise<APIResponse<string>> {
|
|
483
|
+
return request({
|
|
484
|
+
url: `${API_BASE_URL}/garage/${garageId}/suppliers/${supplierId}`,
|
|
485
|
+
method: APIMethod.PATCH,
|
|
486
|
+
appType: MovaAppType.GARAGE,
|
|
487
|
+
body: JSON.stringify(req),
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
static updateGarage(
|
|
491
|
+
garageId: string,
|
|
492
|
+
req: any
|
|
493
|
+
): Promise<APIResponse<string>> {
|
|
494
|
+
return request({
|
|
495
|
+
url: `${API_BASE_URL}/garage/${garageId}`,
|
|
496
|
+
method: APIMethod.PATCH,
|
|
497
|
+
appType: MovaAppType.GARAGE,
|
|
498
|
+
body: JSON.stringify(req),
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
static getAdministratedGarages({
|
|
503
|
+
garageId,
|
|
504
|
+
}: {
|
|
505
|
+
garageId: string;
|
|
506
|
+
}): Promise<APIResponse<Garage>> {
|
|
507
|
+
return request({
|
|
508
|
+
url: `${API_BASE_URL}/user/garage/${garageId}`,
|
|
509
|
+
method: APIMethod.GET,
|
|
510
|
+
appType: MovaAppType.GARAGE,
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
static sendGarageSupportRequest(
|
|
515
|
+
garageId: string,
|
|
516
|
+
req: { message: string }
|
|
517
|
+
): Promise<APIResponse<string>> {
|
|
518
|
+
return request({
|
|
519
|
+
url: `${API_BASE_URL}/garage/${garageId}/support-request`,
|
|
520
|
+
method: APIMethod.POST,
|
|
521
|
+
appType: MovaAppType.GARAGE,
|
|
522
|
+
body: JSON.stringify(req),
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
static addCustomerVehicle({
|
|
527
|
+
garageId,
|
|
528
|
+
customerId,
|
|
529
|
+
...payload
|
|
530
|
+
}: AddCustomerVehicleParams): Promise<APIResponse<string>> {
|
|
531
|
+
return request({
|
|
532
|
+
url: `${API_BASE_URL}/garage/${garageId}/customers/${customerId}/vehicles`,
|
|
533
|
+
method: APIMethod.POST,
|
|
534
|
+
appType: MovaAppType.GARAGE,
|
|
535
|
+
body: JSON.stringify(payload),
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
static deleteCustomerVehicle({
|
|
540
|
+
garageId,
|
|
541
|
+
customerId,
|
|
542
|
+
vehicleId,
|
|
543
|
+
}: DeleteCustomerVehicleParams): Promise<APIResponse<string>> {
|
|
544
|
+
return request({
|
|
545
|
+
url: `${API_BASE_URL}/garage/${garageId}/customers/${customerId}/vehicles/${vehicleId}`,
|
|
546
|
+
method: APIMethod.DELETE,
|
|
547
|
+
appType: MovaAppType.GARAGE,
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
static toogleGarageLoanerVehicleRequest(
|
|
552
|
+
garageId: string,
|
|
553
|
+
req: any
|
|
554
|
+
): Promise<APIResponse<string>> {
|
|
555
|
+
return request({
|
|
556
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/loaner-vehicle-request`,
|
|
557
|
+
method: APIMethod.PATCH,
|
|
558
|
+
appType: MovaAppType.GARAGE,
|
|
559
|
+
body: JSON.stringify(req),
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
static toogleGarageLoanerVehicleFastServiceExclusion(
|
|
564
|
+
garageId: string
|
|
565
|
+
): Promise<APIResponse<string>> {
|
|
566
|
+
return request({
|
|
567
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/loaner-vehicle-fast-service-exclusion`,
|
|
568
|
+
method: APIMethod.PATCH,
|
|
569
|
+
appType: MovaAppType.GARAGE,
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
static updateFastServiceThresholdRequest(
|
|
574
|
+
garageId: string,
|
|
575
|
+
value: any
|
|
576
|
+
): Promise<APIResponse<string>> {
|
|
577
|
+
return request({
|
|
578
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/fast-service-threshold?fastServiceThreshold=${encodeURIComponent(
|
|
579
|
+
value
|
|
580
|
+
)}`,
|
|
581
|
+
method: APIMethod.PATCH,
|
|
582
|
+
appType: MovaAppType.GARAGE,
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
static updateSlotAlogrithm(
|
|
587
|
+
garageId: string,
|
|
588
|
+
req: any
|
|
589
|
+
): Promise<APIResponse<string>> {
|
|
590
|
+
return request({
|
|
591
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/slot-algorithm`,
|
|
592
|
+
method: APIMethod.PATCH,
|
|
593
|
+
appType: MovaAppType.GARAGE,
|
|
594
|
+
body: JSON.stringify(req),
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
static toogleGarageLoanerVehicle(
|
|
599
|
+
garageId: string
|
|
600
|
+
): Promise<APIResponse<string>> {
|
|
601
|
+
return request({
|
|
602
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/loaner-vehicle`,
|
|
603
|
+
method: APIMethod.PATCH,
|
|
604
|
+
appType: MovaAppType.GARAGE,
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
static addGarageVehicle({
|
|
609
|
+
garageId,
|
|
610
|
+
req,
|
|
611
|
+
}: {
|
|
612
|
+
garageId: string;
|
|
613
|
+
req: { plate: string };
|
|
614
|
+
}): Promise<APIResponse<string>> {
|
|
615
|
+
return request({
|
|
616
|
+
url: `${API_BASE_URL}/garage/${garageId}/vehicle`,
|
|
617
|
+
method: APIMethod.POST,
|
|
618
|
+
appType: MovaAppType.GARAGE,
|
|
619
|
+
body: JSON.stringify(req),
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
static deleteGarageVehicle({
|
|
624
|
+
garageId,
|
|
625
|
+
vehicleId,
|
|
626
|
+
}: {
|
|
627
|
+
garageId: string;
|
|
628
|
+
vehicleId: number;
|
|
629
|
+
}): Promise<APIResponse<string>> {
|
|
630
|
+
return request({
|
|
631
|
+
url: `${API_BASE_URL}/garage/${garageId}/vehicle/${vehicleId}`,
|
|
632
|
+
method: APIMethod.DELETE,
|
|
633
|
+
appType: MovaAppType.GARAGE,
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
static getAllGarageVehicles(garageId: string): Promise<APIResponse<any>> {
|
|
638
|
+
return request({
|
|
639
|
+
url: `${API_BASE_URL}/garage/${garageId}/vehicles`,
|
|
640
|
+
method: APIMethod.GET,
|
|
641
|
+
appType: MovaAppType.GARAGE,
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
static getOneGarageVehicle(
|
|
646
|
+
garageId: string,
|
|
647
|
+
vehicleId: number
|
|
648
|
+
): Promise<APIResponse<any>> {
|
|
649
|
+
return request({
|
|
650
|
+
url: `${API_BASE_URL}/garage/${garageId}/vehicle/${vehicleId}`,
|
|
651
|
+
method: APIMethod.GET,
|
|
652
|
+
appType: MovaAppType.GARAGE,
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
static assignGarageVehicleEvent(
|
|
657
|
+
garageId: string,
|
|
658
|
+
eventId: string,
|
|
659
|
+
vehicleId: number
|
|
660
|
+
): Promise<APIResponse<string>> {
|
|
661
|
+
return request({
|
|
662
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicles/${vehicleId}`,
|
|
663
|
+
method: APIMethod.PATCH,
|
|
664
|
+
appType: MovaAppType.GARAGE,
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
static deassignGarageVehicleEvent(
|
|
669
|
+
garageId: string,
|
|
670
|
+
eventId: string
|
|
671
|
+
): Promise<APIResponse<string>> {
|
|
672
|
+
return request({
|
|
673
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicles`,
|
|
674
|
+
method: APIMethod.DELETE,
|
|
675
|
+
appType: MovaAppType.GARAGE,
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// CSM
|
|
680
|
+
static getGaragesCsm(): Promise<APIResponse<Garage[]>> {
|
|
681
|
+
return request({
|
|
682
|
+
url: `${API_BASE_URL}/csm/garages/list`,
|
|
683
|
+
method: APIMethod.GET,
|
|
684
|
+
appType: MovaAppType.GARAGE,
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
static getOneGarageCsm(garageId: string): Promise<APIResponse<Garage[]>> {
|
|
689
|
+
return request({
|
|
690
|
+
url: `${API_BASE_URL}/csm/garage/${garageId}`,
|
|
691
|
+
method: APIMethod.GET,
|
|
692
|
+
appType: MovaAppType.GARAGE,
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
static getAllOperations(garageId: string): Promise<APIResponse<Operation>> {
|
|
697
|
+
return request({
|
|
698
|
+
url: `${API_BASE_URL}/garage/${garageId}/operations/all`,
|
|
699
|
+
method: APIMethod.GET,
|
|
700
|
+
appType: MovaAppType.GARAGE,
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
static getAllProducts(garageId: string): Promise<APIResponse<Product>> {
|
|
705
|
+
return request({
|
|
706
|
+
url: `${API_BASE_URL}/garage/${garageId}/products/all`,
|
|
707
|
+
method: APIMethod.GET,
|
|
708
|
+
appType: MovaAppType.GARAGE,
|
|
709
|
+
});
|
|
710
|
+
}
|
|
665
711
|
}
|