@getjones/test-infra 2.9.1 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/common/commonFlows/records/records.js +8 -8
- package/src/common/utils/complianceUtil.js +1 -0
- package/src/common/utils/timeUtils.js +4 -4
- package/src/resources/virusFile.pdf +0 -0
- package/src/saas/internal-api/compliance/api/audit/audit.service.js +4 -2
- package/src/saas/internal-api/compliance/consts/audit.js +20 -1
- package/src/saas/internal-api/compliance/models/audit/audit.model.js +2 -0
- package/src/saas/internal-api/contractors/api/contractors.api.js +3 -3
package/package.json
CHANGED
|
@@ -7,12 +7,12 @@ const contractors = require('../../../saas/internal-api/contractors');
|
|
|
7
7
|
const compliance = require('../../../saas/internal-api/compliance');
|
|
8
8
|
|
|
9
9
|
const makeRecordNotResponsive = async function(recordId, context, { isTenant } = {}) {
|
|
10
|
-
const
|
|
11
|
-
timeUtils.
|
|
12
|
-
timeUtils.
|
|
10
|
+
const offsetInDaysList = isTenant ?
|
|
11
|
+
timeUtils.getInviteActionOffsetInDaysForNotResponsiveTenant() :
|
|
12
|
+
timeUtils.getInviteActionOffsetInDaysForNotResponsiveVendor();
|
|
13
13
|
|
|
14
|
-
for (const
|
|
15
|
-
await updateLastInviteActionDate(recordId,
|
|
14
|
+
for (const offsetInDays of offsetInDaysList) {
|
|
15
|
+
await updateLastInviteActionDate(recordId, offsetInDays, context);
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
|
|
@@ -33,20 +33,20 @@ const updateInviteDate = async function(recordId, inviteDate, context) {
|
|
|
33
33
|
await timeUtils.waitFor(2.5).seconds; // calls for the same records can override each other
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
const updateLastInviteActionDate = async function(recordId,
|
|
36
|
+
const updateLastInviteActionDate = async function(recordId, offsetInDays, context) {
|
|
37
37
|
await timeUtils.waitFor(1).seconds;
|
|
38
38
|
/*
|
|
39
39
|
To run the reminders mails successfully we must first update the compliance audit actions date,
|
|
40
40
|
Since the thread scheduler will trigger the logic of the reminders mails
|
|
41
41
|
only if last invite action date will be equal or after compliance audit actions date
|
|
42
42
|
*/
|
|
43
|
-
const updateComplianceAuditResponse = await compliance.services.audit.updateComplianceAuditActionsDate(recordId,
|
|
43
|
+
const updateComplianceAuditResponse = await compliance.services.audit.updateComplianceAuditActionsDate(recordId, offsetInDays, context);
|
|
44
44
|
|
|
45
45
|
if (updateComplianceAuditResponse.status !== httpResponseStatusCodes.NO_CONTENT) {
|
|
46
46
|
throw new Error(`Compliance audit date could not be updated\n${updateComplianceAuditResponse}`);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
const updateLastInviteActionResponse = await contractors.services.updateLastInviteActionDate(recordId,
|
|
49
|
+
const updateLastInviteActionResponse = await contractors.services.updateLastInviteActionDate(recordId, offsetInDays, context);
|
|
50
50
|
|
|
51
51
|
if (updateLastInviteActionResponse.status !== httpResponseStatusCodes.NO_CONTENT) {
|
|
52
52
|
throw new Error(`Record invite date could not be updated\n${updateLastInviteActionResponse}`);
|
|
@@ -54,6 +54,7 @@ const getAuditMetadata = async (
|
|
|
54
54
|
contractorOverrideDateModified: recordDetails.contractorOverrideDateModified,
|
|
55
55
|
contractCreateDate: recordDetails.contractCreateDate
|
|
56
56
|
};
|
|
57
|
+
metadata.auditId = recordDetails.auditId;
|
|
57
58
|
|
|
58
59
|
metadata.auditorId = await getAuditorId();
|
|
59
60
|
|
|
@@ -94,7 +94,7 @@ const getInvitationDatesForNotResponsiveVendor = function() {
|
|
|
94
94
|
return [twoDaysAgoUtc, fiveDaysAgoUtc, eightDaysAgoUtc];
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
const
|
|
97
|
+
const getInviteActionOffsetInDaysForNotResponsiveVendor = function() {
|
|
98
98
|
return [inviteActionDateOffset.twoDays, inviteActionDateOffset.fiveDays, inviteActionDateOffset.eightDays];
|
|
99
99
|
};
|
|
100
100
|
|
|
@@ -106,7 +106,7 @@ const getInvitationDatesForNotResponsiveTenant = function() {
|
|
|
106
106
|
return [fiveDaysAgoUtc, tenDaysAgoUtc, fifteenDaysAgoUtc];
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
const
|
|
109
|
+
const getInviteActionOffsetInDaysForNotResponsiveTenant = function() {
|
|
110
110
|
return [inviteActionDateOffset.fiveDays, inviteActionDateOffset.tenDays, inviteActionDateOffset.fifteenDays];
|
|
111
111
|
};
|
|
112
112
|
|
|
@@ -156,9 +156,9 @@ module.exports = {
|
|
|
156
156
|
getDateinTwentyNineDays,
|
|
157
157
|
getDateInTwoMonths,
|
|
158
158
|
getInvitationDatesForNotResponsiveVendor,
|
|
159
|
-
|
|
159
|
+
getInviteActionOffsetInDaysForNotResponsiveVendor,
|
|
160
160
|
getInvitationDatesForNotResponsiveTenant,
|
|
161
|
-
|
|
161
|
+
getInviteActionOffsetInDaysForNotResponsiveTenant,
|
|
162
162
|
getAutomaticRenewalsExpirationDates,
|
|
163
163
|
getLogTimestamp,
|
|
164
164
|
getDayInMilliseconds,
|
|
Binary file
|
|
@@ -97,7 +97,8 @@ const getAuditRequestModel = (metaData, auditEntities) => {
|
|
|
97
97
|
isReaudit = false,
|
|
98
98
|
isProjectOnboarding = false,
|
|
99
99
|
shouldSendNotificationToPM = false,
|
|
100
|
-
auditDates = {}
|
|
100
|
+
auditDates = {},
|
|
101
|
+
auditId = null
|
|
101
102
|
} = metaData;
|
|
102
103
|
|
|
103
104
|
const auditDatesModel = new AuditDatesModel(
|
|
@@ -120,7 +121,8 @@ const getAuditRequestModel = (metaData, auditEntities) => {
|
|
|
120
121
|
isProjectOnboarding,
|
|
121
122
|
shouldSendNotificationToPM,
|
|
122
123
|
auditDatesModel,
|
|
123
|
-
auditStatus
|
|
124
|
+
auditStatus,
|
|
125
|
+
auditId
|
|
124
126
|
);
|
|
125
127
|
|
|
126
128
|
return auditRequestModel;
|
|
@@ -60,6 +60,23 @@ const ATTRIBUTE_NAMES_MAP = {
|
|
|
60
60
|
signature: 'signature'
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
+
const auditTriggerType = {
|
|
64
|
+
newAudit: 'NEW_AUDIT',
|
|
65
|
+
changeRequirements: 'CHANGE_REQUIREMENTS',
|
|
66
|
+
updateRequirements: 'UPDATE_REQUIREMENTS',
|
|
67
|
+
updateRequirementsWithNotifications: 'ENTITY_CHANGED',
|
|
68
|
+
gaps: 'GAPS',
|
|
69
|
+
renewal: 'RENEWAL'
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const auditStatus = {
|
|
73
|
+
pending: 'PENDING',
|
|
74
|
+
inProgress: 'IN_PROGRESS',
|
|
75
|
+
onHold: 'ON_HOLD',
|
|
76
|
+
done: 'DONE',
|
|
77
|
+
canceled: 'CANCELED'
|
|
78
|
+
};
|
|
79
|
+
|
|
63
80
|
module.exports = {
|
|
64
81
|
DEFAULT_POLICY_ID,
|
|
65
82
|
POLICY_NAMES_MAP,
|
|
@@ -67,5 +84,7 @@ module.exports = {
|
|
|
67
84
|
COI_AUDIT_STATUSES,
|
|
68
85
|
AUDITOR_ROLE,
|
|
69
86
|
AUDIT_ENTITY_STATUSES,
|
|
70
|
-
VALID_SCORES
|
|
87
|
+
VALID_SCORES,
|
|
88
|
+
auditTriggerType,
|
|
89
|
+
auditStatus
|
|
71
90
|
};
|
|
@@ -15,6 +15,7 @@ class AuditRequestModel {
|
|
|
15
15
|
shouldSendNotificationToPM = true,
|
|
16
16
|
auditDates = {},
|
|
17
17
|
auditStatus = null,
|
|
18
|
+
auditId = null,
|
|
18
19
|
auditorRole = AUDITOR_ROLE
|
|
19
20
|
) {
|
|
20
21
|
const auditData = {
|
|
@@ -36,6 +37,7 @@ class AuditRequestModel {
|
|
|
36
37
|
validateType(auditDates, AuditDatesModel);
|
|
37
38
|
this.auditData = auditData;
|
|
38
39
|
this.auditDates = auditDates;
|
|
40
|
+
this.auditId = auditId;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -20,7 +20,7 @@ const Endpoints = {
|
|
|
20
20
|
changeRequirement: `${backendUrl}/saas/contractor/requirement`,
|
|
21
21
|
updateVendorExpiryDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/expiry-date`,
|
|
22
22
|
updateContractorInviteDate: contractorId => `${backendUrl}/_saas/automation/contractor/${contractorId}/invite-date`,
|
|
23
|
-
updateLastInviteActionDate: recordId => `${backendUrl}/saas/automation/
|
|
23
|
+
updateLastInviteActionDate: recordId => `${backendUrl}/saas/automation/record/${recordId}/update-emails-date`,
|
|
24
24
|
searchInAutocomplete: ({ tabId, searchWord }) =>
|
|
25
25
|
`${backendUrl}/saas/requests/search/audited?&tabId=${tabId}&searchWord=${searchWord}`,
|
|
26
26
|
automationUpdateContractorUploadDate: contractorId => `${backendUrl}/saas/automation/contractor/${contractorId}/upload-date`,
|
|
@@ -128,8 +128,8 @@ const getLinkedProjectsCount = async (recordId, context) => {
|
|
|
128
128
|
return await requests.getRequestHandler(Endpoints.linkedProjectsCount(recordId), {}, context);
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
const updateLastInviteActionDate = (recordId,
|
|
132
|
-
const url = `${Endpoints.updateLastInviteActionDate(recordId)}?
|
|
131
|
+
const updateLastInviteActionDate = (recordId, offsetInDays, context) => {
|
|
132
|
+
const url = `${Endpoints.updateLastInviteActionDate(recordId)}?offsetInDays=${offsetInDays}`;
|
|
133
133
|
return requests.putRequestHandler(url, {}, context);
|
|
134
134
|
};
|
|
135
135
|
|