@jugarhoy/api 1.1.26 → 1.1.27
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/apis/AdminPaymentConfigsApi.ts +37 -0
- package/apis/AdminSubscriptionBillingApi.ts +357 -1
- package/apis/AdminSubscriptionsApi.ts +215 -0
- package/apis/AdminUsersApi.ts +69 -0
- package/apis/AppPlayRegistrationApi.ts +10 -3
- package/apis/BackgroundApi.ts +35 -0
- package/apis/ClubApi.ts +185 -0
- package/apis/ClubPlacesApi.ts +75 -0
- package/apis/TeamsApi.ts +145 -0
- package/apis/index.ts +1 -0
- package/models/ApiAdminPlayPricesPostRequest.ts +2 -3
- package/models/BankCard.ts +109 -0
- package/models/BillingSummaryItemDto.ts +120 -0
- package/models/BulkImportResult.ts +119 -0
- package/models/BulkImportRowError.ts +81 -0
- package/models/BulkMarkBillsPaid200Response.ts +81 -0
- package/models/BulkMarkBillsPaid200ResponseErrorsInner.ts +81 -0
- package/models/ClubMySubscriptionDto.ts +205 -0
- package/models/ClubPlaceRegistrationStatus.ts +91 -0
- package/models/ClubProfileDto.ts +105 -0
- package/models/ClubProfileDtoProfile.ts +227 -0
- package/models/ClubProfileNextMatchDto.ts +128 -0
- package/models/ClubSubscriptionOfferingDto.ts +148 -0
- package/models/CreateCustomerPaymentConfigDto.ts +34 -0
- package/models/CreatePlaySearchRequest.ts +16 -0
- package/models/CreateRecurringGameRequest.ts +8 -0
- package/models/CreateTeamRequest.ts +55 -0
- package/models/CustomerPaymentConfig.ts +35 -0
- package/models/CustomerPaymentConfigDto.ts +35 -0
- package/models/Frequency.ts +3 -1
- package/models/GenerateRecurringGames200Response.ts +73 -0
- package/models/GenerateSubscriptionBillsRequest.ts +14 -5
- package/models/LocationDto.ts +8 -0
- package/models/MarkBillAsPaidRequest.ts +99 -0
- package/models/MyClubClubPlace.ts +128 -0
- package/models/MyClubDefaultLocation.ts +84 -0
- package/models/MyClubDto.ts +177 -0
- package/models/PaymentMethod.ts +2 -1
- package/models/PlayPrice.ts +3 -4
- package/models/PlayRegistrationDTO.ts +15 -0
- package/models/PlayRegistrationDTOPlaySearch.ts +137 -0
- package/models/PlayRegistrationDTOPlaySearchClubPlace.ts +81 -0
- package/models/PlaySearchDTO.ts +8 -0
- package/models/PlaySearchDetailDTO.ts +8 -0
- package/models/PlaySubscription.ts +48 -0
- package/models/PlaySubscriptionCreateDto.ts +48 -0
- package/models/PlaySubscriptionListDto.ts +8 -0
- package/models/PlaySubscriptionType.ts +2 -1
- package/models/RecurringGame.ts +8 -0
- package/models/RecurringGameResponse.ts +16 -0
- package/models/RegisterClubParams.ts +16 -0
- package/models/RegisterForPlaySearchRequest.ts +73 -0
- package/models/Sport.ts +8 -0
- package/models/SubscriptionBill.ts +84 -1
- package/models/SubscriptionBillItemDto.ts +308 -0
- package/models/SubscriptionBillPageDto.ts +101 -0
- package/models/SubscriptionMemberDto.ts +134 -0
- package/models/SubscriptionMembersPageDto.ts +101 -0
- package/models/TeamFeedItemResponse.ts +8 -0
- package/models/TeamMemberResponse.ts +16 -0
- package/models/TeamPreviewResponse.ts +209 -0
- package/models/TeamPreviewResponseCoachesInner.ts +73 -0
- package/models/TeamResponse.ts +32 -0
- package/models/TeamType.ts +3 -2
- package/models/UpdateMemberPaymentConfigRequest.ts +65 -0
- package/models/UpdateRecurringGameRequest.ts +8 -0
- package/models/UpdateTeamRequest.ts +32 -0
- package/models/UploadBillReceipt200Response.ts +65 -0
- package/models/UserDto.ts +3 -4
- package/models/index.ts +28 -0
- package/package.json +1 -1
- package/runtime.ts +1 -1
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
|
+
BankCard,
|
|
18
19
|
CreateCustomerPaymentConfigDto,
|
|
19
20
|
CustomerPaymentConfig,
|
|
20
21
|
CustomerPaymentConfigDto,
|
|
@@ -24,6 +25,8 @@ import type {
|
|
|
24
25
|
SuccessResponse,
|
|
25
26
|
} from '../models/index';
|
|
26
27
|
import {
|
|
28
|
+
BankCardFromJSON,
|
|
29
|
+
BankCardToJSON,
|
|
27
30
|
CreateCustomerPaymentConfigDtoFromJSON,
|
|
28
31
|
CreateCustomerPaymentConfigDtoToJSON,
|
|
29
32
|
CustomerPaymentConfigFromJSON,
|
|
@@ -185,6 +188,40 @@ export class AdminPaymentConfigsApi extends runtime.BaseAPI {
|
|
|
185
188
|
return await response.value();
|
|
186
189
|
}
|
|
187
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Get all available bank cards
|
|
193
|
+
*/
|
|
194
|
+
async getBankCardsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<BankCard>>> {
|
|
195
|
+
const queryParameters: any = {};
|
|
196
|
+
|
|
197
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
198
|
+
|
|
199
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
200
|
+
const token = this.configuration.accessToken;
|
|
201
|
+
const tokenString = await token("bearerAuth", []);
|
|
202
|
+
|
|
203
|
+
if (tokenString) {
|
|
204
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const response = await this.request({
|
|
208
|
+
path: `/api/admin/payment-configs/bank-cards`,
|
|
209
|
+
method: 'GET',
|
|
210
|
+
headers: headerParameters,
|
|
211
|
+
query: queryParameters,
|
|
212
|
+
}, initOverrides);
|
|
213
|
+
|
|
214
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(BankCardFromJSON));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Get all available bank cards
|
|
219
|
+
*/
|
|
220
|
+
async getBankCards(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<BankCard>> {
|
|
221
|
+
const response = await this.getBankCardsRaw(initOverrides);
|
|
222
|
+
return await response.value();
|
|
223
|
+
}
|
|
224
|
+
|
|
188
225
|
/**
|
|
189
226
|
* Get MercadoPago authorization URL for OAuth flow
|
|
190
227
|
*/
|
|
@@ -15,32 +15,52 @@
|
|
|
15
15
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
|
+
BillingSummaryItemDto,
|
|
19
|
+
BulkMarkBillsPaid200Response,
|
|
18
20
|
DeleteShift200Response,
|
|
19
21
|
GenerateSubscriptionBillsRequest,
|
|
20
22
|
LinkPaymentToBillRequest,
|
|
23
|
+
MarkBillAsPaidRequest,
|
|
21
24
|
SubscriptionBill,
|
|
25
|
+
SubscriptionBillPageDto,
|
|
22
26
|
UpdateBillRequest,
|
|
27
|
+
UploadBillReceipt200Response,
|
|
23
28
|
} from '../models/index';
|
|
24
29
|
import {
|
|
30
|
+
BillingSummaryItemDtoFromJSON,
|
|
31
|
+
BillingSummaryItemDtoToJSON,
|
|
32
|
+
BulkMarkBillsPaid200ResponseFromJSON,
|
|
33
|
+
BulkMarkBillsPaid200ResponseToJSON,
|
|
25
34
|
DeleteShift200ResponseFromJSON,
|
|
26
35
|
DeleteShift200ResponseToJSON,
|
|
27
36
|
GenerateSubscriptionBillsRequestFromJSON,
|
|
28
37
|
GenerateSubscriptionBillsRequestToJSON,
|
|
29
38
|
LinkPaymentToBillRequestFromJSON,
|
|
30
39
|
LinkPaymentToBillRequestToJSON,
|
|
40
|
+
MarkBillAsPaidRequestFromJSON,
|
|
41
|
+
MarkBillAsPaidRequestToJSON,
|
|
31
42
|
SubscriptionBillFromJSON,
|
|
32
43
|
SubscriptionBillToJSON,
|
|
44
|
+
SubscriptionBillPageDtoFromJSON,
|
|
45
|
+
SubscriptionBillPageDtoToJSON,
|
|
33
46
|
UpdateBillRequestFromJSON,
|
|
34
47
|
UpdateBillRequestToJSON,
|
|
48
|
+
UploadBillReceipt200ResponseFromJSON,
|
|
49
|
+
UploadBillReceipt200ResponseToJSON,
|
|
35
50
|
} from '../models/index';
|
|
36
51
|
|
|
52
|
+
export interface BulkMarkBillsPaidRequest {
|
|
53
|
+
subscriptionId: string;
|
|
54
|
+
file: Blob;
|
|
55
|
+
}
|
|
56
|
+
|
|
37
57
|
export interface DeleteBillRequest {
|
|
38
58
|
billId: string;
|
|
39
59
|
}
|
|
40
60
|
|
|
41
61
|
export interface GenerateSubscriptionBillsOperationRequest {
|
|
42
62
|
subscriptionId: string;
|
|
43
|
-
generateSubscriptionBillsRequest
|
|
63
|
+
generateSubscriptionBillsRequest: GenerateSubscriptionBillsRequest;
|
|
44
64
|
}
|
|
45
65
|
|
|
46
66
|
export interface GetBillByIdRequest {
|
|
@@ -51,21 +71,116 @@ export interface GetSubscriptionBillsRequest {
|
|
|
51
71
|
subscriptionId: string;
|
|
52
72
|
}
|
|
53
73
|
|
|
74
|
+
export interface GetSubscriptionBillsPaginatedRequest {
|
|
75
|
+
subscriptionId: string;
|
|
76
|
+
offset?: number;
|
|
77
|
+
limit?: number;
|
|
78
|
+
periodNumber?: number;
|
|
79
|
+
paymentConfigId?: string;
|
|
80
|
+
search?: string;
|
|
81
|
+
billingYear?: number;
|
|
82
|
+
status?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface GetSubscriptionBillsSummaryRequest {
|
|
86
|
+
subscriptionId: string;
|
|
87
|
+
billingYear?: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
54
90
|
export interface LinkPaymentToBillOperationRequest {
|
|
55
91
|
billId: string;
|
|
56
92
|
linkPaymentToBillRequest: LinkPaymentToBillRequest;
|
|
57
93
|
}
|
|
58
94
|
|
|
95
|
+
export interface MarkBillAsPaidOperationRequest {
|
|
96
|
+
billId: string;
|
|
97
|
+
markBillAsPaidRequest: MarkBillAsPaidRequest;
|
|
98
|
+
}
|
|
99
|
+
|
|
59
100
|
export interface UpdateBillOperationRequest {
|
|
60
101
|
billId: string;
|
|
61
102
|
updateBillRequest?: UpdateBillRequest;
|
|
62
103
|
}
|
|
63
104
|
|
|
105
|
+
export interface UploadBillReceiptRequest {
|
|
106
|
+
billId: string;
|
|
107
|
+
file: Blob;
|
|
108
|
+
}
|
|
109
|
+
|
|
64
110
|
/**
|
|
65
111
|
*
|
|
66
112
|
*/
|
|
67
113
|
export class AdminSubscriptionBillingApi extends runtime.BaseAPI {
|
|
68
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Bulk mark bills as paid from CSV data
|
|
117
|
+
*/
|
|
118
|
+
async bulkMarkBillsPaidRaw(requestParameters: BulkMarkBillsPaidRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkMarkBillsPaid200Response>> {
|
|
119
|
+
if (requestParameters['subscriptionId'] == null) {
|
|
120
|
+
throw new runtime.RequiredError(
|
|
121
|
+
'subscriptionId',
|
|
122
|
+
'Required parameter "subscriptionId" was null or undefined when calling bulkMarkBillsPaid().'
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (requestParameters['file'] == null) {
|
|
127
|
+
throw new runtime.RequiredError(
|
|
128
|
+
'file',
|
|
129
|
+
'Required parameter "file" was null or undefined when calling bulkMarkBillsPaid().'
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const queryParameters: any = {};
|
|
134
|
+
|
|
135
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
136
|
+
|
|
137
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
138
|
+
const token = this.configuration.accessToken;
|
|
139
|
+
const tokenString = await token("bearerAuth", []);
|
|
140
|
+
|
|
141
|
+
if (tokenString) {
|
|
142
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const consumes: runtime.Consume[] = [
|
|
146
|
+
{ contentType: 'multipart/form-data' },
|
|
147
|
+
];
|
|
148
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
149
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
150
|
+
|
|
151
|
+
let formParams: { append(param: string, value: any): any };
|
|
152
|
+
let useForm = false;
|
|
153
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
154
|
+
useForm = canConsumeForm;
|
|
155
|
+
if (useForm) {
|
|
156
|
+
formParams = new FormData();
|
|
157
|
+
} else {
|
|
158
|
+
formParams = new URLSearchParams();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (requestParameters['file'] != null) {
|
|
162
|
+
formParams.append('file', requestParameters['file'] as any);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const response = await this.request({
|
|
166
|
+
path: `/api/admin/subscriptions/{subscriptionId}/bills/bulk-mark-paid`.replace(`{${"subscriptionId"}}`, encodeURIComponent(String(requestParameters['subscriptionId']))),
|
|
167
|
+
method: 'POST',
|
|
168
|
+
headers: headerParameters,
|
|
169
|
+
query: queryParameters,
|
|
170
|
+
body: formParams,
|
|
171
|
+
}, initOverrides);
|
|
172
|
+
|
|
173
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BulkMarkBillsPaid200ResponseFromJSON(jsonValue));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Bulk mark bills as paid from CSV data
|
|
178
|
+
*/
|
|
179
|
+
async bulkMarkBillsPaid(requestParameters: BulkMarkBillsPaidRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkMarkBillsPaid200Response> {
|
|
180
|
+
const response = await this.bulkMarkBillsPaidRaw(requestParameters, initOverrides);
|
|
181
|
+
return await response.value();
|
|
182
|
+
}
|
|
183
|
+
|
|
69
184
|
/**
|
|
70
185
|
* Delete a bill
|
|
71
186
|
*/
|
|
@@ -118,6 +233,13 @@ export class AdminSubscriptionBillingApi extends runtime.BaseAPI {
|
|
|
118
233
|
);
|
|
119
234
|
}
|
|
120
235
|
|
|
236
|
+
if (requestParameters['generateSubscriptionBillsRequest'] == null) {
|
|
237
|
+
throw new runtime.RequiredError(
|
|
238
|
+
'generateSubscriptionBillsRequest',
|
|
239
|
+
'Required parameter "generateSubscriptionBillsRequest" was null or undefined when calling generateSubscriptionBills().'
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
121
243
|
const queryParameters: any = {};
|
|
122
244
|
|
|
123
245
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
@@ -233,6 +355,120 @@ export class AdminSubscriptionBillingApi extends runtime.BaseAPI {
|
|
|
233
355
|
return await response.value();
|
|
234
356
|
}
|
|
235
357
|
|
|
358
|
+
/**
|
|
359
|
+
* Get paginated bills for a subscription with filters
|
|
360
|
+
*/
|
|
361
|
+
async getSubscriptionBillsPaginatedRaw(requestParameters: GetSubscriptionBillsPaginatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionBillPageDto>> {
|
|
362
|
+
if (requestParameters['subscriptionId'] == null) {
|
|
363
|
+
throw new runtime.RequiredError(
|
|
364
|
+
'subscriptionId',
|
|
365
|
+
'Required parameter "subscriptionId" was null or undefined when calling getSubscriptionBillsPaginated().'
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const queryParameters: any = {};
|
|
370
|
+
|
|
371
|
+
if (requestParameters['offset'] != null) {
|
|
372
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (requestParameters['limit'] != null) {
|
|
376
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
if (requestParameters['periodNumber'] != null) {
|
|
380
|
+
queryParameters['periodNumber'] = requestParameters['periodNumber'];
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (requestParameters['paymentConfigId'] != null) {
|
|
384
|
+
queryParameters['paymentConfigId'] = requestParameters['paymentConfigId'];
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (requestParameters['search'] != null) {
|
|
388
|
+
queryParameters['search'] = requestParameters['search'];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (requestParameters['billingYear'] != null) {
|
|
392
|
+
queryParameters['billingYear'] = requestParameters['billingYear'];
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
if (requestParameters['status'] != null) {
|
|
396
|
+
queryParameters['status'] = requestParameters['status'];
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
400
|
+
|
|
401
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
402
|
+
const token = this.configuration.accessToken;
|
|
403
|
+
const tokenString = await token("bearerAuth", []);
|
|
404
|
+
|
|
405
|
+
if (tokenString) {
|
|
406
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
const response = await this.request({
|
|
410
|
+
path: `/api/admin/subscriptions/{subscriptionId}/bills/paginated`.replace(`{${"subscriptionId"}}`, encodeURIComponent(String(requestParameters['subscriptionId']))),
|
|
411
|
+
method: 'GET',
|
|
412
|
+
headers: headerParameters,
|
|
413
|
+
query: queryParameters,
|
|
414
|
+
}, initOverrides);
|
|
415
|
+
|
|
416
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SubscriptionBillPageDtoFromJSON(jsonValue));
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Get paginated bills for a subscription with filters
|
|
421
|
+
*/
|
|
422
|
+
async getSubscriptionBillsPaginated(requestParameters: GetSubscriptionBillsPaginatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionBillPageDto> {
|
|
423
|
+
const response = await this.getSubscriptionBillsPaginatedRaw(requestParameters, initOverrides);
|
|
424
|
+
return await response.value();
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Get aggregated billing summary for a subscription
|
|
429
|
+
*/
|
|
430
|
+
async getSubscriptionBillsSummaryRaw(requestParameters: GetSubscriptionBillsSummaryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<BillingSummaryItemDto>>> {
|
|
431
|
+
if (requestParameters['subscriptionId'] == null) {
|
|
432
|
+
throw new runtime.RequiredError(
|
|
433
|
+
'subscriptionId',
|
|
434
|
+
'Required parameter "subscriptionId" was null or undefined when calling getSubscriptionBillsSummary().'
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
const queryParameters: any = {};
|
|
439
|
+
|
|
440
|
+
if (requestParameters['billingYear'] != null) {
|
|
441
|
+
queryParameters['billingYear'] = requestParameters['billingYear'];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
445
|
+
|
|
446
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
447
|
+
const token = this.configuration.accessToken;
|
|
448
|
+
const tokenString = await token("bearerAuth", []);
|
|
449
|
+
|
|
450
|
+
if (tokenString) {
|
|
451
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
const response = await this.request({
|
|
455
|
+
path: `/api/admin/subscriptions/{subscriptionId}/bills/summary`.replace(`{${"subscriptionId"}}`, encodeURIComponent(String(requestParameters['subscriptionId']))),
|
|
456
|
+
method: 'GET',
|
|
457
|
+
headers: headerParameters,
|
|
458
|
+
query: queryParameters,
|
|
459
|
+
}, initOverrides);
|
|
460
|
+
|
|
461
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(BillingSummaryItemDtoFromJSON));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Get aggregated billing summary for a subscription
|
|
466
|
+
*/
|
|
467
|
+
async getSubscriptionBillsSummary(requestParameters: GetSubscriptionBillsSummaryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<BillingSummaryItemDto>> {
|
|
468
|
+
const response = await this.getSubscriptionBillsSummaryRaw(requestParameters, initOverrides);
|
|
469
|
+
return await response.value();
|
|
470
|
+
}
|
|
471
|
+
|
|
236
472
|
/**
|
|
237
473
|
* Link a payment detail to a bill
|
|
238
474
|
*/
|
|
@@ -284,6 +520,57 @@ export class AdminSubscriptionBillingApi extends runtime.BaseAPI {
|
|
|
284
520
|
return await response.value();
|
|
285
521
|
}
|
|
286
522
|
|
|
523
|
+
/**
|
|
524
|
+
* Mark a bill as paid with payment tracking info
|
|
525
|
+
*/
|
|
526
|
+
async markBillAsPaidRaw(requestParameters: MarkBillAsPaidOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionBill>> {
|
|
527
|
+
if (requestParameters['billId'] == null) {
|
|
528
|
+
throw new runtime.RequiredError(
|
|
529
|
+
'billId',
|
|
530
|
+
'Required parameter "billId" was null or undefined when calling markBillAsPaid().'
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
if (requestParameters['markBillAsPaidRequest'] == null) {
|
|
535
|
+
throw new runtime.RequiredError(
|
|
536
|
+
'markBillAsPaidRequest',
|
|
537
|
+
'Required parameter "markBillAsPaidRequest" was null or undefined when calling markBillAsPaid().'
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
const queryParameters: any = {};
|
|
542
|
+
|
|
543
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
544
|
+
|
|
545
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
546
|
+
|
|
547
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
548
|
+
const token = this.configuration.accessToken;
|
|
549
|
+
const tokenString = await token("bearerAuth", []);
|
|
550
|
+
|
|
551
|
+
if (tokenString) {
|
|
552
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
const response = await this.request({
|
|
556
|
+
path: `/api/admin/bills/{billId}/mark-paid`.replace(`{${"billId"}}`, encodeURIComponent(String(requestParameters['billId']))),
|
|
557
|
+
method: 'PATCH',
|
|
558
|
+
headers: headerParameters,
|
|
559
|
+
query: queryParameters,
|
|
560
|
+
body: MarkBillAsPaidRequestToJSON(requestParameters['markBillAsPaidRequest']),
|
|
561
|
+
}, initOverrides);
|
|
562
|
+
|
|
563
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SubscriptionBillFromJSON(jsonValue));
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Mark a bill as paid with payment tracking info
|
|
568
|
+
*/
|
|
569
|
+
async markBillAsPaid(requestParameters: MarkBillAsPaidOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionBill> {
|
|
570
|
+
const response = await this.markBillAsPaidRaw(requestParameters, initOverrides);
|
|
571
|
+
return await response.value();
|
|
572
|
+
}
|
|
573
|
+
|
|
287
574
|
/**
|
|
288
575
|
* Update a bill
|
|
289
576
|
*/
|
|
@@ -328,4 +615,73 @@ export class AdminSubscriptionBillingApi extends runtime.BaseAPI {
|
|
|
328
615
|
return await response.value();
|
|
329
616
|
}
|
|
330
617
|
|
|
618
|
+
/**
|
|
619
|
+
* Upload a receipt attachment for a bill
|
|
620
|
+
*/
|
|
621
|
+
async uploadBillReceiptRaw(requestParameters: UploadBillReceiptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadBillReceipt200Response>> {
|
|
622
|
+
if (requestParameters['billId'] == null) {
|
|
623
|
+
throw new runtime.RequiredError(
|
|
624
|
+
'billId',
|
|
625
|
+
'Required parameter "billId" was null or undefined when calling uploadBillReceipt().'
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
if (requestParameters['file'] == null) {
|
|
630
|
+
throw new runtime.RequiredError(
|
|
631
|
+
'file',
|
|
632
|
+
'Required parameter "file" was null or undefined when calling uploadBillReceipt().'
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
const queryParameters: any = {};
|
|
637
|
+
|
|
638
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
639
|
+
|
|
640
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
641
|
+
const token = this.configuration.accessToken;
|
|
642
|
+
const tokenString = await token("bearerAuth", []);
|
|
643
|
+
|
|
644
|
+
if (tokenString) {
|
|
645
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
const consumes: runtime.Consume[] = [
|
|
649
|
+
{ contentType: 'multipart/form-data' },
|
|
650
|
+
];
|
|
651
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
652
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
653
|
+
|
|
654
|
+
let formParams: { append(param: string, value: any): any };
|
|
655
|
+
let useForm = false;
|
|
656
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
657
|
+
useForm = canConsumeForm;
|
|
658
|
+
if (useForm) {
|
|
659
|
+
formParams = new FormData();
|
|
660
|
+
} else {
|
|
661
|
+
formParams = new URLSearchParams();
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
if (requestParameters['file'] != null) {
|
|
665
|
+
formParams.append('file', requestParameters['file'] as any);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
const response = await this.request({
|
|
669
|
+
path: `/api/admin/bills/{billId}/upload-receipt`.replace(`{${"billId"}}`, encodeURIComponent(String(requestParameters['billId']))),
|
|
670
|
+
method: 'POST',
|
|
671
|
+
headers: headerParameters,
|
|
672
|
+
query: queryParameters,
|
|
673
|
+
body: formParams,
|
|
674
|
+
}, initOverrides);
|
|
675
|
+
|
|
676
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UploadBillReceipt200ResponseFromJSON(jsonValue));
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Upload a receipt attachment for a bill
|
|
681
|
+
*/
|
|
682
|
+
async uploadBillReceipt(requestParameters: UploadBillReceiptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadBillReceipt200Response> {
|
|
683
|
+
const response = await this.uploadBillReceiptRaw(requestParameters, initOverrides);
|
|
684
|
+
return await response.value();
|
|
685
|
+
}
|
|
686
|
+
|
|
331
687
|
}
|