@dapex-tech/elite-online-services 0.0.16 → 0.0.18
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 +10 -0
- package/models/AddDriverCreditsByCardDto.d.ts +11 -0
- package/models/AddDriverCreditsByCardDto.js +2 -0
- package/models/AddDriverCreditsByCashDto.d.ts +6 -0
- package/models/AddDriverCreditsByCashDto.js +2 -0
- package/models/AddPaymentMethodDto.d.ts +46 -0
- package/models/AddPaymentMethodDto.js +2 -0
- package/models/AdminSearchCustomersResponseDto.d.ts +8 -0
- package/models/AdminSearchCustomersResponseDto.js +2 -0
- package/models/CardDataDto.d.ts +42 -0
- package/models/CardDataDto.js +2 -0
- package/models/ChargeTripByCardDto.d.ts +50 -0
- package/models/ChargeTripByCardDto.js +2 -0
- package/models/ChargeTripByCardResponseDto.d.ts +26 -0
- package/models/ChargeTripByCardResponseDto.js +2 -0
- package/models/ChargeTripByCashDto.d.ts +10 -0
- package/models/ChargeTripByCashDto.js +2 -0
- package/models/ChargeTripByCashResponseDto.d.ts +6 -0
- package/models/ChargeTripByCashResponseDto.js +2 -0
- package/models/ChargeTripByVoucherDto.d.ts +14 -0
- package/models/ChargeTripByVoucherDto.js +2 -0
- package/models/ChargeTripDto.d.ts +10 -0
- package/models/ChargeTripDto.js +2 -0
- package/models/CustomerLocationCreateDto.d.ts +19 -0
- package/models/CustomerLocationCreateDto.js +18 -0
- package/models/CustomerLocationDto.d.ts +19 -0
- package/models/CustomerLocationDto.js +18 -0
- package/models/CustomerLocationUpdateDto.d.ts +19 -0
- package/models/CustomerLocationUpdateDto.js +18 -0
- package/models/DriverCreditsResponseDto.d.ts +18 -0
- package/models/DriverCreditsResponseDto.js +2 -0
- package/models/DriverDto.d.ts +4 -0
- package/models/DriverLoginResponseDto.d.ts +4 -0
- package/models/DriverPaymentMethodResponseDto.d.ts +38 -0
- package/models/DriverPaymentMethodResponseDto.js +2 -0
- package/models/InquireVoucherBalanceDto.d.ts +6 -0
- package/models/InquireVoucherBalanceDto.js +2 -0
- package/models/InquireVoucherBalanceResponseDto.d.ts +42 -0
- package/models/InquireVoucherBalanceResponseDto.js +2 -0
- package/models/PaymentDto.d.ts +8 -4
- package/models/PaymentMethodResponseDto.d.ts +38 -0
- package/models/PaymentMethodResponseDto.js +2 -0
- package/models/PurchaseDriverCreditsDto.d.ts +10 -0
- package/models/PurchaseDriverCreditsDto.js +2 -0
- package/models/SectionContentCreateDto.d.ts +27 -0
- package/models/SectionContentCreateDto.js +14 -0
- package/models/SectionContentDto.d.ts +35 -0
- package/models/SectionContentDto.js +14 -0
- package/models/SectionContentUpdateDto.d.ts +27 -0
- package/models/SectionContentUpdateDto.js +14 -0
- package/models/SeniorCenterDto.d.ts +30 -0
- package/models/SeniorCenterDto.js +2 -0
- package/models/TripDto.d.ts +75 -4
- package/models/TripDto.js +38 -0
- package/models/TripStatuses.d.ts +1 -0
- package/models/TripStatuses.js +1 -0
- package/models/TripUpdateDto.d.ts +22 -0
- package/models/TripUpdateDto.js +13 -0
- package/models/TripUpdateTripsStatusDto.d.ts +1 -0
- package/models/TripUpdateTripsStatusDto.js +1 -0
- package/models/VoucherDriverCreateDto.d.ts +54 -0
- package/models/VoucherDriverCreateDto.js +2 -0
- package/models/index.d.ts +22 -0
- package/models/index.js +22 -0
- package/package.json +1 -1
- package/services/AdminDriversService.d.ts +3 -1
- package/services/AdminDriversService.js +4 -1
- package/services/AdminPaymentsService.d.ts +22 -0
- package/services/AdminPaymentsService.js +52 -0
- package/services/AdminSectionContentService.d.ts +46 -0
- package/services/AdminSectionContentService.js +89 -0
- package/services/AdminService.d.ts +16 -0
- package/services/AdminService.js +28 -0
- package/services/AdminSettingsService.d.ts +9 -0
- package/services/AdminSettingsService.js +19 -0
- package/services/AdminTripsService.d.ts +9 -0
- package/services/AdminTripsService.js +19 -0
- package/services/AdminVouchersService.d.ts +61 -0
- package/services/AdminVouchersService.js +116 -0
- package/services/CustomerPaymentsService.d.ts +66 -0
- package/services/CustomerPaymentsService.js +149 -0
- package/services/CustomerSectionContentsService.d.ts +17 -0
- package/services/CustomerSectionContentsService.js +34 -0
- package/services/CustomerSettingsService.d.ts +9 -0
- package/services/CustomerSettingsService.js +19 -0
- package/services/DriverPaymentsService.d.ts +85 -0
- package/services/DriverPaymentsService.js +181 -0
- package/services/DriverSettingsService.d.ts +9 -0
- package/services/DriverSettingsService.js +19 -0
- package/services/DriverTripsService.d.ts +10 -0
- package/services/DriverTripsService.js +18 -0
- package/services/PaymentsService.d.ts +67 -0
- package/services/PaymentsService.js +149 -0
- package/services/index.d.ts +10 -0
- package/services/index.js +10 -0
- package/types/realtime/active-trip.d.ts +2 -0
- package/types/realtime/driver-status.d.ts +3 -3
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerPaymentsService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class CustomerPaymentsService {
|
|
7
|
+
/**
|
|
8
|
+
* Add a payment method
|
|
9
|
+
* @param requestBody
|
|
10
|
+
* @returns PaymentMethodResponseDto Payment method added successfully
|
|
11
|
+
* @throws ApiError
|
|
12
|
+
*/
|
|
13
|
+
static addPaymentMethod(requestBody) {
|
|
14
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
url: '/customers/payments',
|
|
17
|
+
body: requestBody,
|
|
18
|
+
mediaType: 'application/json',
|
|
19
|
+
errors: {
|
|
20
|
+
400: `Invalid card data`,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List payment methods
|
|
26
|
+
* @returns PaymentMethodResponseDto List of payment methods
|
|
27
|
+
* @throws ApiError
|
|
28
|
+
*/
|
|
29
|
+
static listPaymentMethods() {
|
|
30
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
31
|
+
method: 'GET',
|
|
32
|
+
url: '/customers/payments',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Update a payment method
|
|
37
|
+
* @param id
|
|
38
|
+
* @param requestBody
|
|
39
|
+
* @returns PaymentMethodResponseDto Payment method updated successfully
|
|
40
|
+
* @throws ApiError
|
|
41
|
+
*/
|
|
42
|
+
static updatePaymentMethod(id, requestBody) {
|
|
43
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
44
|
+
method: 'PATCH',
|
|
45
|
+
url: '/customers/payments/{id}',
|
|
46
|
+
path: {
|
|
47
|
+
'id': id,
|
|
48
|
+
},
|
|
49
|
+
body: requestBody,
|
|
50
|
+
mediaType: 'application/json',
|
|
51
|
+
errors: {
|
|
52
|
+
400: `Invalid card data`,
|
|
53
|
+
404: `Payment method not found`,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Remove payment method
|
|
59
|
+
* @param id
|
|
60
|
+
* @returns PaymentMethodResponseDto Payment method removed
|
|
61
|
+
* @throws ApiError
|
|
62
|
+
*/
|
|
63
|
+
static removePaymentMethod(id) {
|
|
64
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
65
|
+
method: 'DELETE',
|
|
66
|
+
url: '/customers/payments/{id}',
|
|
67
|
+
path: {
|
|
68
|
+
'id': id,
|
|
69
|
+
},
|
|
70
|
+
errors: {
|
|
71
|
+
404: `Payment method not found`,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Set default payment method
|
|
77
|
+
* @param id
|
|
78
|
+
* @returns PaymentMethodResponseDto Default payment method updated
|
|
79
|
+
* @throws ApiError
|
|
80
|
+
*/
|
|
81
|
+
static setDefaultPaymentMethod(id) {
|
|
82
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
83
|
+
method: 'PATCH',
|
|
84
|
+
url: '/customers/payments/{id}/default',
|
|
85
|
+
path: {
|
|
86
|
+
'id': id,
|
|
87
|
+
},
|
|
88
|
+
errors: {
|
|
89
|
+
404: `Payment method not found`,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Charge trip by cash
|
|
95
|
+
* @param requestBody
|
|
96
|
+
* @returns MessageResponseDto Payment recorded successfully
|
|
97
|
+
* @throws ApiError
|
|
98
|
+
*/
|
|
99
|
+
static chargeTripByCash(requestBody) {
|
|
100
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
101
|
+
method: 'POST',
|
|
102
|
+
url: '/customers/payments/charge-trip/cash',
|
|
103
|
+
body: requestBody,
|
|
104
|
+
mediaType: 'application/json',
|
|
105
|
+
errors: {
|
|
106
|
+
400: `Trip already charged or invalid amount`,
|
|
107
|
+
404: `Trip not found`,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Charge trip by saved payment method
|
|
113
|
+
* Charges the trip using the payment method set on the trip. The trip must have paymentType=DEBIT_CREDIT_CARD and customerPaymentMethodId set.
|
|
114
|
+
* @param requestBody
|
|
115
|
+
* @returns MessageResponseDto Charge successful
|
|
116
|
+
* @throws ApiError
|
|
117
|
+
*/
|
|
118
|
+
static chargeTripByPaymentMethod(requestBody) {
|
|
119
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
120
|
+
method: 'POST',
|
|
121
|
+
url: '/customers/payments/charge-trip/payment-method',
|
|
122
|
+
body: requestBody,
|
|
123
|
+
mediaType: 'application/json',
|
|
124
|
+
errors: {
|
|
125
|
+
400: `Charge failed, trip already charged, trip has no payment method set, or payment method does not belong to customer`,
|
|
126
|
+
404: `Trip not found`,
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Charge trip by card data
|
|
132
|
+
* @param requestBody
|
|
133
|
+
* @returns MessageResponseDto Charge successful
|
|
134
|
+
* @throws ApiError
|
|
135
|
+
*/
|
|
136
|
+
static chargeTripByCard(requestBody) {
|
|
137
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
138
|
+
method: 'POST',
|
|
139
|
+
url: '/customers/payments/charge-trip/card',
|
|
140
|
+
body: requestBody,
|
|
141
|
+
mediaType: 'application/json',
|
|
142
|
+
errors: {
|
|
143
|
+
400: `Charge failed or trip already charged`,
|
|
144
|
+
404: `Trip not found`,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.CustomerPaymentsService = CustomerPaymentsService;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SectionContentDto } from '../models/SectionContentDto';
|
|
2
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
3
|
+
export declare class CustomerSectionContentsService {
|
|
4
|
+
/**
|
|
5
|
+
* Get section contents by type
|
|
6
|
+
* @returns SectionContentDto List of section contents by type, ordered by position ASC
|
|
7
|
+
* @throws ApiError
|
|
8
|
+
*/
|
|
9
|
+
static findByType(): CancelablePromise<Array<SectionContentDto>>;
|
|
10
|
+
/**
|
|
11
|
+
* Get section content by type and ID
|
|
12
|
+
* @param id
|
|
13
|
+
* @returns SectionContentDto Section content found
|
|
14
|
+
* @throws ApiError
|
|
15
|
+
*/
|
|
16
|
+
static findByTypeAndId(id: number): CancelablePromise<SectionContentDto>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerSectionContentsService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class CustomerSectionContentsService {
|
|
7
|
+
/**
|
|
8
|
+
* Get section contents by type
|
|
9
|
+
* @returns SectionContentDto List of section contents by type, ordered by position ASC
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static findByType() {
|
|
13
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
url: '/customers/section-contents/{type}',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get section content by type and ID
|
|
20
|
+
* @param id
|
|
21
|
+
* @returns SectionContentDto Section content found
|
|
22
|
+
* @throws ApiError
|
|
23
|
+
*/
|
|
24
|
+
static findByTypeAndId(id) {
|
|
25
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
26
|
+
method: 'GET',
|
|
27
|
+
url: '/customers/section-contents/{type}/{id}',
|
|
28
|
+
path: {
|
|
29
|
+
'id': id,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.CustomerSectionContentsService = CustomerSectionContentsService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerSettingsService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class CustomerSettingsService {
|
|
7
|
+
/**
|
|
8
|
+
* Get all settings
|
|
9
|
+
* @returns any List of all system settings
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static findAll() {
|
|
13
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
url: '/customers/settings',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.CustomerSettingsService = CustomerSettingsService;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { AddPaymentMethodDto } from '../models/AddPaymentMethodDto';
|
|
2
|
+
import type { ChargeTripByCardDto } from '../models/ChargeTripByCardDto';
|
|
3
|
+
import type { ChargeTripByCashDto } from '../models/ChargeTripByCashDto';
|
|
4
|
+
import type { ChargeTripByVoucherDto } from '../models/ChargeTripByVoucherDto';
|
|
5
|
+
import type { ChargeTripDto } from '../models/ChargeTripDto';
|
|
6
|
+
import type { DriverCreditsResponseDto } from '../models/DriverCreditsResponseDto';
|
|
7
|
+
import type { DriverPaymentMethodResponseDto } from '../models/DriverPaymentMethodResponseDto';
|
|
8
|
+
import type { InquireVoucherBalanceDto } from '../models/InquireVoucherBalanceDto';
|
|
9
|
+
import type { InquireVoucherBalanceResponseDto } from '../models/InquireVoucherBalanceResponseDto';
|
|
10
|
+
import type { MessageResponseDto } from '../models/MessageResponseDto';
|
|
11
|
+
import type { PurchaseDriverCreditsDto } from '../models/PurchaseDriverCreditsDto';
|
|
12
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
13
|
+
export declare class DriverPaymentsService {
|
|
14
|
+
/**
|
|
15
|
+
* Add a payment method (external drivers only)
|
|
16
|
+
* @param requestBody
|
|
17
|
+
* @returns DriverPaymentMethodResponseDto Payment method added successfully
|
|
18
|
+
* @throws ApiError
|
|
19
|
+
*/
|
|
20
|
+
static addPaymentMethod(requestBody: AddPaymentMethodDto): CancelablePromise<DriverPaymentMethodResponseDto>;
|
|
21
|
+
/**
|
|
22
|
+
* List payment methods (external drivers only)
|
|
23
|
+
* @returns DriverPaymentMethodResponseDto List of payment methods
|
|
24
|
+
* @throws ApiError
|
|
25
|
+
*/
|
|
26
|
+
static listPaymentMethods(): CancelablePromise<Array<DriverPaymentMethodResponseDto>>;
|
|
27
|
+
/**
|
|
28
|
+
* Set default payment method
|
|
29
|
+
* @param id
|
|
30
|
+
* @returns DriverPaymentMethodResponseDto Default payment method updated
|
|
31
|
+
* @throws ApiError
|
|
32
|
+
*/
|
|
33
|
+
static setDefaultPaymentMethod(id: number): CancelablePromise<DriverPaymentMethodResponseDto>;
|
|
34
|
+
/**
|
|
35
|
+
* Remove payment method
|
|
36
|
+
* @param id
|
|
37
|
+
* @returns DriverPaymentMethodResponseDto Payment method removed
|
|
38
|
+
* @throws ApiError
|
|
39
|
+
*/
|
|
40
|
+
static removePaymentMethod(id: number): CancelablePromise<DriverPaymentMethodResponseDto>;
|
|
41
|
+
/**
|
|
42
|
+
* Purchase credits using a registered payment method
|
|
43
|
+
* Charges the given payment method; amount = credits × EXTERNAL_DRIVER_CREDIT_COST (external drivers only).
|
|
44
|
+
* @param requestBody
|
|
45
|
+
* @returns DriverCreditsResponseDto Credits purchased successfully
|
|
46
|
+
* @throws ApiError
|
|
47
|
+
*/
|
|
48
|
+
static purchaseCredits(requestBody: PurchaseDriverCreditsDto): CancelablePromise<DriverCreditsResponseDto>;
|
|
49
|
+
/**
|
|
50
|
+
* Charge trip by cash
|
|
51
|
+
* @param requestBody
|
|
52
|
+
* @returns MessageResponseDto Payment recorded successfully
|
|
53
|
+
* @throws ApiError
|
|
54
|
+
*/
|
|
55
|
+
static chargeTripByCash(requestBody: ChargeTripByCashDto): CancelablePromise<MessageResponseDto>;
|
|
56
|
+
/**
|
|
57
|
+
* Charge trip by saved payment method
|
|
58
|
+
* Charges the trip using the payment method set on the trip. The trip must have paymentType=DEBIT_CREDIT_CARD and customerPaymentMethodId set.
|
|
59
|
+
* @param requestBody
|
|
60
|
+
* @returns MessageResponseDto Charge successful
|
|
61
|
+
* @throws ApiError
|
|
62
|
+
*/
|
|
63
|
+
static chargeTripByPaymentMethod(requestBody: ChargeTripDto): CancelablePromise<MessageResponseDto>;
|
|
64
|
+
/**
|
|
65
|
+
* Charge trip by card data
|
|
66
|
+
* @param requestBody
|
|
67
|
+
* @returns MessageResponseDto Charge successful
|
|
68
|
+
* @throws ApiError
|
|
69
|
+
*/
|
|
70
|
+
static chargeTripByCard(requestBody: ChargeTripByCardDto): CancelablePromise<MessageResponseDto>;
|
|
71
|
+
/**
|
|
72
|
+
* Charge trip by voucher
|
|
73
|
+
* @param requestBody
|
|
74
|
+
* @returns MessageResponseDto Voucher charge successful
|
|
75
|
+
* @throws ApiError
|
|
76
|
+
*/
|
|
77
|
+
static chargeTripByVoucher(requestBody: ChargeTripByVoucherDto): CancelablePromise<MessageResponseDto>;
|
|
78
|
+
/**
|
|
79
|
+
* Inquire voucher balance for a trip
|
|
80
|
+
* @param requestBody
|
|
81
|
+
* @returns InquireVoucherBalanceResponseDto Voucher balance inquiry response
|
|
82
|
+
* @throws ApiError
|
|
83
|
+
*/
|
|
84
|
+
static inquireVoucherBalance(requestBody: InquireVoucherBalanceDto): CancelablePromise<InquireVoucherBalanceResponseDto>;
|
|
85
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DriverPaymentsService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class DriverPaymentsService {
|
|
7
|
+
/**
|
|
8
|
+
* Add a payment method (external drivers only)
|
|
9
|
+
* @param requestBody
|
|
10
|
+
* @returns DriverPaymentMethodResponseDto Payment method added successfully
|
|
11
|
+
* @throws ApiError
|
|
12
|
+
*/
|
|
13
|
+
static addPaymentMethod(requestBody) {
|
|
14
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
url: '/drivers/payments',
|
|
17
|
+
body: requestBody,
|
|
18
|
+
mediaType: 'application/json',
|
|
19
|
+
errors: {
|
|
20
|
+
400: `Invalid card data or driver is not external`,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List payment methods (external drivers only)
|
|
26
|
+
* @returns DriverPaymentMethodResponseDto List of payment methods
|
|
27
|
+
* @throws ApiError
|
|
28
|
+
*/
|
|
29
|
+
static listPaymentMethods() {
|
|
30
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
31
|
+
method: 'GET',
|
|
32
|
+
url: '/drivers/payments',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Set default payment method
|
|
37
|
+
* @param id
|
|
38
|
+
* @returns DriverPaymentMethodResponseDto Default payment method updated
|
|
39
|
+
* @throws ApiError
|
|
40
|
+
*/
|
|
41
|
+
static setDefaultPaymentMethod(id) {
|
|
42
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
43
|
+
method: 'PATCH',
|
|
44
|
+
url: '/drivers/payments/{id}/default',
|
|
45
|
+
path: {
|
|
46
|
+
'id': id,
|
|
47
|
+
},
|
|
48
|
+
errors: {
|
|
49
|
+
404: `Payment method not found`,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Remove payment method
|
|
55
|
+
* @param id
|
|
56
|
+
* @returns DriverPaymentMethodResponseDto Payment method removed
|
|
57
|
+
* @throws ApiError
|
|
58
|
+
*/
|
|
59
|
+
static removePaymentMethod(id) {
|
|
60
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
61
|
+
method: 'DELETE',
|
|
62
|
+
url: '/drivers/payments/{id}',
|
|
63
|
+
path: {
|
|
64
|
+
'id': id,
|
|
65
|
+
},
|
|
66
|
+
errors: {
|
|
67
|
+
404: `Payment method not found`,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Purchase credits using a registered payment method
|
|
73
|
+
* Charges the given payment method; amount = credits × EXTERNAL_DRIVER_CREDIT_COST (external drivers only).
|
|
74
|
+
* @param requestBody
|
|
75
|
+
* @returns DriverCreditsResponseDto Credits purchased successfully
|
|
76
|
+
* @throws ApiError
|
|
77
|
+
*/
|
|
78
|
+
static purchaseCredits(requestBody) {
|
|
79
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
80
|
+
method: 'POST',
|
|
81
|
+
url: '/drivers/payments/purchase-credits',
|
|
82
|
+
body: requestBody,
|
|
83
|
+
mediaType: 'application/json',
|
|
84
|
+
errors: {
|
|
85
|
+
404: `Driver or payment method not found`,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Charge trip by cash
|
|
91
|
+
* @param requestBody
|
|
92
|
+
* @returns MessageResponseDto Payment recorded successfully
|
|
93
|
+
* @throws ApiError
|
|
94
|
+
*/
|
|
95
|
+
static chargeTripByCash(requestBody) {
|
|
96
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
97
|
+
method: 'POST',
|
|
98
|
+
url: '/drivers/payments/charge-trip/cash',
|
|
99
|
+
body: requestBody,
|
|
100
|
+
mediaType: 'application/json',
|
|
101
|
+
errors: {
|
|
102
|
+
400: `Trip already charged or invalid amount`,
|
|
103
|
+
404: `Trip not found`,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Charge trip by saved payment method
|
|
109
|
+
* Charges the trip using the payment method set on the trip. The trip must have paymentType=DEBIT_CREDIT_CARD and customerPaymentMethodId set.
|
|
110
|
+
* @param requestBody
|
|
111
|
+
* @returns MessageResponseDto Charge successful
|
|
112
|
+
* @throws ApiError
|
|
113
|
+
*/
|
|
114
|
+
static chargeTripByPaymentMethod(requestBody) {
|
|
115
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
116
|
+
method: 'POST',
|
|
117
|
+
url: '/drivers/payments/charge-trip/payment-method',
|
|
118
|
+
body: requestBody,
|
|
119
|
+
mediaType: 'application/json',
|
|
120
|
+
errors: {
|
|
121
|
+
400: `Charge failed, trip already charged, trip has no payment method set, or payment method does not belong to customer`,
|
|
122
|
+
404: `Trip not found`,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Charge trip by card data
|
|
128
|
+
* @param requestBody
|
|
129
|
+
* @returns MessageResponseDto Charge successful
|
|
130
|
+
* @throws ApiError
|
|
131
|
+
*/
|
|
132
|
+
static chargeTripByCard(requestBody) {
|
|
133
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
134
|
+
method: 'POST',
|
|
135
|
+
url: '/drivers/payments/charge-trip/card',
|
|
136
|
+
body: requestBody,
|
|
137
|
+
mediaType: 'application/json',
|
|
138
|
+
errors: {
|
|
139
|
+
400: `Charge failed or trip already charged`,
|
|
140
|
+
404: `Trip not found`,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Charge trip by voucher
|
|
146
|
+
* @param requestBody
|
|
147
|
+
* @returns MessageResponseDto Voucher charge successful
|
|
148
|
+
* @throws ApiError
|
|
149
|
+
*/
|
|
150
|
+
static chargeTripByVoucher(requestBody) {
|
|
151
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
152
|
+
method: 'POST',
|
|
153
|
+
url: '/drivers/payments/charge-trip/voucher',
|
|
154
|
+
body: requestBody,
|
|
155
|
+
mediaType: 'application/json',
|
|
156
|
+
errors: {
|
|
157
|
+
400: `Trip already charged, invalid amount, trip has no voucher, or voucher declined`,
|
|
158
|
+
404: `Trip not found`,
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Inquire voucher balance for a trip
|
|
164
|
+
* @param requestBody
|
|
165
|
+
* @returns InquireVoucherBalanceResponseDto Voucher balance inquiry response
|
|
166
|
+
* @throws ApiError
|
|
167
|
+
*/
|
|
168
|
+
static inquireVoucherBalance(requestBody) {
|
|
169
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
170
|
+
method: 'POST',
|
|
171
|
+
url: '/drivers/payments/voucher-balance',
|
|
172
|
+
body: requestBody,
|
|
173
|
+
mediaType: 'application/json',
|
|
174
|
+
errors: {
|
|
175
|
+
400: `Invalid voucher inquiry request or trip has no voucher`,
|
|
176
|
+
404: `Trip not found`,
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
exports.DriverPaymentsService = DriverPaymentsService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DriverSettingsService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class DriverSettingsService {
|
|
7
|
+
/**
|
|
8
|
+
* Get all settings
|
|
9
|
+
* @returns any List of all system settings
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static findAll() {
|
|
13
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
url: '/drivers/settings',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.DriverSettingsService = DriverSettingsService;
|
|
@@ -2,6 +2,8 @@ import type { DriverTripActions } from '../models/DriverTripActions';
|
|
|
2
2
|
import type { OrderDto } from '../models/OrderDto';
|
|
3
3
|
import type { TripDto } from '../models/TripDto';
|
|
4
4
|
import type { TripUpdateDto } from '../models/TripUpdateDto';
|
|
5
|
+
import type { VoucherDriverCreateDto } from '../models/VoucherDriverCreateDto';
|
|
6
|
+
import type { VoucherDto } from '../models/VoucherDto';
|
|
5
7
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
6
8
|
export declare class DriverTripsService {
|
|
7
9
|
/**
|
|
@@ -42,6 +44,14 @@ export declare class DriverTripsService {
|
|
|
42
44
|
* @throws ApiError
|
|
43
45
|
*/
|
|
44
46
|
static getActiveTrip(): CancelablePromise<TripDto>;
|
|
47
|
+
/**
|
|
48
|
+
* Create voucher for trip (new senior not yet reported by city)
|
|
49
|
+
* @param id Trip ID
|
|
50
|
+
* @param requestBody
|
|
51
|
+
* @returns VoucherDto Voucher created and assigned to trip.
|
|
52
|
+
* @throws ApiError
|
|
53
|
+
*/
|
|
54
|
+
static createVoucher(id: number, requestBody: VoucherDriverCreateDto): CancelablePromise<VoucherDto>;
|
|
45
55
|
/**
|
|
46
56
|
* Execute an action on a trip
|
|
47
57
|
* @param id Trip ID
|
|
@@ -83,6 +83,24 @@ class DriverTripsService {
|
|
|
83
83
|
url: '/drivers/trips/active',
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Create voucher for trip (new senior not yet reported by city)
|
|
88
|
+
* @param id Trip ID
|
|
89
|
+
* @param requestBody
|
|
90
|
+
* @returns VoucherDto Voucher created and assigned to trip.
|
|
91
|
+
* @throws ApiError
|
|
92
|
+
*/
|
|
93
|
+
static createVoucher(id, requestBody) {
|
|
94
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
95
|
+
method: 'POST',
|
|
96
|
+
url: '/drivers/trips/{id}/voucher',
|
|
97
|
+
path: {
|
|
98
|
+
'id': id,
|
|
99
|
+
},
|
|
100
|
+
body: requestBody,
|
|
101
|
+
mediaType: 'application/json',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
86
104
|
/**
|
|
87
105
|
* Execute an action on a trip
|
|
88
106
|
* @param id Trip ID
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { AddPaymentMethodDto } from '../models/AddPaymentMethodDto';
|
|
2
|
+
import type { ChargeTripByCardDto } from '../models/ChargeTripByCardDto';
|
|
3
|
+
import type { ChargeTripByCardResponseDto } from '../models/ChargeTripByCardResponseDto';
|
|
4
|
+
import type { ChargeTripByCashDto } from '../models/ChargeTripByCashDto';
|
|
5
|
+
import type { ChargeTripByCashResponseDto } from '../models/ChargeTripByCashResponseDto';
|
|
6
|
+
import type { ChargeTripDto } from '../models/ChargeTripDto';
|
|
7
|
+
import type { PaymentMethodResponseDto } from '../models/PaymentMethodResponseDto';
|
|
8
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
9
|
+
export declare class PaymentsService {
|
|
10
|
+
/**
|
|
11
|
+
* Add a payment method
|
|
12
|
+
* @param requestBody
|
|
13
|
+
* @returns PaymentMethodResponseDto Payment method added successfully
|
|
14
|
+
* @throws ApiError
|
|
15
|
+
*/
|
|
16
|
+
static addPaymentMethod(requestBody: AddPaymentMethodDto): CancelablePromise<PaymentMethodResponseDto>;
|
|
17
|
+
/**
|
|
18
|
+
* List payment methods
|
|
19
|
+
* @returns PaymentMethodResponseDto List of payment methods
|
|
20
|
+
* @throws ApiError
|
|
21
|
+
*/
|
|
22
|
+
static listPaymentMethods(): CancelablePromise<Array<PaymentMethodResponseDto>>;
|
|
23
|
+
/**
|
|
24
|
+
* Update a payment method
|
|
25
|
+
* @param id
|
|
26
|
+
* @param requestBody
|
|
27
|
+
* @returns PaymentMethodResponseDto Payment method updated successfully
|
|
28
|
+
* @throws ApiError
|
|
29
|
+
*/
|
|
30
|
+
static updatePaymentMethod(id: number, requestBody: AddPaymentMethodDto): CancelablePromise<PaymentMethodResponseDto>;
|
|
31
|
+
/**
|
|
32
|
+
* Remove payment method
|
|
33
|
+
* @param id
|
|
34
|
+
* @returns PaymentMethodResponseDto Payment method removed
|
|
35
|
+
* @throws ApiError
|
|
36
|
+
*/
|
|
37
|
+
static removePaymentMethod(id: number): CancelablePromise<PaymentMethodResponseDto>;
|
|
38
|
+
/**
|
|
39
|
+
* Set default payment method
|
|
40
|
+
* @param id
|
|
41
|
+
* @returns PaymentMethodResponseDto Default payment method updated
|
|
42
|
+
* @throws ApiError
|
|
43
|
+
*/
|
|
44
|
+
static setDefaultPaymentMethod(id: number): CancelablePromise<PaymentMethodResponseDto>;
|
|
45
|
+
/**
|
|
46
|
+
* Charge trip by cash
|
|
47
|
+
* @param requestBody
|
|
48
|
+
* @returns ChargeTripByCashResponseDto Payment recorded successfully
|
|
49
|
+
* @throws ApiError
|
|
50
|
+
*/
|
|
51
|
+
static chargeTripByCash(requestBody: ChargeTripByCashDto): CancelablePromise<ChargeTripByCashResponseDto>;
|
|
52
|
+
/**
|
|
53
|
+
* Charge trip by saved payment method
|
|
54
|
+
* Charges the trip using the payment method set on the trip. The trip must have paymentType=DEBIT_CREDIT_CARD and customerPaymentMethodId set.
|
|
55
|
+
* @param requestBody
|
|
56
|
+
* @returns ChargeTripByCardResponseDto Charge successful
|
|
57
|
+
* @throws ApiError
|
|
58
|
+
*/
|
|
59
|
+
static chargeTripByPaymentMethod(requestBody: ChargeTripDto): CancelablePromise<ChargeTripByCardResponseDto>;
|
|
60
|
+
/**
|
|
61
|
+
* Charge trip by card data
|
|
62
|
+
* @param requestBody
|
|
63
|
+
* @returns ChargeTripByCardResponseDto Charge successful
|
|
64
|
+
* @throws ApiError
|
|
65
|
+
*/
|
|
66
|
+
static chargeTripByCard(requestBody: ChargeTripByCardDto): CancelablePromise<ChargeTripByCardResponseDto>;
|
|
67
|
+
}
|