@ikonintegration/module-contractor-api 1.0.4 → 1.0.6

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