@dapex-tech/elite-online-services 0.0.7 → 0.0.10
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/createClient.d.ts +19 -0
- package/createClient.js +1 -2
- package/models/AdminDto.d.ts +18 -6
- package/models/{LoginDto.d.ts → AdminLoginDto.d.ts} +1 -1
- package/models/AdminUpdateDto.d.ts +0 -4
- package/models/CustomerDto.d.ts +66 -0
- package/models/{CreateUserLocationDto.d.ts → CustomerLocationCreateDto.d.ts} +2 -2
- package/models/CustomerLocationDto.d.ts +34 -0
- package/models/{UpdateUserLocationDto.d.ts → CustomerLocationUpdateDto.d.ts} +2 -2
- package/models/CustomerLoginDto.d.ts +18 -0
- package/models/{UserDto.d.ts → CustomerUpdatedDto.d.ts} +5 -5
- package/models/{VerifyUserAccountDto.d.ts → CustomerVerifyAccountDto.d.ts} +5 -1
- package/models/DriverDto.d.ts +16 -4
- package/models/{EmailPhoneLoginDto.d.ts → DriverLoginDto.d.ts} +2 -6
- package/models/DriverTripActions.d.ts +10 -0
- package/models/DriverTripActions.js +18 -0
- package/models/DriverUpdateDto.d.ts +6 -6
- package/models/GenerateResetCodeDto.d.ts +6 -2
- package/models/GenerateVerificationCodeDto.d.ts +10 -0
- package/models/PaymentDto.d.ts +18 -0
- package/models/ResetPasswordDto.d.ts +14 -0
- package/models/TripAssignDriverDto.d.ts +6 -0
- package/models/TripDto.d.ts +108 -0
- package/models/TripLocationPointDto.d.ts +26 -0
- package/models/TripUpdateDriverAssignmentModeDto.d.ts +6 -0
- package/models/TripUpdateDto.d.ts +38 -0
- package/models/TripUpdateTripsStatusDto.d.ts +6 -0
- package/models/ValidateResetCodeDto.d.ts +14 -0
- package/models/ValidateResetCodeDto.js +2 -0
- package/models/index.d.ts +20 -18
- package/models/index.js +20 -18
- package/package.json +1 -1
- package/services/AdminAuthService.d.ts +28 -3
- package/services/AdminAuthService.js +57 -1
- package/services/AdminCustomerService.d.ts +50 -0
- package/services/AdminCustomerService.js +119 -0
- package/services/AdminDriversService.d.ts +51 -0
- package/services/AdminDriversService.js +122 -0
- package/services/AdminService.d.ts +0 -44
- package/services/AdminService.js +0 -100
- package/services/AdminTripsService.d.ts +59 -0
- package/services/AdminTripsService.js +150 -0
- package/services/CustomerLocationsService.d.ts +41 -0
- package/services/CustomerLocationsService.js +93 -0
- package/services/CustomerTripsService.d.ts +63 -0
- package/services/CustomerTripsService.js +162 -0
- package/services/CustomersAuthService.d.ts +88 -0
- package/services/{UserAuthService.js → CustomersAuthService.js} +24 -21
- package/services/CustomersService.d.ts +17 -0
- package/services/CustomersService.js +41 -0
- package/services/DriverAuthService.d.ts +6 -6
- package/services/DriverAuthService.js +1 -1
- package/services/DriverTripsService.d.ts +49 -0
- package/services/DriverTripsService.js +121 -0
- package/services/DriversService.d.ts +9 -53
- package/services/DriversService.js +14 -132
- package/services/MainService.d.ts +5 -0
- package/services/MainService.js +10 -0
- package/services/index.d.ts +8 -3
- package/services/index.js +8 -3
- package/socketService.d.ts +54 -0
- package/socketService.js +91 -96
- package/models/CreateServiceOrderDto.d.ts +0 -46
- package/models/CreateStreetPickupDto.d.ts +0 -10
- package/models/GenerateUserResetCodeDto.d.ts +0 -6
- package/models/GenerateUserVerificationCodeDto.d.ts +0 -6
- package/models/ResetDriverPasswordDto.d.ts +0 -10
- package/models/ResetUserPasswordDto.d.ts +0 -10
- package/models/UpdateDriverStatusDto.d.ts +0 -10
- package/models/UpdateDriverTripStatusDto.d.ts +0 -14
- package/models/UpdateTripStatusDto.d.ts +0 -10
- package/models/UserUpdatedDto.d.ts +0 -18
- package/models/ValidateDriverResetCodeDto.d.ts +0 -10
- package/models/ValidateUserResetCodeDto.d.ts +0 -10
- package/services/CatalogsService.d.ts +0 -67
- package/services/CatalogsService.js +0 -142
- package/services/UserAuthService.d.ts +0 -85
- package/services/UsersService.d.ts +0 -81
- package/services/UsersService.js +0 -198
- /package/models/{CreateServiceOrderDto.js → AdminLoginDto.js} +0 -0
- /package/models/{CreateStreetPickupDto.js → CustomerDto.js} +0 -0
- /package/models/{CreateUserLocationDto.js → CustomerLocationCreateDto.js} +0 -0
- /package/models/{EmailPhoneLoginDto.js → CustomerLocationDto.js} +0 -0
- /package/models/{GenerateUserResetCodeDto.js → CustomerLocationUpdateDto.js} +0 -0
- /package/models/{GenerateUserVerificationCodeDto.js → CustomerLoginDto.js} +0 -0
- /package/models/{LoginDto.js → CustomerUpdatedDto.js} +0 -0
- /package/models/{ResetDriverPasswordDto.js → CustomerVerifyAccountDto.js} +0 -0
- /package/models/{ResetUserPasswordDto.js → DriverLoginDto.js} +0 -0
- /package/models/{UpdateDriverStatusDto.js → GenerateVerificationCodeDto.js} +0 -0
- /package/models/{UpdateDriverTripStatusDto.js → PaymentDto.js} +0 -0
- /package/models/{UpdateTripStatusDto.js → ResetPasswordDto.js} +0 -0
- /package/models/{UpdateUserLocationDto.js → TripAssignDriverDto.js} +0 -0
- /package/models/{UserDto.js → TripDto.js} +0 -0
- /package/models/{UserUpdatedDto.js → TripLocationPointDto.js} +0 -0
- /package/models/{ValidateDriverResetCodeDto.js → TripUpdateDriverAssignmentModeDto.js} +0 -0
- /package/models/{ValidateUserResetCodeDto.js → TripUpdateDto.js} +0 -0
- /package/models/{VerifyUserAccountDto.js → TripUpdateTripsStatusDto.js} +0 -0
package/services/AdminService.js
CHANGED
|
@@ -41,34 +41,6 @@ class AdminService {
|
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Reload service orders (IN_PROGRESS and COMPLETED)
|
|
46
|
-
* @returns any Service orders retrieved successfully.
|
|
47
|
-
* @throws ApiError
|
|
48
|
-
*/
|
|
49
|
-
static reloadServiceOrders() {
|
|
50
|
-
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
51
|
-
method: 'GET',
|
|
52
|
-
url: '/admins/service-orders/reload',
|
|
53
|
-
errors: {
|
|
54
|
-
401: `Unauthorized`,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Get taxi locations for all drivers
|
|
60
|
-
* @returns any Taxi locations retrieved successfully.
|
|
61
|
-
* @throws ApiError
|
|
62
|
-
*/
|
|
63
|
-
static getTaxiLocations() {
|
|
64
|
-
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
65
|
-
method: 'GET',
|
|
66
|
-
url: '/admins/taxi-locations',
|
|
67
|
-
errors: {
|
|
68
|
-
401: `Unauthorized`,
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
44
|
/**
|
|
73
45
|
* Get a single admin by ID
|
|
74
46
|
* @param id
|
|
@@ -129,77 +101,5 @@ class AdminService {
|
|
|
129
101
|
},
|
|
130
102
|
});
|
|
131
103
|
}
|
|
132
|
-
/**
|
|
133
|
-
* Create a new driver
|
|
134
|
-
* @param requestBody
|
|
135
|
-
* @returns any Driver created successfully.
|
|
136
|
-
* @throws ApiError
|
|
137
|
-
*/
|
|
138
|
-
static createDriver(requestBody) {
|
|
139
|
-
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
140
|
-
method: 'POST',
|
|
141
|
-
url: '/admins/drivers',
|
|
142
|
-
body: requestBody,
|
|
143
|
-
mediaType: 'application/json',
|
|
144
|
-
errors: {
|
|
145
|
-
401: `Unauthorized`,
|
|
146
|
-
},
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Create a new trip/service order
|
|
151
|
-
* @param requestBody
|
|
152
|
-
* @returns any Trip created successfully.
|
|
153
|
-
* @throws ApiError
|
|
154
|
-
*/
|
|
155
|
-
static createTrip(requestBody) {
|
|
156
|
-
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
157
|
-
method: 'POST',
|
|
158
|
-
url: '/admins/trips',
|
|
159
|
-
body: requestBody,
|
|
160
|
-
mediaType: 'application/json',
|
|
161
|
-
errors: {
|
|
162
|
-
401: `Unauthorized`,
|
|
163
|
-
},
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Update trip status
|
|
168
|
-
* @param requestBody
|
|
169
|
-
* @returns any Trip status updated successfully.
|
|
170
|
-
* @throws ApiError
|
|
171
|
-
*/
|
|
172
|
-
static updateTripStatus(requestBody) {
|
|
173
|
-
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
174
|
-
method: 'PATCH',
|
|
175
|
-
url: '/admins/trips/status',
|
|
176
|
-
body: requestBody,
|
|
177
|
-
mediaType: 'application/json',
|
|
178
|
-
errors: {
|
|
179
|
-
400: `Invalid status`,
|
|
180
|
-
401: `Unauthorized`,
|
|
181
|
-
404: `Service order not found`,
|
|
182
|
-
},
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Update driver status (Taxi In/Out)
|
|
187
|
-
* @param requestBody
|
|
188
|
-
* @returns any Driver status updated successfully.
|
|
189
|
-
* @throws ApiError
|
|
190
|
-
*/
|
|
191
|
-
static updateDriverStatus(requestBody) {
|
|
192
|
-
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
193
|
-
method: 'PATCH',
|
|
194
|
-
url: '/admins/drivers/status',
|
|
195
|
-
body: requestBody,
|
|
196
|
-
mediaType: 'application/json',
|
|
197
|
-
errors: {
|
|
198
|
-
400: `Invalid status`,
|
|
199
|
-
401: `Unauthorized`,
|
|
200
|
-
404: `Driver not found`,
|
|
201
|
-
},
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
104
|
}
|
|
205
105
|
exports.AdminService = AdminService;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { TripAssignDriverDto } from '../models/TripAssignDriverDto';
|
|
2
|
+
import type { TripDto } from '../models/TripDto';
|
|
3
|
+
import type { TripUpdateDriverAssignmentModeDto } from '../models/TripUpdateDriverAssignmentModeDto';
|
|
4
|
+
import type { TripUpdateDto } from '../models/TripUpdateDto';
|
|
5
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
6
|
+
export declare class AdminTripsService {
|
|
7
|
+
/**
|
|
8
|
+
* Get all trips
|
|
9
|
+
* @param search
|
|
10
|
+
* @returns any List of trips
|
|
11
|
+
* @throws ApiError
|
|
12
|
+
*/
|
|
13
|
+
static findAll(search: string): CancelablePromise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new trip/service order
|
|
16
|
+
* @param requestBody
|
|
17
|
+
* @returns any Trip created successfully.
|
|
18
|
+
* @throws ApiError
|
|
19
|
+
*/
|
|
20
|
+
static create(requestBody: TripDto): CancelablePromise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* Get a single trip by ID
|
|
23
|
+
* @param id
|
|
24
|
+
* @returns any Trip found
|
|
25
|
+
* @throws ApiError
|
|
26
|
+
*/
|
|
27
|
+
static findById(id: number): CancelablePromise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Update a trip by ID
|
|
30
|
+
* @param id
|
|
31
|
+
* @param requestBody
|
|
32
|
+
* @returns any Trip updated successfully.
|
|
33
|
+
* @throws ApiError
|
|
34
|
+
*/
|
|
35
|
+
static update(id: number, requestBody: TripUpdateDto): CancelablePromise<any>;
|
|
36
|
+
/**
|
|
37
|
+
* Update trip status
|
|
38
|
+
* @param id
|
|
39
|
+
* @returns any Trip status updated successfully.
|
|
40
|
+
* @throws ApiError
|
|
41
|
+
*/
|
|
42
|
+
static updateTripStatus(id: number): CancelablePromise<any>;
|
|
43
|
+
/**
|
|
44
|
+
* Assign a driver to a trip
|
|
45
|
+
* @param id
|
|
46
|
+
* @param requestBody
|
|
47
|
+
* @returns any Driver assigned to trip successfully.
|
|
48
|
+
* @throws ApiError
|
|
49
|
+
*/
|
|
50
|
+
static assignDriver(id: number, requestBody: TripAssignDriverDto): CancelablePromise<any>;
|
|
51
|
+
/**
|
|
52
|
+
* Update driver assignment mode for a trip
|
|
53
|
+
* @param id
|
|
54
|
+
* @param requestBody
|
|
55
|
+
* @returns any Driver assignment mode updated successfully.
|
|
56
|
+
* @throws ApiError
|
|
57
|
+
*/
|
|
58
|
+
static updateDriverAssignmentMode(id: number, requestBody: TripUpdateDriverAssignmentModeDto): CancelablePromise<any>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdminTripsService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class AdminTripsService {
|
|
7
|
+
/**
|
|
8
|
+
* Get all trips
|
|
9
|
+
* @param search
|
|
10
|
+
* @returns any List of trips
|
|
11
|
+
* @throws ApiError
|
|
12
|
+
*/
|
|
13
|
+
static findAll(search) {
|
|
14
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
15
|
+
method: 'GET',
|
|
16
|
+
url: '/admins/trips',
|
|
17
|
+
query: {
|
|
18
|
+
'search': search,
|
|
19
|
+
},
|
|
20
|
+
errors: {
|
|
21
|
+
401: `Unauthorized`,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a new trip/service order
|
|
27
|
+
* @param requestBody
|
|
28
|
+
* @returns any Trip created successfully.
|
|
29
|
+
* @throws ApiError
|
|
30
|
+
*/
|
|
31
|
+
static create(requestBody) {
|
|
32
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
33
|
+
method: 'POST',
|
|
34
|
+
url: '/admins/trips',
|
|
35
|
+
body: requestBody,
|
|
36
|
+
mediaType: 'application/json',
|
|
37
|
+
errors: {
|
|
38
|
+
401: `Unauthorized`,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get a single trip by ID
|
|
44
|
+
* @param id
|
|
45
|
+
* @returns any Trip found
|
|
46
|
+
* @throws ApiError
|
|
47
|
+
*/
|
|
48
|
+
static findById(id) {
|
|
49
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
50
|
+
method: 'GET',
|
|
51
|
+
url: '/admins/trips/{id}',
|
|
52
|
+
path: {
|
|
53
|
+
'id': id,
|
|
54
|
+
},
|
|
55
|
+
errors: {
|
|
56
|
+
401: `Unauthorized`,
|
|
57
|
+
404: `Trip not found`,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Update a trip by ID
|
|
63
|
+
* @param id
|
|
64
|
+
* @param requestBody
|
|
65
|
+
* @returns any Trip updated successfully.
|
|
66
|
+
* @throws ApiError
|
|
67
|
+
*/
|
|
68
|
+
static update(id, requestBody) {
|
|
69
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
70
|
+
method: 'PATCH',
|
|
71
|
+
url: '/admins/trips/{id}',
|
|
72
|
+
path: {
|
|
73
|
+
'id': id,
|
|
74
|
+
},
|
|
75
|
+
body: requestBody,
|
|
76
|
+
mediaType: 'application/json',
|
|
77
|
+
errors: {
|
|
78
|
+
401: `Unauthorized`,
|
|
79
|
+
404: `Trip not found`,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Update trip status
|
|
85
|
+
* @param id
|
|
86
|
+
* @returns any Trip status updated successfully.
|
|
87
|
+
* @throws ApiError
|
|
88
|
+
*/
|
|
89
|
+
static updateTripStatus(id) {
|
|
90
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
91
|
+
method: 'PATCH',
|
|
92
|
+
url: '/admins/trips/{id}/status/{status}',
|
|
93
|
+
path: {
|
|
94
|
+
'id': id,
|
|
95
|
+
},
|
|
96
|
+
errors: {
|
|
97
|
+
400: `Invalid status`,
|
|
98
|
+
401: `Unauthorized`,
|
|
99
|
+
404: `Service order not found`,
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Assign a driver to a trip
|
|
105
|
+
* @param id
|
|
106
|
+
* @param requestBody
|
|
107
|
+
* @returns any Driver assigned to trip successfully.
|
|
108
|
+
* @throws ApiError
|
|
109
|
+
*/
|
|
110
|
+
static assignDriver(id, requestBody) {
|
|
111
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
112
|
+
method: 'PATCH',
|
|
113
|
+
url: '/admins/trips/{id}/assign-driver',
|
|
114
|
+
path: {
|
|
115
|
+
'id': id,
|
|
116
|
+
},
|
|
117
|
+
body: requestBody,
|
|
118
|
+
mediaType: 'application/json',
|
|
119
|
+
errors: {
|
|
120
|
+
400: `Trip status does not allow driver assignment`,
|
|
121
|
+
401: `Unauthorized`,
|
|
122
|
+
404: `Trip not found`,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Update driver assignment mode for a trip
|
|
128
|
+
* @param id
|
|
129
|
+
* @param requestBody
|
|
130
|
+
* @returns any Driver assignment mode updated successfully.
|
|
131
|
+
* @throws ApiError
|
|
132
|
+
*/
|
|
133
|
+
static updateDriverAssignmentMode(id, requestBody) {
|
|
134
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
135
|
+
method: 'PATCH',
|
|
136
|
+
url: '/admins/trips/{id}/driver-assignment-mode',
|
|
137
|
+
path: {
|
|
138
|
+
'id': id,
|
|
139
|
+
},
|
|
140
|
+
body: requestBody,
|
|
141
|
+
mediaType: 'application/json',
|
|
142
|
+
errors: {
|
|
143
|
+
400: `Trip already has the specified driver assignment mode`,
|
|
144
|
+
401: `Unauthorized`,
|
|
145
|
+
404: `Trip not found`,
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.AdminTripsService = AdminTripsService;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CustomerLocationCreateDto } from '../models/CustomerLocationCreateDto';
|
|
2
|
+
import type { CustomerLocationDto } from '../models/CustomerLocationDto';
|
|
3
|
+
import type { CustomerLocationUpdateDto } from '../models/CustomerLocationUpdateDto';
|
|
4
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
5
|
+
export declare class CustomerLocationsService {
|
|
6
|
+
/**
|
|
7
|
+
* Get all locations for the authenticated user
|
|
8
|
+
* @returns CustomerLocationDto
|
|
9
|
+
* @throws ApiError
|
|
10
|
+
*/
|
|
11
|
+
static getUserLocations(): CancelablePromise<Array<CustomerLocationDto>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new location for the authenticated user
|
|
14
|
+
* @param requestBody
|
|
15
|
+
* @returns CustomerLocationDto
|
|
16
|
+
* @throws ApiError
|
|
17
|
+
*/
|
|
18
|
+
static createUserLocation(requestBody: CustomerLocationCreateDto): CancelablePromise<CustomerLocationDto>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a user location by ID
|
|
21
|
+
* @param locationId
|
|
22
|
+
* @returns CustomerLocationDto
|
|
23
|
+
* @throws ApiError
|
|
24
|
+
*/
|
|
25
|
+
static getUserLocation(locationId: number): CancelablePromise<CustomerLocationDto>;
|
|
26
|
+
/**
|
|
27
|
+
* Update a user location
|
|
28
|
+
* @param locationId
|
|
29
|
+
* @param requestBody
|
|
30
|
+
* @returns CustomerLocationDto
|
|
31
|
+
* @throws ApiError
|
|
32
|
+
*/
|
|
33
|
+
static updateUserLocation(locationId: number, requestBody: CustomerLocationUpdateDto): CancelablePromise<CustomerLocationDto>;
|
|
34
|
+
/**
|
|
35
|
+
* Delete a user location
|
|
36
|
+
* @param locationId
|
|
37
|
+
* @returns any Location deleted successfully.
|
|
38
|
+
* @throws ApiError
|
|
39
|
+
*/
|
|
40
|
+
static deleteUserLocation(locationId: number): CancelablePromise<any>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerLocationsService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class CustomerLocationsService {
|
|
7
|
+
/**
|
|
8
|
+
* Get all locations for the authenticated user
|
|
9
|
+
* @returns CustomerLocationDto
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static getUserLocations() {
|
|
13
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
url: '/customers/locations',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create a new location for the authenticated user
|
|
20
|
+
* @param requestBody
|
|
21
|
+
* @returns CustomerLocationDto
|
|
22
|
+
* @throws ApiError
|
|
23
|
+
*/
|
|
24
|
+
static createUserLocation(requestBody) {
|
|
25
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
26
|
+
method: 'POST',
|
|
27
|
+
url: '/customers/locations',
|
|
28
|
+
body: requestBody,
|
|
29
|
+
mediaType: 'application/json',
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get a user location by ID
|
|
34
|
+
* @param locationId
|
|
35
|
+
* @returns CustomerLocationDto
|
|
36
|
+
* @throws ApiError
|
|
37
|
+
*/
|
|
38
|
+
static getUserLocation(locationId) {
|
|
39
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
40
|
+
method: 'GET',
|
|
41
|
+
url: '/customers/locations/{locationId}',
|
|
42
|
+
path: {
|
|
43
|
+
'locationId': locationId,
|
|
44
|
+
},
|
|
45
|
+
errors: {
|
|
46
|
+
401: `Unauthorized`,
|
|
47
|
+
404: `Location not found.`,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Update a user location
|
|
53
|
+
* @param locationId
|
|
54
|
+
* @param requestBody
|
|
55
|
+
* @returns CustomerLocationDto
|
|
56
|
+
* @throws ApiError
|
|
57
|
+
*/
|
|
58
|
+
static updateUserLocation(locationId, requestBody) {
|
|
59
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
60
|
+
method: 'PATCH',
|
|
61
|
+
url: '/customers/locations/{locationId}',
|
|
62
|
+
path: {
|
|
63
|
+
'locationId': locationId,
|
|
64
|
+
},
|
|
65
|
+
body: requestBody,
|
|
66
|
+
mediaType: 'application/json',
|
|
67
|
+
errors: {
|
|
68
|
+
401: `Unauthorized`,
|
|
69
|
+
404: `Location not found.`,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Delete a user location
|
|
75
|
+
* @param locationId
|
|
76
|
+
* @returns any Location deleted successfully.
|
|
77
|
+
* @throws ApiError
|
|
78
|
+
*/
|
|
79
|
+
static deleteUserLocation(locationId) {
|
|
80
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
81
|
+
method: 'DELETE',
|
|
82
|
+
url: '/customers/locations/{locationId}',
|
|
83
|
+
path: {
|
|
84
|
+
'locationId': locationId,
|
|
85
|
+
},
|
|
86
|
+
errors: {
|
|
87
|
+
401: `Unauthorized`,
|
|
88
|
+
404: `Location not found.`,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.CustomerLocationsService = CustomerLocationsService;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { TripDto } from '../models/TripDto';
|
|
2
|
+
import type { TripUpdateDto } from '../models/TripUpdateDto';
|
|
3
|
+
import type { TripUpdateTripsStatusDto } from '../models/TripUpdateTripsStatusDto';
|
|
4
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
5
|
+
export declare class CustomerTripsService {
|
|
6
|
+
/**
|
|
7
|
+
* Request CUSTOMER APP trip
|
|
8
|
+
* @param requestBody
|
|
9
|
+
* @returns any Trip created successfully.
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static create(requestBody: TripDto): CancelablePromise<any>;
|
|
13
|
+
/**
|
|
14
|
+
* Get all trips for a customer
|
|
15
|
+
* @param search
|
|
16
|
+
* @returns any List of trips
|
|
17
|
+
* @throws ApiError
|
|
18
|
+
*/
|
|
19
|
+
static findAll(search: string): CancelablePromise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* Get active trip for a customer
|
|
22
|
+
* @returns any Active trip found
|
|
23
|
+
* @throws ApiError
|
|
24
|
+
*/
|
|
25
|
+
static getActiveTrip(): CancelablePromise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Get a single trip by ID
|
|
28
|
+
* @param id
|
|
29
|
+
* @returns any Trip found
|
|
30
|
+
* @throws ApiError
|
|
31
|
+
*/
|
|
32
|
+
static findById(id: number): CancelablePromise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Update a trip by ID
|
|
35
|
+
* @param id
|
|
36
|
+
* @param requestBody
|
|
37
|
+
* @returns any Trip updated successfully.
|
|
38
|
+
* @throws ApiError
|
|
39
|
+
*/
|
|
40
|
+
static update(id: number, requestBody: TripUpdateDto): CancelablePromise<any>;
|
|
41
|
+
/**
|
|
42
|
+
* Update trip status
|
|
43
|
+
* @param id
|
|
44
|
+
* @param requestBody
|
|
45
|
+
* @returns any Trip status updated successfully.
|
|
46
|
+
* @throws ApiError
|
|
47
|
+
*/
|
|
48
|
+
static updateTripStatus(id: number, requestBody: TripUpdateTripsStatusDto): CancelablePromise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* Cancel a trip by ID (status must be CANCELED_PASSENGER)
|
|
51
|
+
* @param id
|
|
52
|
+
* @returns any Trip canceled successfully.
|
|
53
|
+
* @throws ApiError
|
|
54
|
+
*/
|
|
55
|
+
static cancelTrip(id: number): CancelablePromise<any>;
|
|
56
|
+
/**
|
|
57
|
+
* Execute an action on a trip
|
|
58
|
+
* @param id
|
|
59
|
+
* @returns any Trip action executed successfully.
|
|
60
|
+
* @throws ApiError
|
|
61
|
+
*/
|
|
62
|
+
static executeTripAction(id: number): CancelablePromise<any>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerTripsService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class CustomerTripsService {
|
|
7
|
+
/**
|
|
8
|
+
* Request CUSTOMER APP trip
|
|
9
|
+
* @param requestBody
|
|
10
|
+
* @returns any Trip created successfully.
|
|
11
|
+
* @throws ApiError
|
|
12
|
+
*/
|
|
13
|
+
static create(requestBody) {
|
|
14
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
url: '/customers/trips',
|
|
17
|
+
body: requestBody,
|
|
18
|
+
mediaType: 'application/json',
|
|
19
|
+
errors: {
|
|
20
|
+
401: `Unauthorized`,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get all trips for a customer
|
|
26
|
+
* @param search
|
|
27
|
+
* @returns any List of trips
|
|
28
|
+
* @throws ApiError
|
|
29
|
+
*/
|
|
30
|
+
static findAll(search) {
|
|
31
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
32
|
+
method: 'GET',
|
|
33
|
+
url: '/customers/trips',
|
|
34
|
+
query: {
|
|
35
|
+
'search': search,
|
|
36
|
+
},
|
|
37
|
+
errors: {
|
|
38
|
+
401: `Unauthorized`,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get active trip for a customer
|
|
44
|
+
* @returns any Active trip found
|
|
45
|
+
* @throws ApiError
|
|
46
|
+
*/
|
|
47
|
+
static getActiveTrip() {
|
|
48
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
49
|
+
method: 'GET',
|
|
50
|
+
url: '/customers/trips/active',
|
|
51
|
+
errors: {
|
|
52
|
+
401: `Unauthorized`,
|
|
53
|
+
404: `No active trip found`,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get a single trip by ID
|
|
59
|
+
* @param id
|
|
60
|
+
* @returns any Trip found
|
|
61
|
+
* @throws ApiError
|
|
62
|
+
*/
|
|
63
|
+
static findById(id) {
|
|
64
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
65
|
+
method: 'GET',
|
|
66
|
+
url: '/customers/trips/{id}',
|
|
67
|
+
path: {
|
|
68
|
+
'id': id,
|
|
69
|
+
},
|
|
70
|
+
errors: {
|
|
71
|
+
401: `Unauthorized`,
|
|
72
|
+
404: `Trip not found`,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Update a trip by ID
|
|
78
|
+
* @param id
|
|
79
|
+
* @param requestBody
|
|
80
|
+
* @returns any Trip updated successfully.
|
|
81
|
+
* @throws ApiError
|
|
82
|
+
*/
|
|
83
|
+
static update(id, requestBody) {
|
|
84
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
85
|
+
method: 'PATCH',
|
|
86
|
+
url: '/customers/trips/{id}',
|
|
87
|
+
path: {
|
|
88
|
+
'id': id,
|
|
89
|
+
},
|
|
90
|
+
body: requestBody,
|
|
91
|
+
mediaType: 'application/json',
|
|
92
|
+
errors: {
|
|
93
|
+
401: `Unauthorized`,
|
|
94
|
+
404: `Trip not found`,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Update trip status
|
|
100
|
+
* @param id
|
|
101
|
+
* @param requestBody
|
|
102
|
+
* @returns any Trip status updated successfully.
|
|
103
|
+
* @throws ApiError
|
|
104
|
+
*/
|
|
105
|
+
static updateTripStatus(id, requestBody) {
|
|
106
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
107
|
+
method: 'PATCH',
|
|
108
|
+
url: '/customers/trips/{id}/status',
|
|
109
|
+
path: {
|
|
110
|
+
'id': id,
|
|
111
|
+
},
|
|
112
|
+
body: requestBody,
|
|
113
|
+
mediaType: 'application/json',
|
|
114
|
+
errors: {
|
|
115
|
+
400: `Invalid status`,
|
|
116
|
+
401: `Unauthorized`,
|
|
117
|
+
404: `Trip not found`,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Cancel a trip by ID (status must be CANCELED_PASSENGER)
|
|
123
|
+
* @param id
|
|
124
|
+
* @returns any Trip canceled successfully.
|
|
125
|
+
* @throws ApiError
|
|
126
|
+
*/
|
|
127
|
+
static cancelTrip(id) {
|
|
128
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
129
|
+
method: 'PATCH',
|
|
130
|
+
url: '/customers/trips/{id}/cancel',
|
|
131
|
+
path: {
|
|
132
|
+
'id': id,
|
|
133
|
+
},
|
|
134
|
+
errors: {
|
|
135
|
+
400: `Invalid status`,
|
|
136
|
+
401: `Unauthorized`,
|
|
137
|
+
404: `Trip not found`,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Execute an action on a trip
|
|
143
|
+
* @param id
|
|
144
|
+
* @returns any Trip action executed successfully.
|
|
145
|
+
* @throws ApiError
|
|
146
|
+
*/
|
|
147
|
+
static executeTripAction(id) {
|
|
148
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
149
|
+
method: 'PATCH',
|
|
150
|
+
url: '/customers/trips/{id}/action/{action}',
|
|
151
|
+
path: {
|
|
152
|
+
'id': id,
|
|
153
|
+
},
|
|
154
|
+
errors: {
|
|
155
|
+
400: `Invalid action`,
|
|
156
|
+
401: `Unauthorized`,
|
|
157
|
+
404: `Trip not found`,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.CustomerTripsService = CustomerTripsService;
|