@getjones/test-infra 4.5.23 → 4.5.25
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 +36 -30
- package/src/common/commonFlows/auth/auth.js +40 -40
- package/src/common/commonFlows/index.js +4 -4
- package/src/common/commonFlows/records/records.js +269 -269
- package/src/common/consts/accountSettings.js +44 -44
- package/src/common/consts/activationStatuses.js +6 -6
- package/src/common/consts/autocomplete.js +10 -10
- package/src/common/consts/constantsForRecordsSortingAndFilters.js +49 -49
- package/src/common/consts/dashboardCharts.js +18 -18
- package/src/common/consts/homepage/AttentionTab.js +6 -6
- package/src/common/consts/homepage/sortOptions.js +19 -19
- package/src/common/consts/ocrStatuses.js +6 -6
- package/src/common/consts/projectSettings.js +21 -21
- package/src/common/consts/recordTypes.js +5 -5
- package/src/common/consts/requirementActions.js +10 -10
- package/src/common/consts/s3FileTypes.js +13 -13
- package/src/common/consts/userRoles.js +18 -18
- package/src/common/consts/userTypes.js +8 -8
- package/src/common/errorCodes.js +3 -3
- package/src/common/httpResponseStatusCodes.json +11 -11
- package/src/common/httpResponseTypes.json +2 -2
- package/src/common/requests/apiKeyAuth/requests.js +44 -44
- package/src/common/requests/cookieAuth/requests.js +40 -40
- package/src/common/requests/internalAuth/requests.js +48 -48
- package/src/common/requests/requestHandlers.js +80 -80
- package/src/common/utils/complianceUtil.js +113 -113
- package/src/common/utils/configsUtil.js +22 -22
- package/src/common/utils/dataTypeUtils.js +41 -41
- package/src/common/utils/numberUtils.js +22 -22
- package/src/common/utils/objectUtils.js +7 -7
- package/src/common/utils/timeUtils.js +177 -177
- package/src/common/validations/errorValidation.js +16 -16
- package/src/common/validations/typeValidations.js +36 -36
- package/src/defaults/configs/auditConfigs.js +125 -125
- package/src/defaults/configs/coverage.js +144 -144
- package/src/defaults/configs/polices.js +76 -76
- package/src/defaults/configs/requirement.js +32 -32
- package/src/defaults/index.js +6 -6
- package/src/env.js +57 -57
- package/src/factory/globalRecord/globalRecord.js +43 -43
- package/src/factory/index.js +8 -8
- package/src/factory/records/records.js +281 -281
- package/src/factory/users/users.js +69 -69
- package/src/index.js +105 -103
- package/src/saas/internal-api/accountDirectory/api/accountDirectory.api.js +50 -50
- package/src/saas/internal-api/accountDirectory/api/accountDirectory.service.js +182 -182
- package/src/saas/internal-api/accountDirectory/index.js +4 -4
- package/src/saas/internal-api/accountDirectory/models/accountDirectory.model.js +40 -40
- package/src/saas/internal-api/accounts/api/core/accounts.core.api.js +35 -35
- package/src/saas/internal-api/accounts/api/core/accounts.core.service.js +93 -93
- package/src/saas/internal-api/accounts/api/emailCustomization/accounts.email.customizations.api.js +29 -29
- package/src/saas/internal-api/accounts/api/emailCustomization/accounts.email.customizations.service.js +61 -61
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.api.js +48 -48
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.service.js +74 -74
- package/src/saas/internal-api/accounts/api/settings/settings.api.js +21 -21
- package/src/saas/internal-api/accounts/api/settings/settings.service.js +41 -41
- package/src/saas/internal-api/accounts/consts/consts.js +8 -8
- package/src/saas/internal-api/accounts/index.js +22 -22
- package/src/saas/internal-api/accounts/models/core/create.account.model.js +16 -16
- package/src/saas/internal-api/accounts/models/settings/update.settings.model.js +53 -53
- package/src/saas/internal-api/accounts/utils/utils.js +61 -61
- package/src/saas/internal-api/agreement/api/agreement.api.js +39 -39
- package/src/saas/internal-api/agreement/api/agreement.service.js +121 -121
- package/src/saas/internal-api/agreement/consts/consts.js +11 -11
- package/src/saas/internal-api/agreement/index.js +12 -12
- package/src/saas/internal-api/agreement/models/create.agreement.model.js +12 -12
- package/src/saas/internal-api/agreement/models/createAgreementByAuditorModel.js +11 -11
- package/src/saas/internal-api/agreement/models/createAgreementByPMModel.js +13 -13
- package/src/saas/internal-api/auditCustomerRules/api/customer.rules.api.js +43 -43
- package/src/saas/internal-api/auditCustomerRules/api/customer.rules.service.js +105 -105
- package/src/saas/internal-api/auditCustomerRules/consts/customer.rule.js +11 -11
- package/src/saas/internal-api/auditCustomerRules/index.js +6 -6
- package/src/saas/internal-api/auditCustomerRules/models/customer.rule.model.js +46 -46
- package/src/saas/internal-api/auditCustomerRules/utils/customer.rule.util.js +19 -19
- package/src/saas/internal-api/auditNotes/api/audit.notes.api.js +40 -40
- package/src/saas/internal-api/auditNotes/api/audit.notes.service.js +115 -115
- package/src/saas/internal-api/auditNotes/index.js +4 -4
- package/src/saas/internal-api/auditNotes/models/audit.note.model.js +30 -30
- package/src/saas/internal-api/auth/api/auth.api.js +27 -27
- package/src/saas/internal-api/auth/api/auth.service.js +90 -90
- package/src/saas/internal-api/auth/index.js +3 -3
- package/src/saas/internal-api/coi/api/coi.api.js +58 -58
- package/src/saas/internal-api/coi/api/coi.service.js +61 -61
- package/src/saas/internal-api/coi/consts/hashes.js +5 -5
- package/src/saas/internal-api/coi/consts/uploaderTypes.js +5 -5
- package/src/saas/internal-api/coi/index.js +14 -14
- package/src/saas/internal-api/coi/models/Combine.last.two.cois.model.js +25 -25
- package/src/saas/internal-api/coi/models/submit.coi.model.js +19 -19
- package/src/saas/internal-api/coi/utils/utils.js +117 -117
- package/src/saas/internal-api/compliance/api/amBestRating/am.best.rating.api.js +12 -12
- package/src/saas/internal-api/compliance/api/amBestRating/am.best.rating.service.js +14 -14
- package/src/saas/internal-api/compliance/api/audit/aiAudit/aiAudit.api.js +27 -27
- package/src/saas/internal-api/compliance/api/audit/aiAudit/aiAudit.service.js +38 -38
- package/src/saas/internal-api/compliance/api/audit/audit.api.js +112 -112
- package/src/saas/internal-api/compliance/api/audit/audit.service.js +319 -319
- package/src/saas/internal-api/compliance/api/convert/convert.api.js +17 -17
- package/src/saas/internal-api/compliance/api/convert/convert.service.js +11 -11
- package/src/saas/internal-api/compliance/api/coverage/coverage.api.js +33 -33
- package/src/saas/internal-api/compliance/api/coverage/coverage.service.js +46 -46
- package/src/saas/internal-api/compliance/api/overrideGap/override.gap.api.js +38 -38
- package/src/saas/internal-api/compliance/api/overrideGap/override.gap.service.js +189 -189
- package/src/saas/internal-api/compliance/consts/audit.js +113 -113
- package/src/saas/internal-api/compliance/index.js +38 -38
- package/src/saas/internal-api/compliance/models/audit/audit.model.js +96 -96
- package/src/saas/internal-api/compliance/models/waive/waive.model.js +49 -49
- package/src/saas/internal-api/compliance/utils/auditUtil.js +269 -269
- package/src/saas/internal-api/compliance/utils/coverageUtil.js +45 -45
- package/src/saas/internal-api/contractors/api/contractors.api.js +209 -209
- package/src/saas/internal-api/contractors/api/contractors.service.js +361 -361
- package/src/saas/internal-api/contractors/consts/consts.js +6 -6
- package/src/saas/internal-api/contractors/index.js +8 -8
- package/src/saas/internal-api/contractors/models/assign.requirement.model.js +10 -10
- package/src/saas/internal-api/contractors/models/edit.contractor.model.js +73 -73
- package/src/saas/internal-api/contractors/models/link.request.model.js +10 -10
- package/src/saas/internal-api/contractors/models/subscription.contractor.model.js +13 -13
- package/src/saas/internal-api/contractors/models/verification.contractor.model.js +27 -27
- package/src/saas/internal-api/contractors/utils.js +25 -25
- package/src/saas/internal-api/dashboard/api/recordList.api.js +38 -38
- package/src/saas/internal-api/dashboard/api/recordList.service.js +60 -60
- package/src/saas/internal-api/dashboard/index.js +5 -5
- package/src/saas/internal-api/dashboard/models/dashboard.filter.criteria.model.js +38 -38
- package/src/saas/internal-api/dbEmails/api/db.emails.api.js +25 -25
- package/src/saas/internal-api/dbEmails/api/db.emails.service.js +163 -156
- package/src/saas/internal-api/dbEmails/consts/consts.js +56 -56
- package/src/saas/internal-api/dbEmails/index.js +6 -6
- package/src/saas/internal-api/dbEmails/models/db.emails.model.js +22 -22
- package/src/saas/internal-api/dbEmails/utils/util.js +87 -87
- package/src/saas/internal-api/emailCustomization/api/email.customization.api.js +26 -26
- package/src/saas/internal-api/emailCustomization/api/email.customization.service.js +50 -50
- package/src/saas/internal-api/emailCustomization/index.js +3 -3
- package/src/saas/internal-api/globalRecord/api/global.record.api.js +95 -95
- package/src/saas/internal-api/globalRecord/api/global.record.service.js +112 -112
- package/src/saas/internal-api/globalRecord/consts.js +20 -20
- package/src/saas/internal-api/globalRecord/index.js +6 -6
- package/src/saas/internal-api/globalRecord/models/global.record.model.js +60 -60
- package/src/saas/internal-api/globalRecord/utils/util.js +161 -161
- package/src/saas/internal-api/homepageCharts/api/charts.api.js +12 -12
- package/src/saas/internal-api/homepageCharts/api/charts.service.js +7 -7
- package/src/saas/internal-api/homepageCharts/index.js +3 -3
- package/src/saas/internal-api/jonesNetworkTab/api/jones.network.tab.api.js +14 -14
- package/src/saas/internal-api/jonesNetworkTab/api/jones.network.tab.service.js +16 -16
- package/src/saas/internal-api/jonesNetworkTab/index.js +3 -3
- package/src/saas/internal-api/notificationCenter/api/notification.center.api.js +32 -32
- package/src/saas/internal-api/notificationCenter/api/notification.center.service.js +49 -49
- package/src/saas/internal-api/notificationCenter/index.js +3 -3
- package/src/saas/internal-api/outlook/api/outlook.api.js +14 -0
- package/src/saas/internal-api/outlook/api/outlook.service.js +14 -0
- package/src/saas/internal-api/outlook/index.js +3 -0
- package/src/saas/internal-api/policyFile/api/policy.file.api.js +43 -43
- package/src/saas/internal-api/policyFile/api/policy.file.service.js +117 -117
- package/src/saas/internal-api/policyFile/consts.js +21 -21
- package/src/saas/internal-api/policyFile/index.js +11 -11
- package/src/saas/internal-api/policyFile/models/create.policy.file.model.js +11 -11
- package/src/saas/internal-api/policyFile/models/set.publish.flag.to.policy.model.js +13 -13
- package/src/saas/internal-api/projects/api/core/projects.api.js +39 -39
- package/src/saas/internal-api/projects/api/core/projects.service.js +77 -77
- package/src/saas/internal-api/projects/api/settings/project.settings.api.js +18 -18
- package/src/saas/internal-api/projects/api/settings/project.settings.service.js +35 -35
- package/src/saas/internal-api/projects/consts/defaultProject.js +3 -3
- package/src/saas/internal-api/projects/index.js +24 -24
- package/src/saas/internal-api/projects/models/core/create.project.model.js +41 -41
- package/src/saas/internal-api/projects/models/core/update.project.model.js +47 -47
- package/src/saas/internal-api/projects/models/settings/update.project.settings.model.js +40 -40
- package/src/saas/internal-api/projects/utils/utils.js +155 -155
- package/src/saas/internal-api/recordHub/api/record.hub.api.js +14 -14
- package/src/saas/internal-api/recordHub/api/record.hub.service.js +32 -32
- package/src/saas/internal-api/recordHub/index.js +3 -3
- package/src/saas/internal-api/recordNotes/api/record.notes.api.js +38 -38
- package/src/saas/internal-api/recordNotes/api/record.notes.service.js +56 -56
- package/src/saas/internal-api/recordNotes/api/record.notes.utils.js +12 -12
- package/src/saas/internal-api/recordNotes/index.js +3 -3
- package/src/saas/internal-api/reports/api/reports.api.js +62 -62
- package/src/saas/internal-api/reports/api/reports.service.js +79 -79
- package/src/saas/internal-api/reports/consts/consts.js +74 -74
- package/src/saas/internal-api/reports/index.js +15 -15
- package/src/saas/internal-api/reports/models/report.model.js +27 -27
- package/src/saas/internal-api/requests/api/requests.api.js +132 -132
- package/src/saas/internal-api/requests/api/requests.service.js +312 -312
- package/src/saas/internal-api/requests/index.js +21 -21
- package/src/saas/internal-api/requests/models/create.request.model.js +36 -36
- package/src/saas/internal-api/requests/models/draft.request.criteria.model.js +18 -18
- package/src/saas/internal-api/requests/models/draft.request.report.model.js +14 -14
- package/src/saas/internal-api/requests/models/edit.request.model.js +31 -31
- package/src/saas/internal-api/requests/models/homepageRequestCriteriaModel.js +19 -19
- package/src/saas/internal-api/requests/models/requestListCriteriaModel.js +17 -17
- package/src/saas/internal-api/requests/models/tenant.request.model.js +9 -9
- package/src/saas/internal-api/requests/utils.js +16 -16
- package/src/saas/internal-api/requestsTable/api/requests.table.api.js +20 -20
- package/src/saas/internal-api/requestsTable/api/requests.table.service.js +14 -14
- package/src/saas/internal-api/requestsTable/index.js +3 -3
- package/src/saas/internal-api/requirements/api/requirements.api.js +57 -57
- package/src/saas/internal-api/requirements/api/requirements.service.js +184 -184
- package/src/saas/internal-api/requirements/consts/attributeTypes.json +8 -8
- package/src/saas/internal-api/requirements/consts/consts.js +6 -6
- package/src/saas/internal-api/requirements/index.js +10 -10
- package/src/saas/internal-api/requirements/models/create.requirement.model.js +17 -17
- package/src/saas/internal-api/requirements/models/policy.model.js +35 -35
- package/src/saas/internal-api/requirements/models/update.requirement.model.js +19 -19
- package/src/saas/internal-api/requirements/utils/utils.js +129 -129
- package/src/saas/internal-api/serviceArea/api/coordinates.api.js +12 -12
- package/src/saas/internal-api/serviceArea/api/coordinates.service.js +7 -7
- package/src/saas/internal-api/serviceArea/index.js +4 -4
- package/src/saas/internal-api/serviceArea/utils/utils.js +8 -8
- package/src/saas/internal-api/tabs/api/tabs.api.js +32 -32
- package/src/saas/internal-api/tabs/api/tabs.service.js +60 -60
- package/src/saas/internal-api/tabs/index.js +3 -3
- package/src/saas/internal-api/tabs/models/tabs.model.js +19 -19
- package/src/saas/internal-api/thread-scheduler/runner.js +55 -55
- package/src/saas/internal-api/uploadFiles/api/upload.file.api.js +43 -43
- package/src/saas/internal-api/uploadFiles/api/upload.file.service.js +107 -107
- package/src/saas/internal-api/uploadFiles/consts.js +12 -12
- package/src/saas/internal-api/uploadFiles/index.js +5 -5
- package/src/saas/internal-api/users/api/tenantApp/tenant.app.api.js +38 -38
- package/src/saas/internal-api/users/api/tenantApp/tenant.app.service.js +108 -108
- package/src/saas/internal-api/users/api/users.api.js +126 -126
- package/src/saas/internal-api/users/api/users.service.js +258 -258
- package/src/saas/internal-api/users/index.js +16 -16
- package/src/saas/internal-api/users/models/create.inner.system.user.model.js +18 -18
- package/src/saas/internal-api/users/models/notification.settings.model.js +12 -12
- package/src/saas/internal-api/users/models/tenent.user.model.js +11 -11
- package/src/saas/internal-api/users/models/users.model.js +43 -43
- package/src/saas/internal-api/users/utils/util.js +39 -39
- package/src/saas/internal-api/vendorProfile/api/vendor.profile.api.js +26 -26
- package/src/saas/internal-api/vendorProfile/api/vendor.profile.service.js +19 -19
- package/src/saas/internal-api/vendorProfile/index.js +3 -3
- package/src/saas/openapi/accounts/accounts.api.js +17 -17
- package/src/saas/openapi/accounts/accounts.service.js +11 -11
- package/src/saas/openapi/coi/coi.api.js +30 -30
- package/src/saas/openapi/coi/coi.service.js +43 -43
- package/src/saas/openapi/projects/projects.api.js +83 -83
- package/src/saas/openapi/projects/projects.service.js +64 -64
- package/src/saas/openapi/requests/index.js +7 -7
- package/src/saas/openapi/requests/models/invite.request.model.js +40 -40
- package/src/saas/openapi/requests/models/update.request.model.js +35 -35
- package/src/saas/openapi/requests/requests.api.js +93 -93
- package/src/saas/openapi/requests/requests.service.js +94 -94
- package/src/saas/openapi/requirements/index.js +6 -6
- package/src/saas/openapi/requirements/models/copy.requirement.model.js +10 -10
- package/src/saas/openapi/requirements/requirements.api.js +41 -41
- package/src/saas/openapi/requirements/requirements.service.js +49 -49
- package/src/saas/openapi/tabs/index.js +6 -6
- package/src/saas/openapi/tabs/models/create.tab.model.js +6 -6
- package/src/saas/openapi/tabs/tabs.api.js +27 -27
- package/src/saas/openapi/tabs/tabs.service.js +19 -19
- package/src/saas/openapi/users/user.model.js +10 -10
- package/src/saas/openapi/users/users.api.js +33 -33
- package/src/saas/openapi/users/users.service.js +51 -51
- package/tests/env.test.js +40 -40
- package/tests/validation.test.js +83 -83
|
@@ -1,209 +1,209 @@
|
|
|
1
|
-
const { backendUrl } = require('../../../../env').getEnv();
|
|
2
|
-
|
|
3
|
-
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
4
|
-
const internalRequests = require('../../../../common/requests/internalAuth/requests');
|
|
5
|
-
|
|
6
|
-
const Endpoints = {
|
|
7
|
-
get: `${backendUrl}/saas/contractors`,
|
|
8
|
-
getContractorById: contractorId => `${backendUrl}/saas/contractor/${contractorId}`,
|
|
9
|
-
getRecordHistory: contractorId => `${backendUrl}/saas/record/${contractorId}/history`,
|
|
10
|
-
getRecordHistoryEventReport: recordHistoryId => `${backendUrl}/saas/record/compliance-history-report/${recordHistoryId}`,
|
|
11
|
-
getRecordHistoryOverrideEventGapData: recordHistoryId => `${backendUrl}/saas/record/gap/history/${recordHistoryId}/report`,
|
|
12
|
-
getRecordOcrStatus: contractorId => `${backendUrl}/saas/contractor/${contractorId}/ocr/status`,
|
|
13
|
-
delete: contractorId => `${backendUrl}/saas/contractor/${contractorId}`,
|
|
14
|
-
archive:
|
|
15
|
-
restore:
|
|
16
|
-
edit: contractorId => `${backendUrl}/saas/contractors/${contractorId}/update`,
|
|
17
|
-
sendGaps: requestId => `${backendUrl}/saas/request/${requestId}/compliance/status`,
|
|
18
|
-
resendInvitation: requestId => `${backendUrl}/saas/contractor/${requestId}/reminders/reset`,
|
|
19
|
-
requestNewCoiAboutToExpire: requestId => `${backendUrl}/saas/coi/${requestId}/about-to-expire`,
|
|
20
|
-
requestNewCoiExpired: requestId => `${backendUrl}/saas/coi/${requestId}/expired`,
|
|
21
|
-
getComplianceReport: encryptedData => `${backendUrl}/_saas/record/compliance-report?data=${encryptedData}`,
|
|
22
|
-
muteNotifications: `${backendUrl}/saas/record/notifications/mute`,
|
|
23
|
-
unmuteNotifications: `${backendUrl}/saas/record/notifications/unmute`,
|
|
24
|
-
unsubscribe: `${backendUrl}/record/email/unsubscribe`,
|
|
25
|
-
subscribe: `${backendUrl}/record/email/subscribe`,
|
|
26
|
-
changeRequirement: `${backendUrl}/saas/contractor/requirement`,
|
|
27
|
-
updateVendorExpiryDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/expiry-date`,
|
|
28
|
-
updateContractorInviteDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/invite-date`,
|
|
29
|
-
updateLastInviteActionDate: recordId => `${backendUrl}/saas/automation/record/${recordId}/update-emails-date`,
|
|
30
|
-
searchInAutocomplete: ({ tabId, searchWord }) =>
|
|
31
|
-
`${backendUrl}/saas/requests/search/audited?&tabId=${tabId}&searchWord=${searchWord}`,
|
|
32
|
-
automationUpdateContractorUploadDate: contractorId => `${backendUrl}/saas/automation/contractor/${contractorId}/upload-date`,
|
|
33
|
-
assignRequirement: requestId => `${backendUrl}/saas/contractor/${requestId}/assign-requirement`,
|
|
34
|
-
linkedProjectsCount: recordId => `${backendUrl}/saas/record/count/${recordId}/linked-projects`,
|
|
35
|
-
verifyInviteLink: encryptedData => `${backendUrl}/vendor-app/verify-link?data=${encryptedData}`,
|
|
36
|
-
getBasicDetailsById: recordId => `${backendUrl}/jcsc/record/${recordId}`,
|
|
37
|
-
getRecordsFromInsuredName: (insuredName, accountIds) => `${backendUrl}/jcsc/record/insured-name/${insuredName}?accountIds=${accountIds}`,
|
|
38
|
-
linkDraftRequest: `${backendUrl}/saas/account/record/link-draft`
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const getContractorsByAccountId = (params, context) => {
|
|
42
|
-
return requests.getRequestHandler(Endpoints.get, params, context);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const getContractorById = (contractorId, context) => {
|
|
46
|
-
return requests.getRequestHandler(Endpoints.getContractorById(contractorId), {}, context);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const getRecordHistory = (contractorId, context) => {
|
|
50
|
-
return requests.getRequestHandler(Endpoints.getRecordHistory(contractorId), {}, context);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const getRecordHistoryEventReport = (recordHistoryId, context) => {
|
|
54
|
-
return requests.getRequestHandler(Endpoints.getRecordHistoryEventReport(recordHistoryId), {}, context);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const getRecordHistoryOverrideEventGapData = (recordHistoryId, context) => {
|
|
58
|
-
return requests.getRequestHandler(Endpoints.getRecordHistoryOverrideEventGapData(recordHistoryId), {}, context);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const getComplianceReport = (encryptedData, context) => {
|
|
62
|
-
return requests.getRequestHandler(Endpoints.getComplianceReport(encryptedData), {}, context);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const getRecordOcrStatus = (contractorId, context) => {
|
|
66
|
-
return requests.getRequestHandler(Endpoints.getRecordOcrStatus(contractorId), {}, context);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const deleteByContractorId = (contractorId, context) => {
|
|
70
|
-
return requests.deleteRequestHandler(Endpoints.delete(contractorId), context);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const archiveRecord = (recordVerificationModel, context) => {
|
|
74
|
-
return requests.deleteRequestHandler(Endpoints.archive
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const restoreRecord = (recordVerificationModel, context) => {
|
|
78
|
-
return requests.postRequestHandler(Endpoints.restore
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const editContractor = (editRequestModel, context) => {
|
|
82
|
-
const params = { updateInfoUser: 'EditVendor' };
|
|
83
|
-
const { record: { contractorId } } = editRequestModel;
|
|
84
|
-
return requests.postRequestHandler(Endpoints.edit(contractorId), editRequestModel, context, {}, params);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const muteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
88
|
-
return requests.postRequestHandler(Endpoints.muteNotifications, recordModifyDateVerificationModel, context);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
const unmuteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
92
|
-
return requests.postRequestHandler(Endpoints.unmuteNotifications, recordModifyDateVerificationModel, context);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const unsubscribe = subscriptionModel => {
|
|
96
|
-
return requests.postRequestHandler(Endpoints.unsubscribe, subscriptionModel);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const subscribe = subscriptionModel => {
|
|
100
|
-
return requests.postRequestHandler(Endpoints.subscribe, subscriptionModel);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const changeRequirement = (recordModifyDateVerificationModel, context) => {
|
|
104
|
-
return requests.putRequestHandler(Endpoints.changeRequirement, recordModifyDateVerificationModel, context);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
const assignRequirement = (requestId, assignRequirementModel, context) => {
|
|
108
|
-
return requests.putRequestHandler(Endpoints.assignRequirement(requestId), assignRequirementModel, context);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const sendGaps = (requestId, recordModifyDateVerificationModel, context) => {
|
|
112
|
-
return requests.postRequestHandler(Endpoints.sendGaps(requestId), recordModifyDateVerificationModel, context);
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const requestNewCoiAboutToExpire = (requestId, recordModifyDateVerificationModel, context) => {
|
|
116
|
-
return requests.postRequestHandler(Endpoints.requestNewCoiAboutToExpire(requestId), recordModifyDateVerificationModel, context);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const requestNewCoiExpired = (requestId, recordModifyDateVerificationModel, context) => {
|
|
120
|
-
return requests.postRequestHandler(Endpoints.requestNewCoiExpired(requestId), recordModifyDateVerificationModel, context);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const resendInvitation = (requestId, recordModifyDateVerificationModel, context) => {
|
|
124
|
-
return requests.postRequestHandler(Endpoints.resendInvitation(requestId), recordModifyDateVerificationModel, context);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const updateExpiryDate = (contractorId, expiryDate, policyName) => {
|
|
128
|
-
const data = { [policyName]: expiryDate };
|
|
129
|
-
return requests.postRequestHandler(Endpoints.updateVendorExpiryDate(contractorId), data);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const updateInviteDate = (contractorId, inviteDate, context) => {
|
|
133
|
-
const data = { date: inviteDate };
|
|
134
|
-
return requests.postRequestHandler(Endpoints.updateContractorInviteDate(contractorId), data, context);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const searchInAutocomplete = ({ tabId, searchWord }, context) => {
|
|
138
|
-
return requests.getRequestHandler(Endpoints.searchInAutocomplete({ tabId, searchWord }), {}, context);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const updateContractorUploadDate = (contractorId, uploadDate, context) => {
|
|
142
|
-
const url = `${Endpoints.automationUpdateContractorUploadDate(contractorId) }?uploadDate=${uploadDate.toISOString()}`;
|
|
143
|
-
return requests.patchRequestHandler(url, context);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const getLinkedProjectsCount = async (recordId, context) => {
|
|
147
|
-
return await requests.getRequestHandler(Endpoints.linkedProjectsCount(recordId), {}, context);
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
const updateLastInviteActionDate = (recordId, offsetInDays, context) => {
|
|
151
|
-
const url = `${Endpoints.updateLastInviteActionDate(recordId)}?offsetInDays=${offsetInDays}`;
|
|
152
|
-
return requests.putRequestHandler(url, {}, context);
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
const getInviteLinkStatus = (encryptedData, context) => {
|
|
156
|
-
return requests.getRequestHandler(Endpoints.verifyInviteLink(encryptedData), {}, context, {});
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const getBasicDetailsById = recordId => {
|
|
160
|
-
return internalRequests.getRequestHandler(Endpoints.getBasicDetailsById(recordId));
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
const getRecordsFromInsuredName = (insuredName, accountIds) => {
|
|
164
|
-
let accountIdsStr = '';
|
|
165
|
-
|
|
166
|
-
if (accountIds && accountIds.length > 0) {
|
|
167
|
-
accountIdsStr = accountIds.join(',');
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return internalRequests.getRequestHandler(Endpoints.getRecordsFromInsuredName(insuredName, accountIdsStr));
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const linkDraftRequestToAccountRecord = async (linkRequestModel, context) => {
|
|
174
|
-
return requests.postRequestHandler(Endpoints.linkDraftRequest, linkRequestModel, context);
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
module.exports = {
|
|
178
|
-
changeRequirement,
|
|
179
|
-
assignRequirement,
|
|
180
|
-
getContractorsByAccountId,
|
|
181
|
-
getContractorById,
|
|
182
|
-
getRecordHistory,
|
|
183
|
-
getRecordHistoryEventReport,
|
|
184
|
-
getRecordHistoryOverrideEventGapData,
|
|
185
|
-
getRecordOcrStatus,
|
|
186
|
-
getComplianceReport,
|
|
187
|
-
deleteByContractorId,
|
|
188
|
-
archiveRecord,
|
|
189
|
-
restoreRecord,
|
|
190
|
-
editContractor,
|
|
191
|
-
updateInviteDate,
|
|
192
|
-
updateExpiryDate,
|
|
193
|
-
searchInAutocomplete,
|
|
194
|
-
updateContractorUploadDate,
|
|
195
|
-
sendGaps,
|
|
196
|
-
requestNewCoiAboutToExpire,
|
|
197
|
-
requestNewCoiExpired,
|
|
198
|
-
resendInvitation,
|
|
199
|
-
muteNotifications,
|
|
200
|
-
unmuteNotifications,
|
|
201
|
-
unsubscribe,
|
|
202
|
-
subscribe,
|
|
203
|
-
getLinkedProjectsCount,
|
|
204
|
-
updateLastInviteActionDate,
|
|
205
|
-
getInviteLinkStatus,
|
|
206
|
-
getBasicDetailsById,
|
|
207
|
-
getRecordsFromInsuredName,
|
|
208
|
-
linkDraftRequestToAccountRecord
|
|
209
|
-
};
|
|
1
|
+
const { backendUrl } = require('../../../../env').getEnv();
|
|
2
|
+
|
|
3
|
+
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
4
|
+
const internalRequests = require('../../../../common/requests/internalAuth/requests');
|
|
5
|
+
|
|
6
|
+
const Endpoints = {
|
|
7
|
+
get: `${backendUrl}/saas/contractors`,
|
|
8
|
+
getContractorById: contractorId => `${backendUrl}/saas/contractor/${contractorId}`,
|
|
9
|
+
getRecordHistory: contractorId => `${backendUrl}/saas/record/${contractorId}/history`,
|
|
10
|
+
getRecordHistoryEventReport: recordHistoryId => `${backendUrl}/saas/record/compliance-history-report/${recordHistoryId}`,
|
|
11
|
+
getRecordHistoryOverrideEventGapData: recordHistoryId => `${backendUrl}/saas/record/gap/history/${recordHistoryId}/report`,
|
|
12
|
+
getRecordOcrStatus: contractorId => `${backendUrl}/saas/contractor/${contractorId}/ocr/status`,
|
|
13
|
+
delete: contractorId => `${backendUrl}/saas/contractor/${contractorId}`,
|
|
14
|
+
archive: `${backendUrl}/saas/contractor/archive`,
|
|
15
|
+
restore: `${backendUrl}/saas/contractor/restore`,
|
|
16
|
+
edit: contractorId => `${backendUrl}/saas/contractors/${contractorId}/update`,
|
|
17
|
+
sendGaps: requestId => `${backendUrl}/saas/request/${requestId}/compliance/status`,
|
|
18
|
+
resendInvitation: requestId => `${backendUrl}/saas/contractor/${requestId}/reminders/reset`,
|
|
19
|
+
requestNewCoiAboutToExpire: requestId => `${backendUrl}/saas/coi/${requestId}/about-to-expire`,
|
|
20
|
+
requestNewCoiExpired: requestId => `${backendUrl}/saas/coi/${requestId}/expired`,
|
|
21
|
+
getComplianceReport: encryptedData => `${backendUrl}/_saas/record/compliance-report?data=${encryptedData}`,
|
|
22
|
+
muteNotifications: `${backendUrl}/saas/record/notifications/mute`,
|
|
23
|
+
unmuteNotifications: `${backendUrl}/saas/record/notifications/unmute`,
|
|
24
|
+
unsubscribe: `${backendUrl}/record/email/unsubscribe`,
|
|
25
|
+
subscribe: `${backendUrl}/record/email/subscribe`,
|
|
26
|
+
changeRequirement: `${backendUrl}/saas/contractor/requirement`,
|
|
27
|
+
updateVendorExpiryDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/expiry-date`,
|
|
28
|
+
updateContractorInviteDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/invite-date`,
|
|
29
|
+
updateLastInviteActionDate: recordId => `${backendUrl}/saas/automation/record/${recordId}/update-emails-date`,
|
|
30
|
+
searchInAutocomplete: ({ tabId, searchWord }) =>
|
|
31
|
+
`${backendUrl}/saas/requests/search/audited?&tabId=${tabId}&searchWord=${searchWord}`,
|
|
32
|
+
automationUpdateContractorUploadDate: contractorId => `${backendUrl}/saas/automation/contractor/${contractorId}/upload-date`,
|
|
33
|
+
assignRequirement: requestId => `${backendUrl}/saas/contractor/${requestId}/assign-requirement`,
|
|
34
|
+
linkedProjectsCount: recordId => `${backendUrl}/saas/record/count/${recordId}/linked-projects`,
|
|
35
|
+
verifyInviteLink: encryptedData => `${backendUrl}/vendor-app/verify-link?data=${encryptedData}`,
|
|
36
|
+
getBasicDetailsById: recordId => `${backendUrl}/jcsc/record/${recordId}`,
|
|
37
|
+
getRecordsFromInsuredName: (insuredName, accountIds) => `${backendUrl}/jcsc/record/insured-name/${insuredName}?accountIds=${accountIds}`,
|
|
38
|
+
linkDraftRequest: `${backendUrl}/saas/account/record/link-draft`
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const getContractorsByAccountId = (params, context) => {
|
|
42
|
+
return requests.getRequestHandler(Endpoints.get, params, context);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const getContractorById = (contractorId, context) => {
|
|
46
|
+
return requests.getRequestHandler(Endpoints.getContractorById(contractorId), {}, context);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const getRecordHistory = (contractorId, context) => {
|
|
50
|
+
return requests.getRequestHandler(Endpoints.getRecordHistory(contractorId), {}, context);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const getRecordHistoryEventReport = (recordHistoryId, context) => {
|
|
54
|
+
return requests.getRequestHandler(Endpoints.getRecordHistoryEventReport(recordHistoryId), {}, context);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const getRecordHistoryOverrideEventGapData = (recordHistoryId, context) => {
|
|
58
|
+
return requests.getRequestHandler(Endpoints.getRecordHistoryOverrideEventGapData(recordHistoryId), {}, context);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const getComplianceReport = (encryptedData, context) => {
|
|
62
|
+
return requests.getRequestHandler(Endpoints.getComplianceReport(encryptedData), {}, context);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const getRecordOcrStatus = (contractorId, context) => {
|
|
66
|
+
return requests.getRequestHandler(Endpoints.getRecordOcrStatus(contractorId), {}, context);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const deleteByContractorId = (contractorId, context) => {
|
|
70
|
+
return requests.deleteRequestHandler(Endpoints.delete(contractorId), context);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const archiveRecord = (recordVerificationModel, context) => {
|
|
74
|
+
return requests.deleteRequestHandler(Endpoints.archive, context, {}, {}, recordVerificationModel);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const restoreRecord = (recordVerificationModel, context) => {
|
|
78
|
+
return requests.postRequestHandler(Endpoints.restore, recordVerificationModel, context);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const editContractor = (editRequestModel, context) => {
|
|
82
|
+
const params = { updateInfoUser: 'EditVendor' };
|
|
83
|
+
const { record: { contractorId } } = editRequestModel;
|
|
84
|
+
return requests.postRequestHandler(Endpoints.edit(contractorId), editRequestModel, context, {}, params);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const muteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
88
|
+
return requests.postRequestHandler(Endpoints.muteNotifications, recordModifyDateVerificationModel, context);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const unmuteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
92
|
+
return requests.postRequestHandler(Endpoints.unmuteNotifications, recordModifyDateVerificationModel, context);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const unsubscribe = subscriptionModel => {
|
|
96
|
+
return requests.postRequestHandler(Endpoints.unsubscribe, subscriptionModel);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const subscribe = subscriptionModel => {
|
|
100
|
+
return requests.postRequestHandler(Endpoints.subscribe, subscriptionModel);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const changeRequirement = (recordModifyDateVerificationModel, context) => {
|
|
104
|
+
return requests.putRequestHandler(Endpoints.changeRequirement, recordModifyDateVerificationModel, context);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const assignRequirement = (requestId, assignRequirementModel, context) => {
|
|
108
|
+
return requests.putRequestHandler(Endpoints.assignRequirement(requestId), assignRequirementModel, context);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const sendGaps = (requestId, recordModifyDateVerificationModel, context) => {
|
|
112
|
+
return requests.postRequestHandler(Endpoints.sendGaps(requestId), recordModifyDateVerificationModel, context);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const requestNewCoiAboutToExpire = (requestId, recordModifyDateVerificationModel, context) => {
|
|
116
|
+
return requests.postRequestHandler(Endpoints.requestNewCoiAboutToExpire(requestId), recordModifyDateVerificationModel, context);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const requestNewCoiExpired = (requestId, recordModifyDateVerificationModel, context) => {
|
|
120
|
+
return requests.postRequestHandler(Endpoints.requestNewCoiExpired(requestId), recordModifyDateVerificationModel, context);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const resendInvitation = (requestId, recordModifyDateVerificationModel, context) => {
|
|
124
|
+
return requests.postRequestHandler(Endpoints.resendInvitation(requestId), recordModifyDateVerificationModel, context);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const updateExpiryDate = (contractorId, expiryDate, policyName) => {
|
|
128
|
+
const data = { [policyName]: expiryDate };
|
|
129
|
+
return requests.postRequestHandler(Endpoints.updateVendorExpiryDate(contractorId), data);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const updateInviteDate = (contractorId, inviteDate, context) => {
|
|
133
|
+
const data = { date: inviteDate };
|
|
134
|
+
return requests.postRequestHandler(Endpoints.updateContractorInviteDate(contractorId), data, context);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const searchInAutocomplete = ({ tabId, searchWord }, context) => {
|
|
138
|
+
return requests.getRequestHandler(Endpoints.searchInAutocomplete({ tabId, searchWord }), {}, context);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const updateContractorUploadDate = (contractorId, uploadDate, context) => {
|
|
142
|
+
const url = `${Endpoints.automationUpdateContractorUploadDate(contractorId) }?uploadDate=${uploadDate.toISOString()}`;
|
|
143
|
+
return requests.patchRequestHandler(url, context);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const getLinkedProjectsCount = async (recordId, context) => {
|
|
147
|
+
return await requests.getRequestHandler(Endpoints.linkedProjectsCount(recordId), {}, context);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const updateLastInviteActionDate = (recordId, offsetInDays, context) => {
|
|
151
|
+
const url = `${Endpoints.updateLastInviteActionDate(recordId)}?offsetInDays=${offsetInDays}`;
|
|
152
|
+
return requests.putRequestHandler(url, {}, context);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const getInviteLinkStatus = (encryptedData, context) => {
|
|
156
|
+
return requests.getRequestHandler(Endpoints.verifyInviteLink(encryptedData), {}, context, {});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const getBasicDetailsById = recordId => {
|
|
160
|
+
return internalRequests.getRequestHandler(Endpoints.getBasicDetailsById(recordId));
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const getRecordsFromInsuredName = (insuredName, accountIds) => {
|
|
164
|
+
let accountIdsStr = '';
|
|
165
|
+
|
|
166
|
+
if (accountIds && accountIds.length > 0) {
|
|
167
|
+
accountIdsStr = accountIds.join(',');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return internalRequests.getRequestHandler(Endpoints.getRecordsFromInsuredName(insuredName, accountIdsStr));
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const linkDraftRequestToAccountRecord = async (linkRequestModel, context) => {
|
|
174
|
+
return requests.postRequestHandler(Endpoints.linkDraftRequest, linkRequestModel, context);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
module.exports = {
|
|
178
|
+
changeRequirement,
|
|
179
|
+
assignRequirement,
|
|
180
|
+
getContractorsByAccountId,
|
|
181
|
+
getContractorById,
|
|
182
|
+
getRecordHistory,
|
|
183
|
+
getRecordHistoryEventReport,
|
|
184
|
+
getRecordHistoryOverrideEventGapData,
|
|
185
|
+
getRecordOcrStatus,
|
|
186
|
+
getComplianceReport,
|
|
187
|
+
deleteByContractorId,
|
|
188
|
+
archiveRecord,
|
|
189
|
+
restoreRecord,
|
|
190
|
+
editContractor,
|
|
191
|
+
updateInviteDate,
|
|
192
|
+
updateExpiryDate,
|
|
193
|
+
searchInAutocomplete,
|
|
194
|
+
updateContractorUploadDate,
|
|
195
|
+
sendGaps,
|
|
196
|
+
requestNewCoiAboutToExpire,
|
|
197
|
+
requestNewCoiExpired,
|
|
198
|
+
resendInvitation,
|
|
199
|
+
muteNotifications,
|
|
200
|
+
unmuteNotifications,
|
|
201
|
+
unsubscribe,
|
|
202
|
+
subscribe,
|
|
203
|
+
getLinkedProjectsCount,
|
|
204
|
+
updateLastInviteActionDate,
|
|
205
|
+
getInviteLinkStatus,
|
|
206
|
+
getBasicDetailsById,
|
|
207
|
+
getRecordsFromInsuredName,
|
|
208
|
+
linkDraftRequestToAccountRecord
|
|
209
|
+
};
|