@ikonintegration/module-contractor-api 1.0.4 → 1.0.5
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 +5 -25
- package/dist/Api.d.ts +1629 -0
- package/dist/Api.js +899 -0
- package/dist/Api.js.map +1 -0
- package/package.json +1 -1
package/dist/Api.d.ts
ADDED
|
@@ -0,0 +1,1629 @@
|
|
|
1
|
+
/** Default API Error response */
|
|
2
|
+
export interface ErrorResponse {
|
|
3
|
+
/** Error message */
|
|
4
|
+
err: string;
|
|
5
|
+
/** Error code */
|
|
6
|
+
errCode: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateCodeSchema {
|
|
9
|
+
/** Unique code identifier (1-50 alphanumeric characters) */
|
|
10
|
+
codeID: CodeIDSchema;
|
|
11
|
+
/**
|
|
12
|
+
* ID of the department this code belongs to
|
|
13
|
+
* @minLength 1
|
|
14
|
+
* @example "DEPT-2a1b3c4d5e6f"
|
|
15
|
+
*/
|
|
16
|
+
departmentID: string;
|
|
17
|
+
/**
|
|
18
|
+
* Description of the code (1-255 characters)
|
|
19
|
+
* @minLength 1
|
|
20
|
+
* @maxLength 255
|
|
21
|
+
* @example "Consulting services for safety audits"
|
|
22
|
+
*/
|
|
23
|
+
description: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Unique code identifier (1-50 alphanumeric characters)
|
|
27
|
+
* @minLength 1
|
|
28
|
+
* @maxLength 50
|
|
29
|
+
* @pattern ^[a-zA-Z0-9]+$
|
|
30
|
+
* @example "ACC001"
|
|
31
|
+
*/
|
|
32
|
+
export type CodeIDSchema = string;
|
|
33
|
+
/** Created code */
|
|
34
|
+
export interface PostCodeResponseSchema {
|
|
35
|
+
/** Code identifier */
|
|
36
|
+
codeID: string;
|
|
37
|
+
/** Associated department ID */
|
|
38
|
+
departmentID: string;
|
|
39
|
+
/** Code description */
|
|
40
|
+
description: string;
|
|
41
|
+
}
|
|
42
|
+
export interface UpdateCodeSchema {
|
|
43
|
+
/**
|
|
44
|
+
* Updated description of the code (1-255 characters)
|
|
45
|
+
* @minLength 1
|
|
46
|
+
* @maxLength 255
|
|
47
|
+
* @example "Updated consulting services description"
|
|
48
|
+
*/
|
|
49
|
+
description: string;
|
|
50
|
+
}
|
|
51
|
+
/** Updated code */
|
|
52
|
+
export interface PutCodeResponseSchema {
|
|
53
|
+
/** Code identifier */
|
|
54
|
+
codeID: string;
|
|
55
|
+
/** Associated department ID */
|
|
56
|
+
departmentID: string;
|
|
57
|
+
/** Updated code description */
|
|
58
|
+
description: string;
|
|
59
|
+
}
|
|
60
|
+
/** Code deletion result (empty body) */
|
|
61
|
+
export type DeleteCodeResponseSchema = object;
|
|
62
|
+
/** Codes list */
|
|
63
|
+
export interface GetCodesResponseSchema {
|
|
64
|
+
/** List of codes */
|
|
65
|
+
codes: any[];
|
|
66
|
+
}
|
|
67
|
+
export interface CreateContractorSchema {
|
|
68
|
+
/**
|
|
69
|
+
* Full name of the contractor
|
|
70
|
+
* @minLength 1
|
|
71
|
+
* @example "Jane Smith"
|
|
72
|
+
*/
|
|
73
|
+
name: string;
|
|
74
|
+
/**
|
|
75
|
+
* Email address of the contractor (must be unique)
|
|
76
|
+
* @format email
|
|
77
|
+
* @example "jane.smith@example.com"
|
|
78
|
+
*/
|
|
79
|
+
email: string;
|
|
80
|
+
/**
|
|
81
|
+
* Phone number of the contractor
|
|
82
|
+
* @example "+1-604-555-1234"
|
|
83
|
+
*/
|
|
84
|
+
phone?: string;
|
|
85
|
+
/**
|
|
86
|
+
* List of hourly job rates (at least one required)
|
|
87
|
+
* @minItems 1
|
|
88
|
+
*/
|
|
89
|
+
jobRates: JobRateSchema[];
|
|
90
|
+
}
|
|
91
|
+
export interface JobRateSchema {
|
|
92
|
+
/**
|
|
93
|
+
* Description of the job rate
|
|
94
|
+
* @minLength 1
|
|
95
|
+
* @example "Senior Instructor"
|
|
96
|
+
*/
|
|
97
|
+
description: string;
|
|
98
|
+
/**
|
|
99
|
+
* Hourly rate value in dollars (must be greater than zero)
|
|
100
|
+
* @min 0
|
|
101
|
+
* @exclusiveMin true
|
|
102
|
+
* @example 75
|
|
103
|
+
*/
|
|
104
|
+
hourlyValue: number;
|
|
105
|
+
}
|
|
106
|
+
/** Created contractor */
|
|
107
|
+
export interface PostContractorResponseSchema {
|
|
108
|
+
/** Created contractor user ID */
|
|
109
|
+
userID: string;
|
|
110
|
+
/** Contractor name */
|
|
111
|
+
name: string;
|
|
112
|
+
/** Contractor email */
|
|
113
|
+
email: string;
|
|
114
|
+
}
|
|
115
|
+
/** Contractor profile */
|
|
116
|
+
export interface GetContractorResponseSchema {
|
|
117
|
+
/** Contractor user ID */
|
|
118
|
+
userID: string;
|
|
119
|
+
/** Contractor name */
|
|
120
|
+
name: string;
|
|
121
|
+
/** Contractor email */
|
|
122
|
+
email: string;
|
|
123
|
+
/** Contractor job rates */
|
|
124
|
+
jobRates?: any[];
|
|
125
|
+
/** Per-contractor rate overrides */
|
|
126
|
+
maximums?: Record<string, number>;
|
|
127
|
+
/** Resolved effective rates (self-view) */
|
|
128
|
+
effectiveRates?: Record<string, number>;
|
|
129
|
+
}
|
|
130
|
+
export interface UpdateContractorRatesSchema {
|
|
131
|
+
/**
|
|
132
|
+
* Maximum nightly accommodation amount (positive, up to two decimal places)
|
|
133
|
+
* @min 0
|
|
134
|
+
* @exclusiveMin true
|
|
135
|
+
* @example 150
|
|
136
|
+
*/
|
|
137
|
+
accommodationNightly?: number;
|
|
138
|
+
/**
|
|
139
|
+
* Maximum breakfast meal amount (positive, up to two decimal places)
|
|
140
|
+
* @min 0
|
|
141
|
+
* @exclusiveMin true
|
|
142
|
+
* @example 20
|
|
143
|
+
*/
|
|
144
|
+
mealBreakfast?: number;
|
|
145
|
+
/**
|
|
146
|
+
* Maximum lunch meal amount (positive, up to two decimal places)
|
|
147
|
+
* @min 0
|
|
148
|
+
* @exclusiveMin true
|
|
149
|
+
* @example 25
|
|
150
|
+
*/
|
|
151
|
+
mealLunch?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Maximum dinner meal amount (positive, up to two decimal places)
|
|
154
|
+
* @min 0
|
|
155
|
+
* @exclusiveMin true
|
|
156
|
+
* @example 40
|
|
157
|
+
*/
|
|
158
|
+
mealDinner?: number;
|
|
159
|
+
/**
|
|
160
|
+
* Maximum transportation amount (positive, up to two decimal places)
|
|
161
|
+
* @min 0
|
|
162
|
+
* @exclusiveMin true
|
|
163
|
+
* @example 100
|
|
164
|
+
*/
|
|
165
|
+
transportationMax?: number;
|
|
166
|
+
}
|
|
167
|
+
/** Updated contractor rates */
|
|
168
|
+
export interface PutContractorRatesResponseSchema {
|
|
169
|
+
/** Contractor user ID */
|
|
170
|
+
userID: string;
|
|
171
|
+
/** Updated rate maximums */
|
|
172
|
+
maximums: Record<string, number>;
|
|
173
|
+
}
|
|
174
|
+
/** Password reset result */
|
|
175
|
+
export interface PostResetPasswordResponseSchema {
|
|
176
|
+
/** Success message */
|
|
177
|
+
message: string;
|
|
178
|
+
}
|
|
179
|
+
export interface UpdateContractorStatusSchema {
|
|
180
|
+
/**
|
|
181
|
+
* The contractor's local status. Set to 'active' to enable or 'disabled' to disable the account.
|
|
182
|
+
* @example "active"
|
|
183
|
+
*/
|
|
184
|
+
status: UpdateContractorStatusSchemaStatusEnum;
|
|
185
|
+
}
|
|
186
|
+
/** Updated contractor status */
|
|
187
|
+
export interface PutContractorStatusResponseSchema {
|
|
188
|
+
/** Contractor user ID */
|
|
189
|
+
userID: string;
|
|
190
|
+
/** Updated local account status */
|
|
191
|
+
localStatus: string;
|
|
192
|
+
}
|
|
193
|
+
/** List of contractors */
|
|
194
|
+
export type GetContractorsResponseSchema = {
|
|
195
|
+
/** Contractor user ID */
|
|
196
|
+
userID: string;
|
|
197
|
+
/** Contractor name */
|
|
198
|
+
name: string;
|
|
199
|
+
/** Contractor email */
|
|
200
|
+
email: string;
|
|
201
|
+
/** Local account status */
|
|
202
|
+
localStatus?: string;
|
|
203
|
+
}[];
|
|
204
|
+
export interface CreateDepartmentSchema {
|
|
205
|
+
/**
|
|
206
|
+
* Name of the department (1-150 characters)
|
|
207
|
+
* @minLength 1
|
|
208
|
+
* @maxLength 150
|
|
209
|
+
* @example "Engineering"
|
|
210
|
+
*/
|
|
211
|
+
name: string;
|
|
212
|
+
/**
|
|
213
|
+
* Contact email addresses for the department (1-10 valid emails)
|
|
214
|
+
* @maxItems 10
|
|
215
|
+
* @minItems 1
|
|
216
|
+
* @example ["eng-lead@bccsa.ca","eng-admin@bccsa.ca"]
|
|
217
|
+
*/
|
|
218
|
+
contactEmails: string[];
|
|
219
|
+
}
|
|
220
|
+
/** Created department */
|
|
221
|
+
export interface PostDepartmentResponseSchema {
|
|
222
|
+
/** Created department ID */
|
|
223
|
+
departmentID: string;
|
|
224
|
+
/** Department name */
|
|
225
|
+
name: string;
|
|
226
|
+
/** Contact email addresses */
|
|
227
|
+
contactEmails: string[];
|
|
228
|
+
}
|
|
229
|
+
export interface UpdateDepartmentSchema {
|
|
230
|
+
/**
|
|
231
|
+
* Updated name of the department (1-150 characters)
|
|
232
|
+
* @minLength 1
|
|
233
|
+
* @maxLength 150
|
|
234
|
+
* @example "Engineering Services"
|
|
235
|
+
*/
|
|
236
|
+
name?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Updated contact email addresses for the department (1-10 valid emails)
|
|
239
|
+
* @maxItems 10
|
|
240
|
+
* @minItems 1
|
|
241
|
+
* @example ["eng-lead@bccsa.ca"]
|
|
242
|
+
*/
|
|
243
|
+
contactEmails?: string[];
|
|
244
|
+
}
|
|
245
|
+
/** Updated department */
|
|
246
|
+
export interface PutDepartmentResponseSchema {
|
|
247
|
+
/** Department ID */
|
|
248
|
+
departmentID: string;
|
|
249
|
+
/** Department name */
|
|
250
|
+
name: string;
|
|
251
|
+
/** Contact email addresses */
|
|
252
|
+
contactEmails: string[];
|
|
253
|
+
/** Associated administrator user IDs */
|
|
254
|
+
adminUserIDs: string[];
|
|
255
|
+
}
|
|
256
|
+
/** Department deletion result */
|
|
257
|
+
export interface DeleteDepartmentResponseSchema {
|
|
258
|
+
/** Deleted department ID */
|
|
259
|
+
departmentID: string;
|
|
260
|
+
/** Deletion confirmation */
|
|
261
|
+
deleted: boolean;
|
|
262
|
+
}
|
|
263
|
+
export interface AssociateAdminSchema {
|
|
264
|
+
/**
|
|
265
|
+
* The user ID of the administrator to associate with the department
|
|
266
|
+
* @minLength 1
|
|
267
|
+
* @example "USR-2RvYIFNJR3CrJHKO0NqgGa1EwcS"
|
|
268
|
+
*/
|
|
269
|
+
userID: string;
|
|
270
|
+
}
|
|
271
|
+
/** Admin association result */
|
|
272
|
+
export interface PostDepartmentAdminResponseSchema {
|
|
273
|
+
/** Department ID */
|
|
274
|
+
departmentID: string;
|
|
275
|
+
/** Associated administrator user ID */
|
|
276
|
+
userID: string;
|
|
277
|
+
/** Optional message if already associated */
|
|
278
|
+
message?: string;
|
|
279
|
+
}
|
|
280
|
+
/** Admin removal result */
|
|
281
|
+
export interface DeleteDepartmentAdminResponseSchema {
|
|
282
|
+
/** Department ID */
|
|
283
|
+
departmentID: string;
|
|
284
|
+
/** Removed administrator user ID */
|
|
285
|
+
userID: string;
|
|
286
|
+
/** Removal confirmation */
|
|
287
|
+
removed: boolean;
|
|
288
|
+
}
|
|
289
|
+
/** List of departments (public fields) */
|
|
290
|
+
export type GetDepartmentsResponseSchema = {
|
|
291
|
+
/** Department unique identifier */
|
|
292
|
+
departmentID: string;
|
|
293
|
+
/** Department name */
|
|
294
|
+
name: string;
|
|
295
|
+
}[];
|
|
296
|
+
/** System settings */
|
|
297
|
+
export interface GetSettingsResponseSchema {
|
|
298
|
+
/** System-wide mileage rate per kilometre */
|
|
299
|
+
mileageRate: number;
|
|
300
|
+
/** Accommodation nightly maximum */
|
|
301
|
+
accommodationNightly: number;
|
|
302
|
+
/** Breakfast meal maximum */
|
|
303
|
+
mealBreakfast: number;
|
|
304
|
+
/** Lunch meal maximum */
|
|
305
|
+
mealLunch: number;
|
|
306
|
+
/** Dinner meal maximum */
|
|
307
|
+
mealDinner: number;
|
|
308
|
+
/** Transportation maximum */
|
|
309
|
+
transportationMax: number;
|
|
310
|
+
/** Days between reminder emails */
|
|
311
|
+
reminderIntervalDays: number;
|
|
312
|
+
/** Default department for RSA submissions */
|
|
313
|
+
rsaDepartmentID?: string;
|
|
314
|
+
}
|
|
315
|
+
export interface UpdateRatesSchema {
|
|
316
|
+
/**
|
|
317
|
+
* Mileage rate in dollars per kilometre (positive, up to two decimal places)
|
|
318
|
+
* @min 0
|
|
319
|
+
* @exclusiveMin true
|
|
320
|
+
* @example 0.65
|
|
321
|
+
*/
|
|
322
|
+
mileageRate: number;
|
|
323
|
+
}
|
|
324
|
+
/** Updated mileage rate */
|
|
325
|
+
export interface PutSettingsRatesResponseSchema {
|
|
326
|
+
/** Updated mileage rate */
|
|
327
|
+
mileageRate: number;
|
|
328
|
+
}
|
|
329
|
+
export interface UpdateMaximumsSchema {
|
|
330
|
+
/**
|
|
331
|
+
* Maximum nightly accommodation amount (positive, up to two decimal places)
|
|
332
|
+
* @min 0
|
|
333
|
+
* @exclusiveMin true
|
|
334
|
+
* @example 150
|
|
335
|
+
*/
|
|
336
|
+
accommodationNightly: number;
|
|
337
|
+
/**
|
|
338
|
+
* Maximum breakfast meal amount (positive, up to two decimal places)
|
|
339
|
+
* @min 0
|
|
340
|
+
* @exclusiveMin true
|
|
341
|
+
* @example 20
|
|
342
|
+
*/
|
|
343
|
+
mealBreakfast: number;
|
|
344
|
+
/**
|
|
345
|
+
* Maximum lunch meal amount (positive, up to two decimal places)
|
|
346
|
+
* @min 0
|
|
347
|
+
* @exclusiveMin true
|
|
348
|
+
* @example 25
|
|
349
|
+
*/
|
|
350
|
+
mealLunch: number;
|
|
351
|
+
/**
|
|
352
|
+
* Maximum dinner meal amount (positive, up to two decimal places)
|
|
353
|
+
* @min 0
|
|
354
|
+
* @exclusiveMin true
|
|
355
|
+
* @example 40
|
|
356
|
+
*/
|
|
357
|
+
mealDinner: number;
|
|
358
|
+
/**
|
|
359
|
+
* Maximum transportation amount (positive, up to two decimal places)
|
|
360
|
+
* @min 0
|
|
361
|
+
* @exclusiveMin true
|
|
362
|
+
* @example 100
|
|
363
|
+
*/
|
|
364
|
+
transportationMax: number;
|
|
365
|
+
}
|
|
366
|
+
/** Updated expense maximums */
|
|
367
|
+
export interface PutSettingsMaximumsResponseSchema {
|
|
368
|
+
/** Accommodation nightly maximum */
|
|
369
|
+
accommodationNightly: number;
|
|
370
|
+
/** Breakfast meal maximum */
|
|
371
|
+
mealBreakfast: number;
|
|
372
|
+
/** Lunch meal maximum */
|
|
373
|
+
mealLunch: number;
|
|
374
|
+
/** Dinner meal maximum */
|
|
375
|
+
mealDinner: number;
|
|
376
|
+
/** Transportation maximum */
|
|
377
|
+
transportationMax: number;
|
|
378
|
+
}
|
|
379
|
+
export interface UpdateRemindersSchema {
|
|
380
|
+
/**
|
|
381
|
+
* Number of days between reminder emails (positive integer)
|
|
382
|
+
* @min 0
|
|
383
|
+
* @exclusiveMin true
|
|
384
|
+
* @example 7
|
|
385
|
+
*/
|
|
386
|
+
reminderIntervalDays: number;
|
|
387
|
+
}
|
|
388
|
+
/** Updated reminder interval */
|
|
389
|
+
export interface PutSettingsRemindersResponseSchema {
|
|
390
|
+
/** Updated reminder interval in days */
|
|
391
|
+
reminderIntervalDays: number;
|
|
392
|
+
}
|
|
393
|
+
/** Create a new draft submission */
|
|
394
|
+
export interface CreateSubmissionSchema {
|
|
395
|
+
/**
|
|
396
|
+
* Department ID
|
|
397
|
+
* @minLength 1
|
|
398
|
+
* @example "DEPT-abc123"
|
|
399
|
+
*/
|
|
400
|
+
departmentID: string;
|
|
401
|
+
/**
|
|
402
|
+
* Submission description
|
|
403
|
+
* @minLength 1
|
|
404
|
+
* @example "Monthly consulting invoice"
|
|
405
|
+
*/
|
|
406
|
+
description: string;
|
|
407
|
+
/**
|
|
408
|
+
* Submission date (epoch ms)
|
|
409
|
+
* @example 1700000000000
|
|
410
|
+
*/
|
|
411
|
+
date: number;
|
|
412
|
+
/**
|
|
413
|
+
* Submission type
|
|
414
|
+
* @example "Submission"
|
|
415
|
+
*/
|
|
416
|
+
type: CreateSubmissionSchemaTypeEnum;
|
|
417
|
+
/**
|
|
418
|
+
* Invoice number or "N/A"
|
|
419
|
+
* @minLength 1
|
|
420
|
+
* @example "INV-2024-001"
|
|
421
|
+
*/
|
|
422
|
+
invoiceNumber: string;
|
|
423
|
+
/**
|
|
424
|
+
* Contract number or "N/A"
|
|
425
|
+
* @minLength 1
|
|
426
|
+
* @example "CNTR-001"
|
|
427
|
+
*/
|
|
428
|
+
contractNumber: string;
|
|
429
|
+
/**
|
|
430
|
+
* PO number (optional)
|
|
431
|
+
* @example "PO-5678"
|
|
432
|
+
*/
|
|
433
|
+
poNumber?: string;
|
|
434
|
+
/**
|
|
435
|
+
* Service invoice line items
|
|
436
|
+
* @default []
|
|
437
|
+
*/
|
|
438
|
+
invoices?: InvoiceInputSchema[];
|
|
439
|
+
/**
|
|
440
|
+
* Expense reimbursement line items
|
|
441
|
+
* @default []
|
|
442
|
+
*/
|
|
443
|
+
expenses?: ExpenseInputSchema[];
|
|
444
|
+
}
|
|
445
|
+
export interface InvoiceInputSchema {
|
|
446
|
+
/**
|
|
447
|
+
* Invoice description
|
|
448
|
+
* @minLength 1
|
|
449
|
+
* @example "Consulting services"
|
|
450
|
+
*/
|
|
451
|
+
description: string;
|
|
452
|
+
/**
|
|
453
|
+
* Time worked in hours
|
|
454
|
+
* @min 0
|
|
455
|
+
* @exclusiveMin true
|
|
456
|
+
* @example 8
|
|
457
|
+
*/
|
|
458
|
+
timeInHours: number;
|
|
459
|
+
/**
|
|
460
|
+
* Hourly rate from contractor profile
|
|
461
|
+
* @min 0
|
|
462
|
+
* @exclusiveMin true
|
|
463
|
+
* @example 75
|
|
464
|
+
*/
|
|
465
|
+
hourlyRate: number;
|
|
466
|
+
/**
|
|
467
|
+
* Tax amount
|
|
468
|
+
* @min 0
|
|
469
|
+
* @default 0
|
|
470
|
+
* @example 30
|
|
471
|
+
*/
|
|
472
|
+
taxAmount?: number;
|
|
473
|
+
/**
|
|
474
|
+
* PO number for this invoice
|
|
475
|
+
* @example "PO-1234"
|
|
476
|
+
*/
|
|
477
|
+
poNumber?: string;
|
|
478
|
+
/**
|
|
479
|
+
* File attachments for this invoice
|
|
480
|
+
* @default []
|
|
481
|
+
*/
|
|
482
|
+
attachments?: AttachmentSchema[];
|
|
483
|
+
}
|
|
484
|
+
export interface AttachmentSchema {
|
|
485
|
+
/**
|
|
486
|
+
* Unique file identifier
|
|
487
|
+
* @example "file-abc123"
|
|
488
|
+
*/
|
|
489
|
+
fileID: string;
|
|
490
|
+
/**
|
|
491
|
+
* Original file name
|
|
492
|
+
* @example "invoice.pdf"
|
|
493
|
+
*/
|
|
494
|
+
fileName: string;
|
|
495
|
+
/**
|
|
496
|
+
* MIME content type
|
|
497
|
+
* @example "application/pdf"
|
|
498
|
+
*/
|
|
499
|
+
contentType: string;
|
|
500
|
+
/**
|
|
501
|
+
* File size in bytes
|
|
502
|
+
* @example 102400
|
|
503
|
+
*/
|
|
504
|
+
size: number;
|
|
505
|
+
/**
|
|
506
|
+
* Upload timestamp (epoch ms)
|
|
507
|
+
* @example 1700000000000
|
|
508
|
+
*/
|
|
509
|
+
uploadedOn: number;
|
|
510
|
+
}
|
|
511
|
+
export interface ExpenseInputSchema {
|
|
512
|
+
/**
|
|
513
|
+
* Expense description
|
|
514
|
+
* @minLength 1
|
|
515
|
+
* @example "Hotel stay"
|
|
516
|
+
*/
|
|
517
|
+
description: string;
|
|
518
|
+
/**
|
|
519
|
+
* Expense date (epoch ms)
|
|
520
|
+
* @example 1700000000000
|
|
521
|
+
*/
|
|
522
|
+
date: number;
|
|
523
|
+
/**
|
|
524
|
+
* Expense type
|
|
525
|
+
* @example "Accommodation"
|
|
526
|
+
*/
|
|
527
|
+
type: ExpenseInputSchemaTypeEnum;
|
|
528
|
+
/**
|
|
529
|
+
* Pre-tax amount
|
|
530
|
+
* @min 0
|
|
531
|
+
* @example 150
|
|
532
|
+
*/
|
|
533
|
+
preTaxAmount: number;
|
|
534
|
+
/**
|
|
535
|
+
* Tax amount
|
|
536
|
+
* @min 0
|
|
537
|
+
* @default 0
|
|
538
|
+
* @example 7.5
|
|
539
|
+
*/
|
|
540
|
+
taxAmount?: number;
|
|
541
|
+
/**
|
|
542
|
+
* Number of nights (Accommodation)
|
|
543
|
+
* @min 0
|
|
544
|
+
* @exclusiveMin true
|
|
545
|
+
* @example 2
|
|
546
|
+
*/
|
|
547
|
+
nights?: number;
|
|
548
|
+
/**
|
|
549
|
+
* Meal type (Meal expenses)
|
|
550
|
+
* @example "Lunch"
|
|
551
|
+
*/
|
|
552
|
+
mealType?: ExpenseInputSchemaMealTypeEnum;
|
|
553
|
+
/**
|
|
554
|
+
* Number of kilometres (Mileage)
|
|
555
|
+
* @min 0
|
|
556
|
+
* @exclusiveMin true
|
|
557
|
+
* @example 100
|
|
558
|
+
*/
|
|
559
|
+
numKilometres?: number;
|
|
560
|
+
/**
|
|
561
|
+
* Transportation type (Transportation expenses)
|
|
562
|
+
* @example "Taxi"
|
|
563
|
+
*/
|
|
564
|
+
transportationType?: ExpenseInputSchemaTransportationTypeEnum;
|
|
565
|
+
/**
|
|
566
|
+
* File attachments for this expense
|
|
567
|
+
* @default []
|
|
568
|
+
*/
|
|
569
|
+
attachments?: AttachmentSchema[];
|
|
570
|
+
}
|
|
571
|
+
/** Created submission with calculated totals */
|
|
572
|
+
export interface PostSubmissionResponseSchema {
|
|
573
|
+
/** Created submission ID */
|
|
574
|
+
submissionID: string;
|
|
575
|
+
/** Submission status */
|
|
576
|
+
status: string;
|
|
577
|
+
/** Total pre-tax amount */
|
|
578
|
+
preTaxAmount: number;
|
|
579
|
+
/** Total tax amount */
|
|
580
|
+
taxAmount: number;
|
|
581
|
+
/** Total amount including tax */
|
|
582
|
+
totalAmount: number;
|
|
583
|
+
/** Created invoices */
|
|
584
|
+
invoices: {
|
|
585
|
+
/** Invoice ID */
|
|
586
|
+
invoiceID: string;
|
|
587
|
+
/** Invoice pre-tax amount */
|
|
588
|
+
preTaxAmount: number;
|
|
589
|
+
}[];
|
|
590
|
+
/** Created expenses with warning flags */
|
|
591
|
+
expenses: {
|
|
592
|
+
/** Expense ID */
|
|
593
|
+
expenseID: string;
|
|
594
|
+
/** Whether expense exceeds configured maximum */
|
|
595
|
+
warningExceeded: boolean;
|
|
596
|
+
}[];
|
|
597
|
+
}
|
|
598
|
+
/** Submission detail with all related entities */
|
|
599
|
+
export interface GetSubmissionResponseSchema {
|
|
600
|
+
/** Submission record */
|
|
601
|
+
submission?: any;
|
|
602
|
+
/** Associated invoices */
|
|
603
|
+
invoices: any[];
|
|
604
|
+
/** Associated expenses */
|
|
605
|
+
expenses: any[];
|
|
606
|
+
/** Assigned billing codes */
|
|
607
|
+
codes: any[];
|
|
608
|
+
}
|
|
609
|
+
/** Update an existing submission */
|
|
610
|
+
export interface UpdateSubmissionSchema {
|
|
611
|
+
/**
|
|
612
|
+
* Submission description
|
|
613
|
+
* @minLength 1
|
|
614
|
+
*/
|
|
615
|
+
description?: string;
|
|
616
|
+
/** Submission date (epoch ms) */
|
|
617
|
+
date?: number;
|
|
618
|
+
/** Submission type */
|
|
619
|
+
type?: UpdateSubmissionSchemaTypeEnum;
|
|
620
|
+
/**
|
|
621
|
+
* Invoice number or "N/A"
|
|
622
|
+
* @minLength 1
|
|
623
|
+
*/
|
|
624
|
+
invoiceNumber?: string;
|
|
625
|
+
/**
|
|
626
|
+
* Contract number or "N/A"
|
|
627
|
+
* @minLength 1
|
|
628
|
+
*/
|
|
629
|
+
contractNumber?: string;
|
|
630
|
+
/** PO number (optional) */
|
|
631
|
+
poNumber?: string;
|
|
632
|
+
/**
|
|
633
|
+
* Department ID
|
|
634
|
+
* @minLength 1
|
|
635
|
+
*/
|
|
636
|
+
departmentID?: string;
|
|
637
|
+
/** Updated service invoice line items */
|
|
638
|
+
invoices?: InvoiceInputSchema[];
|
|
639
|
+
/** Updated expense reimbursement line items */
|
|
640
|
+
expenses?: ExpenseInputSchema[];
|
|
641
|
+
}
|
|
642
|
+
/** Updated submission */
|
|
643
|
+
export interface PutSubmissionResponseSchema {
|
|
644
|
+
/** Submission ID */
|
|
645
|
+
submissionID: string;
|
|
646
|
+
/** Current submission status */
|
|
647
|
+
status: string;
|
|
648
|
+
/** Recalculated pre-tax amount */
|
|
649
|
+
preTaxAmount?: number;
|
|
650
|
+
/** Recalculated tax amount */
|
|
651
|
+
taxAmount?: number;
|
|
652
|
+
/** Recalculated total amount */
|
|
653
|
+
totalAmount?: number;
|
|
654
|
+
/** Recreated invoices (if line items changed) */
|
|
655
|
+
invoices?: {
|
|
656
|
+
/** Invoice ID */
|
|
657
|
+
invoiceID: string;
|
|
658
|
+
/** Invoice pre-tax amount */
|
|
659
|
+
preTaxAmount: number;
|
|
660
|
+
}[];
|
|
661
|
+
/** Recreated expenses (if line items changed) */
|
|
662
|
+
expenses?: {
|
|
663
|
+
/** Expense ID */
|
|
664
|
+
expenseID: string;
|
|
665
|
+
/** Whether expense exceeds configured maximum */
|
|
666
|
+
warningExceeded: boolean;
|
|
667
|
+
}[];
|
|
668
|
+
}
|
|
669
|
+
/** Submission deletion result */
|
|
670
|
+
export interface DeleteSubmissionResponseSchema {
|
|
671
|
+
/** Deleted submission ID */
|
|
672
|
+
submissionID: string;
|
|
673
|
+
/** Deletion confirmation */
|
|
674
|
+
deleted: boolean;
|
|
675
|
+
}
|
|
676
|
+
/** Approval result */
|
|
677
|
+
export interface PostApproveResponseSchema {
|
|
678
|
+
/** Submission ID */
|
|
679
|
+
submissionID: string;
|
|
680
|
+
/** New submission status after approval */
|
|
681
|
+
status: string;
|
|
682
|
+
}
|
|
683
|
+
export interface PutSubmissionCodesSchema {
|
|
684
|
+
/** Array of codes to assign to the submission sections */
|
|
685
|
+
codes: SubmissionCodeItemSchema[];
|
|
686
|
+
}
|
|
687
|
+
export interface SubmissionCodeItemSchema {
|
|
688
|
+
/** The section to assign the code to */
|
|
689
|
+
section: SubmissionCodeItemSchemaSectionEnum;
|
|
690
|
+
/**
|
|
691
|
+
* The code ID to assign
|
|
692
|
+
* @minLength 1
|
|
693
|
+
* @example "CODE-abc123"
|
|
694
|
+
*/
|
|
695
|
+
codeID: string;
|
|
696
|
+
/**
|
|
697
|
+
* Optional note for this code assignment (max 500 chars)
|
|
698
|
+
* @maxLength 500
|
|
699
|
+
* @example "Consulting fees"
|
|
700
|
+
*/
|
|
701
|
+
note?: string;
|
|
702
|
+
}
|
|
703
|
+
/** Code assignment result */
|
|
704
|
+
export interface PutSubmissionCodesResponseSchema {
|
|
705
|
+
/** Submission ID */
|
|
706
|
+
submissionID: string;
|
|
707
|
+
/** Assigned codes */
|
|
708
|
+
codes: {
|
|
709
|
+
/** Section (Service or Reimbursement) */
|
|
710
|
+
section: string;
|
|
711
|
+
/** Billing code ID */
|
|
712
|
+
codeID: string;
|
|
713
|
+
/** Optional note */
|
|
714
|
+
note: string | null;
|
|
715
|
+
}[];
|
|
716
|
+
}
|
|
717
|
+
/** Request a presigned upload URL for a file attachment */
|
|
718
|
+
export interface FileUploadRequestSchema {
|
|
719
|
+
/**
|
|
720
|
+
* ID of the invoice or expense line item
|
|
721
|
+
* @minLength 1
|
|
722
|
+
* @example "INV-abc123"
|
|
723
|
+
*/
|
|
724
|
+
lineItemID: string;
|
|
725
|
+
/**
|
|
726
|
+
* MIME content type of the file
|
|
727
|
+
* @minLength 1
|
|
728
|
+
* @example "application/pdf"
|
|
729
|
+
*/
|
|
730
|
+
contentType: string;
|
|
731
|
+
/**
|
|
732
|
+
* File size in bytes
|
|
733
|
+
* @min 0
|
|
734
|
+
* @exclusiveMin true
|
|
735
|
+
* @example 102400
|
|
736
|
+
*/
|
|
737
|
+
contentLength: number;
|
|
738
|
+
/**
|
|
739
|
+
* Original file name
|
|
740
|
+
* @minLength 1
|
|
741
|
+
* @example "invoice.pdf"
|
|
742
|
+
*/
|
|
743
|
+
fileName: string;
|
|
744
|
+
}
|
|
745
|
+
/** File upload presigned URL */
|
|
746
|
+
export interface PostFileResponseSchema {
|
|
747
|
+
/** Presigned upload URL */
|
|
748
|
+
url: string;
|
|
749
|
+
/** Generated file ID */
|
|
750
|
+
fileID: string;
|
|
751
|
+
/** Original file name */
|
|
752
|
+
fileName: string;
|
|
753
|
+
/** File content type */
|
|
754
|
+
contentType: string;
|
|
755
|
+
/** File size in bytes */
|
|
756
|
+
contentLength: number;
|
|
757
|
+
}
|
|
758
|
+
/** File download presigned URL */
|
|
759
|
+
export interface GetFileResponseSchema {
|
|
760
|
+
/** Presigned download URL */
|
|
761
|
+
url: string;
|
|
762
|
+
/** File ID */
|
|
763
|
+
fileID: string;
|
|
764
|
+
}
|
|
765
|
+
/** Mark paid result */
|
|
766
|
+
export interface PostPaidResponseSchema {
|
|
767
|
+
/** Submission ID */
|
|
768
|
+
submissionID: string;
|
|
769
|
+
/** New submission status (Paid) */
|
|
770
|
+
status: string;
|
|
771
|
+
}
|
|
772
|
+
/** Generated PDF */
|
|
773
|
+
export interface GetPDFResponseSchema {
|
|
774
|
+
/** Base64-encoded PDF content */
|
|
775
|
+
pdf: string;
|
|
776
|
+
/** Content type */
|
|
777
|
+
contentType: GetPdfResponseSchemaContentTypeEnum;
|
|
778
|
+
/** Suggested file name */
|
|
779
|
+
fileName: string;
|
|
780
|
+
}
|
|
781
|
+
export interface UpdatePOSchema {
|
|
782
|
+
/**
|
|
783
|
+
* PO number to set on the submission
|
|
784
|
+
* @example "PO-5678"
|
|
785
|
+
*/
|
|
786
|
+
poNumber: string;
|
|
787
|
+
}
|
|
788
|
+
/** PO number update result */
|
|
789
|
+
export interface PutPOResponseSchema {
|
|
790
|
+
/** Submission ID */
|
|
791
|
+
submissionID: string;
|
|
792
|
+
/** Updated PO number */
|
|
793
|
+
poNumber: string;
|
|
794
|
+
}
|
|
795
|
+
export interface ReassignSubmissionSchema {
|
|
796
|
+
/**
|
|
797
|
+
* The ID of the new department to reassign to
|
|
798
|
+
* @minLength 1
|
|
799
|
+
* @example "DEPT-abc123"
|
|
800
|
+
*/
|
|
801
|
+
departmentID: string;
|
|
802
|
+
}
|
|
803
|
+
/** Reassignment result */
|
|
804
|
+
export interface PostReassignResponseSchema {
|
|
805
|
+
/** Submission ID */
|
|
806
|
+
submissionID: string;
|
|
807
|
+
/** New department ID */
|
|
808
|
+
departmentID: string;
|
|
809
|
+
/** Reassignment confirmation */
|
|
810
|
+
reassigned: boolean;
|
|
811
|
+
}
|
|
812
|
+
/** Rejection result */
|
|
813
|
+
export interface PostRejectResponseSchema {
|
|
814
|
+
/** Submission ID */
|
|
815
|
+
submissionID: string;
|
|
816
|
+
/** New submission status after rejection */
|
|
817
|
+
status: string;
|
|
818
|
+
}
|
|
819
|
+
/** Submission status transition result */
|
|
820
|
+
export interface PostSubmitResponseSchema {
|
|
821
|
+
/** Submission ID */
|
|
822
|
+
submissionID: string;
|
|
823
|
+
/** New submission status */
|
|
824
|
+
status: string;
|
|
825
|
+
}
|
|
826
|
+
export interface GuestSubmissionRequestSchema {
|
|
827
|
+
/**
|
|
828
|
+
* Google reCAPTCHA verification token
|
|
829
|
+
* @example "03AGdBq26..."
|
|
830
|
+
*/
|
|
831
|
+
recaptchaToken: string;
|
|
832
|
+
/**
|
|
833
|
+
* Guest contractor name
|
|
834
|
+
* @minLength 1
|
|
835
|
+
* @example "Jane Smith"
|
|
836
|
+
*/
|
|
837
|
+
name: string;
|
|
838
|
+
/**
|
|
839
|
+
* Guest contractor email address
|
|
840
|
+
* @format email
|
|
841
|
+
* @example "jane@example.com"
|
|
842
|
+
*/
|
|
843
|
+
email: string;
|
|
844
|
+
/**
|
|
845
|
+
* Guest contractor phone number
|
|
846
|
+
* @minLength 1
|
|
847
|
+
* @example "604-555-0100"
|
|
848
|
+
*/
|
|
849
|
+
phone: string;
|
|
850
|
+
/**
|
|
851
|
+
* Invoice date (timestamp)
|
|
852
|
+
* @example 1700000000000
|
|
853
|
+
*/
|
|
854
|
+
date: number;
|
|
855
|
+
/**
|
|
856
|
+
* Invoice description
|
|
857
|
+
* @minLength 1
|
|
858
|
+
* @example "Safety consulting services"
|
|
859
|
+
*/
|
|
860
|
+
description: string;
|
|
861
|
+
/**
|
|
862
|
+
* Department to assign the submission to
|
|
863
|
+
* @minLength 1
|
|
864
|
+
* @example "DEPT-abc123"
|
|
865
|
+
*/
|
|
866
|
+
departmentID: string;
|
|
867
|
+
/**
|
|
868
|
+
* Invoice amount in dollars (pre-tax)
|
|
869
|
+
* @min 0
|
|
870
|
+
* @exclusiveMin true
|
|
871
|
+
* @example 500
|
|
872
|
+
*/
|
|
873
|
+
amount: number;
|
|
874
|
+
/**
|
|
875
|
+
* Tax amount in dollars
|
|
876
|
+
* @min 0
|
|
877
|
+
* @default 0
|
|
878
|
+
* @example 25
|
|
879
|
+
*/
|
|
880
|
+
taxAmount?: number;
|
|
881
|
+
/** Single PDF attachment (max 1 MB). Optional — if omitted, the frontend should upload the file separately via POST /submission/{submissionID}/file after submission creation. */
|
|
882
|
+
attachment?: GuestAttachmentSchema;
|
|
883
|
+
}
|
|
884
|
+
/** Single PDF attachment (max 1 MB). Optional — if omitted, the frontend should upload the file separately via POST /submission/{submissionID}/file after submission creation. */
|
|
885
|
+
export interface GuestAttachmentSchema {
|
|
886
|
+
/**
|
|
887
|
+
* Unique file identifier
|
|
888
|
+
* @example "file-abc123"
|
|
889
|
+
*/
|
|
890
|
+
fileID: string;
|
|
891
|
+
/**
|
|
892
|
+
* Original file name
|
|
893
|
+
* @example "invoice.pdf"
|
|
894
|
+
*/
|
|
895
|
+
fileName: string;
|
|
896
|
+
/**
|
|
897
|
+
* Content type (must be application/pdf for guest)
|
|
898
|
+
* @example "application/pdf"
|
|
899
|
+
*/
|
|
900
|
+
contentType: GuestAttachmentSchemaContentTypeEnum;
|
|
901
|
+
/**
|
|
902
|
+
* File size in bytes (max 1 MB)
|
|
903
|
+
* @max 1048576
|
|
904
|
+
* @example 51200
|
|
905
|
+
*/
|
|
906
|
+
size: number;
|
|
907
|
+
/**
|
|
908
|
+
* Upload timestamp
|
|
909
|
+
* @example 1700000000000
|
|
910
|
+
*/
|
|
911
|
+
uploadedOn: number;
|
|
912
|
+
}
|
|
913
|
+
/** Guest submission result */
|
|
914
|
+
export interface PostGuestSubmissionResponseSchema {
|
|
915
|
+
/** Created submission ID */
|
|
916
|
+
submissionID: string;
|
|
917
|
+
/** Created invoice ID */
|
|
918
|
+
invoiceID?: string;
|
|
919
|
+
}
|
|
920
|
+
/** Paginated submissions list */
|
|
921
|
+
export interface GetSubmissionsResponseSchema {
|
|
922
|
+
/** Submissions matching search criteria */
|
|
923
|
+
data: any[];
|
|
924
|
+
/** Pagination cursor for next page */
|
|
925
|
+
cursor: string | null;
|
|
926
|
+
/** Number of results in this page */
|
|
927
|
+
count: number;
|
|
928
|
+
}
|
|
929
|
+
/** Exported submissions Excel file */
|
|
930
|
+
export interface GetSubmissionsExportResponseSchema {
|
|
931
|
+
/** Base64-encoded Excel file content */
|
|
932
|
+
file: string;
|
|
933
|
+
/** Suggested file name */
|
|
934
|
+
filename: string;
|
|
935
|
+
/** Content type (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) */
|
|
936
|
+
contentType: string;
|
|
937
|
+
/** Number of rows exported */
|
|
938
|
+
rowCount: number;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* The contractor's local status. Set to 'active' to enable or 'disabled' to disable the account.
|
|
942
|
+
* @example "active"
|
|
943
|
+
*/
|
|
944
|
+
export declare enum UpdateContractorStatusSchemaStatusEnum {
|
|
945
|
+
Active = "active",
|
|
946
|
+
Disabled = "disabled"
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Submission type
|
|
950
|
+
* @example "Submission"
|
|
951
|
+
*/
|
|
952
|
+
export declare enum CreateSubmissionSchemaTypeEnum {
|
|
953
|
+
Submission = "Submission",
|
|
954
|
+
Reimbursement = "Reimbursement"
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Expense type
|
|
958
|
+
* @example "Accommodation"
|
|
959
|
+
*/
|
|
960
|
+
export declare enum ExpenseInputSchemaTypeEnum {
|
|
961
|
+
Accommodation = "Accommodation",
|
|
962
|
+
Meal = "Meal",
|
|
963
|
+
Mileage = "Mileage",
|
|
964
|
+
Transportation = "Transportation",
|
|
965
|
+
Other = "Other"
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* Meal type (Meal expenses)
|
|
969
|
+
* @example "Lunch"
|
|
970
|
+
*/
|
|
971
|
+
export declare enum ExpenseInputSchemaMealTypeEnum {
|
|
972
|
+
Breakfast = "Breakfast",
|
|
973
|
+
Lunch = "Lunch",
|
|
974
|
+
Dinner = "Dinner"
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* Transportation type (Transportation expenses)
|
|
978
|
+
* @example "Taxi"
|
|
979
|
+
*/
|
|
980
|
+
export declare enum ExpenseInputSchemaTransportationTypeEnum {
|
|
981
|
+
AirTravel = "Air travel",
|
|
982
|
+
Taxi = "Taxi",
|
|
983
|
+
Ferry = "Ferry",
|
|
984
|
+
Rental = "Rental",
|
|
985
|
+
Other = "Other"
|
|
986
|
+
}
|
|
987
|
+
/** Submission type */
|
|
988
|
+
export declare enum UpdateSubmissionSchemaTypeEnum {
|
|
989
|
+
Submission = "Submission",
|
|
990
|
+
Reimbursement = "Reimbursement"
|
|
991
|
+
}
|
|
992
|
+
/** The section to assign the code to */
|
|
993
|
+
export declare enum SubmissionCodeItemSchemaSectionEnum {
|
|
994
|
+
Service = "Service",
|
|
995
|
+
Reimbursement = "Reimbursement"
|
|
996
|
+
}
|
|
997
|
+
/** Content type */
|
|
998
|
+
export declare enum GetPdfResponseSchemaContentTypeEnum {
|
|
999
|
+
ApplicationPdf = "application/pdf"
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Content type (must be application/pdf for guest)
|
|
1003
|
+
* @example "application/pdf"
|
|
1004
|
+
*/
|
|
1005
|
+
export declare enum GuestAttachmentSchemaContentTypeEnum {
|
|
1006
|
+
ApplicationPdf = "application/pdf"
|
|
1007
|
+
}
|
|
1008
|
+
export type CreateCodeData = PostCodeResponseSchema;
|
|
1009
|
+
export type CreateCodeError = ErrorResponse;
|
|
1010
|
+
export type UpdateCodeData = PutCodeResponseSchema;
|
|
1011
|
+
export type UpdateCodeError = ErrorResponse;
|
|
1012
|
+
export type DeleteCodeData = DeleteCodeResponseSchema;
|
|
1013
|
+
export type DeleteCodeError = ErrorResponse;
|
|
1014
|
+
export type ListCodesData = GetCodesResponseSchema;
|
|
1015
|
+
export type ListCodesError = ErrorResponse;
|
|
1016
|
+
export type CreateContractorData = PostContractorResponseSchema;
|
|
1017
|
+
export type CreateContractorError = ErrorResponse;
|
|
1018
|
+
export type GetContractorData = GetContractorResponseSchema;
|
|
1019
|
+
export type GetContractorError = ErrorResponse;
|
|
1020
|
+
export type UpdateRatesData = PutContractorRatesResponseSchema;
|
|
1021
|
+
export type UpdateRatesError = ErrorResponse;
|
|
1022
|
+
export type CreateResetPasswordData = PostResetPasswordResponseSchema;
|
|
1023
|
+
export type CreateResetPasswordError = ErrorResponse;
|
|
1024
|
+
export type UpdateStatusData = PutContractorStatusResponseSchema;
|
|
1025
|
+
export type UpdateStatusError = ErrorResponse;
|
|
1026
|
+
export interface ListContractorsParams {
|
|
1027
|
+
/**
|
|
1028
|
+
* Search term (minimum 2 characters)
|
|
1029
|
+
* @minLength 2
|
|
1030
|
+
* @example "john"
|
|
1031
|
+
*/
|
|
1032
|
+
q: string;
|
|
1033
|
+
/**
|
|
1034
|
+
* Search field type: name for begins_with match, email for exact match
|
|
1035
|
+
* @example "name"
|
|
1036
|
+
*/
|
|
1037
|
+
type: TypeEnum;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Search field type: name for begins_with match, email for exact match
|
|
1041
|
+
* @example "name"
|
|
1042
|
+
*/
|
|
1043
|
+
export declare enum TypeEnum {
|
|
1044
|
+
Name = "name",
|
|
1045
|
+
Email = "email"
|
|
1046
|
+
}
|
|
1047
|
+
export type ListContractorsData = GetContractorsResponseSchema;
|
|
1048
|
+
export type ListContractorsError = ErrorResponse;
|
|
1049
|
+
/**
|
|
1050
|
+
* Search field type: name for begins_with match, email for exact match
|
|
1051
|
+
* @example "name"
|
|
1052
|
+
*/
|
|
1053
|
+
export declare enum ListContractorsParams1TypeEnum {
|
|
1054
|
+
Name = "name",
|
|
1055
|
+
Email = "email"
|
|
1056
|
+
}
|
|
1057
|
+
export type CreateDepartmentData = PostDepartmentResponseSchema;
|
|
1058
|
+
export type CreateDepartmentError = ErrorResponse;
|
|
1059
|
+
export type UpdateDepartmentData = PutDepartmentResponseSchema;
|
|
1060
|
+
export type UpdateDepartmentError = ErrorResponse;
|
|
1061
|
+
export type DeleteDepartmentData = DeleteDepartmentResponseSchema;
|
|
1062
|
+
export type DeleteDepartmentError = ErrorResponse;
|
|
1063
|
+
export type CreateAdminData = PostDepartmentAdminResponseSchema;
|
|
1064
|
+
export type CreateAdminError = ErrorResponse;
|
|
1065
|
+
export type DeleteAdminData = DeleteDepartmentAdminResponseSchema;
|
|
1066
|
+
export type DeleteAdminError = ErrorResponse;
|
|
1067
|
+
export type ListDepartmentsData = GetDepartmentsResponseSchema;
|
|
1068
|
+
export type ListDepartmentsError = ErrorResponse;
|
|
1069
|
+
export type ListSettingsData = GetSettingsResponseSchema;
|
|
1070
|
+
export type ListSettingsError = ErrorResponse;
|
|
1071
|
+
export type UpdateRatesResult = PutSettingsRatesResponseSchema;
|
|
1072
|
+
export type UpdateRatesFail = ErrorResponse;
|
|
1073
|
+
export type UpdateMaximumsData = PutSettingsMaximumsResponseSchema;
|
|
1074
|
+
export type UpdateMaximumsError = ErrorResponse;
|
|
1075
|
+
export type UpdateRemindersData = PutSettingsRemindersResponseSchema;
|
|
1076
|
+
export type UpdateRemindersError = ErrorResponse;
|
|
1077
|
+
export type CreateSubmissionData = PostSubmissionResponseSchema;
|
|
1078
|
+
export type CreateSubmissionError = ErrorResponse;
|
|
1079
|
+
export type GetSubmissionData = GetSubmissionResponseSchema;
|
|
1080
|
+
export type GetSubmissionError = ErrorResponse;
|
|
1081
|
+
export type UpdateSubmissionData = PutSubmissionResponseSchema;
|
|
1082
|
+
export type UpdateSubmissionError = ErrorResponse;
|
|
1083
|
+
export type DeleteSubmissionData = DeleteSubmissionResponseSchema;
|
|
1084
|
+
export type DeleteSubmissionError = ErrorResponse;
|
|
1085
|
+
export type CreateApproveData = PostApproveResponseSchema;
|
|
1086
|
+
export type CreateApproveError = ErrorResponse;
|
|
1087
|
+
export type UpdateCodesData = PutSubmissionCodesResponseSchema;
|
|
1088
|
+
export type UpdateCodesError = ErrorResponse;
|
|
1089
|
+
export type CreateFileData = PostFileResponseSchema;
|
|
1090
|
+
export type CreateFileError = ErrorResponse;
|
|
1091
|
+
export type GetFileData = GetFileResponseSchema;
|
|
1092
|
+
export type GetFileError = ErrorResponse;
|
|
1093
|
+
export type CreatePaidData = PostPaidResponseSchema;
|
|
1094
|
+
export type CreatePaidError = ErrorResponse;
|
|
1095
|
+
export type GetPdfData = GetPDFResponseSchema;
|
|
1096
|
+
export type GetPdfError = ErrorResponse;
|
|
1097
|
+
export type PutSubmissionData = PutPOResponseSchema;
|
|
1098
|
+
export type PutSubmissionError = ErrorResponse;
|
|
1099
|
+
export type CreateReassignData = PostReassignResponseSchema;
|
|
1100
|
+
export type CreateReassignError = ErrorResponse;
|
|
1101
|
+
export type CreateRejectData = PostRejectResponseSchema;
|
|
1102
|
+
export type CreateRejectError = ErrorResponse;
|
|
1103
|
+
export type CreateSubmitData = PostSubmitResponseSchema;
|
|
1104
|
+
export type CreateSubmitError = ErrorResponse;
|
|
1105
|
+
export type CreateGuestData = PostGuestSubmissionResponseSchema;
|
|
1106
|
+
export type CreateGuestError = ErrorResponse;
|
|
1107
|
+
export interface ListSubmissionsParams {
|
|
1108
|
+
/**
|
|
1109
|
+
* Filter by submission status
|
|
1110
|
+
* @example "Submitted"
|
|
1111
|
+
*/
|
|
1112
|
+
status?: StatusEnum;
|
|
1113
|
+
/**
|
|
1114
|
+
* Filter by department ID
|
|
1115
|
+
* @example "DEPT-abc123"
|
|
1116
|
+
*/
|
|
1117
|
+
departmentID?: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* Filter by contractor user ID
|
|
1120
|
+
* @example "USR-xyz789"
|
|
1121
|
+
*/
|
|
1122
|
+
contractorID?: string;
|
|
1123
|
+
/**
|
|
1124
|
+
* Filter by submission type
|
|
1125
|
+
* @example "Submission"
|
|
1126
|
+
*/
|
|
1127
|
+
type?: TypeEnum1;
|
|
1128
|
+
/**
|
|
1129
|
+
* Filter from date (epoch ms)
|
|
1130
|
+
* @example 1700000000000
|
|
1131
|
+
*/
|
|
1132
|
+
fromDate?: number | null;
|
|
1133
|
+
/**
|
|
1134
|
+
* Filter to date (epoch ms)
|
|
1135
|
+
* @example 1710000000000
|
|
1136
|
+
*/
|
|
1137
|
+
toDate?: number | null;
|
|
1138
|
+
/** Pagination cursor from previous response */
|
|
1139
|
+
cursor?: string;
|
|
1140
|
+
/**
|
|
1141
|
+
* Number of results per page (max 50)
|
|
1142
|
+
* @min 1
|
|
1143
|
+
* @max 50
|
|
1144
|
+
* @default 50
|
|
1145
|
+
* @example 50
|
|
1146
|
+
*/
|
|
1147
|
+
limit?: number;
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Filter by submission status
|
|
1151
|
+
* @example "Submitted"
|
|
1152
|
+
*/
|
|
1153
|
+
export declare enum StatusEnum {
|
|
1154
|
+
Draft = "Draft",
|
|
1155
|
+
Submitted = "Submitted",
|
|
1156
|
+
AdministratorApproved = "Administrator_Approved",
|
|
1157
|
+
Rejected = "Rejected",
|
|
1158
|
+
PaymentPending = "Payment_Pending",
|
|
1159
|
+
Paid = "Paid"
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Filter by submission type
|
|
1163
|
+
* @example "Submission"
|
|
1164
|
+
*/
|
|
1165
|
+
export declare enum TypeEnum1 {
|
|
1166
|
+
Submission = "Submission",
|
|
1167
|
+
Reimbursement = "Reimbursement"
|
|
1168
|
+
}
|
|
1169
|
+
export type ListSubmissionsData = GetSubmissionsResponseSchema;
|
|
1170
|
+
export type ListSubmissionsError = ErrorResponse;
|
|
1171
|
+
/**
|
|
1172
|
+
* Filter by submission status
|
|
1173
|
+
* @example "Submitted"
|
|
1174
|
+
*/
|
|
1175
|
+
export declare enum ListSubmissionsParams1StatusEnum {
|
|
1176
|
+
Draft = "Draft",
|
|
1177
|
+
Submitted = "Submitted",
|
|
1178
|
+
AdministratorApproved = "Administrator_Approved",
|
|
1179
|
+
Rejected = "Rejected",
|
|
1180
|
+
PaymentPending = "Payment_Pending",
|
|
1181
|
+
Paid = "Paid"
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* Filter by submission type
|
|
1185
|
+
* @example "Submission"
|
|
1186
|
+
*/
|
|
1187
|
+
export declare enum ListSubmissionsParams1TypeEnum {
|
|
1188
|
+
Submission = "Submission",
|
|
1189
|
+
Reimbursement = "Reimbursement"
|
|
1190
|
+
}
|
|
1191
|
+
export type ListExportData = GetSubmissionsExportResponseSchema;
|
|
1192
|
+
export type ListExportError = ErrorResponse;
|
|
1193
|
+
import type { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios';
|
|
1194
|
+
export type QueryParamsType = Record<string | number, any>;
|
|
1195
|
+
export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
|
|
1196
|
+
/** set parameter to `true` for call `securityWorker` for this request */
|
|
1197
|
+
secure?: boolean;
|
|
1198
|
+
/** request path */
|
|
1199
|
+
path: string;
|
|
1200
|
+
/** content type of request body */
|
|
1201
|
+
type?: ContentType;
|
|
1202
|
+
/** query params */
|
|
1203
|
+
query?: QueryParamsType;
|
|
1204
|
+
/** format of response (i.e. response.json() -> format: "json") */
|
|
1205
|
+
format?: ResponseType;
|
|
1206
|
+
/** request body */
|
|
1207
|
+
body?: unknown;
|
|
1208
|
+
}
|
|
1209
|
+
export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
|
|
1210
|
+
export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, 'data' | 'cancelToken'> {
|
|
1211
|
+
securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
|
|
1212
|
+
secure?: boolean;
|
|
1213
|
+
format?: ResponseType;
|
|
1214
|
+
}
|
|
1215
|
+
export declare enum ContentType {
|
|
1216
|
+
Json = "application/json",
|
|
1217
|
+
FormData = "multipart/form-data",
|
|
1218
|
+
UrlEncoded = "application/x-www-form-urlencoded",
|
|
1219
|
+
Text = "text/plain"
|
|
1220
|
+
}
|
|
1221
|
+
export declare class HttpClient<SecurityDataType = unknown> {
|
|
1222
|
+
instance: AxiosInstance;
|
|
1223
|
+
private securityData;
|
|
1224
|
+
private securityWorker?;
|
|
1225
|
+
private secure?;
|
|
1226
|
+
private format?;
|
|
1227
|
+
constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig<SecurityDataType>);
|
|
1228
|
+
setSecurityData: (data: SecurityDataType | null) => void;
|
|
1229
|
+
protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
|
|
1230
|
+
protected stringifyFormItem(formItem: unknown): string;
|
|
1231
|
+
protected createFormData(input: Record<string, unknown>): FormData;
|
|
1232
|
+
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<T>;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* @title Contractor Module API
|
|
1236
|
+
* @version 1.0.5
|
|
1237
|
+
* @baseUrl http://localhost:8080
|
|
1238
|
+
* @contact Ikon Integration <ikon@ikonintegration.com> (http://example.com)
|
|
1239
|
+
*/
|
|
1240
|
+
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
1241
|
+
code: {
|
|
1242
|
+
/**
|
|
1243
|
+
* @description Creates a new charging code associated with a department. Only Super Administrators can create codes.
|
|
1244
|
+
*
|
|
1245
|
+
* @tags Codes
|
|
1246
|
+
* @name CreateCode
|
|
1247
|
+
* @summary Create Code
|
|
1248
|
+
* @request POST:/code
|
|
1249
|
+
* @secure
|
|
1250
|
+
*/
|
|
1251
|
+
createCode: (data: CreateCodeSchema, params?: RequestParams) => Promise<PostCodeResponseSchema>;
|
|
1252
|
+
/**
|
|
1253
|
+
* @description Updates an existing charging code description. Only Super Administrators can update codes.
|
|
1254
|
+
*
|
|
1255
|
+
* @tags Codes
|
|
1256
|
+
* @name UpdateCode
|
|
1257
|
+
* @summary Update Code
|
|
1258
|
+
* @request PUT:/code/{codeID}
|
|
1259
|
+
* @secure
|
|
1260
|
+
*/
|
|
1261
|
+
updateCode: (codeId: string, data: UpdateCodeSchema, params?: RequestParams) => Promise<PutCodeResponseSchema>;
|
|
1262
|
+
/**
|
|
1263
|
+
* @description Deletes a charging code. Prevents deletion if the code is referenced by existing submissions. Only Super Administrators can delete codes.
|
|
1264
|
+
*
|
|
1265
|
+
* @tags Codes
|
|
1266
|
+
* @name DeleteCode
|
|
1267
|
+
* @summary Delete Code
|
|
1268
|
+
* @request DELETE:/code/{codeID}
|
|
1269
|
+
* @secure
|
|
1270
|
+
*/
|
|
1271
|
+
deleteCode: (codeId: string, params?: RequestParams) => Promise<object>;
|
|
1272
|
+
};
|
|
1273
|
+
codes: {
|
|
1274
|
+
/**
|
|
1275
|
+
* @description Returns all codes or codes filtered by department. Administrators and above can list codes.
|
|
1276
|
+
*
|
|
1277
|
+
* @tags Codes
|
|
1278
|
+
* @name ListCodes
|
|
1279
|
+
* @summary List Codes
|
|
1280
|
+
* @request GET:/codes
|
|
1281
|
+
* @secure
|
|
1282
|
+
*/
|
|
1283
|
+
listCodes: (params?: RequestParams) => Promise<GetCodesResponseSchema>;
|
|
1284
|
+
};
|
|
1285
|
+
contractor: {
|
|
1286
|
+
/**
|
|
1287
|
+
* @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.
|
|
1288
|
+
*
|
|
1289
|
+
* @tags Contractors
|
|
1290
|
+
* @name CreateContractor
|
|
1291
|
+
* @summary Create Contractor
|
|
1292
|
+
* @request POST:/contractor
|
|
1293
|
+
* @secure
|
|
1294
|
+
*/
|
|
1295
|
+
createContractor: (data: CreateContractorSchema, params?: RequestParams) => Promise<PostContractorResponseSchema>;
|
|
1296
|
+
/**
|
|
1297
|
+
* @description View a contractor profile. Contractors can view their own profile (includes effective rates). Administrators can view any contractor profile.
|
|
1298
|
+
*
|
|
1299
|
+
* @tags Contractors
|
|
1300
|
+
* @name GetContractor
|
|
1301
|
+
* @summary View Contractor Profile
|
|
1302
|
+
* @request GET:/contractor/{userID}
|
|
1303
|
+
* @secure
|
|
1304
|
+
*/
|
|
1305
|
+
getContractor: (userId: string, params?: RequestParams) => Promise<GetContractorResponseSchema>;
|
|
1306
|
+
/**
|
|
1307
|
+
* @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.
|
|
1308
|
+
*
|
|
1309
|
+
* @tags Contractors
|
|
1310
|
+
* @name UpdateRates
|
|
1311
|
+
* @summary Set Contractor Rates
|
|
1312
|
+
* @request PUT:/contractor/{userID}/rates
|
|
1313
|
+
* @secure
|
|
1314
|
+
*/
|
|
1315
|
+
updateRates: (userId: string, data: UpdateContractorRatesSchema, params?: RequestParams) => Promise<PutContractorRatesResponseSchema>;
|
|
1316
|
+
/**
|
|
1317
|
+
* @description Triggers a password reset for the specified contractor. Only Administrators and Super Administrators can trigger password resets.
|
|
1318
|
+
*
|
|
1319
|
+
* @tags Contractors
|
|
1320
|
+
* @name CreateResetPassword
|
|
1321
|
+
* @summary Reset Contractor Password
|
|
1322
|
+
* @request POST:/contractor/{userID}/reset-password
|
|
1323
|
+
* @secure
|
|
1324
|
+
*/
|
|
1325
|
+
createResetPassword: (userId: string, params?: RequestParams) => Promise<PostResetPasswordResponseSchema>;
|
|
1326
|
+
/**
|
|
1327
|
+
* @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.
|
|
1328
|
+
*
|
|
1329
|
+
* @tags Contractors
|
|
1330
|
+
* @name UpdateStatus
|
|
1331
|
+
* @summary Enable/Disable Contractor
|
|
1332
|
+
* @request PUT:/contractor/{userID}/status
|
|
1333
|
+
* @secure
|
|
1334
|
+
*/
|
|
1335
|
+
updateStatus: (userId: string, data: UpdateContractorStatusSchema, params?: RequestParams) => Promise<PutContractorStatusResponseSchema>;
|
|
1336
|
+
};
|
|
1337
|
+
contractors: {
|
|
1338
|
+
/**
|
|
1339
|
+
* @description Search contractors by name (partial match) or email (exact match). Minimum 2 characters required.
|
|
1340
|
+
*
|
|
1341
|
+
* @tags Contractors
|
|
1342
|
+
* @name ListContractors
|
|
1343
|
+
* @summary Search Contractors
|
|
1344
|
+
* @request GET:/contractors
|
|
1345
|
+
* @secure
|
|
1346
|
+
*/
|
|
1347
|
+
listContractors: (query: ListContractorsParams, params?: RequestParams) => Promise<GetContractorsResponseSchema>;
|
|
1348
|
+
};
|
|
1349
|
+
department: {
|
|
1350
|
+
/**
|
|
1351
|
+
* @description Creates a new department. Requires a name (1-150 chars) and contact emails (max 10). SYSADMIN only.
|
|
1352
|
+
*
|
|
1353
|
+
* @tags Departments
|
|
1354
|
+
* @name CreateDepartment
|
|
1355
|
+
* @summary Create Department
|
|
1356
|
+
* @request POST:/department
|
|
1357
|
+
* @secure
|
|
1358
|
+
*/
|
|
1359
|
+
createDepartment: (data: CreateDepartmentSchema, params?: RequestParams) => Promise<PostDepartmentResponseSchema>;
|
|
1360
|
+
/**
|
|
1361
|
+
* @description Updates an existing department name and/or contact emails. SYSADMIN only.
|
|
1362
|
+
*
|
|
1363
|
+
* @tags Departments
|
|
1364
|
+
* @name UpdateDepartment
|
|
1365
|
+
* @summary Update Department
|
|
1366
|
+
* @request PUT:/department/{departmentID}
|
|
1367
|
+
* @secure
|
|
1368
|
+
*/
|
|
1369
|
+
updateDepartment: (departmentId: string, data: UpdateDepartmentSchema, params?: RequestParams) => Promise<PutDepartmentResponseSchema>;
|
|
1370
|
+
/**
|
|
1371
|
+
* @description Deletes a department. Prevents deletion if department has active codes or associated administrators. SYSADMIN only.
|
|
1372
|
+
*
|
|
1373
|
+
* @tags Departments
|
|
1374
|
+
* @name DeleteDepartment
|
|
1375
|
+
* @summary Delete Department
|
|
1376
|
+
* @request DELETE:/department/{departmentID}
|
|
1377
|
+
* @secure
|
|
1378
|
+
*/
|
|
1379
|
+
deleteDepartment: (departmentId: string, params?: RequestParams) => Promise<DeleteDepartmentResponseSchema>;
|
|
1380
|
+
/**
|
|
1381
|
+
* @description Associates an administrator with a department. Each administrator can only belong to one department. SYSADMIN only.
|
|
1382
|
+
*
|
|
1383
|
+
* @tags Departments
|
|
1384
|
+
* @name CreateAdmin
|
|
1385
|
+
* @summary Associate Admin with Department
|
|
1386
|
+
* @request POST:/department/{departmentID}/admin
|
|
1387
|
+
* @secure
|
|
1388
|
+
*/
|
|
1389
|
+
createAdmin: (departmentId: string, data: AssociateAdminSchema, params?: RequestParams) => Promise<PostDepartmentAdminResponseSchema>;
|
|
1390
|
+
/**
|
|
1391
|
+
* @description Removes an administrator association from a department. SYSADMIN only.
|
|
1392
|
+
*
|
|
1393
|
+
* @tags Departments
|
|
1394
|
+
* @name DeleteAdmin
|
|
1395
|
+
* @summary Remove Admin from Department
|
|
1396
|
+
* @request DELETE:/department/{departmentID}/admin/{userID}
|
|
1397
|
+
* @secure
|
|
1398
|
+
*/
|
|
1399
|
+
deleteAdmin: (departmentId: string, userId: string, params?: RequestParams) => Promise<DeleteDepartmentAdminResponseSchema>;
|
|
1400
|
+
};
|
|
1401
|
+
departments: {
|
|
1402
|
+
/**
|
|
1403
|
+
* @description Returns all departments. For ADMIN/SYSADMIN users returns full department data. For lower roles (USER, ACCOUNTANT, NONE) returns only departmentID and name.
|
|
1404
|
+
*
|
|
1405
|
+
* @tags Departments
|
|
1406
|
+
* @name ListDepartments
|
|
1407
|
+
* @summary List All Departments
|
|
1408
|
+
* @request GET:/departments
|
|
1409
|
+
* @secure
|
|
1410
|
+
*/
|
|
1411
|
+
listDepartments: (params?: RequestParams) => Promise<GetDepartmentsResponseSchema>;
|
|
1412
|
+
};
|
|
1413
|
+
settings: {
|
|
1414
|
+
/**
|
|
1415
|
+
* @description Retrieves system settings. Administrators have read-only access. Super Administrators have full access.
|
|
1416
|
+
*
|
|
1417
|
+
* @tags Settings
|
|
1418
|
+
* @name ListSettings
|
|
1419
|
+
* @summary Get System Settings
|
|
1420
|
+
* @request GET:/settings
|
|
1421
|
+
* @secure
|
|
1422
|
+
*/
|
|
1423
|
+
listSettings: (params?: RequestParams) => Promise<GetSettingsResponseSchema>;
|
|
1424
|
+
/**
|
|
1425
|
+
* @description Updates the system-wide mileage rate. Only Super Administrators can modify system settings.
|
|
1426
|
+
*
|
|
1427
|
+
* @tags Settings
|
|
1428
|
+
* @name UpdateRates
|
|
1429
|
+
* @summary Update Mileage Rate
|
|
1430
|
+
* @request PUT:/settings/rates
|
|
1431
|
+
* @secure
|
|
1432
|
+
*/
|
|
1433
|
+
updateRates: (data: UpdateRatesSchema, params?: RequestParams) => Promise<PutSettingsRatesResponseSchema>;
|
|
1434
|
+
/**
|
|
1435
|
+
* @description Updates all system-wide expense maximums (accommodation, meals, transportation). Only Super Administrators can modify system settings.
|
|
1436
|
+
*
|
|
1437
|
+
* @tags Settings
|
|
1438
|
+
* @name UpdateMaximums
|
|
1439
|
+
* @summary Update Expense Maximums
|
|
1440
|
+
* @request PUT:/settings/maximums
|
|
1441
|
+
* @secure
|
|
1442
|
+
*/
|
|
1443
|
+
updateMaximums: (data: UpdateMaximumsSchema, params?: RequestParams) => Promise<PutSettingsMaximumsResponseSchema>;
|
|
1444
|
+
/**
|
|
1445
|
+
* @description Updates the reminder interval (in days) for pending submission notifications. Only Super Administrators can modify system settings.
|
|
1446
|
+
*
|
|
1447
|
+
* @tags Settings
|
|
1448
|
+
* @name UpdateReminders
|
|
1449
|
+
* @summary Update Reminder Interval
|
|
1450
|
+
* @request PUT:/settings/reminders
|
|
1451
|
+
* @secure
|
|
1452
|
+
*/
|
|
1453
|
+
updateReminders: (data: UpdateRemindersSchema, params?: RequestParams) => Promise<PutSettingsRemindersResponseSchema>;
|
|
1454
|
+
};
|
|
1455
|
+
submission: {
|
|
1456
|
+
/**
|
|
1457
|
+
* @description Creates a new draft submission for the authenticated contractor. Validates invoice number uniqueness, calculates totals, and validates expenses against configured maximums.
|
|
1458
|
+
*
|
|
1459
|
+
* @tags Submissions
|
|
1460
|
+
* @name CreateSubmission
|
|
1461
|
+
* @summary Create draft submission
|
|
1462
|
+
* @request POST:/submission
|
|
1463
|
+
* @secure
|
|
1464
|
+
*/
|
|
1465
|
+
createSubmission: (data: CreateSubmissionSchema, params?: RequestParams) => Promise<PostSubmissionResponseSchema>;
|
|
1466
|
+
/**
|
|
1467
|
+
* @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.
|
|
1468
|
+
*
|
|
1469
|
+
* @tags Submissions
|
|
1470
|
+
* @name GetSubmission
|
|
1471
|
+
* @summary View submission detail
|
|
1472
|
+
* @request GET:/submission/{submissionID}
|
|
1473
|
+
* @secure
|
|
1474
|
+
*/
|
|
1475
|
+
getSubmission: (submissionId: string, params?: RequestParams) => Promise<GetSubmissionResponseSchema>;
|
|
1476
|
+
/**
|
|
1477
|
+
* @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.
|
|
1478
|
+
*
|
|
1479
|
+
* @tags Submissions
|
|
1480
|
+
* @name UpdateSubmission
|
|
1481
|
+
* @summary Update submission
|
|
1482
|
+
* @request PUT:/submission/{submissionID}
|
|
1483
|
+
* @secure
|
|
1484
|
+
*/
|
|
1485
|
+
updateSubmission: (submissionId: string, data: UpdateSubmissionSchema, params?: RequestParams) => Promise<PutSubmissionResponseSchema>;
|
|
1486
|
+
/**
|
|
1487
|
+
* @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.
|
|
1488
|
+
*
|
|
1489
|
+
* @tags Submissions
|
|
1490
|
+
* @name DeleteSubmission
|
|
1491
|
+
* @summary Delete submission
|
|
1492
|
+
* @request DELETE:/submission/{submissionID}
|
|
1493
|
+
* @secure
|
|
1494
|
+
*/
|
|
1495
|
+
deleteSubmission: (submissionId: string, params?: RequestParams) => Promise<DeleteSubmissionResponseSchema>;
|
|
1496
|
+
/**
|
|
1497
|
+
* @description Admin: transitions Submitted → Administrator_Approved (notifies accountants + contractor). Accountant: transitions Administrator_Approved → Payment_Pending (notifies contractor).
|
|
1498
|
+
*
|
|
1499
|
+
* @tags Submissions
|
|
1500
|
+
* @name CreateApprove
|
|
1501
|
+
* @summary Approve a submission
|
|
1502
|
+
* @request POST:/submission/{submissionID}/approve
|
|
1503
|
+
* @secure
|
|
1504
|
+
*/
|
|
1505
|
+
createApprove: (submissionId: string, params?: RequestParams) => Promise<PostApproveResponseSchema>;
|
|
1506
|
+
/**
|
|
1507
|
+
* @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.
|
|
1508
|
+
*
|
|
1509
|
+
* @tags Submissions
|
|
1510
|
+
* @name UpdateCodes
|
|
1511
|
+
* @summary Assign codes to submission sections
|
|
1512
|
+
* @request PUT:/submission/{submissionID}/codes
|
|
1513
|
+
* @secure
|
|
1514
|
+
*/
|
|
1515
|
+
updateCodes: (submissionId: string, data: PutSubmissionCodesSchema, params?: RequestParams) => Promise<PutSubmissionCodesResponseSchema>;
|
|
1516
|
+
/**
|
|
1517
|
+
* @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).
|
|
1518
|
+
*
|
|
1519
|
+
* @tags Submissions
|
|
1520
|
+
* @name CreateFile
|
|
1521
|
+
* @summary Get presigned upload URL for a file attachment
|
|
1522
|
+
* @request POST:/submission/{submissionID}/file
|
|
1523
|
+
* @secure
|
|
1524
|
+
*/
|
|
1525
|
+
createFile: (submissionId: string, data: FileUploadRequestSchema, params?: RequestParams) => Promise<PostFileResponseSchema>;
|
|
1526
|
+
/**
|
|
1527
|
+
* @description Returns a presigned S3 URL for downloading a file attachment associated with a submission line item.
|
|
1528
|
+
*
|
|
1529
|
+
* @tags Submissions
|
|
1530
|
+
* @name GetFile
|
|
1531
|
+
* @summary Get presigned download URL for a file attachment
|
|
1532
|
+
* @request GET:/submission/{submissionID}/file/{fileID}
|
|
1533
|
+
* @secure
|
|
1534
|
+
*/
|
|
1535
|
+
getFile: (submissionId: string, fileId: string, params?: RequestParams) => Promise<GetFileResponseSchema>;
|
|
1536
|
+
/**
|
|
1537
|
+
* @description Transitions a Payment_Pending submission to Paid. Only Accountants may perform this action. Notifies the approving administrator.
|
|
1538
|
+
*
|
|
1539
|
+
* @tags Submissions
|
|
1540
|
+
* @name CreatePaid
|
|
1541
|
+
* @summary Mark a submission as paid
|
|
1542
|
+
* @request POST:/submission/{submissionID}/paid
|
|
1543
|
+
* @secure
|
|
1544
|
+
*/
|
|
1545
|
+
createPaid: (submissionId: string, params?: RequestParams) => Promise<PostPaidResponseSchema>;
|
|
1546
|
+
/**
|
|
1547
|
+
* @description Generates and returns a PDF summary of the submission including invoices, expenses, and assigned codes. Returns the PDF as a base64-encoded string.
|
|
1548
|
+
*
|
|
1549
|
+
* @tags Submissions
|
|
1550
|
+
* @name GetPdf
|
|
1551
|
+
* @summary Generate submission summary PDF
|
|
1552
|
+
* @request GET:/submission/{submissionID}/pdf
|
|
1553
|
+
* @secure
|
|
1554
|
+
*/
|
|
1555
|
+
getPdf: (submissionId: string, params?: RequestParams) => Promise<GetPDFResponseSchema>;
|
|
1556
|
+
/**
|
|
1557
|
+
* @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.
|
|
1558
|
+
*
|
|
1559
|
+
* @tags Submissions
|
|
1560
|
+
* @name PutSubmission
|
|
1561
|
+
* @summary Update submission PO number
|
|
1562
|
+
* @request PUT:/submission/{submissionID}/po
|
|
1563
|
+
* @secure
|
|
1564
|
+
*/
|
|
1565
|
+
putSubmission: (submissionId: string, data: UpdatePOSchema, params?: RequestParams) => Promise<PutPOResponseSchema>;
|
|
1566
|
+
/**
|
|
1567
|
+
* @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.
|
|
1568
|
+
*
|
|
1569
|
+
* @tags Submissions
|
|
1570
|
+
* @name CreateReassign
|
|
1571
|
+
* @summary Reassign submission to a different department
|
|
1572
|
+
* @request POST:/submission/{submissionID}/reassign
|
|
1573
|
+
* @secure
|
|
1574
|
+
*/
|
|
1575
|
+
createReassign: (submissionId: string, data: ReassignSubmissionSchema, params?: RequestParams) => Promise<PostReassignResponseSchema>;
|
|
1576
|
+
/**
|
|
1577
|
+
* @description Admin rejects a Submitted submission; Accountant rejects an Administrator_Approved submission. RSA-sourced submissions cannot be rejected. Notifies the contractor.
|
|
1578
|
+
*
|
|
1579
|
+
* @tags Submissions
|
|
1580
|
+
* @name CreateReject
|
|
1581
|
+
* @summary Reject a submission
|
|
1582
|
+
* @request POST:/submission/{submissionID}/reject
|
|
1583
|
+
* @secure
|
|
1584
|
+
*/
|
|
1585
|
+
createReject: (submissionId: string, params?: RequestParams) => Promise<PostRejectResponseSchema>;
|
|
1586
|
+
/**
|
|
1587
|
+
* @description Transitions a Draft or Rejected submission to Submitted. Only the owning contractor may submit. Routes the submission to department administrators and sends notifications.
|
|
1588
|
+
*
|
|
1589
|
+
* @tags Submissions
|
|
1590
|
+
* @name CreateSubmit
|
|
1591
|
+
* @summary Submit a draft or rejected submission
|
|
1592
|
+
* @request POST:/submission/{submissionID}/submit
|
|
1593
|
+
* @secure
|
|
1594
|
+
*/
|
|
1595
|
+
createSubmit: (submissionId: string, params?: RequestParams) => Promise<PostSubmitResponseSchema>;
|
|
1596
|
+
/**
|
|
1597
|
+
* @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.
|
|
1598
|
+
*
|
|
1599
|
+
* @tags Submissions
|
|
1600
|
+
* @name CreateGuest
|
|
1601
|
+
* @summary Submit guest invoice
|
|
1602
|
+
* @request POST:/submission/guest
|
|
1603
|
+
* @secure
|
|
1604
|
+
*/
|
|
1605
|
+
createGuest: (data: GuestSubmissionRequestSchema, params?: RequestParams) => Promise<PostGuestSubmissionResponseSchema>;
|
|
1606
|
+
};
|
|
1607
|
+
submissions: {
|
|
1608
|
+
/**
|
|
1609
|
+
* @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.
|
|
1610
|
+
*
|
|
1611
|
+
* @tags Submissions
|
|
1612
|
+
* @name ListSubmissions
|
|
1613
|
+
* @summary Search Submissions
|
|
1614
|
+
* @request GET:/submissions
|
|
1615
|
+
* @secure
|
|
1616
|
+
*/
|
|
1617
|
+
listSubmissions: (query: ListSubmissionsParams, params?: RequestParams) => Promise<GetSubmissionsResponseSchema>;
|
|
1618
|
+
/**
|
|
1619
|
+
* @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.
|
|
1620
|
+
*
|
|
1621
|
+
* @tags Submissions
|
|
1622
|
+
* @name ListExport
|
|
1623
|
+
* @summary Export Submissions to Excel
|
|
1624
|
+
* @request GET:/submissions/export
|
|
1625
|
+
* @secure
|
|
1626
|
+
*/
|
|
1627
|
+
listExport: (params?: RequestParams) => Promise<GetSubmissionsExportResponseSchema>;
|
|
1628
|
+
};
|
|
1629
|
+
}
|