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