@ikonintegration/module-contractor-api 1.0.0 → 1.0.2
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/Api.ts +65 -65
- package/dist/Api.d.ts +1463 -0
- package/dist/Api.js +891 -0
- package/dist/Api.js.map +1 -0
- package/package.json +1 -1
- package/tsconfig.json +16 -0
package/dist/Api.js
ADDED
|
@@ -0,0 +1,891 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/*
|
|
5
|
+
* ---------------------------------------------------------------
|
|
6
|
+
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
7
|
+
* ## ##
|
|
8
|
+
* ## AUTHOR: acacode ##
|
|
9
|
+
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
10
|
+
* ---------------------------------------------------------------
|
|
11
|
+
*/
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.Api = exports.HttpClient = exports.ContentType = exports.ListSubmissionsParams1TypeEnum = exports.ListSubmissionsParams1StatusEnum = exports.TypeEnum1 = exports.StatusEnum = exports.ListContractorsParams1TypeEnum = exports.TypeEnum = exports.InputJiuwxuwhbyjContentTypeEnum = exports.InputZuufi5FlopSectionEnum = exports.InputKvk7Y9Qob6TransportationTypeEnum = exports.InputKvk7Y9Qob6MealTypeEnum = exports.InputKvk7Y9Qob6TypeEnum1 = exports.InputKvk7Y9Qob6TypeEnum = exports.InputIjeu6D8I3BTransportationTypeEnum = exports.InputIjeu6D8I3BMealTypeEnum = exports.InputIjeu6D8I3BTypeEnum1 = exports.InputIjeu6D8I3BTypeEnum = exports.Input4M0Lv5AhswStatusEnum = void 0;
|
|
17
|
+
/**
|
|
18
|
+
* The contractor's local status. Set to 'active' to enable or 'disabled' to disable the account.
|
|
19
|
+
* @example "active"
|
|
20
|
+
*/
|
|
21
|
+
var Input4M0Lv5AhswStatusEnum;
|
|
22
|
+
(function (Input4M0Lv5AhswStatusEnum) {
|
|
23
|
+
Input4M0Lv5AhswStatusEnum["Active"] = "active";
|
|
24
|
+
Input4M0Lv5AhswStatusEnum["Disabled"] = "disabled";
|
|
25
|
+
})(Input4M0Lv5AhswStatusEnum || (exports.Input4M0Lv5AhswStatusEnum = Input4M0Lv5AhswStatusEnum = {}));
|
|
26
|
+
/**
|
|
27
|
+
* Submission type
|
|
28
|
+
* @example "Submission"
|
|
29
|
+
*/
|
|
30
|
+
var InputIjeu6D8I3BTypeEnum;
|
|
31
|
+
(function (InputIjeu6D8I3BTypeEnum) {
|
|
32
|
+
InputIjeu6D8I3BTypeEnum["Submission"] = "Submission";
|
|
33
|
+
InputIjeu6D8I3BTypeEnum["Reimbursement"] = "Reimbursement";
|
|
34
|
+
})(InputIjeu6D8I3BTypeEnum || (exports.InputIjeu6D8I3BTypeEnum = InputIjeu6D8I3BTypeEnum = {}));
|
|
35
|
+
/**
|
|
36
|
+
* Expense type
|
|
37
|
+
* @example "Accommodation"
|
|
38
|
+
*/
|
|
39
|
+
var InputIjeu6D8I3BTypeEnum1;
|
|
40
|
+
(function (InputIjeu6D8I3BTypeEnum1) {
|
|
41
|
+
InputIjeu6D8I3BTypeEnum1["Accommodation"] = "Accommodation";
|
|
42
|
+
InputIjeu6D8I3BTypeEnum1["Meal"] = "Meal";
|
|
43
|
+
InputIjeu6D8I3BTypeEnum1["Mileage"] = "Mileage";
|
|
44
|
+
InputIjeu6D8I3BTypeEnum1["Transportation"] = "Transportation";
|
|
45
|
+
InputIjeu6D8I3BTypeEnum1["Other"] = "Other";
|
|
46
|
+
})(InputIjeu6D8I3BTypeEnum1 || (exports.InputIjeu6D8I3BTypeEnum1 = InputIjeu6D8I3BTypeEnum1 = {}));
|
|
47
|
+
/**
|
|
48
|
+
* Meal type (Meal expenses)
|
|
49
|
+
* @example "Lunch"
|
|
50
|
+
*/
|
|
51
|
+
var InputIjeu6D8I3BMealTypeEnum;
|
|
52
|
+
(function (InputIjeu6D8I3BMealTypeEnum) {
|
|
53
|
+
InputIjeu6D8I3BMealTypeEnum["Breakfast"] = "Breakfast";
|
|
54
|
+
InputIjeu6D8I3BMealTypeEnum["Lunch"] = "Lunch";
|
|
55
|
+
InputIjeu6D8I3BMealTypeEnum["Dinner"] = "Dinner";
|
|
56
|
+
})(InputIjeu6D8I3BMealTypeEnum || (exports.InputIjeu6D8I3BMealTypeEnum = InputIjeu6D8I3BMealTypeEnum = {}));
|
|
57
|
+
/**
|
|
58
|
+
* Transportation type (Transportation expenses)
|
|
59
|
+
* @example "Taxi"
|
|
60
|
+
*/
|
|
61
|
+
var InputIjeu6D8I3BTransportationTypeEnum;
|
|
62
|
+
(function (InputIjeu6D8I3BTransportationTypeEnum) {
|
|
63
|
+
InputIjeu6D8I3BTransportationTypeEnum["AirTravel"] = "Air travel";
|
|
64
|
+
InputIjeu6D8I3BTransportationTypeEnum["Taxi"] = "Taxi";
|
|
65
|
+
InputIjeu6D8I3BTransportationTypeEnum["Ferry"] = "Ferry";
|
|
66
|
+
InputIjeu6D8I3BTransportationTypeEnum["Rental"] = "Rental";
|
|
67
|
+
InputIjeu6D8I3BTransportationTypeEnum["Other"] = "Other";
|
|
68
|
+
})(InputIjeu6D8I3BTransportationTypeEnum || (exports.InputIjeu6D8I3BTransportationTypeEnum = InputIjeu6D8I3BTransportationTypeEnum = {}));
|
|
69
|
+
/** Submission type */
|
|
70
|
+
var InputKvk7Y9Qob6TypeEnum;
|
|
71
|
+
(function (InputKvk7Y9Qob6TypeEnum) {
|
|
72
|
+
InputKvk7Y9Qob6TypeEnum["Submission"] = "Submission";
|
|
73
|
+
InputKvk7Y9Qob6TypeEnum["Reimbursement"] = "Reimbursement";
|
|
74
|
+
})(InputKvk7Y9Qob6TypeEnum || (exports.InputKvk7Y9Qob6TypeEnum = InputKvk7Y9Qob6TypeEnum = {}));
|
|
75
|
+
/**
|
|
76
|
+
* Expense type
|
|
77
|
+
* @example "Accommodation"
|
|
78
|
+
*/
|
|
79
|
+
var InputKvk7Y9Qob6TypeEnum1;
|
|
80
|
+
(function (InputKvk7Y9Qob6TypeEnum1) {
|
|
81
|
+
InputKvk7Y9Qob6TypeEnum1["Accommodation"] = "Accommodation";
|
|
82
|
+
InputKvk7Y9Qob6TypeEnum1["Meal"] = "Meal";
|
|
83
|
+
InputKvk7Y9Qob6TypeEnum1["Mileage"] = "Mileage";
|
|
84
|
+
InputKvk7Y9Qob6TypeEnum1["Transportation"] = "Transportation";
|
|
85
|
+
InputKvk7Y9Qob6TypeEnum1["Other"] = "Other";
|
|
86
|
+
})(InputKvk7Y9Qob6TypeEnum1 || (exports.InputKvk7Y9Qob6TypeEnum1 = InputKvk7Y9Qob6TypeEnum1 = {}));
|
|
87
|
+
/**
|
|
88
|
+
* Meal type (Meal expenses)
|
|
89
|
+
* @example "Lunch"
|
|
90
|
+
*/
|
|
91
|
+
var InputKvk7Y9Qob6MealTypeEnum;
|
|
92
|
+
(function (InputKvk7Y9Qob6MealTypeEnum) {
|
|
93
|
+
InputKvk7Y9Qob6MealTypeEnum["Breakfast"] = "Breakfast";
|
|
94
|
+
InputKvk7Y9Qob6MealTypeEnum["Lunch"] = "Lunch";
|
|
95
|
+
InputKvk7Y9Qob6MealTypeEnum["Dinner"] = "Dinner";
|
|
96
|
+
})(InputKvk7Y9Qob6MealTypeEnum || (exports.InputKvk7Y9Qob6MealTypeEnum = InputKvk7Y9Qob6MealTypeEnum = {}));
|
|
97
|
+
/**
|
|
98
|
+
* Transportation type (Transportation expenses)
|
|
99
|
+
* @example "Taxi"
|
|
100
|
+
*/
|
|
101
|
+
var InputKvk7Y9Qob6TransportationTypeEnum;
|
|
102
|
+
(function (InputKvk7Y9Qob6TransportationTypeEnum) {
|
|
103
|
+
InputKvk7Y9Qob6TransportationTypeEnum["AirTravel"] = "Air travel";
|
|
104
|
+
InputKvk7Y9Qob6TransportationTypeEnum["Taxi"] = "Taxi";
|
|
105
|
+
InputKvk7Y9Qob6TransportationTypeEnum["Ferry"] = "Ferry";
|
|
106
|
+
InputKvk7Y9Qob6TransportationTypeEnum["Rental"] = "Rental";
|
|
107
|
+
InputKvk7Y9Qob6TransportationTypeEnum["Other"] = "Other";
|
|
108
|
+
})(InputKvk7Y9Qob6TransportationTypeEnum || (exports.InputKvk7Y9Qob6TransportationTypeEnum = InputKvk7Y9Qob6TransportationTypeEnum = {}));
|
|
109
|
+
/** The section to assign the code to */
|
|
110
|
+
var InputZuufi5FlopSectionEnum;
|
|
111
|
+
(function (InputZuufi5FlopSectionEnum) {
|
|
112
|
+
InputZuufi5FlopSectionEnum["Service"] = "Service";
|
|
113
|
+
InputZuufi5FlopSectionEnum["Reimbursement"] = "Reimbursement";
|
|
114
|
+
})(InputZuufi5FlopSectionEnum || (exports.InputZuufi5FlopSectionEnum = InputZuufi5FlopSectionEnum = {}));
|
|
115
|
+
/**
|
|
116
|
+
* Content type (must be application/pdf for guest)
|
|
117
|
+
* @example "application/pdf"
|
|
118
|
+
*/
|
|
119
|
+
var InputJiuwxuwhbyjContentTypeEnum;
|
|
120
|
+
(function (InputJiuwxuwhbyjContentTypeEnum) {
|
|
121
|
+
InputJiuwxuwhbyjContentTypeEnum["ApplicationPdf"] = "application/pdf";
|
|
122
|
+
})(InputJiuwxuwhbyjContentTypeEnum || (exports.InputJiuwxuwhbyjContentTypeEnum = InputJiuwxuwhbyjContentTypeEnum = {}));
|
|
123
|
+
/**
|
|
124
|
+
* Search field type: name for begins_with match, email for exact match
|
|
125
|
+
* @example "name"
|
|
126
|
+
*/
|
|
127
|
+
var TypeEnum;
|
|
128
|
+
(function (TypeEnum) {
|
|
129
|
+
TypeEnum["Name"] = "name";
|
|
130
|
+
TypeEnum["Email"] = "email";
|
|
131
|
+
})(TypeEnum || (exports.TypeEnum = TypeEnum = {}));
|
|
132
|
+
/**
|
|
133
|
+
* Search field type: name for begins_with match, email for exact match
|
|
134
|
+
* @example "name"
|
|
135
|
+
*/
|
|
136
|
+
var ListContractorsParams1TypeEnum;
|
|
137
|
+
(function (ListContractorsParams1TypeEnum) {
|
|
138
|
+
ListContractorsParams1TypeEnum["Name"] = "name";
|
|
139
|
+
ListContractorsParams1TypeEnum["Email"] = "email";
|
|
140
|
+
})(ListContractorsParams1TypeEnum || (exports.ListContractorsParams1TypeEnum = ListContractorsParams1TypeEnum = {}));
|
|
141
|
+
/**
|
|
142
|
+
* Filter by submission status
|
|
143
|
+
* @example "Submitted"
|
|
144
|
+
*/
|
|
145
|
+
var StatusEnum;
|
|
146
|
+
(function (StatusEnum) {
|
|
147
|
+
StatusEnum["Draft"] = "Draft";
|
|
148
|
+
StatusEnum["Submitted"] = "Submitted";
|
|
149
|
+
StatusEnum["AdministratorApproved"] = "Administrator_Approved";
|
|
150
|
+
StatusEnum["Rejected"] = "Rejected";
|
|
151
|
+
StatusEnum["PaymentPending"] = "Payment_Pending";
|
|
152
|
+
StatusEnum["Paid"] = "Paid";
|
|
153
|
+
})(StatusEnum || (exports.StatusEnum = StatusEnum = {}));
|
|
154
|
+
/**
|
|
155
|
+
* Filter by submission type
|
|
156
|
+
* @example "Submission"
|
|
157
|
+
*/
|
|
158
|
+
var TypeEnum1;
|
|
159
|
+
(function (TypeEnum1) {
|
|
160
|
+
TypeEnum1["Submission"] = "Submission";
|
|
161
|
+
TypeEnum1["Reimbursement"] = "Reimbursement";
|
|
162
|
+
})(TypeEnum1 || (exports.TypeEnum1 = TypeEnum1 = {}));
|
|
163
|
+
/**
|
|
164
|
+
* Filter by submission status
|
|
165
|
+
* @example "Submitted"
|
|
166
|
+
*/
|
|
167
|
+
var ListSubmissionsParams1StatusEnum;
|
|
168
|
+
(function (ListSubmissionsParams1StatusEnum) {
|
|
169
|
+
ListSubmissionsParams1StatusEnum["Draft"] = "Draft";
|
|
170
|
+
ListSubmissionsParams1StatusEnum["Submitted"] = "Submitted";
|
|
171
|
+
ListSubmissionsParams1StatusEnum["AdministratorApproved"] = "Administrator_Approved";
|
|
172
|
+
ListSubmissionsParams1StatusEnum["Rejected"] = "Rejected";
|
|
173
|
+
ListSubmissionsParams1StatusEnum["PaymentPending"] = "Payment_Pending";
|
|
174
|
+
ListSubmissionsParams1StatusEnum["Paid"] = "Paid";
|
|
175
|
+
})(ListSubmissionsParams1StatusEnum || (exports.ListSubmissionsParams1StatusEnum = ListSubmissionsParams1StatusEnum = {}));
|
|
176
|
+
/**
|
|
177
|
+
* Filter by submission type
|
|
178
|
+
* @example "Submission"
|
|
179
|
+
*/
|
|
180
|
+
var ListSubmissionsParams1TypeEnum;
|
|
181
|
+
(function (ListSubmissionsParams1TypeEnum) {
|
|
182
|
+
ListSubmissionsParams1TypeEnum["Submission"] = "Submission";
|
|
183
|
+
ListSubmissionsParams1TypeEnum["Reimbursement"] = "Reimbursement";
|
|
184
|
+
})(ListSubmissionsParams1TypeEnum || (exports.ListSubmissionsParams1TypeEnum = ListSubmissionsParams1TypeEnum = {}));
|
|
185
|
+
const axios_1 = __importDefault(require("axios"));
|
|
186
|
+
var ContentType;
|
|
187
|
+
(function (ContentType) {
|
|
188
|
+
ContentType["Json"] = "application/json";
|
|
189
|
+
ContentType["FormData"] = "multipart/form-data";
|
|
190
|
+
ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
|
|
191
|
+
ContentType["Text"] = "text/plain";
|
|
192
|
+
})(ContentType || (exports.ContentType = ContentType = {}));
|
|
193
|
+
class HttpClient {
|
|
194
|
+
constructor({ securityWorker, secure, format, ...axiosConfig } = {}) {
|
|
195
|
+
this.securityData = null;
|
|
196
|
+
this.setSecurityData = (data) => {
|
|
197
|
+
this.securityData = data;
|
|
198
|
+
};
|
|
199
|
+
this.request = async ({ secure, path, type, query, format, body, ...params }) => {
|
|
200
|
+
const secureParams = ((typeof secure === 'boolean' ? secure : this.secure) &&
|
|
201
|
+
this.securityWorker &&
|
|
202
|
+
(await this.securityWorker(this.securityData))) ||
|
|
203
|
+
{};
|
|
204
|
+
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
205
|
+
const responseFormat = format || this.format || undefined;
|
|
206
|
+
if (type === ContentType.FormData && body && body !== null && typeof body === 'object') {
|
|
207
|
+
body = this.createFormData(body);
|
|
208
|
+
}
|
|
209
|
+
if (type === ContentType.Text && body && body !== null && typeof body !== 'string') {
|
|
210
|
+
body = JSON.stringify(body);
|
|
211
|
+
}
|
|
212
|
+
return this.instance
|
|
213
|
+
.request({
|
|
214
|
+
...requestParams,
|
|
215
|
+
headers: {
|
|
216
|
+
...(requestParams.headers || {}),
|
|
217
|
+
...(type ? { 'Content-Type': type } : {}),
|
|
218
|
+
},
|
|
219
|
+
params: query,
|
|
220
|
+
responseType: responseFormat,
|
|
221
|
+
data: body,
|
|
222
|
+
url: path,
|
|
223
|
+
})
|
|
224
|
+
.then(response => response.data);
|
|
225
|
+
};
|
|
226
|
+
this.instance = axios_1.default.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || 'http://localhost:8080' });
|
|
227
|
+
this.secure = secure;
|
|
228
|
+
this.format = format;
|
|
229
|
+
this.securityWorker = securityWorker;
|
|
230
|
+
}
|
|
231
|
+
mergeRequestParams(params1, params2) {
|
|
232
|
+
const method = params1.method || (params2 && params2.method);
|
|
233
|
+
return {
|
|
234
|
+
...this.instance.defaults,
|
|
235
|
+
...params1,
|
|
236
|
+
...(params2 || {}),
|
|
237
|
+
headers: {
|
|
238
|
+
...((method && this.instance.defaults.headers[method.toLowerCase()]) || {}),
|
|
239
|
+
...(params1.headers || {}),
|
|
240
|
+
...((params2 && params2.headers) || {}),
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
stringifyFormItem(formItem) {
|
|
245
|
+
if (typeof formItem === 'object' && formItem !== null) {
|
|
246
|
+
return JSON.stringify(formItem);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
return `${formItem}`;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
createFormData(input) {
|
|
253
|
+
if (input instanceof FormData) {
|
|
254
|
+
return input;
|
|
255
|
+
}
|
|
256
|
+
return Object.keys(input || {}).reduce((formData, key) => {
|
|
257
|
+
const property = input[key];
|
|
258
|
+
const propertyContent = property instanceof Array ? property : [property];
|
|
259
|
+
for (const formItem of propertyContent) {
|
|
260
|
+
const isFileType = formItem instanceof Blob || formItem instanceof File;
|
|
261
|
+
formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
|
|
262
|
+
}
|
|
263
|
+
return formData;
|
|
264
|
+
}, new FormData());
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
exports.HttpClient = HttpClient;
|
|
268
|
+
/**
|
|
269
|
+
* @title Contractor Module API
|
|
270
|
+
* @version 1.0.2
|
|
271
|
+
* @baseUrl http://localhost:8080
|
|
272
|
+
* @contact Ikon Integration <ikon@ikonintegration.com> (http://example.com)
|
|
273
|
+
*/
|
|
274
|
+
class Api extends HttpClient {
|
|
275
|
+
constructor() {
|
|
276
|
+
super(...arguments);
|
|
277
|
+
this.code = {
|
|
278
|
+
/**
|
|
279
|
+
* @description Creates a new charging code associated with a department. Only Super Administrators can create codes.
|
|
280
|
+
*
|
|
281
|
+
* @tags Codes
|
|
282
|
+
* @name CreateCode
|
|
283
|
+
* @summary Create Code
|
|
284
|
+
* @request POST:/code
|
|
285
|
+
* @secure
|
|
286
|
+
*/
|
|
287
|
+
createCode: (data, params = {}) => this.request({
|
|
288
|
+
path: `/code`,
|
|
289
|
+
method: 'POST',
|
|
290
|
+
body: data,
|
|
291
|
+
secure: true,
|
|
292
|
+
type: ContentType.Json,
|
|
293
|
+
...params,
|
|
294
|
+
}),
|
|
295
|
+
/**
|
|
296
|
+
* @description Updates an existing charging code description. Only Super Administrators can update codes.
|
|
297
|
+
*
|
|
298
|
+
* @tags Codes
|
|
299
|
+
* @name UpdateCode
|
|
300
|
+
* @summary Update Code
|
|
301
|
+
* @request PUT:/code/{codeID}
|
|
302
|
+
* @secure
|
|
303
|
+
*/
|
|
304
|
+
updateCode: (codeId, data, params = {}) => this.request({
|
|
305
|
+
path: `/code/${codeId}`,
|
|
306
|
+
method: 'PUT',
|
|
307
|
+
body: data,
|
|
308
|
+
secure: true,
|
|
309
|
+
type: ContentType.Json,
|
|
310
|
+
...params,
|
|
311
|
+
}),
|
|
312
|
+
/**
|
|
313
|
+
* @description Deletes a charging code. Prevents deletion if the code is referenced by existing submissions. Only Super Administrators can delete codes.
|
|
314
|
+
*
|
|
315
|
+
* @tags Codes
|
|
316
|
+
* @name DeleteCode
|
|
317
|
+
* @summary Delete Code
|
|
318
|
+
* @request DELETE:/code/{codeID}
|
|
319
|
+
* @secure
|
|
320
|
+
*/
|
|
321
|
+
deleteCode: (codeId, params = {}) => this.request({
|
|
322
|
+
path: `/code/${codeId}`,
|
|
323
|
+
method: 'DELETE',
|
|
324
|
+
secure: true,
|
|
325
|
+
...params,
|
|
326
|
+
}),
|
|
327
|
+
};
|
|
328
|
+
this.codes = {
|
|
329
|
+
/**
|
|
330
|
+
* @description Returns all codes or codes filtered by department. Administrators and above can list codes.
|
|
331
|
+
*
|
|
332
|
+
* @tags Codes
|
|
333
|
+
* @name ListCodes
|
|
334
|
+
* @summary List Codes
|
|
335
|
+
* @request GET:/codes
|
|
336
|
+
* @secure
|
|
337
|
+
*/
|
|
338
|
+
listCodes: (params = {}) => this.request({
|
|
339
|
+
path: `/codes`,
|
|
340
|
+
method: 'GET',
|
|
341
|
+
secure: true,
|
|
342
|
+
...params,
|
|
343
|
+
}),
|
|
344
|
+
};
|
|
345
|
+
this.contractor = {
|
|
346
|
+
/**
|
|
347
|
+
* @description Creates a new contractor account. Requires a unique email address and at least one job rate. Only Administrators and Super Administrators can create contractor accounts.
|
|
348
|
+
*
|
|
349
|
+
* @tags Contractors
|
|
350
|
+
* @name CreateContractor
|
|
351
|
+
* @summary Create Contractor
|
|
352
|
+
* @request POST:/contractor
|
|
353
|
+
* @secure
|
|
354
|
+
*/
|
|
355
|
+
createContractor: (data, params = {}) => this.request({
|
|
356
|
+
path: `/contractor`,
|
|
357
|
+
method: 'POST',
|
|
358
|
+
body: data,
|
|
359
|
+
secure: true,
|
|
360
|
+
type: ContentType.Json,
|
|
361
|
+
...params,
|
|
362
|
+
}),
|
|
363
|
+
/**
|
|
364
|
+
* @description View a contractor profile. Contractors can view their own profile (includes effective rates). Administrators can view any contractor profile.
|
|
365
|
+
*
|
|
366
|
+
* @tags Contractors
|
|
367
|
+
* @name GetContractor
|
|
368
|
+
* @summary View Contractor Profile
|
|
369
|
+
* @request GET:/contractor/{userID}
|
|
370
|
+
* @secure
|
|
371
|
+
*/
|
|
372
|
+
getContractor: (userId, params = {}) => this.request({
|
|
373
|
+
path: `/contractor/${userId}`,
|
|
374
|
+
method: 'GET',
|
|
375
|
+
secure: true,
|
|
376
|
+
...params,
|
|
377
|
+
}),
|
|
378
|
+
/**
|
|
379
|
+
* @description Sets user-specific rate maximums for a contractor. Only Administrators and Super Administrators can set rates. Values must be positive numbers with up to two decimal places.
|
|
380
|
+
*
|
|
381
|
+
* @tags Contractors
|
|
382
|
+
* @name UpdateRates
|
|
383
|
+
* @summary Set Contractor Rates
|
|
384
|
+
* @request PUT:/contractor/{userID}/rates
|
|
385
|
+
* @secure
|
|
386
|
+
*/
|
|
387
|
+
updateRates: (userId, data, params = {}) => this.request({
|
|
388
|
+
path: `/contractor/${userId}/rates`,
|
|
389
|
+
method: 'PUT',
|
|
390
|
+
body: data,
|
|
391
|
+
secure: true,
|
|
392
|
+
type: ContentType.Json,
|
|
393
|
+
...params,
|
|
394
|
+
}),
|
|
395
|
+
/**
|
|
396
|
+
* @description Triggers a password reset for the specified contractor. Only Administrators and Super Administrators can trigger password resets.
|
|
397
|
+
*
|
|
398
|
+
* @tags Contractors
|
|
399
|
+
* @name CreateResetPassword
|
|
400
|
+
* @summary Reset Contractor Password
|
|
401
|
+
* @request POST:/contractor/{userID}/reset-password
|
|
402
|
+
* @secure
|
|
403
|
+
*/
|
|
404
|
+
createResetPassword: (userId, params = {}) => this.request({
|
|
405
|
+
path: `/contractor/${userId}/reset-password`,
|
|
406
|
+
method: 'POST',
|
|
407
|
+
secure: true,
|
|
408
|
+
...params,
|
|
409
|
+
}),
|
|
410
|
+
/**
|
|
411
|
+
* @description Sets a contractor's local status to active or disabled. Disabling prevents all API access while preserving the IDM account. Only Administrators and Super Administrators can toggle status.
|
|
412
|
+
*
|
|
413
|
+
* @tags Contractors
|
|
414
|
+
* @name UpdateStatus
|
|
415
|
+
* @summary Enable/Disable Contractor
|
|
416
|
+
* @request PUT:/contractor/{userID}/status
|
|
417
|
+
* @secure
|
|
418
|
+
*/
|
|
419
|
+
updateStatus: (userId, data, params = {}) => this.request({
|
|
420
|
+
path: `/contractor/${userId}/status`,
|
|
421
|
+
method: 'PUT',
|
|
422
|
+
body: data,
|
|
423
|
+
secure: true,
|
|
424
|
+
type: ContentType.Json,
|
|
425
|
+
...params,
|
|
426
|
+
}),
|
|
427
|
+
};
|
|
428
|
+
this.contractors = {
|
|
429
|
+
/**
|
|
430
|
+
* @description Search contractors by name (partial match) or email (exact match). Minimum 2 characters required.
|
|
431
|
+
*
|
|
432
|
+
* @tags Contractors
|
|
433
|
+
* @name ListContractors
|
|
434
|
+
* @summary Search Contractors
|
|
435
|
+
* @request GET:/contractors
|
|
436
|
+
* @secure
|
|
437
|
+
*/
|
|
438
|
+
listContractors: (query, params = {}) => this.request({
|
|
439
|
+
path: `/contractors`,
|
|
440
|
+
method: 'GET',
|
|
441
|
+
query: query,
|
|
442
|
+
secure: true,
|
|
443
|
+
...params,
|
|
444
|
+
}),
|
|
445
|
+
};
|
|
446
|
+
this.department = {
|
|
447
|
+
/**
|
|
448
|
+
* @description Creates a new department. Requires a name (1-150 chars) and contact emails (max 10). SYSADMIN only.
|
|
449
|
+
*
|
|
450
|
+
* @tags Departments
|
|
451
|
+
* @name CreateDepartment
|
|
452
|
+
* @summary Create Department
|
|
453
|
+
* @request POST:/department
|
|
454
|
+
* @secure
|
|
455
|
+
*/
|
|
456
|
+
createDepartment: (data, params = {}) => this.request({
|
|
457
|
+
path: `/department`,
|
|
458
|
+
method: 'POST',
|
|
459
|
+
body: data,
|
|
460
|
+
secure: true,
|
|
461
|
+
type: ContentType.Json,
|
|
462
|
+
...params,
|
|
463
|
+
}),
|
|
464
|
+
/**
|
|
465
|
+
* @description Updates an existing department name and/or contact emails. SYSADMIN only.
|
|
466
|
+
*
|
|
467
|
+
* @tags Departments
|
|
468
|
+
* @name UpdateDepartment
|
|
469
|
+
* @summary Update Department
|
|
470
|
+
* @request PUT:/department/{departmentID}
|
|
471
|
+
* @secure
|
|
472
|
+
*/
|
|
473
|
+
updateDepartment: (departmentId, data, params = {}) => this.request({
|
|
474
|
+
path: `/department/${departmentId}`,
|
|
475
|
+
method: 'PUT',
|
|
476
|
+
body: data,
|
|
477
|
+
secure: true,
|
|
478
|
+
type: ContentType.Json,
|
|
479
|
+
...params,
|
|
480
|
+
}),
|
|
481
|
+
/**
|
|
482
|
+
* @description Deletes a department. Prevents deletion if department has active codes or associated administrators. SYSADMIN only.
|
|
483
|
+
*
|
|
484
|
+
* @tags Departments
|
|
485
|
+
* @name DeleteDepartment
|
|
486
|
+
* @summary Delete Department
|
|
487
|
+
* @request DELETE:/department/{departmentID}
|
|
488
|
+
* @secure
|
|
489
|
+
*/
|
|
490
|
+
deleteDepartment: (departmentId, params = {}) => this.request({
|
|
491
|
+
path: `/department/${departmentId}`,
|
|
492
|
+
method: 'DELETE',
|
|
493
|
+
secure: true,
|
|
494
|
+
...params,
|
|
495
|
+
}),
|
|
496
|
+
/**
|
|
497
|
+
* @description Associates an administrator with a department. Each administrator can only belong to one department. SYSADMIN only.
|
|
498
|
+
*
|
|
499
|
+
* @tags Departments
|
|
500
|
+
* @name CreateAdmin
|
|
501
|
+
* @summary Associate Admin with Department
|
|
502
|
+
* @request POST:/department/{departmentID}/admin
|
|
503
|
+
* @secure
|
|
504
|
+
*/
|
|
505
|
+
createAdmin: (departmentId, data, params = {}) => this.request({
|
|
506
|
+
path: `/department/${departmentId}/admin`,
|
|
507
|
+
method: 'POST',
|
|
508
|
+
body: data,
|
|
509
|
+
secure: true,
|
|
510
|
+
type: ContentType.Json,
|
|
511
|
+
...params,
|
|
512
|
+
}),
|
|
513
|
+
/**
|
|
514
|
+
* @description Removes an administrator association from a department. SYSADMIN only.
|
|
515
|
+
*
|
|
516
|
+
* @tags Departments
|
|
517
|
+
* @name DeleteAdmin
|
|
518
|
+
* @summary Remove Admin from Department
|
|
519
|
+
* @request DELETE:/department/{departmentID}/admin/{userID}
|
|
520
|
+
* @secure
|
|
521
|
+
*/
|
|
522
|
+
deleteAdmin: (departmentId, userId, params = {}) => this.request({
|
|
523
|
+
path: `/department/${departmentId}/admin/${userId}`,
|
|
524
|
+
method: 'DELETE',
|
|
525
|
+
secure: true,
|
|
526
|
+
...params,
|
|
527
|
+
}),
|
|
528
|
+
};
|
|
529
|
+
this.departments = {
|
|
530
|
+
/**
|
|
531
|
+
* @description Returns all departments. For ADMIN/SYSADMIN users returns full department data. For lower roles (USER, ACCOUNTANT, NONE) returns only departmentID and name.
|
|
532
|
+
*
|
|
533
|
+
* @tags Departments
|
|
534
|
+
* @name ListDepartments
|
|
535
|
+
* @summary List All Departments
|
|
536
|
+
* @request GET:/departments
|
|
537
|
+
* @secure
|
|
538
|
+
*/
|
|
539
|
+
listDepartments: (params = {}) => this.request({
|
|
540
|
+
path: `/departments`,
|
|
541
|
+
method: 'GET',
|
|
542
|
+
secure: true,
|
|
543
|
+
...params,
|
|
544
|
+
}),
|
|
545
|
+
};
|
|
546
|
+
this.settings = {
|
|
547
|
+
/**
|
|
548
|
+
* @description Retrieves system settings. Administrators have read-only access. Super Administrators have full access.
|
|
549
|
+
*
|
|
550
|
+
* @tags Settings
|
|
551
|
+
* @name ListSettings
|
|
552
|
+
* @summary Get System Settings
|
|
553
|
+
* @request GET:/settings
|
|
554
|
+
* @secure
|
|
555
|
+
*/
|
|
556
|
+
listSettings: (params = {}) => this.request({
|
|
557
|
+
path: `/settings`,
|
|
558
|
+
method: 'GET',
|
|
559
|
+
secure: true,
|
|
560
|
+
...params,
|
|
561
|
+
}),
|
|
562
|
+
/**
|
|
563
|
+
* @description Updates the system-wide mileage rate. Only Super Administrators can modify system settings.
|
|
564
|
+
*
|
|
565
|
+
* @tags Settings
|
|
566
|
+
* @name UpdateRates
|
|
567
|
+
* @summary Update Mileage Rate
|
|
568
|
+
* @request PUT:/settings/rates
|
|
569
|
+
* @secure
|
|
570
|
+
*/
|
|
571
|
+
updateRates: (data, params = {}) => this.request({
|
|
572
|
+
path: `/settings/rates`,
|
|
573
|
+
method: 'PUT',
|
|
574
|
+
body: data,
|
|
575
|
+
secure: true,
|
|
576
|
+
type: ContentType.Json,
|
|
577
|
+
...params,
|
|
578
|
+
}),
|
|
579
|
+
/**
|
|
580
|
+
* @description Updates all system-wide expense maximums (accommodation, meals, transportation). Only Super Administrators can modify system settings.
|
|
581
|
+
*
|
|
582
|
+
* @tags Settings
|
|
583
|
+
* @name UpdateMaximums
|
|
584
|
+
* @summary Update Expense Maximums
|
|
585
|
+
* @request PUT:/settings/maximums
|
|
586
|
+
* @secure
|
|
587
|
+
*/
|
|
588
|
+
updateMaximums: (data, params = {}) => this.request({
|
|
589
|
+
path: `/settings/maximums`,
|
|
590
|
+
method: 'PUT',
|
|
591
|
+
body: data,
|
|
592
|
+
secure: true,
|
|
593
|
+
type: ContentType.Json,
|
|
594
|
+
...params,
|
|
595
|
+
}),
|
|
596
|
+
/**
|
|
597
|
+
* @description Updates the reminder interval (in days) for pending submission notifications. Only Super Administrators can modify system settings.
|
|
598
|
+
*
|
|
599
|
+
* @tags Settings
|
|
600
|
+
* @name UpdateReminders
|
|
601
|
+
* @summary Update Reminder Interval
|
|
602
|
+
* @request PUT:/settings/reminders
|
|
603
|
+
* @secure
|
|
604
|
+
*/
|
|
605
|
+
updateReminders: (data, params = {}) => this.request({
|
|
606
|
+
path: `/settings/reminders`,
|
|
607
|
+
method: 'PUT',
|
|
608
|
+
body: data,
|
|
609
|
+
secure: true,
|
|
610
|
+
type: ContentType.Json,
|
|
611
|
+
...params,
|
|
612
|
+
}),
|
|
613
|
+
};
|
|
614
|
+
this.submission = {
|
|
615
|
+
/**
|
|
616
|
+
* @description Creates a new draft submission for the authenticated contractor. Validates invoice number uniqueness, calculates totals, and validates expenses against configured maximums.
|
|
617
|
+
*
|
|
618
|
+
* @tags Submissions
|
|
619
|
+
* @name CreateSubmission
|
|
620
|
+
* @summary Create draft submission
|
|
621
|
+
* @request POST:/submission
|
|
622
|
+
* @secure
|
|
623
|
+
*/
|
|
624
|
+
createSubmission: (data, params = {}) => this.request({
|
|
625
|
+
path: `/submission`,
|
|
626
|
+
method: 'POST',
|
|
627
|
+
body: data,
|
|
628
|
+
secure: true,
|
|
629
|
+
type: ContentType.Json,
|
|
630
|
+
...params,
|
|
631
|
+
}),
|
|
632
|
+
/**
|
|
633
|
+
* @description Returns a single submission with all invoices, expenses, and assigned codes in a single DynamoDB query using an ElectroDB collection. Access is scoped by role: contractors see only their own, admins see their department, accountants/superadmins see any.
|
|
634
|
+
*
|
|
635
|
+
* @tags Submissions
|
|
636
|
+
* @name GetSubmission
|
|
637
|
+
* @summary View submission detail
|
|
638
|
+
* @request GET:/submission/{submissionID}
|
|
639
|
+
* @secure
|
|
640
|
+
*/
|
|
641
|
+
getSubmission: (submissionId, params = {}) => this.request({
|
|
642
|
+
path: `/submission/${submissionId}`,
|
|
643
|
+
method: 'GET',
|
|
644
|
+
secure: true,
|
|
645
|
+
...params,
|
|
646
|
+
}),
|
|
647
|
+
/**
|
|
648
|
+
* @description Updates an existing submission. Edit permissions are determined by the caller role and the submission status. Contractors can fully edit Draft/Rejected submissions and update only PO on Submitted/Administrator_Approved. Admins can edit non-calculated fields on non-Paid submissions. Recalculates totals when line items change.
|
|
649
|
+
*
|
|
650
|
+
* @tags Submissions
|
|
651
|
+
* @name UpdateSubmission
|
|
652
|
+
* @summary Update submission
|
|
653
|
+
* @request PUT:/submission/{submissionID}
|
|
654
|
+
* @secure
|
|
655
|
+
*/
|
|
656
|
+
updateSubmission: (submissionId, data, params = {}) => this.request({
|
|
657
|
+
path: `/submission/${submissionId}`,
|
|
658
|
+
method: 'PUT',
|
|
659
|
+
body: data,
|
|
660
|
+
secure: true,
|
|
661
|
+
type: ContentType.Json,
|
|
662
|
+
...params,
|
|
663
|
+
}),
|
|
664
|
+
/**
|
|
665
|
+
* @description Deletes a submission and all related invoices, expenses, and codes. Admin/SuperAdmin only. Cannot delete paid submissions. Notifies the contractor and any reviewing accountant.
|
|
666
|
+
*
|
|
667
|
+
* @tags Submissions
|
|
668
|
+
* @name DeleteSubmission
|
|
669
|
+
* @summary Delete submission
|
|
670
|
+
* @request DELETE:/submission/{submissionID}
|
|
671
|
+
* @secure
|
|
672
|
+
*/
|
|
673
|
+
deleteSubmission: (submissionId, params = {}) => this.request({
|
|
674
|
+
path: `/submission/${submissionId}`,
|
|
675
|
+
method: 'DELETE',
|
|
676
|
+
secure: true,
|
|
677
|
+
...params,
|
|
678
|
+
}),
|
|
679
|
+
/**
|
|
680
|
+
* @description Admin: transitions Submitted → Administrator_Approved (notifies accountants + contractor). Accountant: transitions Administrator_Approved → Payment_Pending (notifies contractor).
|
|
681
|
+
*
|
|
682
|
+
* @tags Submissions
|
|
683
|
+
* @name CreateApprove
|
|
684
|
+
* @summary Approve a submission
|
|
685
|
+
* @request POST:/submission/{submissionID}/approve
|
|
686
|
+
* @secure
|
|
687
|
+
*/
|
|
688
|
+
createApprove: (submissionId, params = {}) => this.request({
|
|
689
|
+
path: `/submission/${submissionId}/approve`,
|
|
690
|
+
method: 'POST',
|
|
691
|
+
secure: true,
|
|
692
|
+
...params,
|
|
693
|
+
}),
|
|
694
|
+
/**
|
|
695
|
+
* @description Assigns codes to Service and/or Reimbursement sections of a submission with optional notes. Only codes belonging to the submission's assigned department are allowed. Admin only.
|
|
696
|
+
*
|
|
697
|
+
* @tags Submissions
|
|
698
|
+
* @name UpdateCodes
|
|
699
|
+
* @summary Assign codes to submission sections
|
|
700
|
+
* @request PUT:/submission/{submissionID}/codes
|
|
701
|
+
* @secure
|
|
702
|
+
*/
|
|
703
|
+
updateCodes: (submissionId, data, params = {}) => this.request({
|
|
704
|
+
path: `/submission/${submissionId}/codes`,
|
|
705
|
+
method: 'PUT',
|
|
706
|
+
body: data,
|
|
707
|
+
secure: true,
|
|
708
|
+
type: ContentType.Json,
|
|
709
|
+
...params,
|
|
710
|
+
}),
|
|
711
|
+
/**
|
|
712
|
+
* @description Validates file constraints (size, type, count) and returns a presigned S3 URL for uploading a file attachment to a submission line item. Supports both authenticated users (max 10 MB, any type, max 5 files per line item) and guest submissions (PDF only, max 1 MB, max 1 file per line item).
|
|
713
|
+
*
|
|
714
|
+
* @tags Submissions
|
|
715
|
+
* @name CreateFile
|
|
716
|
+
* @summary Get presigned upload URL for a file attachment
|
|
717
|
+
* @request POST:/submission/{submissionID}/file
|
|
718
|
+
* @secure
|
|
719
|
+
*/
|
|
720
|
+
createFile: (submissionId, data, params = {}) => this.request({
|
|
721
|
+
path: `/submission/${submissionId}/file`,
|
|
722
|
+
method: 'POST',
|
|
723
|
+
body: data,
|
|
724
|
+
secure: true,
|
|
725
|
+
type: ContentType.Json,
|
|
726
|
+
...params,
|
|
727
|
+
}),
|
|
728
|
+
/**
|
|
729
|
+
* @description Returns a presigned S3 URL for downloading a file attachment associated with a submission line item.
|
|
730
|
+
*
|
|
731
|
+
* @tags Submissions
|
|
732
|
+
* @name GetFile
|
|
733
|
+
* @summary Get presigned download URL for a file attachment
|
|
734
|
+
* @request GET:/submission/{submissionID}/file/{fileID}
|
|
735
|
+
* @secure
|
|
736
|
+
*/
|
|
737
|
+
getFile: (submissionId, fileId, params = {}) => this.request({
|
|
738
|
+
path: `/submission/${submissionId}/file/${fileId}`,
|
|
739
|
+
method: 'GET',
|
|
740
|
+
secure: true,
|
|
741
|
+
...params,
|
|
742
|
+
}),
|
|
743
|
+
/**
|
|
744
|
+
* @description Transitions a Payment_Pending submission to Paid. Only Accountants may perform this action. Notifies the approving administrator.
|
|
745
|
+
*
|
|
746
|
+
* @tags Submissions
|
|
747
|
+
* @name CreatePaid
|
|
748
|
+
* @summary Mark a submission as paid
|
|
749
|
+
* @request POST:/submission/{submissionID}/paid
|
|
750
|
+
* @secure
|
|
751
|
+
*/
|
|
752
|
+
createPaid: (submissionId, params = {}) => this.request({
|
|
753
|
+
path: `/submission/${submissionId}/paid`,
|
|
754
|
+
method: 'POST',
|
|
755
|
+
secure: true,
|
|
756
|
+
...params,
|
|
757
|
+
}),
|
|
758
|
+
/**
|
|
759
|
+
* @description Generates and returns a PDF summary of the submission including invoices, expenses, and assigned codes. Returns the PDF as a base64-encoded string.
|
|
760
|
+
*
|
|
761
|
+
* @tags Submissions
|
|
762
|
+
* @name GetPdf
|
|
763
|
+
* @summary Generate submission summary PDF
|
|
764
|
+
* @request GET:/submission/{submissionID}/pdf
|
|
765
|
+
* @secure
|
|
766
|
+
*/
|
|
767
|
+
getPdf: (submissionId, params = {}) => this.request({
|
|
768
|
+
path: `/submission/${submissionId}/pdf`,
|
|
769
|
+
method: 'GET',
|
|
770
|
+
secure: true,
|
|
771
|
+
...params,
|
|
772
|
+
}),
|
|
773
|
+
/**
|
|
774
|
+
* @description Updates the PO number on a submission. Contractors can update PO on Submitted or Administrator_Approved submissions. Admins can update PO on any non-Paid submission.
|
|
775
|
+
*
|
|
776
|
+
* @tags Submissions
|
|
777
|
+
* @name PutSubmission
|
|
778
|
+
* @summary Update submission PO number
|
|
779
|
+
* @request PUT:/submission/{submissionID}/po
|
|
780
|
+
* @secure
|
|
781
|
+
*/
|
|
782
|
+
putSubmission: (submissionId, data, params = {}) => this.request({
|
|
783
|
+
path: `/submission/${submissionId}/po`,
|
|
784
|
+
method: 'PUT',
|
|
785
|
+
body: data,
|
|
786
|
+
secure: true,
|
|
787
|
+
type: ContentType.Json,
|
|
788
|
+
...params,
|
|
789
|
+
}),
|
|
790
|
+
/**
|
|
791
|
+
* @description Reassigns a submission to a new department. Removes all codes from the original department. Notifies new department admins and the contractor. Admin/SuperAdmin only.
|
|
792
|
+
*
|
|
793
|
+
* @tags Submissions
|
|
794
|
+
* @name CreateReassign
|
|
795
|
+
* @summary Reassign submission to a different department
|
|
796
|
+
* @request POST:/submission/{submissionID}/reassign
|
|
797
|
+
* @secure
|
|
798
|
+
*/
|
|
799
|
+
createReassign: (submissionId, data, params = {}) => this.request({
|
|
800
|
+
path: `/submission/${submissionId}/reassign`,
|
|
801
|
+
method: 'POST',
|
|
802
|
+
body: data,
|
|
803
|
+
secure: true,
|
|
804
|
+
type: ContentType.Json,
|
|
805
|
+
...params,
|
|
806
|
+
}),
|
|
807
|
+
/**
|
|
808
|
+
* @description Admin rejects a Submitted submission; Accountant rejects an Administrator_Approved submission. RSA-sourced submissions cannot be rejected. Notifies the contractor.
|
|
809
|
+
*
|
|
810
|
+
* @tags Submissions
|
|
811
|
+
* @name CreateReject
|
|
812
|
+
* @summary Reject a submission
|
|
813
|
+
* @request POST:/submission/{submissionID}/reject
|
|
814
|
+
* @secure
|
|
815
|
+
*/
|
|
816
|
+
createReject: (submissionId, params = {}) => this.request({
|
|
817
|
+
path: `/submission/${submissionId}/reject`,
|
|
818
|
+
method: 'POST',
|
|
819
|
+
secure: true,
|
|
820
|
+
...params,
|
|
821
|
+
}),
|
|
822
|
+
/**
|
|
823
|
+
* @description Transitions a Draft or Rejected submission to Submitted. Only the owning contractor may submit. Routes the submission to department administrators and sends notifications.
|
|
824
|
+
*
|
|
825
|
+
* @tags Submissions
|
|
826
|
+
* @name CreateSubmit
|
|
827
|
+
* @summary Submit a draft or rejected submission
|
|
828
|
+
* @request POST:/submission/{submissionID}/submit
|
|
829
|
+
* @secure
|
|
830
|
+
*/
|
|
831
|
+
createSubmit: (submissionId, params = {}) => this.request({
|
|
832
|
+
path: `/submission/${submissionId}/submit`,
|
|
833
|
+
method: 'POST',
|
|
834
|
+
secure: true,
|
|
835
|
+
...params,
|
|
836
|
+
}),
|
|
837
|
+
/**
|
|
838
|
+
* @description Public endpoint for guest contractors to submit a single invoice without authentication. Requires reCAPTCHA verification. The submission goes directly to Submitted status (no Draft). The attachment field is optional — if omitted, the frontend should upload the file separately via POST /submission/{submissionID}/file after creation.
|
|
839
|
+
*
|
|
840
|
+
* @tags Submissions
|
|
841
|
+
* @name CreateGuest
|
|
842
|
+
* @summary Submit guest invoice
|
|
843
|
+
* @request POST:/submission/guest
|
|
844
|
+
* @secure
|
|
845
|
+
*/
|
|
846
|
+
createGuest: (data, params = {}) => this.request({
|
|
847
|
+
path: `/submission/guest`,
|
|
848
|
+
method: 'POST',
|
|
849
|
+
body: data,
|
|
850
|
+
secure: true,
|
|
851
|
+
type: ContentType.Json,
|
|
852
|
+
...params,
|
|
853
|
+
}),
|
|
854
|
+
};
|
|
855
|
+
this.submissions = {
|
|
856
|
+
/**
|
|
857
|
+
* @description Search submissions with role-based scoping. Contractors see only their own submissions. Administrators see submissions for their department. Accountants and Super Administrators see all submissions.
|
|
858
|
+
*
|
|
859
|
+
* @tags Submissions
|
|
860
|
+
* @name ListSubmissions
|
|
861
|
+
* @summary Search Submissions
|
|
862
|
+
* @request GET:/submissions
|
|
863
|
+
* @secure
|
|
864
|
+
*/
|
|
865
|
+
listSubmissions: (query, params = {}) => this.request({
|
|
866
|
+
path: `/submissions`,
|
|
867
|
+
method: 'GET',
|
|
868
|
+
query: query,
|
|
869
|
+
secure: true,
|
|
870
|
+
...params,
|
|
871
|
+
}),
|
|
872
|
+
/**
|
|
873
|
+
* @description Generate an Excel export of submissions scoped by role. Contractors see only their own submissions. Administrators see their department. Accountants and Super Administrators see all. Maximum 10,000 rows.
|
|
874
|
+
*
|
|
875
|
+
* @tags Submissions
|
|
876
|
+
* @name ListExport
|
|
877
|
+
* @summary Export Submissions to Excel
|
|
878
|
+
* @request GET:/submissions/export
|
|
879
|
+
* @secure
|
|
880
|
+
*/
|
|
881
|
+
listExport: (params = {}) => this.request({
|
|
882
|
+
path: `/submissions/export`,
|
|
883
|
+
method: 'GET',
|
|
884
|
+
secure: true,
|
|
885
|
+
...params,
|
|
886
|
+
}),
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
exports.Api = Api;
|
|
891
|
+
//# sourceMappingURL=Api.js.map
|