@ikonintegration/module-contractor-api 1.0.18 → 1.0.20

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 CHANGED
@@ -5,6 +5,60 @@ export interface ErrorResponse {
5
5
  /** Error code */
6
6
  errCode: string;
7
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;
8
62
  /** Codes list */
9
63
  export interface GetCodesResponseSchema {
10
64
  /** List of codes */
@@ -269,6 +323,22 @@ export interface UserSearchResult {
269
323
  /** Account status (active/disabled) */
270
324
  localStatus?: string;
271
325
  }
326
+ export interface IDMUserSearchInput {
327
+ /**
328
+ * Full-text IDM search term
329
+ * @example "vitor"
330
+ */
331
+ searchTerm?: string;
332
+ /** Optional IDM filter object, forwarded verbatim to IDM */
333
+ filter?: Record<string, any>;
334
+ }
335
+ /** IDM directory user search results (proxied) */
336
+ export interface IDMUserSearchResponse {
337
+ /** IDM user records (Elasticsearch-hit shape) as returned by IDM */
338
+ users: any[];
339
+ /** Total matching records reported by IDM */
340
+ total: number;
341
+ }
272
342
  export interface CreateDepartmentSchema {
273
343
  /**
274
344
  * Name of the department (1-150 characters)
@@ -1041,52 +1111,47 @@ export interface PostApproveResponseSchema {
1041
1111
  /** New submission status after approval */
1042
1112
  status: string;
1043
1113
  }
1044
- export interface CreateSubmissionCodeSchema {
1114
+ export interface AttachSubmissionCodeSchema {
1045
1115
  /**
1046
- * Description of the code (1-255 characters)
1047
- * @minLength 1
1048
- * @maxLength 255
1049
- * @example "Consulting services for safety audits"
1116
+ * The submission section the code is associated with
1117
+ * @example "Service"
1050
1118
  */
1051
- description: string;
1119
+ section: AttachSubmissionCodeSchemaSectionEnum;
1120
+ /**
1121
+ * Optional note for the code association (max 500 characters)
1122
+ * @maxLength 500
1123
+ * @example "Charge 20% to this code"
1124
+ */
1125
+ note?: string;
1052
1126
  }
1053
- export interface SubmissionCodeMutationResponseSchema {
1054
- /** Code identifier */
1127
+ export interface SubmissionCodeAssociationResponseSchema {
1128
+ /** Parent submission ID */
1129
+ submissionID: string;
1130
+ /**
1131
+ * The submission section the code is associated with
1132
+ * @example "Service"
1133
+ */
1134
+ section: SubmissionCodeAssociationResponseSchemaSectionEnum;
1135
+ /** Associated catalog code ID */
1055
1136
  codeID: string;
1056
- /** Derived department ID */
1057
- departmentID: string;
1058
- /** Code description */
1059
- description: string;
1137
+ /** Note for the association, or null when unset */
1138
+ note: string | null;
1060
1139
  }
1061
- export interface UpdateSubmissionCodeSchema {
1140
+ export interface UpdateSubmissionCodeNoteSchema {
1062
1141
  /**
1063
- * Description of the code (1-255 characters)
1064
- * @minLength 1
1065
- * @maxLength 255
1066
- * @example "Consulting services for safety audits"
1142
+ * The submission section the code is associated with
1143
+ * @example "Service"
1067
1144
  */
1068
- description: string;
1145
+ section: UpdateSubmissionCodeNoteSchemaSectionEnum;
1146
+ /**
1147
+ * Optional note for the code association (max 500 characters)
1148
+ * @maxLength 500
1149
+ * @example "Charge 20% to this code"
1150
+ */
1151
+ note?: string;
1069
1152
  }
1070
- /** Deletion result (empty body) */
1153
+ /** Detach result (empty body) */
1071
1154
  export type DeleteSubmissionCodeResponseSchema = object;
1072
- export interface PutSubmissionCodesSchema {
1073
- /** Array of codes to assign to the submission sections */
1074
- codes: SubmissionCodeItemSchema[];
1075
- }
1076
- /** Code assignment result */
1077
- export interface PutSubmissionCodesResponseSchema {
1078
- /** Submission ID */
1079
- submissionID: string;
1080
- /** Assigned codes */
1081
- codes: {
1082
- /** Section (Service or Reimbursement) */
1083
- section: string;
1084
- /** Billing code ID */
1085
- codeID: string;
1086
- /** Optional note */
1087
- note: string | null;
1088
- }[];
1089
- }
1090
1155
  /** Request a presigned upload URL for a file attachment */
1091
1156
  export interface FileUploadRequestSchema {
1092
1157
  /**
@@ -1529,6 +1594,30 @@ export declare enum UpdateExpenseInputSchemaTransportationTypeEnum {
1529
1594
  Rental = "Rental",
1530
1595
  Other = "Other"
1531
1596
  }
1597
+ /**
1598
+ * The submission section the code is associated with
1599
+ * @example "Service"
1600
+ */
1601
+ export declare enum AttachSubmissionCodeSchemaSectionEnum {
1602
+ Service = "Service",
1603
+ Reimbursement = "Reimbursement"
1604
+ }
1605
+ /**
1606
+ * The submission section the code is associated with
1607
+ * @example "Service"
1608
+ */
1609
+ export declare enum SubmissionCodeAssociationResponseSchemaSectionEnum {
1610
+ Service = "Service",
1611
+ Reimbursement = "Reimbursement"
1612
+ }
1613
+ /**
1614
+ * The submission section the code is associated with
1615
+ * @example "Service"
1616
+ */
1617
+ export declare enum UpdateSubmissionCodeNoteSchemaSectionEnum {
1618
+ Service = "Service",
1619
+ Reimbursement = "Reimbursement"
1620
+ }
1532
1621
  /** Content type */
1533
1622
  export declare enum GetPdfResponseSchemaContentTypeEnum {
1534
1623
  ApplicationPdf = "application/pdf"
@@ -1540,6 +1629,12 @@ export declare enum GetPdfResponseSchemaContentTypeEnum {
1540
1629
  export declare enum GuestFileMetadataSchemaContentTypeEnum {
1541
1630
  ApplicationPdf = "application/pdf"
1542
1631
  }
1632
+ export type CreateCodeData = PostCodeResponseSchema;
1633
+ export type CreateCodeError = ErrorResponse;
1634
+ export type UpdateCodeData = PutCodeResponseSchema;
1635
+ export type UpdateCodeError = ErrorResponse;
1636
+ export type DeleteCodeData = DeleteCodeResponseSchema;
1637
+ export type DeleteCodeError = ErrorResponse;
1543
1638
  export interface ListCodesParams {
1544
1639
  /**
1545
1640
  * Filter codes by department. If omitted, all codes are returned.
@@ -1594,6 +1689,8 @@ export declare enum ListContractorsParams1TypeEnum {
1594
1689
  }
1595
1690
  export type CreateSearchResult = UserSearchResponse;
1596
1691
  export type CreateSearchFail = ErrorResponse;
1692
+ export type CreateSearchIdmData = IDMUserSearchResponse;
1693
+ export type CreateSearchIdmError = ErrorResponse;
1597
1694
  export type CreateDepartmentData = PostDepartmentResponseSchema;
1598
1695
  export type CreateDepartmentError = ErrorResponse;
1599
1696
  export type UpdateDepartmentData = PutDepartmentResponseSchema;
@@ -1653,14 +1750,53 @@ export type DeleteSubmissionData = DeleteSubmissionResponseSchema;
1653
1750
  export type DeleteSubmissionError = ErrorResponse;
1654
1751
  export type CreateApproveData = PostApproveResponseSchema;
1655
1752
  export type CreateApproveError = ErrorResponse;
1656
- export type CreateCodeData = SubmissionCodeMutationResponseSchema;
1657
- export type CreateCodeError = ErrorResponse;
1658
- export type UpdateCodeData = SubmissionCodeMutationResponseSchema;
1659
- export type UpdateCodeError = ErrorResponse;
1660
- export type DeleteCodeData = DeleteSubmissionCodeResponseSchema;
1661
- export type DeleteCodeError = ErrorResponse;
1662
- export type UpdateCodesData = PutSubmissionCodesResponseSchema;
1663
- export type UpdateCodesError = ErrorResponse;
1753
+ export type CreateCodeResult = SubmissionCodeAssociationResponseSchema;
1754
+ export type CreateCodeFail = ErrorResponse;
1755
+ export type UpdateCodeResult = SubmissionCodeAssociationResponseSchema;
1756
+ export type UpdateCodeFail = ErrorResponse;
1757
+ export interface DeleteCodeParams1 {
1758
+ /**
1759
+ * The submission section the code is associated with
1760
+ * @example "Service"
1761
+ */
1762
+ section: SectionEnum;
1763
+ /**
1764
+ * Owner user identifier (submission partition key)
1765
+ * @minLength 1
1766
+ * @example "USR-2RvYIFNJR3CrJHKO0NqgGa1EwcS"
1767
+ */
1768
+ userId: string;
1769
+ /**
1770
+ * Submission identifier
1771
+ * @minLength 1
1772
+ * @example "SUB-2RvYIFNJR3CrJHKO0NqgGa1EwcS"
1773
+ */
1774
+ submissionId: string;
1775
+ /**
1776
+ * Code identifier
1777
+ * @minLength 1
1778
+ * @example "CODE-2RvYIFNJR3CrJHKO0NqgGa1EwcS"
1779
+ */
1780
+ codeId: string;
1781
+ }
1782
+ /**
1783
+ * The submission section the code is associated with
1784
+ * @example "Service"
1785
+ */
1786
+ export declare enum SectionEnum {
1787
+ Service = "Service",
1788
+ Reimbursement = "Reimbursement"
1789
+ }
1790
+ export type DeleteCodeResult = DeleteSubmissionCodeResponseSchema;
1791
+ export type DeleteCodeFail = ErrorResponse;
1792
+ /**
1793
+ * The submission section the code is associated with
1794
+ * @example "Service"
1795
+ */
1796
+ export declare enum DeleteCodeParams2SectionEnum {
1797
+ Service = "Service",
1798
+ Reimbursement = "Reimbursement"
1799
+ }
1664
1800
  export type CreateFileData = PostFileResponseSchema;
1665
1801
  export type CreateFileError = ErrorResponse;
1666
1802
  export type GetFileData = GetFileResponseSchema;
@@ -1765,7 +1901,7 @@ export declare enum ListSubmissionsParams1TypeEnum {
1765
1901
  }
1766
1902
  export type ListExportData = GetSubmissionsExportResponseSchema;
1767
1903
  export type ListExportError = ErrorResponse;
1768
- export type CreateSearchData1 = SubmissionSearchResponse;
1904
+ export type CreateSearchResult1 = SubmissionSearchResponse;
1769
1905
  export type CreateSearchErrorData = ErrorResponse;
1770
1906
  import type { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios';
1771
1907
  export type QueryParamsType = Record<string | number, any>;
@@ -1810,11 +1946,43 @@ export declare class HttpClient<SecurityDataType = unknown> {
1810
1946
  }
1811
1947
  /**
1812
1948
  * @title Contractor Module API
1813
- * @version 1.0.18
1949
+ * @version 1.0.20
1814
1950
  * @baseUrl http://localhost:8080
1815
1951
  * @contact Ikon Integration <ikon@ikonintegration.com> (http://example.com)
1816
1952
  */
1817
1953
  export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
1954
+ code: {
1955
+ /**
1956
+ * @description Creates a new charging code associated with a department. Only Super Administrators can create codes.
1957
+ *
1958
+ * @tags Codes
1959
+ * @name CreateCode
1960
+ * @summary Create Code
1961
+ * @request POST:/code
1962
+ * @secure
1963
+ */
1964
+ createCode: (data: CreateCodeSchema, params?: RequestParams) => Promise<PostCodeResponseSchema>;
1965
+ /**
1966
+ * @description Updates an existing charging code description. Only Super Administrators can update codes.
1967
+ *
1968
+ * @tags Codes
1969
+ * @name UpdateCode
1970
+ * @summary Update Code
1971
+ * @request PUT:/code/{codeID}
1972
+ * @secure
1973
+ */
1974
+ updateCode: (codeId: string, data: UpdateCodeSchema, params?: RequestParams) => Promise<PutCodeResponseSchema>;
1975
+ /**
1976
+ * @description Deletes a charging code. Prevents deletion if the code is referenced by existing submissions. Only Super Administrators can delete codes.
1977
+ *
1978
+ * @tags Codes
1979
+ * @name DeleteCode
1980
+ * @summary Delete Code
1981
+ * @request DELETE:/code/{codeID}
1982
+ * @secure
1983
+ */
1984
+ deleteCode: (codeId: string, params?: RequestParams) => Promise<object>;
1985
+ };
1818
1986
  codes: {
1819
1987
  /**
1820
1988
  * @description Returns all codes or codes filtered by department. Administrators and above can list codes.
@@ -1900,18 +2068,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1900
2068
  * @secure
1901
2069
  */
1902
2070
  listContractors: (query: ListContractorsParams, params?: RequestParams) => Promise<GetContractorsResponseSchema>;
1903
- };
1904
- users: {
1905
2071
  /**
1906
2072
  * @description Search users by name, email, phone, role, or status.
1907
2073
  *
1908
2074
  * @tags Users
1909
2075
  * @name CreateSearch
1910
2076
  * @summary Search users
1911
- * @request POST:/users/search
2077
+ * @request POST:/contractors/search
1912
2078
  * @secure
1913
2079
  */
1914
2080
  createSearch: (data: UserSearchInput, params?: RequestParams) => Promise<UserSearchResponse>;
2081
+ /**
2082
+ * @description Search the full customer IDM user directory. Authenticated server-side with the customer IDM credentials so results are consistent for all administrators. Admin/Sysadmin only.
2083
+ *
2084
+ * @tags Users
2085
+ * @name CreateSearchIdm
2086
+ * @summary Search IDM users (directory proxy)
2087
+ * @request POST:/contractors/search/idm
2088
+ * @secure
2089
+ */
2090
+ createSearchIdm: (data: IDMUserSearchInput, params?: RequestParams) => Promise<IDMUserSearchResponse>;
1915
2091
  };
1916
2092
  department: {
1917
2093
  /**
@@ -2041,45 +2217,35 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
2041
2217
  */
2042
2218
  createApprove: (userId: string, submissionId: string, params?: RequestParams) => Promise<PostApproveResponseSchema>;
2043
2219
  /**
2044
- * @description Creates a new billing code bound to the parent submission's department. The codeID is System-generated and the departmentID is derived from the submission, so neither is taken from the request. Admin only.
2220
+ * @description Attaches an existing catalog code (addressed by codeID within the submission's department) to a submission's Service or Reimbursement section, with an optional note. Operates on the SubmissionCode association. Admin only.
2045
2221
  *
2046
2222
  * @tags Submissions
2047
2223
  * @name CreateCode
2048
- * @summary Create code on submission
2049
- * @request POST:/submission/{userID}/{submissionID}/code
2224
+ * @summary Attach a catalog code to a submission section
2225
+ * @request POST:/submission/{userID}/{submissionID}/code/{codeID}
2050
2226
  * @secure
2051
2227
  */
2052
- createCode: (userId: string, submissionId: string, data: CreateSubmissionCodeSchema, params?: RequestParams) => Promise<SubmissionCodeMutationResponseSchema>;
2228
+ createCode: (userId: string, submissionId: string, codeId: string, data: AttachSubmissionCodeSchema, params?: RequestParams) => Promise<SubmissionCodeAssociationResponseSchema>;
2053
2229
  /**
2054
- * @description Updates the description of a billing code addressed by codeID and derived from the parent submission's department. Admin only.
2230
+ * @description Updates the note of a catalog code attached to a submission's Service or Reimbursement section. Operates on the SubmissionCode association. Admin only.
2055
2231
  *
2056
2232
  * @tags Submissions
2057
2233
  * @name UpdateCode
2058
- * @summary Update a submission code
2234
+ * @summary Update an attached submission code note
2059
2235
  * @request PUT:/submission/{userID}/{submissionID}/code/{codeID}
2060
2236
  * @secure
2061
2237
  */
2062
- updateCode: (userId: string, submissionId: string, codeId: string, data: UpdateSubmissionCodeSchema, params?: RequestParams) => Promise<SubmissionCodeMutationResponseSchema>;
2238
+ updateCode: (userId: string, submissionId: string, codeId: string, data: UpdateSubmissionCodeNoteSchema, params?: RequestParams) => Promise<SubmissionCodeAssociationResponseSchema>;
2063
2239
  /**
2064
- * @description Deletes a billing code owned by the submission's department. The owning departmentID is derived from the parent submission. Fails if the code is still referenced by any submission. Admin only.
2240
+ * @description Detaches an attached catalog code (addressed by codeID) from a submission's Service or Reimbursement section, identified by the required 'section' query parameter. Operates on the SubmissionCode association. Admin only.
2065
2241
  *
2066
2242
  * @tags Submissions
2067
2243
  * @name DeleteCode
2068
- * @summary Delete a code from a submission
2244
+ * @summary Detach a catalog code from a submission section
2069
2245
  * @request DELETE:/submission/{userID}/{submissionID}/code/{codeID}
2070
2246
  * @secure
2071
2247
  */
2072
- deleteCode: (userId: string, submissionId: string, codeId: string, params?: RequestParams) => Promise<object>;
2073
- /**
2074
- * @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.
2075
- *
2076
- * @tags Submissions
2077
- * @name UpdateCodes
2078
- * @summary Assign codes to submission sections
2079
- * @request PUT:/submission/{userID}/{submissionID}/codes
2080
- * @secure
2081
- */
2082
- updateCodes: (userId: string, submissionId: string, data: PutSubmissionCodesSchema, params?: RequestParams) => Promise<PutSubmissionCodesResponseSchema>;
2248
+ deleteCode: ({ userId, submissionId, codeId, ...query }: DeleteCodeParams1, params?: RequestParams) => Promise<object>;
2083
2249
  /**
2084
2250
  * @description Validates file constraints (size, type, count) and returns a presigned IKFS URL for uploading a file attachment to a submission line item. Max 10 MB, max 5 files per line item.
2085
2251
  *
@@ -2183,7 +2349,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
2183
2349
  */
2184
2350
  listSubmissions: (query: ListSubmissionsParams, params?: RequestParams) => Promise<GetSubmissionsResponseSchema>;
2185
2351
  /**
2186
- * @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.
2352
+ * @description Generate an Excel export of submissions scoped by role. Contractors see only their own submissions. Administrators see their departments. Accountants and Super Administrators see all. Maximum 10,000 rows.
2187
2353
  *
2188
2354
  * @tags Submissions
2189
2355
  * @name ListExport