@getjones/test-infra 4.5.27 → 4.5.29
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 +18 -18
- package/src/common/commonFlows/records/records.js +44 -1
- package/src/common/requests/apiKeyAuth/requests.js +1 -0
- package/src/common/utils/objectUtils.js +28 -1
- package/src/defaults/configs/attributes.js +160 -0
- package/src/defaults/configs/auditConfigs.js +12 -9
- package/src/defaults/configs/coverage.js +7 -7
- package/src/defaults/configs/polices.js +1 -51
- package/src/defaults/configs/requirement.js +4 -2
- package/src/defaults/index.js +2 -1
- package/src/resources/coi/realCoiAlleyton.pdf +0 -0
- package/src/resources/coi/realCoiREM.pdf +0 -0
- package/src/saas/internal-api/accountDirectory/api/accountDirectory.service.js +4 -4
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.api.js +6 -0
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.service.js +6 -13
- package/src/saas/internal-api/accounts/models/settings/update.settings.model.js +4 -0
- package/src/saas/internal-api/agreement/models/createAgreementByAuditorModel.js +1 -1
- package/src/saas/internal-api/coi/api/coi.api.js +6 -0
- package/src/saas/internal-api/coi/api/coi.service.js +6 -1
- package/src/saas/internal-api/coi/utils/utils.js +4 -2
- package/src/saas/internal-api/compliance/api/audit/aiAudit/aiAudit.api.js +24 -6
- package/src/saas/internal-api/compliance/api/audit/aiAudit/aiAudit.service.js +38 -5
- package/src/saas/internal-api/outlook/api/outlook.api.js +4 -4
- package/src/saas/internal-api/outlook/api/outlook.service.js +3 -3
- package/src/saas/internal-api/requests/models/draft.request.report.model.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getjones/test-infra",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.29",
|
|
4
4
|
"description": "Providing internal and openapi interface",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,25 +10,25 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"axios": "
|
|
14
|
-
"axios-file": "
|
|
15
|
-
"chai": "
|
|
16
|
-
"dotenv": "
|
|
17
|
-
"enum": "
|
|
18
|
-
"form-data": "
|
|
19
|
-
"mocha": "
|
|
13
|
+
"axios": "1.8.1",
|
|
14
|
+
"axios-file": "1.0.17",
|
|
15
|
+
"chai": "4.3.4",
|
|
16
|
+
"dotenv": "16.5.0",
|
|
17
|
+
"enum": "3.0.4",
|
|
18
|
+
"form-data": "4.0.0",
|
|
19
|
+
"mocha": "8.3.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@babel/core": "
|
|
23
|
-
"@babel/eslint-parser": "
|
|
24
|
-
"@babel/preset-env": "
|
|
25
|
-
"@eslint/compat": "
|
|
26
|
-
"@eslint/eslintrc": "
|
|
27
|
-
"@eslint/js": "
|
|
28
|
-
"eslint": "
|
|
29
|
-
"eslint-plugin-import": "
|
|
30
|
-
"globals": "
|
|
31
|
-
"mocha-spec-json-output-reporter": "
|
|
22
|
+
"@babel/core": "7.26.9",
|
|
23
|
+
"@babel/eslint-parser": "7.26.8",
|
|
24
|
+
"@babel/preset-env": "7.26.9",
|
|
25
|
+
"@eslint/compat": "1.2.7",
|
|
26
|
+
"@eslint/eslintrc": "3.3.0",
|
|
27
|
+
"@eslint/js": "9.21.0",
|
|
28
|
+
"eslint": "9.21.0",
|
|
29
|
+
"eslint-plugin-import": "2.31.0",
|
|
30
|
+
"globals": "16.0.0",
|
|
31
|
+
"mocha-spec-json-output-reporter": "1.1.7"
|
|
32
32
|
},
|
|
33
33
|
"directories": {
|
|
34
34
|
"test": "tests"
|
|
@@ -6,11 +6,12 @@ const httpResponseStatusCodes = require('../../../common/httpResponseStatusCodes
|
|
|
6
6
|
const ocrStatuses = require('../../consts/ocrStatuses');
|
|
7
7
|
const contractors = require('../../../saas/internal-api/contractors');
|
|
8
8
|
const compliance = require('../../../saas/internal-api/compliance');
|
|
9
|
+
const aiAuditApi = require('../../../saas/internal-api/compliance/api/audit/aiAudit/aiAudit.api');
|
|
9
10
|
const requests = require('../../../saas/internal-api/requests');
|
|
10
11
|
const dbEmails = require('../../../saas/internal-api/dbEmails');
|
|
11
12
|
const activationStatuses = require('../../../common/consts/activationStatuses');
|
|
12
13
|
const recordTypes = require('../../../common/consts/recordTypes');
|
|
13
|
-
const
|
|
14
|
+
const policyNames = require('../../../defaults/index').polices;
|
|
14
15
|
|
|
15
16
|
const makeRecordNotResponsive = async function(recordId, context) {
|
|
16
17
|
const { data: record } = await contractors.services.getContractorById(recordId, context);
|
|
@@ -208,6 +209,47 @@ const waitForOcrStatus = async function(recordId, context, { expectedStatus = oc
|
|
|
208
209
|
}
|
|
209
210
|
};
|
|
210
211
|
|
|
212
|
+
const waitForAiAnalysisStatus = async (recordId, context, { expectedStatus = ocrStatuses.SUCCESS, isCheckPreviousCoi = false } = {}) => {
|
|
213
|
+
const timeout = expectedStatus === ocrStatuses.IN_PROGRESS ? 1 : 5;
|
|
214
|
+
let retries = 20;
|
|
215
|
+
let isExpectedStatus = false;
|
|
216
|
+
|
|
217
|
+
do {
|
|
218
|
+
await timeUtils.waitFor(timeout).seconds;
|
|
219
|
+
const aiAnalysisResponse = await aiAuditApi.getAiAnalysisStatus(recordId, context);
|
|
220
|
+
const { status: httpStatus, data } = aiAnalysisResponse;
|
|
221
|
+
|
|
222
|
+
const isNotFoundStatus = httpStatus === httpResponseStatusCodes.NOT_FOUND;
|
|
223
|
+
const isExpectingNoAnalysis = expectedStatus === ocrStatuses.UNKNOWN;
|
|
224
|
+
|
|
225
|
+
if (isNotFoundStatus) {
|
|
226
|
+
const hasExpectedMessage = data.message?.includes('COI AI analysis status not found for record ID');
|
|
227
|
+
|
|
228
|
+
if (isExpectingNoAnalysis && hasExpectedMessage) {
|
|
229
|
+
isExpectedStatus = true;
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
} else {
|
|
233
|
+
if (isExpectingNoAnalysis) {
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const [latestAnalysis, previousAnalysis] = data;
|
|
238
|
+
const isLatestMatch = latestAnalysis?.status === expectedStatus;
|
|
239
|
+
const isPreviousMatch = isCheckPreviousCoi ? previousAnalysis?.status === expectedStatus : true;
|
|
240
|
+
|
|
241
|
+
if (isLatestMatch && isPreviousMatch) {
|
|
242
|
+
isExpectedStatus = true;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
} while (--retries);
|
|
247
|
+
|
|
248
|
+
if (!isExpectedStatus) {
|
|
249
|
+
throw new Error(`AI analysis status not as expected. Expected: ${expectedStatus}`);
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
|
|
211
253
|
const deleteAllRequestsInProject = async function(accountId, projectId, context) {
|
|
212
254
|
const activationStatus = [activationStatuses.ACTIVE, activationStatuses.ARCHIVED, activationStatuses.DRAFT];
|
|
213
255
|
const { data: requestsInAccount } = await requests.services.getRequestsByAccountId(accountId, context, activationStatus);
|
|
@@ -258,6 +300,7 @@ module.exports = {
|
|
|
258
300
|
getLatestHistoryEventId,
|
|
259
301
|
updateLastInviteActionDate,
|
|
260
302
|
waitForOcrStatus,
|
|
303
|
+
waitForAiAnalysisStatus,
|
|
261
304
|
generateSubscriptionModelFromMail,
|
|
262
305
|
deleteAllRequestsInProject,
|
|
263
306
|
getLatestRecordHistoryEventIdByItemTitle,
|
|
@@ -2,6 +2,33 @@ const cloneObject = object => {
|
|
|
2
2
|
return JSON.parse(JSON.stringify(object));
|
|
3
3
|
};
|
|
4
4
|
|
|
5
|
+
function removeObjectKeys(obj, keysToRemove) {
|
|
6
|
+
if (Array.isArray(obj)) {
|
|
7
|
+
return obj.map(item => removeObjectKeys(item, keysToRemove));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const newObj = {};
|
|
15
|
+
for (const key of Object.keys(obj)) {
|
|
16
|
+
if (!keysToRemove.includes(key)) {
|
|
17
|
+
newObj[key] = removeObjectKeys(obj[key], keysToRemove);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return newObj;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const removeNullValuesFromObject = obj => {
|
|
25
|
+
return JSON.parse(
|
|
26
|
+
JSON.stringify(obj, (key, value) => (value === null ? undefined : value))
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
5
30
|
module.exports = {
|
|
6
|
-
cloneObject
|
|
31
|
+
cloneObject,
|
|
32
|
+
removeObjectKeys,
|
|
33
|
+
removeNullValuesFromObject
|
|
7
34
|
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
generalLiability: {
|
|
3
|
+
eachOccurrence: 'Each Occurrence',
|
|
4
|
+
generalAggregate: 'General Aggregate',
|
|
5
|
+
personalAdvertisingInjury: 'Personal & Advertising Injury',
|
|
6
|
+
medicalExpenses: 'Medical Expenses',
|
|
7
|
+
damageToRentedPremises: 'Damage to Rented Premises',
|
|
8
|
+
primaryNonContributoryProvision: 'Primary Non-Contributory Provision',
|
|
9
|
+
primaryNonContributoryEndorsement: 'Primary Non-Contributory Endorsement',
|
|
10
|
+
waiverOfSubrogation: 'Waiver of Subrogation',
|
|
11
|
+
waiverOfSubrogationEndorsement: 'Waiver of Subrogation Endorsement',
|
|
12
|
+
additionalInsuredEndorsement: 'Additional Insured Endorsement',
|
|
13
|
+
perProjectAggregateLimit: 'Per Project Aggregate Limit',
|
|
14
|
+
blanketAdditionalInsuredEndorsement: 'Blanket Additional Insured Endorsement',
|
|
15
|
+
crossLiability: 'Cross Liability',
|
|
16
|
+
noticeOfCancellation: 'Notice of Cancellation',
|
|
17
|
+
noticeOfCancellationEndorsement: 'Notice of Cancellation Endorsement',
|
|
18
|
+
occurrenceBasis: 'Occurrence Basis',
|
|
19
|
+
perLocationAggregate: 'Per Location Aggregate',
|
|
20
|
+
perLocationAggregateEndorsement: 'Per Location Aggregate Endorsement',
|
|
21
|
+
perProjectAggregate: 'Per Project Aggregate',
|
|
22
|
+
perProjectAggregateEndorsement: 'Per Project Aggregate Endorsement',
|
|
23
|
+
productsCompletedOperations: 'Products/Completed Operations Aggregate',
|
|
24
|
+
additionalInsuredEntityNamesExplicitly: 'Additional Insured Entity Names Explicitly Listed on Endorsement',
|
|
25
|
+
additionalInsuredOngoingOperations: 'Additional Insured Endorsement Covering Ongoing Operations (CG 2010 or equivalent)',
|
|
26
|
+
additionalInsuredCompletedOperations: 'Additional Insured Endorsement Covering Completed Operations (CG 2037 or equivalent)',
|
|
27
|
+
liabilityAmountPerLeaseRequirement: 'Liability Amount Per Lease Requirement',
|
|
28
|
+
contractualLiability: 'Contractual Liability',
|
|
29
|
+
productsCompletedOperationsPerOccurrence: 'Products/Completed Operations Per Occurrence',
|
|
30
|
+
bodilyInjuryPerOccurrence: 'Bodily Injury Per Occurrence',
|
|
31
|
+
propertyDamagePerOccurrence: 'Property Damage Per Occurrence',
|
|
32
|
+
additionalInsuredManagersOrLessors: 'Additional Insured Endorsement for Managers or Lessors of Premises'
|
|
33
|
+
},
|
|
34
|
+
umbrella: {
|
|
35
|
+
eachOccurrence: 'Each Occurrence',
|
|
36
|
+
additionalInsuredEndorsement: 'Additional Insured Endorsement',
|
|
37
|
+
followsForm: 'Follows Form',
|
|
38
|
+
followFormEndorsement: 'Follow-Form Endorsement',
|
|
39
|
+
occurrenceBasis: 'Occurrence Basis',
|
|
40
|
+
primaryNonContributoryEndorsement: 'Primary Non-Contributory Endorsement',
|
|
41
|
+
primaryNonContributoryProvision: 'Primary Non-Contributory Provision',
|
|
42
|
+
waiverOfSubrogation: 'Waiver of Subrogation',
|
|
43
|
+
waiverOfSubrogationEndorsement: 'Waiver of Subrogation Endorsement'
|
|
44
|
+
},
|
|
45
|
+
professionalLiability: {
|
|
46
|
+
eachOccurrence: 'Each Occurrence',
|
|
47
|
+
generalAggregate: 'General Aggregate'
|
|
48
|
+
},
|
|
49
|
+
environmentalLiability: {
|
|
50
|
+
eachOccurrence: 'Each Occurrence',
|
|
51
|
+
generalAggregate: 'General Aggregate'
|
|
52
|
+
},
|
|
53
|
+
liquorLiability: {
|
|
54
|
+
eachClaim: 'Each Claim',
|
|
55
|
+
generalAggregate: 'General Aggregate'
|
|
56
|
+
},
|
|
57
|
+
garageLiability: {
|
|
58
|
+
eachAccident: 'Each Accident',
|
|
59
|
+
aggregate: 'Aggregate'
|
|
60
|
+
},
|
|
61
|
+
garageKeepersLiability: {
|
|
62
|
+
eachOccurrence: 'Each Occurrence'
|
|
63
|
+
},
|
|
64
|
+
workersCompensation: {
|
|
65
|
+
eachAccident: 'Employer’s Liability Each Accident',
|
|
66
|
+
diseaseEachEmployee: 'Employer’s Liability Disease - Each Employee',
|
|
67
|
+
diseasePolicyLimit: 'Employer’s Liability Disease - Policy Limit',
|
|
68
|
+
statutoryLimitsRequired: 'Statutory Limits Required',
|
|
69
|
+
waiverOfSubrogation: 'Waiver of Subrogation',
|
|
70
|
+
waiverOfSubrogationEndorsement: 'Waiver of Subrogation Endorsement'
|
|
71
|
+
},
|
|
72
|
+
automobileLiability: {
|
|
73
|
+
combinedSingleLimit: 'Combined Single Limit',
|
|
74
|
+
including: 'Including',
|
|
75
|
+
anyAuto: 'Any Auto',
|
|
76
|
+
scheduled: 'Scheduled',
|
|
77
|
+
waiverOfSubrogation: 'Waiver of Subrogation',
|
|
78
|
+
waiverOfSubrogationEndorsement: 'Waiver of Subrogation Endorsement',
|
|
79
|
+
additionalOngoingOperations: 'Additional Insured Endorsement Covering Ongoing Operations',
|
|
80
|
+
additionalCompletedOperations: 'Additional Insured Endorsement Covering Completed Operations',
|
|
81
|
+
additionalInsuredEndorsement: 'Additional Insured Endorsement',
|
|
82
|
+
primaryNonContributoryProvision: 'Primary Non-Contributory Provision',
|
|
83
|
+
primaryNonContributoryEndorsement: 'Primary Non-Contributory Endorsement'
|
|
84
|
+
},
|
|
85
|
+
propertyInsurance: {
|
|
86
|
+
personalProperty: 'Personal Property',
|
|
87
|
+
realProperty: 'Real Property / Building Limit',
|
|
88
|
+
specialFormProperty: 'Special Form Property',
|
|
89
|
+
replacementCost: 'Replacement Cost',
|
|
90
|
+
earthquakeSprinklerLeakageCoverage: 'Earthquake Sprinkler Leakage Coverage',
|
|
91
|
+
businessPersonalPropertyLimit: 'Business Personal Property Limit',
|
|
92
|
+
inlandMarineToolsEquipment: 'Inland Marine / Tools & Equipment',
|
|
93
|
+
businessInterruptionIncomeInsurance: 'Business Interruption / Income Insurance',
|
|
94
|
+
businessInterruptionInsurance12Months: 'Business Interruption Insurance - 12 months',
|
|
95
|
+
businessInterruptionInsurance6Months: 'Business Interruption Insurance - 6 months',
|
|
96
|
+
boilerMachineryEquipmentBreakdownInsurance: 'Boiler & Machinery / Equipment Breakdown Insurance',
|
|
97
|
+
buildersRiskInsurance: 'Builder’s Risk Insurance',
|
|
98
|
+
plateGlassInsurance: 'Plate Glass Insurance',
|
|
99
|
+
earthquakeInsurance: 'Earthquake Insurance',
|
|
100
|
+
floodInsurance: 'Flood Insurance',
|
|
101
|
+
terrorismInsurance: 'Terrorism Insurance'
|
|
102
|
+
},
|
|
103
|
+
rentedLeasedEquipment: {
|
|
104
|
+
eachOccurrence: 'Each Occurrence'
|
|
105
|
+
},
|
|
106
|
+
fidelityCrime: {
|
|
107
|
+
clientProperty: 'Client Property'
|
|
108
|
+
},
|
|
109
|
+
employmentPracticesLiability: {
|
|
110
|
+
eachClaim: 'Each Claim',
|
|
111
|
+
generalAggregate: 'General Aggregate'
|
|
112
|
+
},
|
|
113
|
+
directorsAndOfficersLiability: {
|
|
114
|
+
eachClaim: 'Each Claim',
|
|
115
|
+
generalAggregate: 'General Aggregate'
|
|
116
|
+
},
|
|
117
|
+
cyberLiability: {
|
|
118
|
+
eachClaim: 'Each Claim',
|
|
119
|
+
aggregate: 'Aggregate'
|
|
120
|
+
},
|
|
121
|
+
businessInterruptionIncomeInsurance: {
|
|
122
|
+
Limit: 'Limit',
|
|
123
|
+
indemnityPeriod: 'Indemnity Period',
|
|
124
|
+
actualLossSustained: 'Actual Loss Sustained',
|
|
125
|
+
extraExpense: 'Extra Expense'
|
|
126
|
+
},
|
|
127
|
+
common: {
|
|
128
|
+
amBestRating: 'AM Best Rating',
|
|
129
|
+
amBestFinancialSizeCategory: 'AM Best Financial Size Category',
|
|
130
|
+
eachOccurrence: 'Each Occurrence',
|
|
131
|
+
occur: 'Occur',
|
|
132
|
+
aggregate: 'Aggregate',
|
|
133
|
+
generalAggregate: 'General Aggregate',
|
|
134
|
+
eachClaim: 'Each Claim',
|
|
135
|
+
fullPolicyCopy: 'Full Policy Copy',
|
|
136
|
+
text: 'text',
|
|
137
|
+
boolean: 'boolean'
|
|
138
|
+
},
|
|
139
|
+
audit: {
|
|
140
|
+
coverageExists: 'Coverage Exists',
|
|
141
|
+
policyNumber: 'Policy Number',
|
|
142
|
+
policyExpiry: 'Policy Expiry',
|
|
143
|
+
perOccur: 'Per Occur',
|
|
144
|
+
perPolicy: 'Per Policy',
|
|
145
|
+
perProject: 'Per Project',
|
|
146
|
+
perLocation: 'Per Location',
|
|
147
|
+
occur: 'Occur',
|
|
148
|
+
policyState: 'Policy State',
|
|
149
|
+
insuredAddress: 'Insured Address',
|
|
150
|
+
insuredName: 'Insured Name',
|
|
151
|
+
InsuredDBA: 'Insured DBA',
|
|
152
|
+
coiAuthentication: 'COI authentication',
|
|
153
|
+
cancellationTerms: 'Cancellation Terms',
|
|
154
|
+
certificateIssueDate: 'Certificate issue date',
|
|
155
|
+
signature: 'Signature',
|
|
156
|
+
amScore: 'AM Score',
|
|
157
|
+
other: 'Other',
|
|
158
|
+
multiple: 'multiple'
|
|
159
|
+
}
|
|
160
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const policyNames = require('./polices');
|
|
2
|
+
const attributeNames = require('./attributes');
|
|
3
|
+
|
|
2
4
|
const { cloneObject } = require('../../common/utils/objectUtils');
|
|
3
5
|
const { getOneWeekAgoDate, getOneWeekAheadDate } = require('../../common/utils/timeUtils');
|
|
4
6
|
|
|
@@ -18,19 +20,20 @@ const {
|
|
|
18
20
|
const {
|
|
19
21
|
coverageExists,
|
|
20
22
|
policyNumber,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
policyExpiry,
|
|
24
|
+
perOccur,
|
|
23
25
|
perPolicy,
|
|
24
26
|
perProject,
|
|
25
27
|
perLocation,
|
|
26
|
-
eachOccurrence,
|
|
27
28
|
cancellationTerms,
|
|
28
29
|
coiAuthentication,
|
|
29
30
|
signature,
|
|
30
31
|
amScore,
|
|
31
32
|
insuredAddress,
|
|
32
33
|
insuredName
|
|
33
|
-
} = attributeNames;
|
|
34
|
+
} = attributeNames.audit;
|
|
35
|
+
|
|
36
|
+
const { eachOccurrence } = attributeNames.common;
|
|
34
37
|
|
|
35
38
|
const policySelections = {
|
|
36
39
|
YES: 'Yes',
|
|
@@ -48,8 +51,8 @@ const getCompliantAuditConfig = ({ glPolicyNumber = DEFAULT_POLICY_NUMBER } = {}
|
|
|
48
51
|
[generalLiability]: {
|
|
49
52
|
[coverageExists]: policySelections.YES,
|
|
50
53
|
[policyNumber]: glPolicyNumber,
|
|
51
|
-
[
|
|
52
|
-
[
|
|
54
|
+
[policyExpiry]: `${DEFAULT_POLICY_DATE}`,
|
|
55
|
+
[perOccur]: policySelections.YES,
|
|
53
56
|
[perPolicy]: policySelections.YES,
|
|
54
57
|
[perProject]: policySelections.YES,
|
|
55
58
|
[perLocation]: policySelections.YES,
|
|
@@ -103,10 +106,10 @@ const getExpiredConfig = ({ glPolicyNumber } = {}) => {
|
|
|
103
106
|
};
|
|
104
107
|
|
|
105
108
|
const setAboutExpiredConfig = config =>
|
|
106
|
-
config[generalLiability][
|
|
109
|
+
config[generalLiability][policyExpiry] = `${getOneWeekAheadDate()}`;
|
|
107
110
|
|
|
108
111
|
const setExpiredConfig = config =>
|
|
109
|
-
config[generalLiability][
|
|
112
|
+
config[generalLiability][policyExpiry] = `${getOneWeekAgoDate()}`;
|
|
110
113
|
|
|
111
114
|
module.exports = {
|
|
112
115
|
getCompliantAuditConfig,
|
|
@@ -4,7 +4,7 @@ const defaultExpiryDate = '2030-10-10T00:00:00.000Z';
|
|
|
4
4
|
const defaultEffectiveDate = '2020-10-10T00:00:00.000Z';
|
|
5
5
|
|
|
6
6
|
const policiesCoverageConfig = {
|
|
7
|
-
[policies.
|
|
7
|
+
[policies.generalLiability]: {
|
|
8
8
|
key: 'generalLiability',
|
|
9
9
|
policyEntities: [
|
|
10
10
|
{
|
|
@@ -21,7 +21,7 @@ const policiesCoverageConfig = {
|
|
|
21
21
|
],
|
|
22
22
|
provisions: []
|
|
23
23
|
},
|
|
24
|
-
[policies.
|
|
24
|
+
[policies.automobileLiability]: {
|
|
25
25
|
key: 'automobileLiability',
|
|
26
26
|
policyEntities: [
|
|
27
27
|
{
|
|
@@ -38,7 +38,7 @@ const policiesCoverageConfig = {
|
|
|
38
38
|
],
|
|
39
39
|
provisions: []
|
|
40
40
|
},
|
|
41
|
-
[policies.
|
|
41
|
+
[policies.excessLiability]: {
|
|
42
42
|
key: 'excessLiability',
|
|
43
43
|
policyEntities: [
|
|
44
44
|
{
|
|
@@ -50,7 +50,7 @@ const policiesCoverageConfig = {
|
|
|
50
50
|
limits: [],
|
|
51
51
|
provisions: []
|
|
52
52
|
},
|
|
53
|
-
[policies.
|
|
53
|
+
[policies.umbrella]: {
|
|
54
54
|
key: 'umbrellaLiability',
|
|
55
55
|
policyEntities: [
|
|
56
56
|
{
|
|
@@ -67,7 +67,7 @@ const policiesCoverageConfig = {
|
|
|
67
67
|
],
|
|
68
68
|
provisions: []
|
|
69
69
|
},
|
|
70
|
-
[policies.
|
|
70
|
+
[policies.workersCompensation]: {
|
|
71
71
|
key: 'workersCompensation',
|
|
72
72
|
policyEntities: [
|
|
73
73
|
{
|
|
@@ -84,7 +84,7 @@ const policiesCoverageConfig = {
|
|
|
84
84
|
],
|
|
85
85
|
provisions: []
|
|
86
86
|
},
|
|
87
|
-
[policies.
|
|
87
|
+
[policies.fidelityCrime]: {
|
|
88
88
|
key: 'fidelityCrime',
|
|
89
89
|
policyEntities: [
|
|
90
90
|
{
|
|
@@ -102,7 +102,7 @@ const policiesCoverageConfig = {
|
|
|
102
102
|
provisions: [
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
|
-
[policies.
|
|
105
|
+
[policies.cyberLiability]: {
|
|
106
106
|
key: 'cyberLiability',
|
|
107
107
|
policyEntities: [
|
|
108
108
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
module.exports = {
|
|
2
2
|
certificateOfInsurance: 'Certificate of Insurance',
|
|
3
3
|
certificateIssueDate: 'Certificate issue date',
|
|
4
4
|
generalLiability: 'General Liability',
|
|
@@ -24,53 +24,3 @@ const policyNames = {
|
|
|
24
24
|
additionalInsured: 'Additional Insured',
|
|
25
25
|
businessInterruptionIncomeInsurance: 'Business Interruption / Income Insurance'
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
const attributeNames = {
|
|
29
|
-
insuredAddress: 'Insured Address',
|
|
30
|
-
insuredName: 'Insured Name',
|
|
31
|
-
amScore: 'AM Score',
|
|
32
|
-
cancellationTerms: 'Cancellation Terms',
|
|
33
|
-
coiAuthentication: 'COI authentication',
|
|
34
|
-
signature: 'Signature',
|
|
35
|
-
coverageExists: 'Coverage Exists',
|
|
36
|
-
policyNumber: 'Policy Number',
|
|
37
|
-
policyExpired: 'Policy Expiry',
|
|
38
|
-
perOccurrence: 'Per Occur',
|
|
39
|
-
perPolicy: 'Per Policy',
|
|
40
|
-
perProject: 'Per Project',
|
|
41
|
-
perLocation: 'Per Location',
|
|
42
|
-
eachOccurrence: 'Each Occurrence',
|
|
43
|
-
generalAggregate: 'General Aggregate',
|
|
44
|
-
noticeOfCancelation: 'Notice of Cancellation',
|
|
45
|
-
noticeOfCancelationEndorsement: 'Notice of Cancellation Endorsement',
|
|
46
|
-
occurrenceBasis: 'Occurrence Basis',
|
|
47
|
-
perProjectAggregate: 'Per Project Aggregate',
|
|
48
|
-
occur: 'Occur',
|
|
49
|
-
text: 'text',
|
|
50
|
-
boolean: 'boolean',
|
|
51
|
-
limit: 'limit',
|
|
52
|
-
additionalInsuredEndorsement: 'Additional Insured Endorsement',
|
|
53
|
-
primaryNonContributoryProvision: 'Primary Non-Contributory Provision',
|
|
54
|
-
primaryNonContributoryEndorsement: 'Primary Non-Contributory Endorsement',
|
|
55
|
-
indemnityPeriod: 'Indemnity Period',
|
|
56
|
-
actualLossSustained: 'Actual Loss Sustained',
|
|
57
|
-
extraExpense: 'Extra Expense',
|
|
58
|
-
combinedSingleLimit: 'Combined Single Limit',
|
|
59
|
-
followsForm: 'Follows Form',
|
|
60
|
-
followFormEndorsement: 'Follow-Form Endorsement',
|
|
61
|
-
waiverOfSubrogation: 'Waiver of Subrogation',
|
|
62
|
-
waiverOfSubrogationEndorsement: 'Waiver of Subrogation Endorsement',
|
|
63
|
-
amBestRating: 'AM Best Rating',
|
|
64
|
-
amBestFinancialSizeCategory: 'AM Best Financial Size Category',
|
|
65
|
-
additionalInsuredEndorsementCoveringOngoingOperations: 'Additional Insured Endorsement Covering Ongoing Operations',
|
|
66
|
-
anyAuto: 'Any Auto',
|
|
67
|
-
scheduled: 'Scheduled',
|
|
68
|
-
multiple: 'multiple',
|
|
69
|
-
other: 'Other',
|
|
70
|
-
fullPolicyCopy: 'Full Policy Copy'
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
module.exports = {
|
|
74
|
-
policyNames,
|
|
75
|
-
attributeNames
|
|
76
|
-
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const policyNames = require('../configs/polices');
|
|
2
|
+
const attributeNames = require('../configs/attributes');
|
|
3
|
+
|
|
2
4
|
const { cloneObject } = require('../../common/utils/objectUtils');
|
|
3
5
|
|
|
4
|
-
const { eachOccurrence } = attributeNames;
|
|
6
|
+
const { eachOccurrence } = attributeNames.common;
|
|
5
7
|
const { generalLiability } = policyNames;
|
|
6
8
|
|
|
7
9
|
const { REQUIREMENT_SHARING_LEVELS } = require('../../saas/internal-api/requirements/consts/consts');
|
package/src/defaults/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const audit = require('./configs/auditConfigs');
|
|
2
2
|
const polices = require('./configs/polices');
|
|
3
|
+
const attributes = require('./configs/attributes');
|
|
3
4
|
const requirement = require('./configs/requirement');
|
|
4
5
|
const coverage = require('./configs/coverage');
|
|
5
6
|
|
|
6
|
-
module.exports = { audit, polices, requirement, coverage };
|
|
7
|
+
module.exports = { audit, polices, attributes, requirement, coverage };
|
|
Binary file
|
|
Binary file
|
|
@@ -131,12 +131,12 @@ const getRequestActivityCountByModel = async (accountDirectoryRequestTableFilter
|
|
|
131
131
|
return activityCountResponse.data;
|
|
132
132
|
};
|
|
133
133
|
|
|
134
|
-
const getRecordDetailsByModel = async (accountDirectoryRequestTableFilterModel, context) => {
|
|
134
|
+
const getRecordDetailsByModel = async (accountDirectoryRequestTableFilterModel, expectError, context) => {
|
|
135
135
|
validateType(accountDirectoryRequestTableFilterModel, accountDirectoryModels.AccountDirectoryRequestTableFilterModel);
|
|
136
136
|
|
|
137
137
|
const recordDetailsResponse = await accountDirectoryAPI.getRecordDetails(accountDirectoryRequestTableFilterModel, context);
|
|
138
138
|
|
|
139
|
-
if (recordDetailsResponse.status !== httpResponseStatusCodes.OK) {
|
|
139
|
+
if (recordDetailsResponse.status !== httpResponseStatusCodes.OK && !expectError) {
|
|
140
140
|
throw Error(`Failed to get record details. Status code: ${recordDetailsResponse.status}`);
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -155,7 +155,7 @@ const getRequestActivityCount = (accountId, context, { globalRecordId, recordId,
|
|
|
155
155
|
return getRequestActivityCountByModel(accountDirectoryRequestTableFilterModel, context, { expectError });
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
-
const getRecordDetails = (accountId, context, { globalRecordId, recordId } = {}) => {
|
|
158
|
+
const getRecordDetails = (accountId, context, { globalRecordId, recordId } = {}, expectError) => {
|
|
159
159
|
const accountDirectoryRequestTableFilterModel = new accountDirectoryModels.AccountDirectoryRequestTableFilterModel(
|
|
160
160
|
{
|
|
161
161
|
accountId,
|
|
@@ -163,7 +163,7 @@ const getRecordDetails = (accountId, context, { globalRecordId, recordId } = {})
|
|
|
163
163
|
recordId
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
-
return getRecordDetailsByModel(accountDirectoryRequestTableFilterModel, context);
|
|
166
|
+
return getRecordDetailsByModel(accountDirectoryRequestTableFilterModel, expectError, context);
|
|
167
167
|
};
|
|
168
168
|
|
|
169
169
|
module.exports = {
|
|
@@ -4,6 +4,7 @@ const { backendUrl } = require('../../../../../env').getEnv();
|
|
|
4
4
|
const Endpoints = {
|
|
5
5
|
createApiKey: `${backendUrl}/saas/integration-tests/api-keys`,
|
|
6
6
|
getStaticApiKeyByAccountId: accountId => `${backendUrl}/saas/integration-tests/accounts/${accountId}/static-api-keys`,
|
|
7
|
+
getOrCreateStaticApiKeyByAccountId: accountId => `${backendUrl}/saas/integration-tests/accounts/${accountId}/static-api-keys`,
|
|
7
8
|
getApiKeyByKeyValue: `${backendUrl}/saas/integration-tests/api-keys`,
|
|
8
9
|
removeStaticApiKey: accountId => `${backendUrl}/saas/integration-tests/accounts/${accountId}/static-api-keys`,
|
|
9
10
|
dynamicApiKey: accountId => `${backendUrl}/saas/integration-tests/accounts/${accountId}/dynamic-api-key`
|
|
@@ -21,6 +22,10 @@ const getStaticApiKeyByAccountId = (accountId, context) => {
|
|
|
21
22
|
return requests.getRequestHandler(Endpoints.getStaticApiKeyByAccountId(accountId), {}, context);
|
|
22
23
|
};
|
|
23
24
|
|
|
25
|
+
const getOrCreateStaticApiKeyByAccountId = (accountId, apiKeyValue, context) => {
|
|
26
|
+
return requests.postRequestHandler(Endpoints.getOrCreateStaticApiKeyByAccountId(accountId), { apiKeyValue }, context);
|
|
27
|
+
};
|
|
28
|
+
|
|
24
29
|
const getApiKeyDetails = (apiKeyValue, context) => {
|
|
25
30
|
return requests.getRequestHandler(Endpoints.getApiKeyByKeyValue, { apiKeyValue }, context);
|
|
26
31
|
};
|
|
@@ -41,6 +46,7 @@ module.exports = {
|
|
|
41
46
|
createStaticApiKey,
|
|
42
47
|
createGeneratorApiKey,
|
|
43
48
|
getStaticApiKeyByAccountId,
|
|
49
|
+
getOrCreateStaticApiKeyByAccountId,
|
|
44
50
|
getApiKeyDetails,
|
|
45
51
|
makeDynamicApiKeyExpired,
|
|
46
52
|
deleteStaticApiKey,
|
|
@@ -19,6 +19,10 @@ const getStaticApiKeyByAccountId = async (accountId, context) => {
|
|
|
19
19
|
return accountsAPI.getStaticApiKeyByAccountId(accountId, context);
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
const getOrCreateStaticApiKeyByAccountId = async (accountId, apiKeyValue, context) => {
|
|
23
|
+
return accountsAPI.getOrCreateStaticApiKeyByAccountId(accountId, apiKeyValue, context);
|
|
24
|
+
};
|
|
25
|
+
|
|
22
26
|
const getApiKeyDetails = async (apiKeyValue, context) => {
|
|
23
27
|
return accountsAPI.getApiKeyDetails(apiKeyValue, context);
|
|
24
28
|
};
|
|
@@ -27,19 +31,8 @@ const deleteStaticApiKey = async (accountId, context) => {
|
|
|
27
31
|
return accountsAPI.deleteStaticApiKey(accountId, context);
|
|
28
32
|
};
|
|
29
33
|
|
|
30
|
-
const getOrCreateStaticApiKey = async (accountId, apiKeyValue, context
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (response.data.apiKeyValue) {
|
|
34
|
-
return response.data;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
response = await getApiKeyDetails(apiKeyValue, context);
|
|
38
|
-
|
|
39
|
-
if (!response.data.apiKeyValue) {
|
|
40
|
-
response = await createStaticApiKey(accountId, apiKeyValue, context, { apiKeyType, apiKeyName });
|
|
41
|
-
}
|
|
42
|
-
|
|
34
|
+
const getOrCreateStaticApiKey = async (accountId, apiKeyValue, context) => {
|
|
35
|
+
const response = await getOrCreateStaticApiKeyByAccountId(accountId, apiKeyValue, context);
|
|
43
36
|
return response.data;
|
|
44
37
|
};
|
|
45
38
|
|
|
@@ -9,6 +9,8 @@ class UpdateAccountSettingsModel {
|
|
|
9
9
|
isExcludedFromNetwork = false,
|
|
10
10
|
isOcrEnabled = false,
|
|
11
11
|
isAuditingAiEnabled = false,
|
|
12
|
+
isCoiSnapshotAiEnabled = false,
|
|
13
|
+
isComplianceSnapshotAiEnabled = false,
|
|
12
14
|
isCoverageAudit = false,
|
|
13
15
|
isAccountRequirementsEnabled = false,
|
|
14
16
|
isAccountRequirementsAutoRenewalsEnabled = false,
|
|
@@ -28,6 +30,8 @@ class UpdateAccountSettingsModel {
|
|
|
28
30
|
this.isExcludedFromNetwork = isExcludedFromNetwork;
|
|
29
31
|
this.isOcrEnabled = isOcrEnabled;
|
|
30
32
|
this.isAuditingAiEnabled = isAuditingAiEnabled;
|
|
33
|
+
this.isCoiSnapshotAiEnabled = isCoiSnapshotAiEnabled;
|
|
34
|
+
this.isComplianceSnapshotAiEnabled = isComplianceSnapshotAiEnabled;
|
|
31
35
|
this.isCoverageAudit = isCoverageAudit;
|
|
32
36
|
this.isAccountRequirementsEnabled = isAccountRequirementsEnabled;
|
|
33
37
|
this.isAccountRequirementsAutoRenewalsEnabled = isAccountRequirementsAutoRenewalsEnabled;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const policyNames = require('../../../../defaults/configs/polices');
|
|
2
2
|
|
|
3
3
|
class CreateAgreementByAuditorModel {
|
|
4
4
|
constructor({ contractorId, fileName, fileType = 'contract', auditName = policyNames.agreement }) {
|
|
@@ -11,6 +11,7 @@ const Endpoints = {
|
|
|
11
11
|
getCoiPresignedUrl: fileName => `${backendUrl}/saas/coi/${fileName}`,
|
|
12
12
|
getCoiPresignedUrlBeforeMerge: fileId => `${backendUrl}/saas/coi-file-before-merge/presigned-url/${fileId}`,
|
|
13
13
|
getCoiHashes: recordId => `${backendUrl}/jcsc/record/${recordId}/coi/hashes`,
|
|
14
|
+
getCombinedCoiByRecordId: recordId => `${backendUrl}/saas/record/${recordId}/coi/combined-coi-mapping`,
|
|
14
15
|
combineLastTwoCOIs: `${backendUrl}/saas/auditor/record/coi/merge-last-two`
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -43,6 +44,10 @@ const getCoiHashes = recordId => {
|
|
|
43
44
|
return internalRequests.getRequestHandler(Endpoints.getCoiHashes(recordId));
|
|
44
45
|
};
|
|
45
46
|
|
|
47
|
+
const getCombinedCoiByRecordId = (recordId, context) => {
|
|
48
|
+
return requests.getRequestHandler(Endpoints.getCombinedCoiByRecordId(recordId), {}, context);
|
|
49
|
+
};
|
|
50
|
+
|
|
46
51
|
const combineLastTwoCOIs = (combineLastTwoCOIsModel, context) => {
|
|
47
52
|
return requests.postRequestHandler(Endpoints.combineLastTwoCOIs, combineLastTwoCOIsModel, context);
|
|
48
53
|
};
|
|
@@ -54,5 +59,6 @@ module.exports = {
|
|
|
54
59
|
getCoiPreSignedUrl,
|
|
55
60
|
getCoiPresignedUrlBeforeMerge,
|
|
56
61
|
getCoiHashes,
|
|
62
|
+
getCombinedCoiByRecordId,
|
|
57
63
|
combineLastTwoCOIs
|
|
58
64
|
};
|
|
@@ -50,6 +50,10 @@ const combineLastTwoCOIs = async (combineLastTwoCOIsModel, auditorContext) => {
|
|
|
50
50
|
return response;
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
+
const getCombinedCoiByRecordId = (recordId, context) => {
|
|
54
|
+
return coiApi.getCombinedCoiByRecordId(recordId, context);
|
|
55
|
+
};
|
|
56
|
+
|
|
53
57
|
module.exports = {
|
|
54
58
|
uploadToS3,
|
|
55
59
|
submitCoi,
|
|
@@ -57,5 +61,6 @@ module.exports = {
|
|
|
57
61
|
getCoiPresignedUrlBeforeMerge,
|
|
58
62
|
completeScan,
|
|
59
63
|
getCoiHashes,
|
|
60
|
-
combineLastTwoCOIs
|
|
64
|
+
combineLastTwoCOIs,
|
|
65
|
+
getCombinedCoiByRecordId
|
|
61
66
|
};
|
|
@@ -92,7 +92,8 @@ const combineLastTwoCOIs = async ({
|
|
|
92
92
|
uploaderEmail,
|
|
93
93
|
isContractorExist,
|
|
94
94
|
icsContext,
|
|
95
|
-
auditorContext
|
|
95
|
+
auditorContext,
|
|
96
|
+
isNewCoiOnTop
|
|
96
97
|
}) => {
|
|
97
98
|
const recordResponse = await getContractorById(recordId, icsContext);
|
|
98
99
|
const recordDateModified = recordResponse.data.dateModified;
|
|
@@ -103,7 +104,8 @@ const combineLastTwoCOIs = async ({
|
|
|
103
104
|
uploadedBy,
|
|
104
105
|
uploaderEmail,
|
|
105
106
|
recordDateModified,
|
|
106
|
-
isContractorExist
|
|
107
|
+
isContractorExist,
|
|
108
|
+
isNewCoiOnTop
|
|
107
109
|
});
|
|
108
110
|
return services.combineLastTwoCOIs(combineLastTwoCOIsModel, auditorContext);
|
|
109
111
|
};
|
|
@@ -3,13 +3,16 @@ const requests = require('../../../../../../common/requests/cookieAuth/requests'
|
|
|
3
3
|
const { nodeBackendUrl, backendUrl } = require('../../../../../../env').getEnv();
|
|
4
4
|
|
|
5
5
|
const Endpoints = {
|
|
6
|
-
|
|
6
|
+
getAiAnalysisResult: (uniqueCoiId, requirementsId) => `${nodeBackendUrl}/compliance/ai/analysis-results/${uniqueCoiId}/${requirementsId}`,
|
|
7
7
|
getComparisonAlgorithmResultsIos: `${nodeBackendUrl}/compliance/comparison-algorithm-results`,
|
|
8
|
-
getAiAnalysisStatus: recordId => `${backendUrl}/saas/record/${recordId}/coi/ai-analysis-status
|
|
8
|
+
getAiAnalysisStatus: recordId => `${backendUrl}/saas/record/${recordId}/coi/ai-analysis-status`,
|
|
9
|
+
getAcord25ByAiAnalysis: uniqueCoiId => `${nodeBackendUrl}/compliance/ai/analysis/acord25/${uniqueCoiId}`,
|
|
10
|
+
getAuxiliaryDataByAiAnalysis: uniqueCoiId => `${nodeBackendUrl}/compliance/auxiliary-data/from/coi-analysis/${uniqueCoiId}`,
|
|
11
|
+
getOcrByRecordIdAiAnalysis: recordId => `${backendUrl}/jcsc/record/${recordId}/ocr`
|
|
9
12
|
};
|
|
10
13
|
|
|
11
|
-
const
|
|
12
|
-
return internalRequests.getRequestHandler(Endpoints.
|
|
14
|
+
const getAiAnalysisResult = (uniqueCoiId, requirementsId) => {
|
|
15
|
+
return internalRequests.getRequestHandler(Endpoints.getAiAnalysisResult(uniqueCoiId, requirementsId));
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
const getComparisonAlgorithmResultsIos = (data, context) => {
|
|
@@ -20,8 +23,23 @@ const getAiAnalysisStatus = (recordId, context) => {
|
|
|
20
23
|
return requests.getRequestHandler(Endpoints.getAiAnalysisStatus(recordId), {}, context);
|
|
21
24
|
};
|
|
22
25
|
|
|
26
|
+
const getAcord25ByAiAnalysis = uniqueCoiId => {
|
|
27
|
+
return internalRequests.getRequestHandler(Endpoints.getAcord25ByAiAnalysis(uniqueCoiId));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getAuxiliaryDataByAiAnalysis = uniqueCoiId => {
|
|
31
|
+
return internalRequests.getRequestHandler(Endpoints.getAuxiliaryDataByAiAnalysis(uniqueCoiId));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const getOcrByRecordIdAiAnalysis = recordId => {
|
|
35
|
+
return internalRequests.getRequestHandler(Endpoints.getOcrByRecordIdAiAnalysis(recordId));
|
|
36
|
+
};
|
|
37
|
+
|
|
23
38
|
module.exports = {
|
|
24
39
|
getComparisonAlgorithmResultsIos,
|
|
25
|
-
|
|
26
|
-
getAiAnalysisStatus
|
|
40
|
+
getAiAnalysisResult,
|
|
41
|
+
getAiAnalysisStatus,
|
|
42
|
+
getAcord25ByAiAnalysis,
|
|
43
|
+
getAuxiliaryDataByAiAnalysis,
|
|
44
|
+
getOcrByRecordIdAiAnalysis
|
|
27
45
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const aiAuditApi = require('./aiAudit.api');
|
|
2
2
|
const httpResponseStatusCodes = require('../../../../../../common/httpResponseStatusCodes.json');
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
const response = await aiAuditApi.
|
|
4
|
+
const getAiAnalysisResult = async (uniqueCoiId, requirementsId) => {
|
|
5
|
+
const response = await aiAuditApi.getAiAnalysisResult(uniqueCoiId, requirementsId);
|
|
6
6
|
|
|
7
7
|
if (response.status !== httpResponseStatusCodes.OK) {
|
|
8
|
-
throw Error(`Failed to get AI
|
|
8
|
+
throw Error(`Failed to get AI analysis result with code: ${response.status}`);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
return response.data;
|
|
@@ -31,8 +31,41 @@ const getAiAnalysisStatus = async (recordId, context) => {
|
|
|
31
31
|
return response.data;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
const getAcord25ByAiAnalysis = async uniqueCoiId => {
|
|
35
|
+
const response = await aiAuditApi.getAcord25ByAiAnalysis(uniqueCoiId);
|
|
36
|
+
|
|
37
|
+
if (response.status !== httpResponseStatusCodes.OK) {
|
|
38
|
+
throw Error(`Failed to get Acord 25 using Ai with code: ${response.status}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return response.data;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const getAuxiliaryDataByAiAnalysis = async uniqueCoiId => {
|
|
45
|
+
const response = await aiAuditApi.getAuxiliaryDataByAiAnalysis(uniqueCoiId);
|
|
46
|
+
|
|
47
|
+
if (response.status !== httpResponseStatusCodes.OK) {
|
|
48
|
+
throw Error(`Failed to get aux data using Ai with code: ${response.status}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return response.data;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const getOcrByRecordIdAiAnalysis = async recordId => {
|
|
55
|
+
const response = await aiAuditApi.getOcrByRecordIdAiAnalysis(recordId);
|
|
56
|
+
|
|
57
|
+
if (response.status !== httpResponseStatusCodes.OK) {
|
|
58
|
+
throw Error(`Failed to get OCR using Ai with code: ${response.status}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return response.data;
|
|
62
|
+
};
|
|
63
|
+
|
|
34
64
|
module.exports = {
|
|
35
|
-
|
|
65
|
+
getAiAnalysisResult,
|
|
36
66
|
getComparisonAlgorithmResultsIos,
|
|
37
|
-
getAiAnalysisStatus
|
|
67
|
+
getAiAnalysisStatus,
|
|
68
|
+
getAcord25ByAiAnalysis,
|
|
69
|
+
getAuxiliaryDataByAiAnalysis,
|
|
70
|
+
getOcrByRecordIdAiAnalysis
|
|
38
71
|
};
|
|
@@ -2,13 +2,13 @@ const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
|
2
2
|
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
3
|
|
|
4
4
|
const Endpoints = {
|
|
5
|
-
|
|
5
|
+
getRequestIdByRecordIdBase64: base64RecordId => `${backendUrl}/secured/outlook/record/${base64RecordId}/compliance-report`
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
return requests.getRequestHandler(Endpoints.
|
|
8
|
+
const getRequestIdByRecordIdBase64 = async (base64RecordId, context) => {
|
|
9
|
+
return requests.getRequestHandler(Endpoints.getRequestIdByRecordIdBase64(base64RecordId), {}, context);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
module.exports = {
|
|
13
|
-
|
|
13
|
+
getRequestIdByRecordIdBase64
|
|
14
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const vendorProfileApi = require('./outlook.api');
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
return vendorProfileApi.
|
|
3
|
+
const getRequestIdByRecordIdBase64 = async (base64RecordId, context) => {
|
|
4
|
+
return vendorProfileApi.getRequestIdByRecordIdBase64(base64RecordId, context);
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
const generateRecordIdBase64 = recordId => {
|
|
@@ -9,6 +9,6 @@ const generateRecordIdBase64 = recordId => {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
module.exports = {
|
|
12
|
-
|
|
12
|
+
getRequestIdByRecordIdBase64,
|
|
13
13
|
generateRecordIdBase64
|
|
14
14
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class DraftRequestReportModel {
|
|
2
|
-
constructor(requestId, { emailAddress, selectedRequirementsId, additionalEmails, recordDateModified, overrideDateModified } = {}) {
|
|
2
|
+
constructor(requestId, { emailAddress = '', selectedRequirementsId, additionalEmails = [], recordDateModified, overrideDateModified } = {}) {
|
|
3
3
|
this.requestId = requestId;
|
|
4
4
|
this.emailAddress = emailAddress;
|
|
5
5
|
this.selectedRequirementsId = selectedRequirementsId;
|