@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.
@@ -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 {AddCustomerVehicleParams, DeleteCustomerVehicleParams} from "./GarageService.types";
5
+ import {
6
+ AddCustomerVehicleParams,
7
+ DeleteCustomerVehicleParams,
8
+ } from "./GarageService.types";
6
9
 
7
10
  export default class GarageService {
8
11
 
9
- static toogleEventVehicleReceived(garageId: string, eventId: string): Promise<APIResponse<string>> {
10
- return request({
11
- url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/vehicle-received`,
12
- method: APIMethod.PATCH,
13
- appType: MovaAppType.GARAGE
14
- });
15
- }
16
-
17
- static setOrderedEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>> {
18
- return request({
19
- url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/ordered`,
20
- method: APIMethod.POST,
21
- appType: MovaAppType.GARAGE,
22
- body: JSON.stringify(req)
23
- });
24
- }
25
-
26
- static deleteEventEmployee(garageId: string, eventId: string): Promise<APIResponse<string>> {
27
- return request({
28
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/employees`,
29
- method: APIMethod.DELETE,
30
- appType: MovaAppType.GARAGE
31
- });
32
- }
33
-
34
- static updateEventEmployee(garageId: string, eventId: string, employeeId: string): Promise<APIResponse<string>> {
35
- return request({
36
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/employees/${employeeId}`,
37
- method: APIMethod.PATCH,
38
- appType: MovaAppType.GARAGE
39
- });
40
- }
41
-
42
- static updateColorPrestationCategory(garageId: string, categoryCode: string, color: string): Promise<APIResponse<string>> {
43
- return request({
44
- url: `${API_BASE_URL}/garage/${garageId}/prestation-category/${categoryCode}/color`,
45
- method: APIMethod.PATCH,
46
- appType: MovaAppType.GARAGE,
47
- body: JSON.stringify({ color })
48
- });
49
- }
50
- static updateGarageEventColor(garageId: string, eventId: string, color: string): Promise<APIResponse<string>> {
51
- return request({
52
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/color`,
53
- method: APIMethod.PATCH,
54
- appType: MovaAppType.GARAGE,
55
- body: JSON.stringify({ color })
56
- });
57
- }
58
- static updateVehicleGarageEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>> {
59
-
60
- return request({
61
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicle`,
62
- method: APIMethod.PATCH,
63
- appType: MovaAppType.GARAGE,
64
- body: JSON.stringify(req)
65
- });
66
- }
67
-
68
- static sendGarageMandate(garageId: string): Promise<APIResponse<string>> {
69
-
70
- return request({
71
- url: `${API_BASE_URL}/garage/${garageId}/subscription-mandate`,
72
- method: APIMethod.POST,
73
- appType: MovaAppType.GARAGE
74
- });
75
- }
76
-
77
- static getGarageAllData(garageId: string): Promise<APIResponse<Garage>> {
78
- return request({
79
- url: `${API_BASE_URL}/garage/${garageId}/all-data`,
80
- method: APIMethod.GET,
81
- appType: MovaAppType.GARAGE
82
- });
83
- }
84
-
85
- static createGaragePrestationRequest(garageId: string, req: any): Promise<APIResponse<string>> {
86
- return request({
87
- url: `${API_BASE_URL}/garage/${garageId}/prestations/request`,
88
- method: APIMethod.POST,
89
- appType: MovaAppType.GARAGE,
90
- body: JSON.stringify(req)
91
- });
92
- }
93
-
94
- static getGarageSettings(garageId: string): Promise<APIResponse<Garage>> {
95
- return request({
96
- url: `${API_BASE_URL}/garage/${garageId}/settings`,
97
- method: APIMethod.GET,
98
- appType: MovaAppType.GARAGE
99
- });
100
- }
101
-
102
- static uploadLogo(garageId: string, formData: FormData): Promise<APIResponse<string>> {
103
- return request({
104
- url: `${API_BASE_URL}/garage/${garageId}/logo`,
105
- method: APIMethod.PATCH,
106
- appType: MovaAppType.GARAGE,
107
- body: formData
108
- });
109
- }
110
-
111
- static sendAppointmentVehicleAvailable(garageId: string, eventId: string): Promise<APIResponse<string>> {
112
- return request({
113
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicle-available`,
114
- method: APIMethod.POST,
115
- appType: MovaAppType.GARAGE
116
- });
117
- }
118
-
119
- static enableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>> {
120
- return request({
121
- url: `${API_BASE_URL}/garage/${garageId}/prestations/${prestationId}/enable`,
122
- method: APIMethod.PATCH,
123
- appType: MovaAppType.GARAGE
124
- });
125
- }
126
-
127
- static disableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>> {
128
- return request({
129
- url: `${API_BASE_URL}/garage/${garageId}/prestations/${prestationId}/disable`,
130
- method: APIMethod.PATCH,
131
- appType: MovaAppType.GARAGE
132
- });
133
- }
134
-
135
- static getEmployeeDetails(garageId: string, employeeId: string): Promise<APIResponse<Employee>> {
136
- return request({
137
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}`,
138
- method: APIMethod.GET,
139
- appType: MovaAppType.GARAGE
140
- });
141
- }
142
-
143
-
144
- static updateGaragePrestation(garageId: string, prestationId: string, req: any): Promise<APIResponse<string>> {
145
- return request({
146
- url: `${API_BASE_URL}/garage/${garageId}/prestations/${prestationId}`,
147
- method: APIMethod.PATCH,
148
- appType: MovaAppType.GARAGE,
149
- body: JSON.stringify(req)
150
- });
151
- }
152
-
153
- static deleteGarageEmployeePrestation(garageId: string, employeeId: string, prestationId: string): Promise<APIResponse<string>> {
154
- return request({
155
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/prestations/${prestationId}`,
156
- method: APIMethod.DELETE,
157
- appType: MovaAppType.GARAGE
158
- });
159
- }
160
-
161
- static createGarageEmployeePrestation(garageId: string, employeeId: string, prestationId: string): Promise<APIResponse<string>> {
162
- return request({
163
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/prestations/${prestationId}`,
164
- method: APIMethod.POST,
165
- appType: MovaAppType.GARAGE
166
- });
167
- }
168
-
169
- static deleteGarageEmployeeAbsence(garageId: string, employeeId: string, absenceId: string): Promise<APIResponse<string>> {
170
- return request({
171
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/absences/${absenceId}`,
172
- method: APIMethod.DELETE,
173
- appType: MovaAppType.GARAGE
174
- });
175
- }
176
-
177
- static createGarageEmployeeAbsence(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>> {
178
- return request({
179
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/absences`,
180
- method: APIMethod.POST,
181
- appType: MovaAppType.GARAGE,
182
- body: JSON.stringify(req)
183
- });
184
- }
185
-
186
- static updateGarageEmployee(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>> {
187
- return request({
188
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}`,
189
- method: APIMethod.PATCH,
190
- appType: MovaAppType.GARAGE,
191
- body: JSON.stringify(req)
192
- });
193
- }
194
-
195
- static updateGarageEmployeeSchedules(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>> {
196
- return request({
197
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/schedules`,
198
- method: APIMethod.PATCH,
199
- appType: MovaAppType.GARAGE,
200
- body: JSON.stringify(req)
201
- });
202
- }
203
-
204
- static deleteGarageEmployee(garageId: string, employeeId: string): Promise<APIResponse<string>> {
205
- return request({
206
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}`,
207
- method: APIMethod.DELETE,
208
- appType: MovaAppType.GARAGE
209
- });
210
- }
211
-
212
- static createGarageEmployee(garageId: string, req: any): Promise<APIResponse<string>> {
213
- return request({
214
- url: `${API_BASE_URL}/garage/${garageId}/employees`,
215
- method: APIMethod.POST,
216
- appType: MovaAppType.GARAGE,
217
- body: JSON.stringify(req)
218
- });
219
- }
220
-
221
- static getEmployees(garageId: string): Promise<APIResponse<Employee[]>> {
222
- return request({
223
- url: `${API_BASE_URL}/garage/${garageId}/employees`,
224
- method: APIMethod.GET,
225
- appType: MovaAppType.GARAGE
226
- });
227
- }
228
-
229
- static activateGarage(garageId: string): Promise<APIResponse<string>> {
230
-
231
- return request({
232
- url: `${API_BASE_URL}/garage/${garageId}/activate`,
233
- method: APIMethod.PATCH,
234
- appType: MovaAppType.GARAGE
235
- });
236
- }
237
-
238
- static salesSignUp(formData: FormData): Promise<APIResponse<number>> {
239
- return request({
240
- url: `${API_BASE_URL}/garage/sales-signup`,
241
- method: APIMethod.POST,
242
- appType: MovaAppType.GARAGE,
243
- body: formData
244
- });
245
- }
246
-
247
- static sendNewEventQuote(garageId: string, eventId: string, formData: FormData): Promise<APIResponse<string>> {
248
- return request({
249
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/quote`,
250
- method: APIMethod.PATCH,
251
- appType: MovaAppType.GARAGE,
252
- body: formData
253
- });
254
- }
255
-
256
- static sendCustomerReminder(garageId: string, eventId: string, message: string): Promise<APIResponse<string>> {
257
-
258
- return request({
259
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/customer-reminder`,
260
- method: APIMethod.POST,
261
- appType: MovaAppType.GARAGE,
262
- body: message
263
- });
264
- }
265
-
266
- static updateGarageEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>> {
267
-
268
- return request({
269
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}`,
270
- method: APIMethod.PATCH,
271
- appType: MovaAppType.GARAGE,
272
- body: JSON.stringify(req)
273
- });
274
- }
275
-
276
- static sendSupplierRequest(garageId: string, eventId: string, req: any): Promise<APIResponse<string>> {
277
- return request({
278
- url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/supplierRequest`,
279
- method: APIMethod.POST,
280
- appType: MovaAppType.GARAGE,
281
- body: JSON.stringify(req)
282
- });
283
- }
284
-
285
- static deleteGarageSupplier(garageId: string, supplierId: string): Promise<APIResponse<string>> {
286
- return request({
287
- url: `${API_BASE_URL}/garage/${garageId}/suppliers/${supplierId}`,
288
- method: APIMethod.DELETE,
289
- appType: MovaAppType.GARAGE
290
- });
291
- }
292
-
293
- static createGarageSupplier(garageId: string, req: any): Promise<APIResponse<string>> {
294
- return request({
295
- url: `${API_BASE_URL}/garage/${garageId}/suppliers`,
296
- method: APIMethod.POST,
297
- appType: MovaAppType.GARAGE,
298
- body: JSON.stringify(req)
299
- });
300
- }
301
-
302
- static updateGarageSupplier(garageId: string, supplierId: number ,req: any): Promise<APIResponse<string>> {
303
- return request({
304
- url: `${API_BASE_URL}/garage/${garageId}/suppliers/${supplierId}`,
305
- method: APIMethod.PATCH,
306
- appType: MovaAppType.GARAGE,
307
- body: JSON.stringify(req)
308
- });
309
- }
310
- static updateGarage(garageId: string, req: any): Promise<APIResponse<string>> {
311
- return request({
312
- url: `${API_BASE_URL}/garage/${garageId}`,
313
- method: APIMethod.PATCH,
314
- appType: MovaAppType.GARAGE,
315
- body: JSON.stringify(req)
316
- });
317
- }
318
-
319
- static getAdministratedGarages({garageId}: {garageId: string}): Promise<APIResponse<Garage>> {
320
- return request({
321
- url: `${API_BASE_URL}/user/garage/${garageId}`,
322
- method: APIMethod.GET,
323
- appType: MovaAppType.GARAGE
324
- });
325
- }
326
-
327
- static sendGarageSupportRequest(garageId: string, req: { message: string }): Promise<APIResponse<string>> {
328
- return request({
329
- url: `${API_BASE_URL}/garage/${garageId}/support-request`,
330
- method: APIMethod.POST,
331
- appType: MovaAppType.GARAGE,
332
- body: JSON.stringify(req)
333
- });
334
- }
335
-
336
- static addCustomerVehicle({garageId, customerId, ...payload}: AddCustomerVehicleParams):Promise<APIResponse<string>> {
337
- return request({
338
- url: `${API_BASE_URL}/garage/${garageId}/customers/${customerId}/vehicles`,
339
- method: APIMethod.POST,
340
- appType: MovaAppType.GARAGE,
341
- body: JSON.stringify(payload)
342
- })
343
- }
344
-
345
- static deleteCustomerVehicle({garageId, customerId, vehicleId}: DeleteCustomerVehicleParams):Promise<APIResponse<string>> {
346
- return request({
347
- url: `${API_BASE_URL}/garage/${garageId}/customers/${customerId}/vehicles/${vehicleId}`,
348
- method: APIMethod.DELETE,
349
- appType: MovaAppType.GARAGE,
350
- })
351
- }
352
-
353
- static toogleGarageLoanerVehicleRequest(garageId: string, req: any): Promise<APIResponse<string>> {
354
- return request({
355
- url: `${API_BASE_URL}/garage/${garageId}/settings/loaner-vehicle-request`,
356
- method: APIMethod.PATCH,
357
- appType: MovaAppType.GARAGE,
358
- body: JSON.stringify(req)
359
- });
360
- }
361
-
362
- static toogleGarageLoanerVehicle(garageId: string): Promise<APIResponse<string>> {
363
- return request({
364
- url: `${API_BASE_URL}/garage/${garageId}/settings/loaner-vehicle`,
365
- method: APIMethod.PATCH,
366
- appType: MovaAppType.GARAGE,
367
- });
368
- }
369
-
370
- static addGarageVehicle({garageId, req} :{garageId: string, req: {plate: string}}): Promise<APIResponse<string>> {
371
- return request({
372
- url: `${API_BASE_URL}/garage/${garageId}/vehicle`,
373
- method: APIMethod.POST,
374
- appType: MovaAppType.GARAGE,
375
- body: JSON.stringify(req)
376
- });
377
- }
378
-
379
- static deleteGarageVehicle({garageId, vehicleId}:{garageId: string, vehicleId: number}): Promise<APIResponse<string>> {
380
- return request({
381
- url: `${API_BASE_URL}/garage/${garageId}/vehicle/${vehicleId}`,
382
- method: APIMethod.DELETE,
383
- appType: MovaAppType.GARAGE
384
- });
385
- }
386
-
387
- static getAllGarageVehicles(garageId: string): Promise<APIResponse<any>> {
388
- return request({
389
- url: `${API_BASE_URL}/garage/${garageId}/vehicles`,
390
- method: APIMethod.GET,
391
- appType: MovaAppType.GARAGE
392
- })
393
- }
394
-
395
- static getOneGarageVehicle(garageId: string, vehicleId: number): Promise<APIResponse<any>> {
396
- return request({
397
- url: `${API_BASE_URL}/garage/${garageId}/vehicle/${vehicleId}`,
398
- method: APIMethod.GET,
399
- appType: MovaAppType.GARAGE
400
- })
401
- }
402
-
403
- static assignGarageVehicleEvent(garageId: string, eventId: string, vehicleId: number): Promise<APIResponse<string>> {
404
- return request({
405
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicles/${vehicleId}`,
406
- method: APIMethod.PATCH,
407
- appType: MovaAppType.GARAGE
408
- })
409
- }
410
-
411
- static deassignGarageVehicleEvent(garageId: string, eventId: string): Promise<APIResponse<string>> {
412
- return request({
413
- url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicles`,
414
- method: APIMethod.DELETE,
415
- appType: MovaAppType.GARAGE
416
- })
417
- }
418
-
419
- // CSM
420
- static getGaragesCsm(): Promise<APIResponse<Garage[]>> {
421
- return request({
422
- url: `${API_BASE_URL}/csm/garages/list`,
423
- method: APIMethod.GET,
424
- appType: MovaAppType.GARAGE
425
- });
426
- }
427
-
428
- static getOneGarageCsm(garageId: string): Promise<APIResponse<Garage[]>> {
429
- return request({
430
- url: `${API_BASE_URL}/csm/garage/${garageId}`,
431
- method: APIMethod.GET,
432
- appType: MovaAppType.GARAGE
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
  }