@getjones/test-infra 4.5.7 → 4.5.8
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/package.json +1 -1
- package/src/common/consts/accountSettings.js +25 -3
- package/src/common/consts/homepage/AttentionTab.js +2 -1
- package/src/common/utils/complianceUtil.js +2 -2
- package/src/saas/internal-api/accounts/utils/utils.js +1 -2
- package/src/saas/internal-api/compliance/api/audit/audit.api.js +8 -8
- package/src/saas/internal-api/compliance/api/audit/audit.service.js +24 -15
- package/src/saas/internal-api/requests/api/requests.api.js +8 -2
- package/src/saas/internal-api/requests/api/requests.service.js +12 -1
package/package.json
CHANGED
|
@@ -11,8 +11,30 @@ module.exports = {
|
|
|
11
11
|
on: { hasPolicyVerification: true },
|
|
12
12
|
off: { hasPolicyVerification: false }
|
|
13
13
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
integrations: {
|
|
15
|
+
vendorsAndTenantsON: {
|
|
16
|
+
integrations: {
|
|
17
|
+
isVendorIntegrationsEnabled: true,
|
|
18
|
+
isTenantIntegrationsEnabled: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
vendorsAndTenantsOFF: {
|
|
22
|
+
integrations: {
|
|
23
|
+
isVendorIntegrationsEnabled: false,
|
|
24
|
+
isTenantIntegrationsEnabled: false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
vendorsON: {
|
|
28
|
+
integrations: {
|
|
29
|
+
isVendorIntegrationsEnabled: true,
|
|
30
|
+
isTenantIntegrationsEnabled: false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
tenantsON: {
|
|
34
|
+
integrations: {
|
|
35
|
+
isVendorIntegrationsEnabled: false,
|
|
36
|
+
isTenantIntegrationsEnabled: true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
17
39
|
}
|
|
18
40
|
};
|
|
@@ -50,14 +50,14 @@ const prepareMetadataForAudit = async (
|
|
|
50
50
|
const isReauditResponse = await isReaudit(recordId, auditorContext);
|
|
51
51
|
metadata.isReaudit = isReauditResponse.data.isReaudit;
|
|
52
52
|
|
|
53
|
+
const enterAuditResponse = await auditApi.enterAudit(recordId, auditorContext); //moved up here
|
|
54
|
+
|
|
53
55
|
const recordDetailsResponse = await auditApi.getAuditRecordModel(recordId, auditorContext);
|
|
54
56
|
const recordDetails = recordDetailsResponse.data;
|
|
55
57
|
|
|
56
58
|
const auditResponse = await auditApi.getAuditMetadata(recordDetails.auditId, auditorContext);
|
|
57
59
|
const { currentAudit } = auditResponse.data;
|
|
58
60
|
|
|
59
|
-
const enterAuditResponse = await auditApi.enterAudit(recordId, auditorContext);
|
|
60
|
-
|
|
61
61
|
metadata.certificateId = recordDetails.certificateDetails.certificateuploadId;
|
|
62
62
|
metadata.auditDates = {
|
|
63
63
|
contractorId: recordId,
|
|
@@ -56,6 +56,5 @@ const attributesConvertor = {
|
|
|
56
56
|
'Coverage Auditing': 'isCoverageAudit',
|
|
57
57
|
'Account Requirements': 'isAccountRequirementsEnabled',
|
|
58
58
|
'Skip 50 miles autocomplete limitation': 'isWithoutAutocompleteDistanceLimitation',
|
|
59
|
-
'Policy Verification': 'hasPolicyVerification'
|
|
60
|
-
'Auditing AI Enabled': 'isAuditingAiEnabled'
|
|
59
|
+
'Policy Verification': 'hasPolicyVerification'
|
|
61
60
|
};
|
|
@@ -20,13 +20,13 @@ const Endpoints = {
|
|
|
20
20
|
auditRawData: recordId => `${backendUrl}/saas/integration-tests/record/${recordId}/audit/raw`
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const audit = async (contractorId, auditRequestModel, context) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
23
|
+
// const audit = async (contractorId, auditRequestModel, context) => {
|
|
24
|
+
// await enterAudit(contractorId, context);
|
|
25
|
+
// const auditResponse = await getAuditMetadata(auditRequestModel.auditId, context);
|
|
26
|
+
// const { currentAudit } = auditResponse.data;
|
|
27
|
+
// auditRequestModel.auditDates.auditDateModified = currentAudit.dateModified;
|
|
28
|
+
// return submitAudit(auditRequestModel, context);
|
|
29
|
+
// };
|
|
30
30
|
|
|
31
31
|
const submitAudit = async (auditRequestModel, context) => {
|
|
32
32
|
return requests.postRequestHandler(Endpoints.audit, auditRequestModel, context);
|
|
@@ -95,7 +95,7 @@ const getAuditRawData = (recordId, context) => {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
module.exports = {
|
|
98
|
-
audit,
|
|
98
|
+
// audit,
|
|
99
99
|
submitAudit,
|
|
100
100
|
revertCoi,
|
|
101
101
|
wrongCoi,
|
|
@@ -7,10 +7,11 @@ const { cloneObject } = require('../../../../../common/utils/objectUtils');
|
|
|
7
7
|
const complianceUtil = require('../../../../../common/utils/complianceUtil');
|
|
8
8
|
const httpResponseStatusCodes = require('../../../../../common/httpResponseStatusCodes.json');
|
|
9
9
|
|
|
10
|
-
const audit = (auditRequestModel, context) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
// const audit = (auditRequestModel, context) => {
|
|
11
|
+
// validateType(auditRequestModel, AuditRequestModel);
|
|
12
|
+
// // return auditApi.audit(auditRequestModel.auditData.contractorId, auditRequestModel, context);
|
|
13
|
+
// return auditApi.submitAudit(auditRequestModel, context); //switched to this
|
|
14
|
+
// };
|
|
14
15
|
|
|
15
16
|
const submitAudit = (auditRequestModel, context) => {
|
|
16
17
|
validateType(auditRequestModel, AuditRequestModel);
|
|
@@ -35,24 +36,31 @@ const getAuditorContractorList = (auditListParametersModel, context) => {
|
|
|
35
36
|
return auditApi.getAuditorContractorList(auditListParametersModel, context);
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
const getAuditRequestModelAfterEnterAudit = async (
|
|
39
|
+
const getAuditRequestModelAfterEnterAudit = async (accountId, projectId, requirementId, recordId, auditConfig, context) => {
|
|
39
40
|
const metadata = await prepareMetadataForAudit(context, accountId, projectId, requirementId, recordId);
|
|
40
|
-
const auditEntities = await getAuditEntities(recordId,
|
|
41
|
+
const auditEntities = await getAuditEntities(recordId, auditConfig, context);
|
|
41
42
|
const auditRequestModel = getAuditRequestModel(metadata, auditEntities);
|
|
42
43
|
|
|
43
44
|
return auditRequestModel;
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
const enterAudit = async (recordId, context, {
|
|
47
|
-
|
|
47
|
+
const enterAudit = async (recordId, context, { shouldGetAuditRequestModelAfterEnterAudit, auditConfig, accountId, projectId, requirementId } = {}) => {
|
|
48
|
+
// const enterAudit = async (recordId, context, { auditConfigForModelAfterEnterAudit, accountId, projectId, requirementId } = {}) => {
|
|
49
|
+
if (shouldGetAuditRequestModelAfterEnterAudit) {
|
|
50
|
+
return getAuditRequestModelAfterEnterAudit(accountId, projectId, requirementId, recordId, auditConfig, context);
|
|
51
|
+
} else {
|
|
52
|
+
const enterAuditResponse = await auditApi.enterAudit(recordId, context);
|
|
53
|
+
|
|
54
|
+
if (enterAuditResponse.status !== httpResponseStatusCodes.OK) {
|
|
55
|
+
throw Error(`Failed to enter audit\n$response - ${enterAuditResponse.status}\n${JSON.stringify(enterAuditResponse.data)}`);
|
|
56
|
+
}
|
|
48
57
|
|
|
49
|
-
|
|
50
|
-
throw Error(`Failed to enter audit\n$response - ${enterAuditResponse.status}\n${JSON.stringify(enterAuditResponse.data)}`);
|
|
58
|
+
return enterAuditResponse;
|
|
51
59
|
}
|
|
52
60
|
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
// return auditConfig ?
|
|
62
|
+
// getAuditRequestModelAfterEnterAudit(auditConfig, accountId, projectId, requirementId, recordId, context) :
|
|
63
|
+
// enterAuditResponse;
|
|
56
64
|
};
|
|
57
65
|
|
|
58
66
|
const getAuditRecordModel = (recordId, context) => {
|
|
@@ -180,7 +188,8 @@ const auditRecord = async function(
|
|
|
180
188
|
const auditEntities = await getAuditEntities(recordId, auditApiConfig, auditorContext);
|
|
181
189
|
const auditRequestModel = getAuditRequestModel(auditMetadata, auditEntities);
|
|
182
190
|
|
|
183
|
-
const auditResponse = await
|
|
191
|
+
const auditResponse = await submitAudit(auditRequestModel, auditorContext); // switched to this
|
|
192
|
+
// const auditResponse = await audit(auditRequestModel, auditorContext);
|
|
184
193
|
return auditResponse;
|
|
185
194
|
};
|
|
186
195
|
|
|
@@ -272,7 +281,7 @@ const getAttributeKey = attributeName => {
|
|
|
272
281
|
};
|
|
273
282
|
|
|
274
283
|
module.exports = {
|
|
275
|
-
audit,
|
|
284
|
+
// audit,
|
|
276
285
|
submitAudit,
|
|
277
286
|
revertCoi,
|
|
278
287
|
isReaudit,
|
|
@@ -21,7 +21,8 @@ const Endpoints = {
|
|
|
21
21
|
homePageRequestsCount: `${backendUrl}/saas/requests/homepage/count`,
|
|
22
22
|
draftFilterCounters: tabId => `${backendUrl}/saas/tab/${tabId}/requests/draft/filter/counter`,
|
|
23
23
|
activityStatusCounter: tabId => `${backendUrl}/saas/tab/${tabId}/requests/activity-status/count`,
|
|
24
|
-
requestsCounters: tabId => `${backendUrl}/saas/tab/${tabId}/requests/counters
|
|
24
|
+
requestsCounters: tabId => `${backendUrl}/saas/tab/${tabId}/requests/counters`,
|
|
25
|
+
showIntegrations: `${backendUrl}/saas/requests/homepage/show-integrations`
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
const createRequest = (createRequestModel, context) => {
|
|
@@ -83,6 +84,10 @@ const getHomePageRequests = (requestListCriteriaModel, context) => {
|
|
|
83
84
|
return requests.postRequestHandler(Endpoints.homePageRequests, requestListCriteriaModel, context);
|
|
84
85
|
};
|
|
85
86
|
|
|
87
|
+
const isIntegrationsEnabled = context => {
|
|
88
|
+
return requests.getRequestHandler(Endpoints.showIntegrations, {}, context);
|
|
89
|
+
};
|
|
90
|
+
|
|
86
91
|
const getHomePageRequestsCount = context => {
|
|
87
92
|
return requests.getRequestHandler(Endpoints.homePageRequestsCount, {}, context);
|
|
88
93
|
};
|
|
@@ -122,5 +127,6 @@ module.exports = {
|
|
|
122
127
|
getDraftRequestList,
|
|
123
128
|
getDraftFilterCountersByTabId,
|
|
124
129
|
getActivityStatusCounterByTabId,
|
|
125
|
-
getRequestsCountersByTabId
|
|
130
|
+
getRequestsCountersByTabId,
|
|
131
|
+
isIntegrationsEnabled
|
|
126
132
|
};
|
|
@@ -270,6 +270,16 @@ const getRequestsCountersByTabId = async (tabId, context) => {
|
|
|
270
270
|
return response.data;
|
|
271
271
|
};
|
|
272
272
|
|
|
273
|
+
const isIntegrationsEnabled = async context => {
|
|
274
|
+
const response = await requestsAPI.isIntegrationsEnabled(context);
|
|
275
|
+
|
|
276
|
+
if (response.status !== httpResponseStatusCodes.OK) {
|
|
277
|
+
throw Error(`Failed to get the integrations enable status - ${response.status}`);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return response.data;
|
|
281
|
+
};
|
|
282
|
+
|
|
273
283
|
module.exports = {
|
|
274
284
|
createRequest,
|
|
275
285
|
getAutocompleteAutoSelect,
|
|
@@ -297,5 +307,6 @@ module.exports = {
|
|
|
297
307
|
getDraftRequestListByTabId,
|
|
298
308
|
getDraftFilterCountersByTabId,
|
|
299
309
|
getActivityStatusCounterByTabId,
|
|
300
|
-
getRequestsCountersByTabId
|
|
310
|
+
getRequestsCountersByTabId,
|
|
311
|
+
isIntegrationsEnabled
|
|
301
312
|
};
|