@getjones/test-infra 2.6.0 → 2.6.1
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 +30 -30
- 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 -41
- package/src/common/utils/numberUtils.js +22 -22
- package/src/common/utils/objectUtils.js +9 -9
- package/src/common/utils/timeUtils.js +171 -171
- package/src/common/validations/errorValidation.js +16 -16
- package/src/common/validations/typeValidations.js +36 -36
- package/src/defaults/configs/auditConfigs.js +85 -85
- package/src/defaults/configs/polices.js +47 -47
- package/src/defaults/configs/requirement.js +29 -29
- package/src/defaults/index.js +5 -5
- package/src/env.js +57 -57
- package/src/index.js +73 -73
- 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/consts/consts.js +6 -6
- package/src/saas/internal-api/accounts/index.js +21 -21
- 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 +23 -23
- package/src/saas/internal-api/accounts/utils/utils.js +32 -32
- package/src/saas/internal-api/auth/api/auth.api.js +18 -18
- package/src/saas/internal-api/auth/api/auth.service.js +67 -67
- 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 +40 -40
- package/src/saas/internal-api/compliance/api/audit/audit.service.js +151 -151
- 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 +175 -175
- package/src/saas/internal-api/contractors/api/contractors.api.js +141 -141
- package/src/saas/internal-api/contractors/api/contractors.service.js +147 -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 -12
- package/src/saas/internal-api/dashboardInnerPage/api/recordList.service.js +7 -7
- package/src/saas/internal-api/dashboardInnerPage/index.js +5 -5
- package/src/saas/internal-api/dashboardInnerPage/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 +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 +45 -45
- package/src/saas/internal-api/requirements/api/requirements.service.js +94 -94
- package/src/saas/internal-api/requirements/consts/attributeTypes.json +5 -5
- package/src/saas/internal-api/requirements/consts/consts.js +6 -6
- package/src/saas/internal-api/requirements/index.js +8 -8
- package/src/saas/internal-api/requirements/models/create.requirement.model.js +17 -17
- package/src/saas/internal-api/requirements/models/policy.model.js +32 -32
- package/src/saas/internal-api/requirements/models/update.requirement.model.js +21 -21
- package/src/saas/internal-api/requirements/utils/utils.js +101 -101
- 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 +39 -39
- 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,123 +1,147 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
+
const httpResponseStatusCodes = require('../../../../common/httpResponseStatusCodes.json');
|
|
7
|
+
|
|
8
|
+
const createContractor = async (createContractorModel, context) => {
|
|
9
|
+
validateType(createContractorModel, CreateContractorModel);
|
|
10
|
+
return contractorsAPI.createContractor(createContractorModel, context);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const getContractorsByAccountId = async (accountId, context, activationStatus = null) => {
|
|
14
|
+
if (activationStatus) {
|
|
15
|
+
activationStatus = activationStatus.reduce((f, s) => `${f},${s}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return contractorsAPI.getContractorsByAccountId({ accountId, activationStatus }, context);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const getContractorById = (contractorId, context) => {
|
|
22
|
+
return contractorsAPI.getContractorById(contractorId, context);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const getRecordHistory = (contractorId, context) => {
|
|
26
|
+
return contractorsAPI.getRecordHistory(contractorId, context);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const archiveByContractorId = (contractorId, context) => {
|
|
30
|
+
return contractorsAPI.archiveByContractorId(contractorId, context);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const restoreContractor = (recordVerificationModel, context) => {
|
|
34
|
+
validateType(recordVerificationModel, RecordModifyDateVerificationModel);
|
|
35
|
+
return contractorsAPI.restoreContractor(recordVerificationModel, context);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const editContractor = (editRequestModel, context) => {
|
|
39
|
+
validateType(editRequestModel, RequestModel);
|
|
40
|
+
return contractorsAPI.editContractor(editRequestModel, context);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const updateExpiryDate = (contractorId, expiryDate, policyName) => {
|
|
44
|
+
return contractorsAPI.updateExpiryDate(contractorId, expiryDate, policyName);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const updateInviteDate = (contractorId, inviteDate, context) => {
|
|
48
|
+
return contractorsAPI.updateInviteDate(contractorId, inviteDate, context);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const getContractorsByTabId = (tabId, context, activityStatus = 'Active') => {
|
|
52
|
+
return contractorsAPI.getContractorsByTabId(tabId, context, activityStatus);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const searchInAutoComplete = ({ tabId, searchWord }, context) => {
|
|
56
|
+
return contractorsAPI.searchInAutocomplete({ tabId, searchWord }, context);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const updateContractorUploadDate = (contractorId, uploadDate, context) => {
|
|
60
|
+
validateType(uploadDate, Date);
|
|
61
|
+
return contractorsAPI.updateContractorUploadDate(contractorId, uploadDate, context);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const changeRequirement = (recordModifyDateVerificationModel, context) => {
|
|
65
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
66
|
+
return contractorsAPI.changeRequirement(recordModifyDateVerificationModel, context);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const sendGaps = (recordModifyDateVerificationModel, context) => {
|
|
70
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
71
|
+
return contractorsAPI.sendGaps(recordModifyDateVerificationModel, context);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const requestNewCoiAboutToExpire = (recordModifyDateVerificationModel, context) => {
|
|
75
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
76
|
+
return contractorsAPI.requestNewCoiAboutToExpire(recordModifyDateVerificationModel, context);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const requestNewCoiExpired = (recordModifyDateVerificationModel, context) => {
|
|
80
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
81
|
+
return contractorsAPI.requestNewCoiExpired(recordModifyDateVerificationModel, context);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const resendInvitation = (recordModifyDateVerificationModel, context) => {
|
|
85
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
86
|
+
return contractorsAPI.resendInvitation(recordModifyDateVerificationModel, context);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const muteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
90
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
91
|
+
return contractorsAPI.muteNotifications(recordModifyDateVerificationModel, context);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const unmuteNotifications = (recordModifyDateVerificationModel, context) => {
|
|
95
|
+
validateType(recordModifyDateVerificationModel, RecordModifyDateVerificationModel);
|
|
96
|
+
return contractorsAPI.unmuteNotifications(recordModifyDateVerificationModel, context);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const deleteByContractorId = (contractorId, context) => {
|
|
100
|
+
return contractorsAPI.deleteByContractorId(contractorId, context);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const deleteAllRecordsInAccount = async (accountId, context, { activationStatus } = {}) => {
|
|
104
|
+
const { data: existingRecords } = await getContractorsByAccountId(accountId, context, activationStatus);
|
|
105
|
+
|
|
106
|
+
if (!existingRecords.length) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const failed = [];
|
|
111
|
+
for (const record of existingRecords) {
|
|
112
|
+
const response = await deleteByContractorId(record.id, context);
|
|
113
|
+
|
|
114
|
+
if (response.status !== httpResponseStatusCodes.NO_CONTENT) {
|
|
115
|
+
console.error('Failed to delete record: ', record.company);
|
|
116
|
+
failed.push(response);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (failed.length) {
|
|
121
|
+
throw Error(`Failed to delete ${failed.length} of ${existingRecords.length} records in account. Failed with status: ${ failed[0].status }`);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
module.exports = {
|
|
126
|
+
createContractor,
|
|
127
|
+
changeRequirement,
|
|
128
|
+
getContractorsByAccountId,
|
|
129
|
+
getContractorById,
|
|
130
|
+
getRecordHistory,
|
|
131
|
+
archiveByContractorId,
|
|
132
|
+
restoreContractor,
|
|
133
|
+
editContractor,
|
|
134
|
+
updateInviteDate,
|
|
135
|
+
updateExpiryDate,
|
|
136
|
+
getContractorsByTabId,
|
|
137
|
+
searchInAutoComplete,
|
|
138
|
+
updateContractorUploadDate,
|
|
139
|
+
sendGaps,
|
|
140
|
+
requestNewCoiAboutToExpire,
|
|
141
|
+
requestNewCoiExpired,
|
|
142
|
+
resendInvitation,
|
|
143
|
+
muteNotifications,
|
|
144
|
+
unmuteNotifications,
|
|
145
|
+
deleteByContractorId,
|
|
146
|
+
deleteAllRecordsInAccount
|
|
147
|
+
};
|
|
@@ -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 };
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
2
|
-
|
|
3
|
-
class ContractorModel {
|
|
4
|
-
constructor(contractorId, recordType, company, emailAddress, additionalDetails) {
|
|
5
|
-
validateType(additionalDetails, ContractorDetailsModel);
|
|
6
|
-
|
|
7
|
-
this.contractorId = contractorId;
|
|
8
|
-
this.recordType = recordType;
|
|
9
|
-
this.company = company;
|
|
10
|
-
this.emailAddress = emailAddress;
|
|
11
|
-
|
|
12
|
-
for (const detail in additionalDetails) {
|
|
13
|
-
if (additionalDetails[detail]) {
|
|
14
|
-
this[detail] = additionalDetails[detail];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
class ContractorDetailsModel {
|
|
21
|
-
constructor({
|
|
22
|
-
additionalEmails = [],
|
|
23
|
-
dba = null,
|
|
24
|
-
firstName = null,
|
|
25
|
-
lastName = null,
|
|
26
|
-
address = null,
|
|
27
|
-
city = null,
|
|
28
|
-
state = null,
|
|
29
|
-
zipCode = null,
|
|
30
|
-
phoneNumber = null,
|
|
31
|
-
recordId = null,
|
|
32
|
-
projectDescription = null,
|
|
33
|
-
startDate = null,
|
|
34
|
-
endDate = null
|
|
35
|
-
} = {}) {
|
|
36
|
-
this.dba = dba;
|
|
37
|
-
this.fName = firstName;
|
|
38
|
-
this.lName = lastName;
|
|
39
|
-
this.location = address;
|
|
40
|
-
this.city = city;
|
|
41
|
-
this.state = state;
|
|
42
|
-
this.zipCode = zipCode;
|
|
43
|
-
this.phoneNumber = phoneNumber;
|
|
44
|
-
this.externalRecordId = recordId;
|
|
45
|
-
this.descriptionOfOperations = projectDescription;
|
|
46
|
-
this.startDate = startDate;
|
|
47
|
-
this.endDate = endDate;
|
|
48
|
-
|
|
49
|
-
this.additionalEmails = [];
|
|
50
|
-
|
|
51
|
-
for (const email of additionalEmails) {
|
|
52
|
-
this.additionalEmails.push(typeof email === 'string' ? { email: email } : email);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
module.exports = {
|
|
58
|
-
ContractorModel,
|
|
59
|
-
ContractorDetailsModel
|
|
60
|
-
};
|
|
1
|
+
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
2
|
+
|
|
3
|
+
class ContractorModel {
|
|
4
|
+
constructor(contractorId, recordType, company, emailAddress, additionalDetails) {
|
|
5
|
+
validateType(additionalDetails, ContractorDetailsModel);
|
|
6
|
+
|
|
7
|
+
this.contractorId = contractorId;
|
|
8
|
+
this.recordType = recordType;
|
|
9
|
+
this.company = company;
|
|
10
|
+
this.emailAddress = emailAddress;
|
|
11
|
+
|
|
12
|
+
for (const detail in additionalDetails) {
|
|
13
|
+
if (additionalDetails[detail]) {
|
|
14
|
+
this[detail] = additionalDetails[detail];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class ContractorDetailsModel {
|
|
21
|
+
constructor({
|
|
22
|
+
additionalEmails = [],
|
|
23
|
+
dba = null,
|
|
24
|
+
firstName = null,
|
|
25
|
+
lastName = null,
|
|
26
|
+
address = null,
|
|
27
|
+
city = null,
|
|
28
|
+
state = null,
|
|
29
|
+
zipCode = null,
|
|
30
|
+
phoneNumber = null,
|
|
31
|
+
recordId = null,
|
|
32
|
+
projectDescription = null,
|
|
33
|
+
startDate = null,
|
|
34
|
+
endDate = null
|
|
35
|
+
} = {}) {
|
|
36
|
+
this.dba = dba;
|
|
37
|
+
this.fName = firstName;
|
|
38
|
+
this.lName = lastName;
|
|
39
|
+
this.location = address;
|
|
40
|
+
this.city = city;
|
|
41
|
+
this.state = state;
|
|
42
|
+
this.zipCode = zipCode;
|
|
43
|
+
this.phoneNumber = phoneNumber;
|
|
44
|
+
this.externalRecordId = recordId;
|
|
45
|
+
this.descriptionOfOperations = projectDescription;
|
|
46
|
+
this.startDate = startDate;
|
|
47
|
+
this.endDate = endDate;
|
|
48
|
+
|
|
49
|
+
this.additionalEmails = [];
|
|
50
|
+
|
|
51
|
+
for (const email of additionalEmails) {
|
|
52
|
+
this.additionalEmails.push(typeof email === 'string' ? { email: email } : email);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = {
|
|
58
|
+
ContractorModel,
|
|
59
|
+
ContractorDetailsModel
|
|
60
|
+
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
const { validateDateString } = require('../../../../common/validations/typeValidations');
|
|
2
|
-
|
|
3
|
-
class RecordModifyDateVerificationModel {
|
|
4
|
-
constructor(
|
|
5
|
-
contractorId,
|
|
6
|
-
{
|
|
7
|
-
contractorDateModified,
|
|
8
|
-
contractorOverrideDateModified,
|
|
9
|
-
requirementId,
|
|
10
|
-
requirementDateModified
|
|
11
|
-
} = {}
|
|
12
|
-
) {
|
|
13
|
-
contractorDateModified && validateDateString(contractorDateModified);
|
|
14
|
-
contractorOverrideDateModified && validateDateString(contractorOverrideDateModified);
|
|
15
|
-
requirementId && validateDateString(requirementDateModified);
|
|
16
|
-
|
|
17
|
-
this.contractorId = contractorId;
|
|
18
|
-
this.contractorDateModified = contractorDateModified;
|
|
19
|
-
this.contractorOverrideDateModified = contractorOverrideDateModified;
|
|
20
|
-
this.requirementId = requirementId;
|
|
21
|
-
this.requirementDateModified = requirementDateModified;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
module.exports = {
|
|
26
|
-
RecordModifyDateVerificationModel
|
|
27
|
-
};
|
|
1
|
+
const { validateDateString } = require('../../../../common/validations/typeValidations');
|
|
2
|
+
|
|
3
|
+
class RecordModifyDateVerificationModel {
|
|
4
|
+
constructor(
|
|
5
|
+
contractorId,
|
|
6
|
+
{
|
|
7
|
+
contractorDateModified,
|
|
8
|
+
contractorOverrideDateModified,
|
|
9
|
+
requirementId,
|
|
10
|
+
requirementDateModified
|
|
11
|
+
} = {}
|
|
12
|
+
) {
|
|
13
|
+
contractorDateModified && validateDateString(contractorDateModified);
|
|
14
|
+
contractorOverrideDateModified && validateDateString(contractorOverrideDateModified);
|
|
15
|
+
requirementId && validateDateString(requirementDateModified);
|
|
16
|
+
|
|
17
|
+
this.contractorId = contractorId;
|
|
18
|
+
this.contractorDateModified = contractorDateModified;
|
|
19
|
+
this.contractorOverrideDateModified = contractorOverrideDateModified;
|
|
20
|
+
this.requirementId = requirementId;
|
|
21
|
+
this.requirementDateModified = requirementDateModified;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = {
|
|
26
|
+
RecordModifyDateVerificationModel
|
|
27
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
-
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
|
-
|
|
4
|
-
const Endpoints = {
|
|
5
|
-
innerPageRecordsApi: `${backendUrl}/saas/analytics/dashboard/
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const getSortedRecordsForDashboardInnerPage = (dashboardCriteriaModel, context) => {
|
|
9
|
-
return requests.postRequestHandler(Endpoints.innerPageRecordsApi, dashboardCriteriaModel, context);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
module.exports = { getSortedRecordsForDashboardInnerPage };
|
|
1
|
+
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
+
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
|
+
|
|
4
|
+
const Endpoints = {
|
|
5
|
+
innerPageRecordsApi: `${backendUrl}/saas/analytics/dashboard/requests`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const getSortedRecordsForDashboardInnerPage = (dashboardCriteriaModel, context) => {
|
|
9
|
+
return requests.postRequestHandler(Endpoints.innerPageRecordsApi, dashboardCriteriaModel, context);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
module.exports = { getSortedRecordsForDashboardInnerPage };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const recordListAPI = require('./recordList.api');
|
|
2
|
-
|
|
3
|
-
const getSortedRecordsForDashboardInnerPage = (dashboardCriteriaModel, context) => {
|
|
4
|
-
return recordListAPI.getSortedRecordsForDashboardInnerPage(dashboardCriteriaModel, context);
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
module.exports = { getSortedRecordsForDashboardInnerPage };
|
|
1
|
+
const recordListAPI = require('./recordList.api');
|
|
2
|
+
|
|
3
|
+
const getSortedRecordsForDashboardInnerPage = (dashboardCriteriaModel, context) => {
|
|
4
|
+
return recordListAPI.getSortedRecordsForDashboardInnerPage(dashboardCriteriaModel, context);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
module.exports = { getSortedRecordsForDashboardInnerPage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const criteria = require('./models/dashboard.filter.criteria.model');
|
|
2
|
-
const services = require('./api/recordList.service');
|
|
3
|
-
|
|
4
|
-
const models = { filterCriteria: criteria };
|
|
5
|
-
module.exports = { services, models };
|
|
1
|
+
const criteria = require('./models/dashboard.filter.criteria.model');
|
|
2
|
+
const services = require('./api/recordList.service');
|
|
3
|
+
|
|
4
|
+
const models = { filterCriteria: criteria };
|
|
5
|
+
module.exports = { services, models };
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
2
|
-
|
|
3
|
-
class DashboardInnerPageRecordListCriteriaModel {
|
|
4
|
-
constructor({
|
|
5
|
-
appliedFilters = [],
|
|
6
|
-
criteria = null,
|
|
7
|
-
chartType = null,
|
|
8
|
-
sortBy = null,
|
|
9
|
-
sortOrder = null,
|
|
10
|
-
pageNo = 1
|
|
11
|
-
} = {}) {
|
|
12
|
-
appliedFilters && validateType(appliedFilters, AnalyticsDashboardRequestModel);
|
|
13
|
-
|
|
14
|
-
this.appliedFilters = appliedFilters,
|
|
15
|
-
this.criteria = criteria,
|
|
16
|
-
this.chartType = chartType,
|
|
17
|
-
this.sortBy = sortBy,
|
|
18
|
-
this.sortOrder = sortOrder,
|
|
19
|
-
this.pageNo = pageNo;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
class AnalyticsDashboardRequestModel {
|
|
24
|
-
constructor({
|
|
25
|
-
propertiesIds = [],
|
|
26
|
-
recordTypes = [],
|
|
27
|
-
accountId = null
|
|
28
|
-
} = {}) {
|
|
29
|
-
this.propertiesIds = propertiesIds;
|
|
30
|
-
this.recordTypes = recordTypes;
|
|
31
|
-
this.accountId = accountId;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
module.exports = {
|
|
36
|
-
DashboardInnerPageRecordListCriteriaModel,
|
|
37
|
-
AnalyticsDashboardRequestModel
|
|
38
|
-
};
|
|
1
|
+
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
2
|
+
|
|
3
|
+
class DashboardInnerPageRecordListCriteriaModel {
|
|
4
|
+
constructor({
|
|
5
|
+
appliedFilters = [],
|
|
6
|
+
criteria = null,
|
|
7
|
+
chartType = null,
|
|
8
|
+
sortBy = null,
|
|
9
|
+
sortOrder = null,
|
|
10
|
+
pageNo = 1
|
|
11
|
+
} = {}) {
|
|
12
|
+
appliedFilters && validateType(appliedFilters, AnalyticsDashboardRequestModel);
|
|
13
|
+
|
|
14
|
+
this.appliedFilters = appliedFilters,
|
|
15
|
+
this.criteria = criteria,
|
|
16
|
+
this.chartType = chartType,
|
|
17
|
+
this.sortBy = sortBy,
|
|
18
|
+
this.sortOrder = sortOrder,
|
|
19
|
+
this.pageNo = pageNo;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class AnalyticsDashboardRequestModel {
|
|
24
|
+
constructor({
|
|
25
|
+
propertiesIds = [],
|
|
26
|
+
recordTypes = [],
|
|
27
|
+
accountId = null
|
|
28
|
+
} = {}) {
|
|
29
|
+
this.propertiesIds = propertiesIds;
|
|
30
|
+
this.recordTypes = recordTypes;
|
|
31
|
+
this.accountId = accountId;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = {
|
|
36
|
+
DashboardInnerPageRecordListCriteriaModel,
|
|
37
|
+
AnalyticsDashboardRequestModel
|
|
38
|
+
};
|