@getjones/test-infra 2.1.2 → 2.1.4
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 +29 -29
- package/src/common/commonFlows/index.js +3 -3
- package/src/common/commonFlows/records/records.js +71 -71
- package/src/common/httpResponseStatusCodes.json +11 -11
- package/src/common/requests/apiKeyAuth/requests.js +38 -38
- package/src/common/requests/cookieAuth/requests.js +40 -40
- package/src/common/requests/requestHandlers.js +60 -60
- package/src/common/utils/dataTypeUtils.js +41 -0
- package/src/common/utils/numberUtils.js +22 -22
- package/src/common/utils/timeUtils.js +167 -162
- package/src/common/validations/errorValidation.js +16 -16
- package/src/common/validations/typeValidations.js +36 -36
- package/src/env.js +45 -45
- package/src/index.js +71 -69
- package/src/saas/internal-api/accounts/api/core/accounts.core.api.js +28 -28
- package/src/saas/internal-api/accounts/api/core/accounts.core.service.js +77 -77
- 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 +24 -24
- package/src/saas/internal-api/accounts/index.js +20 -20
- package/src/saas/internal-api/accounts/models/core/create.account.model.js +15 -15
- package/src/saas/internal-api/accounts/models/settings/update.settings.model.js +23 -21
- package/src/saas/internal-api/accounts/utils/utils.js +32 -32
- package/src/saas/internal-api/auth/api/auth.api.js +18 -12
- package/src/saas/internal-api/auth/api/auth.service.js +75 -47
- package/src/saas/internal-api/auth/index.js +3 -3
- package/src/saas/internal-api/coi/api/coi.api.js +34 -34
- package/src/saas/internal-api/coi/api/coi.service.js +22 -22
- package/src/saas/internal-api/coi/consts/uploaderTypes.js +7 -7
- package/src/saas/internal-api/coi/index.js +13 -13
- package/src/saas/internal-api/coi/models/submit.coi.model.js +9 -9
- package/src/saas/internal-api/coi/utils/utils.js +48 -48
- package/src/saas/internal-api/compliance/api/audit/audit.api.js +41 -40
- package/src/saas/internal-api/compliance/api/audit/audit.service.js +151 -33
- 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 +24 -24
- package/src/saas/internal-api/compliance/api/waive/waive.api.js +21 -21
- package/src/saas/internal-api/compliance/api/waive/waive.service.js +15 -15
- package/src/saas/internal-api/compliance/consts/audit.js +81 -81
- package/src/saas/internal-api/compliance/index.js +28 -28
- package/src/saas/internal-api/compliance/models/audit/audit.model.js +84 -84
- package/src/saas/internal-api/compliance/models/waive/waive.model.js +45 -45
- package/src/saas/internal-api/compliance/utils/util.js +173 -218
- package/src/saas/internal-api/contractors/api/contractors.api.js +141 -141
- package/src/saas/internal-api/contractors/api/contractors.service.js +123 -123
- package/src/saas/internal-api/contractors/index.js +8 -8
- package/src/saas/internal-api/contractors/models/create.contractor.model.js +22 -22
- package/src/saas/internal-api/contractors/models/edit.contractor.model.js +60 -60
- package/src/saas/internal-api/contractors/models/verification.contractor.model.js +27 -27
- package/src/saas/internal-api/dashboardInnerPage/api/recordList.api.js +12 -0
- package/src/saas/internal-api/dashboardInnerPage/api/recordList.service.js +7 -0
- package/src/saas/internal-api/dashboardInnerPage/index.js +5 -0
- package/src/saas/internal-api/dashboardInnerPage/models/dashboard.filter.criteria.model.js +38 -0
- package/src/saas/internal-api/dbEmails/api/db.emails.api.js +25 -25
- package/src/saas/internal-api/dbEmails/api/db.emails.service.js +127 -127
- package/src/saas/internal-api/dbEmails/consts/consts.js +3 -3
- package/src/saas/internal-api/dbEmails/index.js +4 -4
- package/src/saas/internal-api/dbEmails/models/db.emails.model.js +21 -21
- package/src/saas/internal-api/dbEmails/utils/util.js +59 -59
- package/src/saas/internal-api/globalRecord/api/global.record.api.js +76 -76
- package/src/saas/internal-api/globalRecord/api/global.record.service.js +83 -83
- 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 +43 -43
- package/src/saas/internal-api/globalRecord/utils/util.js +148 -148
- 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/projects/api/core/projects.api.js +39 -39
- package/src/saas/internal-api/projects/api/core/projects.service.js +65 -65
- 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 +17 -17
- 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 +39 -39
- package/src/saas/internal-api/projects/utils/utils.js +82 -82
- package/src/saas/internal-api/recordNotes/api/record.notes.api.js +38 -38
- package/src/saas/internal-api/recordNotes/api/record.notes.service.js +29 -29
- package/src/saas/internal-api/recordNotes/index.js +3 -3
- package/src/saas/internal-api/reports/api/reports.api.js +39 -39
- package/src/saas/internal-api/reports/api/reports.service.js +34 -34
- package/src/saas/internal-api/reports/consts/consts.js +63 -63
- 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 +54 -54
- package/src/saas/internal-api/requests/api/requests.service.js +51 -51
- package/src/saas/internal-api/requests/index.js +14 -14
- package/src/saas/internal-api/requests/models/create.request.model.js +22 -22
- package/src/saas/internal-api/requests/models/edit.request.model.js +31 -31
- package/src/saas/internal-api/requests/models/tenant.request.model.js +9 -9
- package/src/saas/internal-api/requests/utils.js +8 -8
- package/src/saas/internal-api/requirements/api/requirements.api.js +27 -27
- package/src/saas/internal-api/requirements/api/requirements.service.js +23 -23
- package/src/saas/internal-api/requirements/consts/attributeTypes.json +6 -0
- package/src/saas/internal-api/requirements/index.js +6 -6
- package/src/saas/internal-api/requirements/models/create.requirement.model.js +45 -45
- package/src/saas/internal-api/requirements/utils/utils.js +88 -0
- 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 +54 -54
- package/src/saas/internal-api/tabs/index.js +3 -3
- package/src/saas/internal-api/tabs/models/tabs.model.js +18 -18
- package/src/saas/internal-api/thread-scheduler/runner.js +13 -13
- package/src/saas/internal-api/users/api/users.api.js +77 -77
- package/src/saas/internal-api/users/api/users.service.js +101 -101
- package/src/saas/internal-api/users/index.js +4 -4
- package/src/saas/internal-api/users/models/users.model.js +31 -31
- package/src/saas/internal-api/users/utils/util.js +14 -14
- package/src/saas/internal-api/vendorProfile/api/vendor.profile.api.js +20 -20
- package/src/saas/internal-api/vendorProfile/api/vendor.profile.service.js +14 -14
- 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/projects/projects.api.js +59 -59
- package/src/saas/openapi/projects/projects.service.js +44 -44
- package/src/saas/openapi/requests/index.js +6 -6
- package/src/saas/openapi/requests/models/invite.request.model.js +37 -37
- package/src/saas/openapi/requests/requests.api.js +20 -20
- package/src/saas/openapi/requests/requests.service.js +18 -18
- 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 +12 -12
- package/src/saas/openapi/requirements/requirements.service.js +20 -20
- package/src/saas/openapi/tabs/tabs.api.js +13 -13
- package/src/saas/openapi/tabs/tabs.service.js +7 -7
- package/tests/env.test.js +40 -40
- package/tests/validation.test.js +83 -83
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
-
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
|
-
|
|
4
|
-
const Endpoints = {
|
|
5
|
-
create: `${backendUrl}/saas/contractors/invite`,
|
|
6
|
-
get: `${backendUrl}/saas/contractors`,
|
|
7
|
-
getContractorById: contractorId => `${backendUrl}/saas/contractor/${contractorId}`,
|
|
8
|
-
getRecordHistory: contractorId => `${backendUrl}/saas/record/${contractorId}/history`,
|
|
9
|
-
delete: contractorId => `${backendUrl}/saas/contractor/${contractorId}`,
|
|
10
|
-
archive: contractorId => `${backendUrl}/saas/contractor/${contractorId}/archive`,
|
|
11
|
-
restore: contractorId => `${backendUrl}/saas/contractor/${contractorId}/restore`,
|
|
12
|
-
edit: contractorId => `${backendUrl}/saas/contractors/${contractorId}/update`,
|
|
13
|
-
sendGaps: `${backendUrl}/saas/contractor/compliance/status`,
|
|
14
|
-
requestNewCoiAboutToExpire: `${backendUrl}/saas/coi/about-to-expire`,
|
|
15
|
-
requestNewCoiExpired: `${backendUrl}/saas/coi/expired`,
|
|
16
|
-
resendInvitation: contractorId => `${backendUrl}/saas/contractor/${contractorId}/reminders/reset`,
|
|
17
|
-
muteNotifications: `${backendUrl}/saas/record/notifications/mute`,
|
|
18
|
-
unmuteNotifications: `${backendUrl}/saas/record/notifications/unmute`,
|
|
19
|
-
changeRequirement: `${backendUrl}/saas/contractor/requirement`,
|
|
20
|
-
updateVendorExpiryDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/expiry-date`,
|
|
21
|
-
updateContractorInviteDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/invite-date`,
|
|
22
|
-
searchInAutocomplete: ({ tabId, searchWord }) =>
|
|
23
|
-
`${backendUrl}/saas/contractors/search/audited?&tabId=${tabId}&searchWord=${searchWord}`,
|
|
24
|
-
automationUpdateContractorUploadDate: contractorId => `${backendUrl}/saas/automation/contractor/${contractorId}/upload-date`
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const createContractor = (createContractorModel, context) => {
|
|
28
|
-
return requests.postRequestHandler(Endpoints.create, createContractorModel, context);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const getContractorsByAccountId = (params, context) => {
|
|
32
|
-
return requests.getRequestHandler(Endpoints.get, params, context);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const getContractorById = (contractorId, context) => {
|
|
36
|
-
return requests.getRequestHandler(Endpoints.getContractorById(contractorId), {}, context);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const getRecordHistory = (contractorId, context) => {
|
|
40
|
-
return requests.getRequestHandler(Endpoints.getRecordHistory(contractorId), {}, context);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const deleteByContractorId = (contractorId, context) => {
|
|
44
|
-
return requests.deleteRequestHandler(Endpoints.delete(contractorId), context);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const archiveByContractorId = (contractorId, context) => {
|
|
48
|
-
return requests.deleteRequestHandler(Endpoints.archive(contractorId), context);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const restoreContractor = (recordVerificationModel, context) => {
|
|
52
|
-
return requests.postRequestHandler(Endpoints.restore(recordVerificationModel.contractorId), recordVerificationModel, context);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const editContractor = (editRequestModel, context) => {
|
|
56
|
-
const params = { updateInfoUser: 'EditVendor' };
|
|
57
|
-
const { record: { contractorId } } = editRequestModel;
|
|
58
|
-
return requests.postRequestHandler(Endpoints.edit(contractorId), editRequestModel, context, {}, params);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const muteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
62
|
-
return requests.postRequestHandler(Endpoints.muteNotifications, recordModifyDateVerificationModel, context);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const unmuteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
66
|
-
return requests.postRequestHandler(Endpoints.unmuteNotifications, recordModifyDateVerificationModel, context);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const changeRequirement = (recordModifyDateVerificationModel, context) => {
|
|
70
|
-
return requests.putRequestHandler(Endpoints.changeRequirement, recordModifyDateVerificationModel, context);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const sendGaps = (recordModifyDateVerificationModel, context) => {
|
|
74
|
-
return requests.postRequestHandler(Endpoints.sendGaps, recordModifyDateVerificationModel, context);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const requestNewCoiAboutToExpire = (recordModifyDateVerificationModel, context) => {
|
|
78
|
-
return requests.postRequestHandler(Endpoints.requestNewCoiAboutToExpire, recordModifyDateVerificationModel, context);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const requestNewCoiExpired = (recordModifyDateVerificationModel, context) => {
|
|
82
|
-
return requests.postRequestHandler(Endpoints.requestNewCoiExpired, recordModifyDateVerificationModel, context);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const resendInvitation = (recordModifyDateVerificationModel, context) => {
|
|
86
|
-
const recordId = recordModifyDateVerificationModel.contractorId;
|
|
87
|
-
return requests.postRequestHandler(Endpoints.resendInvitation(recordId), recordModifyDateVerificationModel, context);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const updateExpiryDate = (contractorId, expiryDate, policyName) => {
|
|
91
|
-
const data = { [policyName]: expiryDate };
|
|
92
|
-
return requests.postRequestHandler(Endpoints.updateVendorExpiryDate(contractorId), data);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const updateInviteDate = (contractorId, inviteDate, context) => {
|
|
96
|
-
const data = { date: inviteDate };
|
|
97
|
-
return requests.postRequestHandler(Endpoints.updateContractorInviteDate(contractorId), data, context);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const getContractorsByTabId = async (tabId, context, activityStatus) => {
|
|
101
|
-
const body = { tabId, activityStatus };
|
|
102
|
-
const response = await requests.postRequestHandler(Endpoints.get, body, context);
|
|
103
|
-
const records = {
|
|
104
|
-
... response,
|
|
105
|
-
data: response.data.map(({ record }) => record)
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
return records;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const searchInAutocomplete = ({ tabId, searchWord }, context) => {
|
|
112
|
-
return requests.getRequestHandler(Endpoints.searchInAutocomplete({ tabId, searchWord }), {}, context);
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const updateContractorUploadDate = (contractorId, uploadDate, context) => {
|
|
116
|
-
const url = `${Endpoints.automationUpdateContractorUploadDate(contractorId) }?uploadDate=${uploadDate.toISOString()}`;
|
|
117
|
-
return requests.patchRequestHandler(url, context);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
module.exports = {
|
|
121
|
-
createContractor,
|
|
122
|
-
changeRequirement,
|
|
123
|
-
getContractorsByAccountId,
|
|
124
|
-
getContractorById,
|
|
125
|
-
getRecordHistory,
|
|
126
|
-
deleteByContractorId,
|
|
127
|
-
archiveByContractorId,
|
|
128
|
-
restoreContractor,
|
|
129
|
-
editContractor,
|
|
130
|
-
updateInviteDate,
|
|
131
|
-
updateExpiryDate,
|
|
132
|
-
getContractorsByTabId,
|
|
133
|
-
searchInAutocomplete,
|
|
134
|
-
updateContractorUploadDate,
|
|
135
|
-
sendGaps,
|
|
136
|
-
requestNewCoiAboutToExpire,
|
|
137
|
-
requestNewCoiExpired,
|
|
138
|
-
resendInvitation,
|
|
139
|
-
muteNotifications,
|
|
140
|
-
unmuteNotifications
|
|
141
|
-
};
|
|
1
|
+
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
+
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
|
+
|
|
4
|
+
const Endpoints = {
|
|
5
|
+
create: `${backendUrl}/saas/contractors/invite`,
|
|
6
|
+
get: `${backendUrl}/saas/contractors`,
|
|
7
|
+
getContractorById: contractorId => `${backendUrl}/saas/contractor/${contractorId}`,
|
|
8
|
+
getRecordHistory: contractorId => `${backendUrl}/saas/record/${contractorId}/history`,
|
|
9
|
+
delete: contractorId => `${backendUrl}/saas/contractor/${contractorId}`,
|
|
10
|
+
archive: contractorId => `${backendUrl}/saas/contractor/${contractorId}/archive`,
|
|
11
|
+
restore: contractorId => `${backendUrl}/saas/contractor/${contractorId}/restore`,
|
|
12
|
+
edit: contractorId => `${backendUrl}/saas/contractors/${contractorId}/update`,
|
|
13
|
+
sendGaps: `${backendUrl}/saas/contractor/compliance/status`,
|
|
14
|
+
requestNewCoiAboutToExpire: `${backendUrl}/saas/coi/about-to-expire`,
|
|
15
|
+
requestNewCoiExpired: `${backendUrl}/saas/coi/expired`,
|
|
16
|
+
resendInvitation: contractorId => `${backendUrl}/saas/contractor/${contractorId}/reminders/reset`,
|
|
17
|
+
muteNotifications: `${backendUrl}/saas/record/notifications/mute`,
|
|
18
|
+
unmuteNotifications: `${backendUrl}/saas/record/notifications/unmute`,
|
|
19
|
+
changeRequirement: `${backendUrl}/saas/contractor/requirement`,
|
|
20
|
+
updateVendorExpiryDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/expiry-date`,
|
|
21
|
+
updateContractorInviteDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/invite-date`,
|
|
22
|
+
searchInAutocomplete: ({ tabId, searchWord }) =>
|
|
23
|
+
`${backendUrl}/saas/contractors/search/audited?&tabId=${tabId}&searchWord=${searchWord}`,
|
|
24
|
+
automationUpdateContractorUploadDate: contractorId => `${backendUrl}/saas/automation/contractor/${contractorId}/upload-date`
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const createContractor = (createContractorModel, context) => {
|
|
28
|
+
return requests.postRequestHandler(Endpoints.create, createContractorModel, context);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const getContractorsByAccountId = (params, context) => {
|
|
32
|
+
return requests.getRequestHandler(Endpoints.get, params, context);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const getContractorById = (contractorId, context) => {
|
|
36
|
+
return requests.getRequestHandler(Endpoints.getContractorById(contractorId), {}, context);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getRecordHistory = (contractorId, context) => {
|
|
40
|
+
return requests.getRequestHandler(Endpoints.getRecordHistory(contractorId), {}, context);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const deleteByContractorId = (contractorId, context) => {
|
|
44
|
+
return requests.deleteRequestHandler(Endpoints.delete(contractorId), context);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const archiveByContractorId = (contractorId, context) => {
|
|
48
|
+
return requests.deleteRequestHandler(Endpoints.archive(contractorId), context);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const restoreContractor = (recordVerificationModel, context) => {
|
|
52
|
+
return requests.postRequestHandler(Endpoints.restore(recordVerificationModel.contractorId), recordVerificationModel, context);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const editContractor = (editRequestModel, context) => {
|
|
56
|
+
const params = { updateInfoUser: 'EditVendor' };
|
|
57
|
+
const { record: { contractorId } } = editRequestModel;
|
|
58
|
+
return requests.postRequestHandler(Endpoints.edit(contractorId), editRequestModel, context, {}, params);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const muteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
62
|
+
return requests.postRequestHandler(Endpoints.muteNotifications, recordModifyDateVerificationModel, context);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const unmuteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
66
|
+
return requests.postRequestHandler(Endpoints.unmuteNotifications, recordModifyDateVerificationModel, context);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const changeRequirement = (recordModifyDateVerificationModel, context) => {
|
|
70
|
+
return requests.putRequestHandler(Endpoints.changeRequirement, recordModifyDateVerificationModel, context);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const sendGaps = (recordModifyDateVerificationModel, context) => {
|
|
74
|
+
return requests.postRequestHandler(Endpoints.sendGaps, recordModifyDateVerificationModel, context);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const requestNewCoiAboutToExpire = (recordModifyDateVerificationModel, context) => {
|
|
78
|
+
return requests.postRequestHandler(Endpoints.requestNewCoiAboutToExpire, recordModifyDateVerificationModel, context);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const requestNewCoiExpired = (recordModifyDateVerificationModel, context) => {
|
|
82
|
+
return requests.postRequestHandler(Endpoints.requestNewCoiExpired, recordModifyDateVerificationModel, context);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const resendInvitation = (recordModifyDateVerificationModel, context) => {
|
|
86
|
+
const recordId = recordModifyDateVerificationModel.contractorId;
|
|
87
|
+
return requests.postRequestHandler(Endpoints.resendInvitation(recordId), recordModifyDateVerificationModel, context);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const updateExpiryDate = (contractorId, expiryDate, policyName) => {
|
|
91
|
+
const data = { [policyName]: expiryDate };
|
|
92
|
+
return requests.postRequestHandler(Endpoints.updateVendorExpiryDate(contractorId), data);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const updateInviteDate = (contractorId, inviteDate, context) => {
|
|
96
|
+
const data = { date: inviteDate };
|
|
97
|
+
return requests.postRequestHandler(Endpoints.updateContractorInviteDate(contractorId), data, context);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const getContractorsByTabId = async (tabId, context, activityStatus) => {
|
|
101
|
+
const body = { tabId, activityStatus };
|
|
102
|
+
const response = await requests.postRequestHandler(Endpoints.get, body, context);
|
|
103
|
+
const records = {
|
|
104
|
+
... response,
|
|
105
|
+
data: response.data.map(({ record }) => record)
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return records;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const searchInAutocomplete = ({ tabId, searchWord }, context) => {
|
|
112
|
+
return requests.getRequestHandler(Endpoints.searchInAutocomplete({ tabId, searchWord }), {}, context);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const updateContractorUploadDate = (contractorId, uploadDate, context) => {
|
|
116
|
+
const url = `${Endpoints.automationUpdateContractorUploadDate(contractorId) }?uploadDate=${uploadDate.toISOString()}`;
|
|
117
|
+
return requests.patchRequestHandler(url, context);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
module.exports = {
|
|
121
|
+
createContractor,
|
|
122
|
+
changeRequirement,
|
|
123
|
+
getContractorsByAccountId,
|
|
124
|
+
getContractorById,
|
|
125
|
+
getRecordHistory,
|
|
126
|
+
deleteByContractorId,
|
|
127
|
+
archiveByContractorId,
|
|
128
|
+
restoreContractor,
|
|
129
|
+
editContractor,
|
|
130
|
+
updateInviteDate,
|
|
131
|
+
updateExpiryDate,
|
|
132
|
+
getContractorsByTabId,
|
|
133
|
+
searchInAutocomplete,
|
|
134
|
+
updateContractorUploadDate,
|
|
135
|
+
sendGaps,
|
|
136
|
+
requestNewCoiAboutToExpire,
|
|
137
|
+
requestNewCoiExpired,
|
|
138
|
+
resendInvitation,
|
|
139
|
+
muteNotifications,
|
|
140
|
+
unmuteNotifications
|
|
141
|
+
};
|
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
const contractorsAPI = require('./contractors.api');
|
|
2
|
-
const { CreateContractorModel } = require('../models/create.contractor.model');
|
|
3
|
-
const { RequestModel } = require('../../requests/models/edit.request.model');
|
|
4
|
-
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
5
|
-
const { RecordModifyDateVerificationModel } = require('../models/verification.contractor.model');
|
|
6
|
-
|
|
7
|
-
const createContractor = async (createContractorModel, context) => {
|
|
8
|
-
validateType(createContractorModel, CreateContractorModel);
|
|
9
|
-
return contractorsAPI.createContractor(createContractorModel, context);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const getContractorsByAccountId = async (accountId, context, activationStatus = null) => {
|
|
13
|
-
if (activationStatus) {
|
|
14
|
-
activationStatus = activationStatus.reduce((f, s) => `${f},${s}`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return contractorsAPI.getContractorsByAccountId({ accountId, activationStatus }, context);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const getContractorById = (contractorId, context) => {
|
|
21
|
-
return contractorsAPI.getContractorById(contractorId, context);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const getRecordHistory = (contractorId, context) => {
|
|
25
|
-
return contractorsAPI.getRecordHistory(contractorId, context);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const deleteByContractorId = (contractorId, context) => {
|
|
29
|
-
return contractorsAPI.deleteByContractorId(contractorId, context);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const archiveByContractorId = (contractorId, context) => {
|
|
33
|
-
return contractorsAPI.archiveByContractorId(contractorId, context);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const restoreContractor = (recordVerificationModel, context) => {
|
|
37
|
-
validateType(recordVerificationModel, RecordModifyDateVerificationModel);
|
|
38
|
-
return contractorsAPI.restoreContractor(recordVerificationModel, context);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const editContractor = (editRequestModel, context) => {
|
|
42
|
-
validateType(editRequestModel, RequestModel);
|
|
43
|
-
return contractorsAPI.editContractor(editRequestModel, context);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const updateExpiryDate = (contractorId, expiryDate, policyName) => {
|
|
47
|
-
return contractorsAPI.updateExpiryDate(contractorId, expiryDate, policyName);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const updateInviteDate = (contractorId, inviteDate, context) => {
|
|
51
|
-
return contractorsAPI.updateInviteDate(contractorId, inviteDate, context);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const getContractorsByTabId = (tabId, context, activityStatus = 'Active') => {
|
|
55
|
-
return contractorsAPI.getContractorsByTabId(tabId, context, activityStatus);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const searchInAutoComplete = ({ tabId, searchWord }, context) => {
|
|
59
|
-
return contractorsAPI.searchInAutocomplete({ tabId, searchWord }, context);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const updateContractorUploadDate = (contractorId, uploadDate, context) => {
|
|
63
|
-
validateType(uploadDate, Date);
|
|
64
|
-
return contractorsAPI.updateContractorUploadDate(contractorId, uploadDate, context);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const changeRequirement = (recordModifyDateVerificationModel, context) => {
|
|
68
|
-
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
69
|
-
return contractorsAPI.changeRequirement(recordModifyDateVerificationModel, context);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const sendGaps = (recordModifyDateVerificationModel, context) => {
|
|
73
|
-
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
74
|
-
return contractorsAPI.sendGaps(recordModifyDateVerificationModel, context);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const requestNewCoiAboutToExpire = (recordModifyDateVerificationModel, context) => {
|
|
78
|
-
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
79
|
-
return contractorsAPI.requestNewCoiAboutToExpire(recordModifyDateVerificationModel, context);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const requestNewCoiExpired = (recordModifyDateVerificationModel, context) => {
|
|
83
|
-
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
84
|
-
return contractorsAPI.requestNewCoiExpired(recordModifyDateVerificationModel, context);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const resendInvitation = (recordModifyDateVerificationModel, context) => {
|
|
88
|
-
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
89
|
-
return contractorsAPI.resendInvitation(recordModifyDateVerificationModel, context);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const muteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
93
|
-
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
94
|
-
return contractorsAPI.muteNotifications(recordModifyDateVerificationModel, context);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const unmuteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
98
|
-
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
99
|
-
return contractorsAPI.unmuteNotifications(recordModifyDateVerificationModel, context);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
module.exports = {
|
|
103
|
-
createContractor,
|
|
104
|
-
changeRequirement,
|
|
105
|
-
getContractorsByAccountId,
|
|
106
|
-
getContractorById,
|
|
107
|
-
getRecordHistory,
|
|
108
|
-
deleteByContractorId,
|
|
109
|
-
archiveByContractorId,
|
|
110
|
-
restoreContractor,
|
|
111
|
-
editContractor,
|
|
112
|
-
updateInviteDate,
|
|
113
|
-
updateExpiryDate,
|
|
114
|
-
getContractorsByTabId,
|
|
115
|
-
searchInAutoComplete,
|
|
116
|
-
updateContractorUploadDate,
|
|
117
|
-
sendGaps,
|
|
118
|
-
requestNewCoiAboutToExpire,
|
|
119
|
-
requestNewCoiExpired,
|
|
120
|
-
resendInvitation,
|
|
121
|
-
muteNotifications,
|
|
122
|
-
unmuteNotifications
|
|
123
|
-
};
|
|
1
|
+
const contractorsAPI = require('./contractors.api');
|
|
2
|
+
const { CreateContractorModel } = require('../models/create.contractor.model');
|
|
3
|
+
const { RequestModel } = require('../../requests/models/edit.request.model');
|
|
4
|
+
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
5
|
+
const { RecordModifyDateVerificationModel } = require('../models/verification.contractor.model');
|
|
6
|
+
|
|
7
|
+
const createContractor = async (createContractorModel, context) => {
|
|
8
|
+
validateType(createContractorModel, CreateContractorModel);
|
|
9
|
+
return contractorsAPI.createContractor(createContractorModel, context);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const getContractorsByAccountId = async (accountId, context, activationStatus = null) => {
|
|
13
|
+
if (activationStatus) {
|
|
14
|
+
activationStatus = activationStatus.reduce((f, s) => `${f},${s}`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return contractorsAPI.getContractorsByAccountId({ accountId, activationStatus }, context);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getContractorById = (contractorId, context) => {
|
|
21
|
+
return contractorsAPI.getContractorById(contractorId, context);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getRecordHistory = (contractorId, context) => {
|
|
25
|
+
return contractorsAPI.getRecordHistory(contractorId, context);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const deleteByContractorId = (contractorId, context) => {
|
|
29
|
+
return contractorsAPI.deleteByContractorId(contractorId, context);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const archiveByContractorId = (contractorId, context) => {
|
|
33
|
+
return contractorsAPI.archiveByContractorId(contractorId, context);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const restoreContractor = (recordVerificationModel, context) => {
|
|
37
|
+
validateType(recordVerificationModel, RecordModifyDateVerificationModel);
|
|
38
|
+
return contractorsAPI.restoreContractor(recordVerificationModel, context);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const editContractor = (editRequestModel, context) => {
|
|
42
|
+
validateType(editRequestModel, RequestModel);
|
|
43
|
+
return contractorsAPI.editContractor(editRequestModel, context);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const updateExpiryDate = (contractorId, expiryDate, policyName) => {
|
|
47
|
+
return contractorsAPI.updateExpiryDate(contractorId, expiryDate, policyName);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const updateInviteDate = (contractorId, inviteDate, context) => {
|
|
51
|
+
return contractorsAPI.updateInviteDate(contractorId, inviteDate, context);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const getContractorsByTabId = (tabId, context, activityStatus = 'Active') => {
|
|
55
|
+
return contractorsAPI.getContractorsByTabId(tabId, context, activityStatus);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const searchInAutoComplete = ({ tabId, searchWord }, context) => {
|
|
59
|
+
return contractorsAPI.searchInAutocomplete({ tabId, searchWord }, context);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const updateContractorUploadDate = (contractorId, uploadDate, context) => {
|
|
63
|
+
validateType(uploadDate, Date);
|
|
64
|
+
return contractorsAPI.updateContractorUploadDate(contractorId, uploadDate, context);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const changeRequirement = (recordModifyDateVerificationModel, context) => {
|
|
68
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
69
|
+
return contractorsAPI.changeRequirement(recordModifyDateVerificationModel, context);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const sendGaps = (recordModifyDateVerificationModel, context) => {
|
|
73
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
74
|
+
return contractorsAPI.sendGaps(recordModifyDateVerificationModel, context);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const requestNewCoiAboutToExpire = (recordModifyDateVerificationModel, context) => {
|
|
78
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
79
|
+
return contractorsAPI.requestNewCoiAboutToExpire(recordModifyDateVerificationModel, context);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const requestNewCoiExpired = (recordModifyDateVerificationModel, context) => {
|
|
83
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
84
|
+
return contractorsAPI.requestNewCoiExpired(recordModifyDateVerificationModel, context);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const resendInvitation = (recordModifyDateVerificationModel, context) => {
|
|
88
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
89
|
+
return contractorsAPI.resendInvitation(recordModifyDateVerificationModel, context);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const muteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
93
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
94
|
+
return contractorsAPI.muteNotifications(recordModifyDateVerificationModel, context);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const unmuteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
98
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
99
|
+
return contractorsAPI.unmuteNotifications(recordModifyDateVerificationModel, context);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
module.exports = {
|
|
103
|
+
createContractor,
|
|
104
|
+
changeRequirement,
|
|
105
|
+
getContractorsByAccountId,
|
|
106
|
+
getContractorById,
|
|
107
|
+
getRecordHistory,
|
|
108
|
+
deleteByContractorId,
|
|
109
|
+
archiveByContractorId,
|
|
110
|
+
restoreContractor,
|
|
111
|
+
editContractor,
|
|
112
|
+
updateInviteDate,
|
|
113
|
+
updateExpiryDate,
|
|
114
|
+
getContractorsByTabId,
|
|
115
|
+
searchInAutoComplete,
|
|
116
|
+
updateContractorUploadDate,
|
|
117
|
+
sendGaps,
|
|
118
|
+
requestNewCoiAboutToExpire,
|
|
119
|
+
requestNewCoiExpired,
|
|
120
|
+
resendInvitation,
|
|
121
|
+
muteNotifications,
|
|
122
|
+
unmuteNotifications
|
|
123
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const createModel = require('./models/create.contractor.model');
|
|
2
|
-
const editModel = require('./models/edit.contractor.model');
|
|
3
|
-
const verificationModel = require('./models/verification.contractor.model');
|
|
4
|
-
const services = require('./api/contractors.service');
|
|
5
|
-
|
|
6
|
-
const models = { create: createModel, edit: editModel, verification: verificationModel };
|
|
7
|
-
|
|
8
|
-
module.exports = { services, models };
|
|
1
|
+
const createModel = require('./models/create.contractor.model');
|
|
2
|
+
const editModel = require('./models/edit.contractor.model');
|
|
3
|
+
const verificationModel = require('./models/verification.contractor.model');
|
|
4
|
+
const services = require('./api/contractors.service');
|
|
5
|
+
|
|
6
|
+
const models = { create: createModel, edit: editModel, verification: verificationModel };
|
|
7
|
+
|
|
8
|
+
module.exports = { services, models };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
2
|
-
|
|
3
|
-
function CreateContractorModel(requirementId, inviterEmail, vendorInfo, { tabId = null, sendMail = false, publicLink } = {}) {
|
|
4
|
-
this.reqId = requirementId;
|
|
5
|
-
this.inviterEmail = inviterEmail;
|
|
6
|
-
this.vendorInfo = vendorInfo;
|
|
7
|
-
this.disableMail = !sendMail;
|
|
8
|
-
this.tabId = tabId;
|
|
9
|
-
this.publicLink = publicLink;
|
|
10
|
-
|
|
11
|
-
vendorInfo && validateType(vendorInfo, ContractorInfo);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function ContractorInfo(recordType, email, companyName, additionalEmails) {
|
|
15
|
-
this.recordType = recordType;
|
|
16
|
-
this.email = email;
|
|
17
|
-
this.companyName = companyName;
|
|
18
|
-
this.title = email;
|
|
19
|
-
this.additionalEmails = additionalEmails;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
module.exports = { CreateContractorModel, ContractorInfo };
|
|
1
|
+
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
2
|
+
|
|
3
|
+
function CreateContractorModel(requirementId, inviterEmail, vendorInfo, { tabId = null, sendMail = false, publicLink } = {}) {
|
|
4
|
+
this.reqId = requirementId;
|
|
5
|
+
this.inviterEmail = inviterEmail;
|
|
6
|
+
this.vendorInfo = vendorInfo;
|
|
7
|
+
this.disableMail = !sendMail;
|
|
8
|
+
this.tabId = tabId;
|
|
9
|
+
this.publicLink = publicLink;
|
|
10
|
+
|
|
11
|
+
vendorInfo && validateType(vendorInfo, ContractorInfo);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function ContractorInfo(recordType, email, companyName, additionalEmails) {
|
|
15
|
+
this.recordType = recordType;
|
|
16
|
+
this.email = email;
|
|
17
|
+
this.companyName = companyName;
|
|
18
|
+
this.title = email;
|
|
19
|
+
this.additionalEmails = additionalEmails;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = { CreateContractorModel, ContractorInfo };
|