@getjones/test-infra 1.12.0 → 2.1.0
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/{factory → commonFlows}/index.js +3 -3
- package/src/common/{factory → 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/numberUtils.js +22 -22
- package/src/common/utils/timeUtils.js +162 -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 +69 -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 +19 -19
- package/src/saas/internal-api/accounts/utils/utils.js +32 -32
- package/src/saas/internal-api/auth/api/auth.api.js +12 -12
- package/src/saas/internal-api/auth/api/auth.service.js +47 -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 +40 -40
- package/src/saas/internal-api/compliance/api/audit/audit.service.js +33 -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/index.js +22 -22
- package/src/saas/internal-api/compliance/models/audit/audit.model.js +110 -110
- package/src/saas/internal-api/compliance/models/waive/waive.model.js +45 -45
- package/src/saas/internal-api/contractors/api/contractors.api.js +147 -146
- package/src/saas/internal-api/contractors/api/contractors.service.js +130 -129
- 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 -74
- package/src/saas/internal-api/contractors/models/verification.contractor.model.js +27 -27
- 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 +34 -28
- package/src/saas/internal-api/requests/api/requests.service.js +31 -19
- package/src/saas/internal-api/requests/index.js +11 -9
- package/src/saas/internal-api/requests/models/edit.request.model.js +31 -0
- package/src/saas/internal-api/requests/models/tenant.request.model.js +9 -9
- package/src/saas/internal-api/requests/utils.js +8 -0
- 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/index.js +6 -6
- package/src/saas/internal-api/requirements/models/create.requirement.model.js +45 -45
- 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,59 +1,59 @@
|
|
|
1
|
-
const compareUnorderedArrays = (arr, other, { caseSensitive = true } = {}) => {
|
|
2
|
-
const isEachElementEqual = arr.sort().every((mail, i) => {
|
|
3
|
-
if (caseSensitive) {
|
|
4
|
-
return mail === other.sort()[i];
|
|
5
|
-
} else {
|
|
6
|
-
return mail.toLowerCase() === other.sort()[i].toLowerCase();
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
return arr.length === other.length && isEachElementEqual;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const recipientsMatchVerification = (expectedRecipients, actualRecipients) => {
|
|
13
|
-
const caseSensitive = false;
|
|
14
|
-
|
|
15
|
-
return expectedRecipients.from.includes(actualRecipients.from) && // For some emails can be few sendor options (ex: branded emails)
|
|
16
|
-
compareUnorderedArrays(actualRecipients.to, expectedRecipients.to, { caseSensitive }) &&
|
|
17
|
-
compareUnorderedArrays(actualRecipients.cc, expectedRecipients.cc, { caseSensitive });
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const regexVerification = (message, regex, { returnType } = {}) => {
|
|
21
|
-
const capturingGroupsArr = message.match(regex);
|
|
22
|
-
|
|
23
|
-
if (!capturingGroupsArr || capturingGroupsArr.length < 1) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const capturingGroups = capturingGroupsArr[capturingGroupsArr.length - 1];
|
|
28
|
-
|
|
29
|
-
if (!capturingGroups || capturingGroups.length < 2) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
switch (returnType) {
|
|
34
|
-
case 'url':
|
|
35
|
-
return typeof capturingGroups === 'string' ? capturingGroups : capturingGroups[capturingGroups.length - 1];
|
|
36
|
-
case 'body':
|
|
37
|
-
return message;
|
|
38
|
-
default:
|
|
39
|
-
return 'Bad "returnType" argument';
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const extractEmailFromNameAndEmailFormat = str => {
|
|
44
|
-
// In case the format is 'First Last <username@domain.com>' we will return username@domain.com only
|
|
45
|
-
return str.split('<').pop().split('>')[0];
|
|
46
|
-
};
|
|
47
|
-
const logRetrievedEmailInfo = (to, subject, { cc } = {}) => {
|
|
48
|
-
let log = 'The following email retrieved and will be sent to trash:';
|
|
49
|
-
log += `\n| To: ${to}`;
|
|
50
|
-
cc ? log += `\n| Cc: ${cc}` : '';
|
|
51
|
-
log += `\n| Subject: ${subject}`;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
module.exports = {
|
|
55
|
-
recipientsMatchVerification,
|
|
56
|
-
regexVerification,
|
|
57
|
-
extractEmailFromNameAndEmailFormat,
|
|
58
|
-
logRetrievedEmailInfo
|
|
59
|
-
};
|
|
1
|
+
const compareUnorderedArrays = (arr, other, { caseSensitive = true } = {}) => {
|
|
2
|
+
const isEachElementEqual = arr.sort().every((mail, i) => {
|
|
3
|
+
if (caseSensitive) {
|
|
4
|
+
return mail === other.sort()[i];
|
|
5
|
+
} else {
|
|
6
|
+
return mail.toLowerCase() === other.sort()[i].toLowerCase();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
return arr.length === other.length && isEachElementEqual;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const recipientsMatchVerification = (expectedRecipients, actualRecipients) => {
|
|
13
|
+
const caseSensitive = false;
|
|
14
|
+
|
|
15
|
+
return expectedRecipients.from.includes(actualRecipients.from) && // For some emails can be few sendor options (ex: branded emails)
|
|
16
|
+
compareUnorderedArrays(actualRecipients.to, expectedRecipients.to, { caseSensitive }) &&
|
|
17
|
+
compareUnorderedArrays(actualRecipients.cc, expectedRecipients.cc, { caseSensitive });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const regexVerification = (message, regex, { returnType } = {}) => {
|
|
21
|
+
const capturingGroupsArr = message.match(regex);
|
|
22
|
+
|
|
23
|
+
if (!capturingGroupsArr || capturingGroupsArr.length < 1) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const capturingGroups = capturingGroupsArr[capturingGroupsArr.length - 1];
|
|
28
|
+
|
|
29
|
+
if (!capturingGroups || capturingGroups.length < 2) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
switch (returnType) {
|
|
34
|
+
case 'url':
|
|
35
|
+
return typeof capturingGroups === 'string' ? capturingGroups : capturingGroups[capturingGroups.length - 1];
|
|
36
|
+
case 'body':
|
|
37
|
+
return message;
|
|
38
|
+
default:
|
|
39
|
+
return 'Bad "returnType" argument';
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const extractEmailFromNameAndEmailFormat = str => {
|
|
44
|
+
// In case the format is 'First Last <username@domain.com>' we will return username@domain.com only
|
|
45
|
+
return str.split('<').pop().split('>')[0];
|
|
46
|
+
};
|
|
47
|
+
const logRetrievedEmailInfo = (to, subject, { cc } = {}) => {
|
|
48
|
+
let log = 'The following email retrieved and will be sent to trash:';
|
|
49
|
+
log += `\n| To: ${to}`;
|
|
50
|
+
cc ? log += `\n| Cc: ${cc}` : '';
|
|
51
|
+
log += `\n| Subject: ${subject}`;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
module.exports = {
|
|
55
|
+
recipientsMatchVerification,
|
|
56
|
+
regexVerification,
|
|
57
|
+
extractEmailFromNameAndEmailFormat,
|
|
58
|
+
logRetrievedEmailInfo
|
|
59
|
+
};
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
const cookieAuthRequests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
-
const apiKeyAuthRequests = require('../../../../common/requests/apiKeyAuth/requests');
|
|
3
|
-
|
|
4
|
-
const { nodeBackendUrl, backendUrl } = require('../../../../env').getEnv();
|
|
5
|
-
|
|
6
|
-
const Endpoints = {
|
|
7
|
-
createGlobalRecord: `${nodeBackendUrl}/global-record`,
|
|
8
|
-
getGlobalRecordById: id => `${nodeBackendUrl}/global-record/id/${id}`,
|
|
9
|
-
getAllGlobalRecords: (pageNumber, itemsInPage) => `${nodeBackendUrl}/global-record/all-global-records/${pageNumber}/items/${itemsInPage}`,
|
|
10
|
-
getGlobalRecordServiceAreas: `${backendUrl}/saas/global-record/service-areas`,
|
|
11
|
-
deleteGlobalRecord: id => `${nodeBackendUrl}/global-record/id/${id}`,
|
|
12
|
-
updateGlobalRecord: id => `${nodeBackendUrl}/global-record/id/${id}`,
|
|
13
|
-
getRecordProfileDetails: id => `${nodeBackendUrl}/global-record/record-profile/id/${id}`,
|
|
14
|
-
getGlobalRecordByPolicyNumber: policyNumber => `${nodeBackendUrl}/global-record/policyNumber/${policyNumber}`,
|
|
15
|
-
publishGlobalRecord: `${backendUrl}/saas/global-record/publish`,
|
|
16
|
-
getGlobalRecordLinkedRecords: id => `${backendUrl}/saas/global-record/${id}/linked-records`,
|
|
17
|
-
splitToNewGlobalRecord: `${backendUrl}/saas/global-record/split-to-new`
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const getGlobalRecord = async (id, nodeBackendSecret) => {
|
|
21
|
-
return apiKeyAuthRequests.getRequestHandler(Endpoints.getGlobalRecordById(id), nodeBackendSecret);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const createGlobalRecord = async (globalRecord, nodeBackendSecret) => {
|
|
25
|
-
return apiKeyAuthRequests.postRequestHandler(Endpoints.createGlobalRecord, nodeBackendSecret, globalRecord);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const getAllGlobalRecords = async (data, pageNumber, itemsInPage, context) => {
|
|
29
|
-
return cookieAuthRequests.postRequestHandler(Endpoints.getAllGlobalRecords(pageNumber, itemsInPage), data, context);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const deleteGlobalRecord = async (id, nodeBackendSecret, globalRecordModel) => {
|
|
33
|
-
return apiKeyAuthRequests.deleteRequestHandler(Endpoints.deleteGlobalRecord(id), nodeBackendSecret, {}, {}, globalRecordModel);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const updateGlobalRecord = async (id, nodeBackendSecret, updatedGlobalRecord) => {
|
|
37
|
-
return apiKeyAuthRequests.putRequestHandler(Endpoints.updateGlobalRecord(id), nodeBackendSecret, updatedGlobalRecord);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const getGlobalRecordServiceAreas = async context => {
|
|
41
|
-
return cookieAuthRequests.getRequestHandler(Endpoints.getGlobalRecordServiceAreas, {}, context);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const getRecordProfileDetails = async (id, context) => {
|
|
45
|
-
return cookieAuthRequests.getRequestHandler(Endpoints.getRecordProfileDetails(id), {}, context);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const publishGlobalRecord = async (globalRecordDetails, context) => {
|
|
49
|
-
return cookieAuthRequests.putRequestHandler(Endpoints.publishGlobalRecord, globalRecordDetails, context);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const getGlobalRecordByPolicyNumber = async (policyNumber, nodeBackendSecret) => {
|
|
53
|
-
return apiKeyAuthRequests.getRequestHandler(Endpoints.getGlobalRecordByPolicyNumber(policyNumber), nodeBackendSecret);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const getGlobalRecordLinkedRecords = async (id, context) => {
|
|
57
|
-
return cookieAuthRequests.getRequestHandler(Endpoints.getGlobalRecordLinkedRecords(id), {}, context);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const splitToNewGlobalRecord = ({ recordId, glPolicyNumber }, context) => {
|
|
61
|
-
return cookieAuthRequests.postRequestHandler(Endpoints.splitToNewGlobalRecord, { recordId, glPolicyNumber }, context);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
module.exports = {
|
|
65
|
-
createGlobalRecord,
|
|
66
|
-
getGlobalRecord,
|
|
67
|
-
getAllGlobalRecords,
|
|
68
|
-
getGlobalRecordServiceAreas,
|
|
69
|
-
deleteGlobalRecord,
|
|
70
|
-
updateGlobalRecord,
|
|
71
|
-
getRecordProfileDetails,
|
|
72
|
-
getGlobalRecordByPolicyNumber,
|
|
73
|
-
publishGlobalRecord,
|
|
74
|
-
getGlobalRecordLinkedRecords,
|
|
75
|
-
splitToNewGlobalRecord
|
|
76
|
-
};
|
|
1
|
+
const cookieAuthRequests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
+
const apiKeyAuthRequests = require('../../../../common/requests/apiKeyAuth/requests');
|
|
3
|
+
|
|
4
|
+
const { nodeBackendUrl, backendUrl } = require('../../../../env').getEnv();
|
|
5
|
+
|
|
6
|
+
const Endpoints = {
|
|
7
|
+
createGlobalRecord: `${nodeBackendUrl}/global-record`,
|
|
8
|
+
getGlobalRecordById: id => `${nodeBackendUrl}/global-record/id/${id}`,
|
|
9
|
+
getAllGlobalRecords: (pageNumber, itemsInPage) => `${nodeBackendUrl}/global-record/all-global-records/${pageNumber}/items/${itemsInPage}`,
|
|
10
|
+
getGlobalRecordServiceAreas: `${backendUrl}/saas/global-record/service-areas`,
|
|
11
|
+
deleteGlobalRecord: id => `${nodeBackendUrl}/global-record/id/${id}`,
|
|
12
|
+
updateGlobalRecord: id => `${nodeBackendUrl}/global-record/id/${id}`,
|
|
13
|
+
getRecordProfileDetails: id => `${nodeBackendUrl}/global-record/record-profile/id/${id}`,
|
|
14
|
+
getGlobalRecordByPolicyNumber: policyNumber => `${nodeBackendUrl}/global-record/policyNumber/${policyNumber}`,
|
|
15
|
+
publishGlobalRecord: `${backendUrl}/saas/global-record/publish`,
|
|
16
|
+
getGlobalRecordLinkedRecords: id => `${backendUrl}/saas/global-record/${id}/linked-records`,
|
|
17
|
+
splitToNewGlobalRecord: `${backendUrl}/saas/global-record/split-to-new`
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getGlobalRecord = async (id, nodeBackendSecret) => {
|
|
21
|
+
return apiKeyAuthRequests.getRequestHandler(Endpoints.getGlobalRecordById(id), nodeBackendSecret);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const createGlobalRecord = async (globalRecord, nodeBackendSecret) => {
|
|
25
|
+
return apiKeyAuthRequests.postRequestHandler(Endpoints.createGlobalRecord, nodeBackendSecret, globalRecord);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const getAllGlobalRecords = async (data, pageNumber, itemsInPage, context) => {
|
|
29
|
+
return cookieAuthRequests.postRequestHandler(Endpoints.getAllGlobalRecords(pageNumber, itemsInPage), data, context);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const deleteGlobalRecord = async (id, nodeBackendSecret, globalRecordModel) => {
|
|
33
|
+
return apiKeyAuthRequests.deleteRequestHandler(Endpoints.deleteGlobalRecord(id), nodeBackendSecret, {}, {}, globalRecordModel);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const updateGlobalRecord = async (id, nodeBackendSecret, updatedGlobalRecord) => {
|
|
37
|
+
return apiKeyAuthRequests.putRequestHandler(Endpoints.updateGlobalRecord(id), nodeBackendSecret, updatedGlobalRecord);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const getGlobalRecordServiceAreas = async context => {
|
|
41
|
+
return cookieAuthRequests.getRequestHandler(Endpoints.getGlobalRecordServiceAreas, {}, context);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const getRecordProfileDetails = async (id, context) => {
|
|
45
|
+
return cookieAuthRequests.getRequestHandler(Endpoints.getRecordProfileDetails(id), {}, context);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const publishGlobalRecord = async (globalRecordDetails, context) => {
|
|
49
|
+
return cookieAuthRequests.putRequestHandler(Endpoints.publishGlobalRecord, globalRecordDetails, context);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const getGlobalRecordByPolicyNumber = async (policyNumber, nodeBackendSecret) => {
|
|
53
|
+
return apiKeyAuthRequests.getRequestHandler(Endpoints.getGlobalRecordByPolicyNumber(policyNumber), nodeBackendSecret);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const getGlobalRecordLinkedRecords = async (id, context) => {
|
|
57
|
+
return cookieAuthRequests.getRequestHandler(Endpoints.getGlobalRecordLinkedRecords(id), {}, context);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const splitToNewGlobalRecord = ({ recordId, glPolicyNumber }, context) => {
|
|
61
|
+
return cookieAuthRequests.postRequestHandler(Endpoints.splitToNewGlobalRecord, { recordId, glPolicyNumber }, context);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
module.exports = {
|
|
65
|
+
createGlobalRecord,
|
|
66
|
+
getGlobalRecord,
|
|
67
|
+
getAllGlobalRecords,
|
|
68
|
+
getGlobalRecordServiceAreas,
|
|
69
|
+
deleteGlobalRecord,
|
|
70
|
+
updateGlobalRecord,
|
|
71
|
+
getRecordProfileDetails,
|
|
72
|
+
getGlobalRecordByPolicyNumber,
|
|
73
|
+
publishGlobalRecord,
|
|
74
|
+
getGlobalRecordLinkedRecords,
|
|
75
|
+
splitToNewGlobalRecord
|
|
76
|
+
};
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
const globalRecordAPI = require('./global.record.api');
|
|
2
|
-
const { CreateGlobalRecordModel } = require('../models/global.record.model');
|
|
3
|
-
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
4
|
-
const { nodeBackendSecret } = require('../../../../env').getEnv();
|
|
5
|
-
|
|
6
|
-
const getGlobalRecordById = async id => {
|
|
7
|
-
return globalRecordAPI.getGlobalRecord(id, nodeBackendSecret);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const getGlobalRecordByPolicyNumber = async policyNumber => {
|
|
11
|
-
return globalRecordAPI.getGlobalRecordByPolicyNumber(policyNumber, nodeBackendSecret);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const createGlobalRecord = async createGlobalRecordModel => {
|
|
15
|
-
validateType(createGlobalRecordModel, CreateGlobalRecordModel);
|
|
16
|
-
return globalRecordAPI.createGlobalRecord(createGlobalRecordModel, nodeBackendSecret);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const getAllGlobalRecordsInPage = async (pageNumber, context, itemsInPage = 10) => {
|
|
20
|
-
const param = {};
|
|
21
|
-
return globalRecordAPI.getAllGlobalRecords(param, pageNumber, itemsInPage, context);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const getAllGlobalRecordsInPageByServiceAreas = async (serviceAreas, pageNumber, contxet, itemsInPage = 10) => {
|
|
25
|
-
const data = Array.isArray(serviceAreas) ? { serviceAreas } : { serviceAreas: new Array(serviceAreas) };
|
|
26
|
-
return globalRecordAPI.getAllGlobalRecords(data, pageNumber, itemsInPage, contxet);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const getAllGlobalRecordsInPageBySearchTerm = async (searchTerm, pageNumber, context, itemsInPage = 10) => {
|
|
30
|
-
const data = searchTerm;
|
|
31
|
-
return globalRecordAPI.getAllGlobalRecords(data, pageNumber, itemsInPage, context);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const getAllGlobalRecordsInPageByCombinedSearch = async (combinedSearch, pageNumber, context, itemsInPage = 10) => {
|
|
35
|
-
const data = combinedSearch;
|
|
36
|
-
return globalRecordAPI.getAllGlobalRecords(data, pageNumber, itemsInPage, context);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const getGlobalRecordServiceAreas = async context => {
|
|
40
|
-
return globalRecordAPI.getGlobalRecordServiceAreas(context);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const deleteGlobalRecord = async (id, globalRecordModel) => {
|
|
44
|
-
return globalRecordAPI.deleteGlobalRecord(id, nodeBackendSecret, globalRecordModel);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const updateGlobalRecord = async (id, updatedGlobalRecordModel) => {
|
|
48
|
-
return globalRecordAPI.updateGlobalRecord(id, nodeBackendSecret, updatedGlobalRecordModel);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const getRecordProfileDetails = async (id, context) => {
|
|
52
|
-
return globalRecordAPI.getRecordProfileDetails(id, context);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const publishGlobalRecord = async (globalRecordDetails, context) => {
|
|
56
|
-
return globalRecordAPI.publishGlobalRecord(globalRecordDetails, context);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const getGlobalRecordLinkedRecords = async (id, context) => {
|
|
60
|
-
return globalRecordAPI.getGlobalRecordLinkedRecords(id, context);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const splitToNewGlobalRecord = async (recordId, glPolicyNumber, context) => {
|
|
64
|
-
const requestData = { recordId, glPolicyNumber };
|
|
65
|
-
return globalRecordAPI.splitToNewGlobalRecord(requestData, context);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
module.exports = {
|
|
69
|
-
createGlobalRecord,
|
|
70
|
-
getGlobalRecordById,
|
|
71
|
-
getAllGlobalRecordsInPage,
|
|
72
|
-
getAllGlobalRecordsInPageByServiceAreas,
|
|
73
|
-
getAllGlobalRecordsInPageBySearchTerm,
|
|
74
|
-
getAllGlobalRecordsInPageByCombinedSearch,
|
|
75
|
-
getGlobalRecordServiceAreas,
|
|
76
|
-
deleteGlobalRecord,
|
|
77
|
-
updateGlobalRecord,
|
|
78
|
-
getRecordProfileDetails,
|
|
79
|
-
getGlobalRecordByPolicyNumber,
|
|
80
|
-
publishGlobalRecord,
|
|
81
|
-
getGlobalRecordLinkedRecords,
|
|
82
|
-
splitToNewGlobalRecord
|
|
83
|
-
};
|
|
1
|
+
const globalRecordAPI = require('./global.record.api');
|
|
2
|
+
const { CreateGlobalRecordModel } = require('../models/global.record.model');
|
|
3
|
+
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
4
|
+
const { nodeBackendSecret } = require('../../../../env').getEnv();
|
|
5
|
+
|
|
6
|
+
const getGlobalRecordById = async id => {
|
|
7
|
+
return globalRecordAPI.getGlobalRecord(id, nodeBackendSecret);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const getGlobalRecordByPolicyNumber = async policyNumber => {
|
|
11
|
+
return globalRecordAPI.getGlobalRecordByPolicyNumber(policyNumber, nodeBackendSecret);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const createGlobalRecord = async createGlobalRecordModel => {
|
|
15
|
+
validateType(createGlobalRecordModel, CreateGlobalRecordModel);
|
|
16
|
+
return globalRecordAPI.createGlobalRecord(createGlobalRecordModel, nodeBackendSecret);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const getAllGlobalRecordsInPage = async (pageNumber, context, itemsInPage = 10) => {
|
|
20
|
+
const param = {};
|
|
21
|
+
return globalRecordAPI.getAllGlobalRecords(param, pageNumber, itemsInPage, context);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getAllGlobalRecordsInPageByServiceAreas = async (serviceAreas, pageNumber, contxet, itemsInPage = 10) => {
|
|
25
|
+
const data = Array.isArray(serviceAreas) ? { serviceAreas } : { serviceAreas: new Array(serviceAreas) };
|
|
26
|
+
return globalRecordAPI.getAllGlobalRecords(data, pageNumber, itemsInPage, contxet);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const getAllGlobalRecordsInPageBySearchTerm = async (searchTerm, pageNumber, context, itemsInPage = 10) => {
|
|
30
|
+
const data = searchTerm;
|
|
31
|
+
return globalRecordAPI.getAllGlobalRecords(data, pageNumber, itemsInPage, context);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const getAllGlobalRecordsInPageByCombinedSearch = async (combinedSearch, pageNumber, context, itemsInPage = 10) => {
|
|
35
|
+
const data = combinedSearch;
|
|
36
|
+
return globalRecordAPI.getAllGlobalRecords(data, pageNumber, itemsInPage, context);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getGlobalRecordServiceAreas = async context => {
|
|
40
|
+
return globalRecordAPI.getGlobalRecordServiceAreas(context);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const deleteGlobalRecord = async (id, globalRecordModel) => {
|
|
44
|
+
return globalRecordAPI.deleteGlobalRecord(id, nodeBackendSecret, globalRecordModel);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const updateGlobalRecord = async (id, updatedGlobalRecordModel) => {
|
|
48
|
+
return globalRecordAPI.updateGlobalRecord(id, nodeBackendSecret, updatedGlobalRecordModel);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const getRecordProfileDetails = async (id, context) => {
|
|
52
|
+
return globalRecordAPI.getRecordProfileDetails(id, context);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const publishGlobalRecord = async (globalRecordDetails, context) => {
|
|
56
|
+
return globalRecordAPI.publishGlobalRecord(globalRecordDetails, context);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const getGlobalRecordLinkedRecords = async (id, context) => {
|
|
60
|
+
return globalRecordAPI.getGlobalRecordLinkedRecords(id, context);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const splitToNewGlobalRecord = async (recordId, glPolicyNumber, context) => {
|
|
64
|
+
const requestData = { recordId, glPolicyNumber };
|
|
65
|
+
return globalRecordAPI.splitToNewGlobalRecord(requestData, context);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
module.exports = {
|
|
69
|
+
createGlobalRecord,
|
|
70
|
+
getGlobalRecordById,
|
|
71
|
+
getAllGlobalRecordsInPage,
|
|
72
|
+
getAllGlobalRecordsInPageByServiceAreas,
|
|
73
|
+
getAllGlobalRecordsInPageBySearchTerm,
|
|
74
|
+
getAllGlobalRecordsInPageByCombinedSearch,
|
|
75
|
+
getGlobalRecordServiceAreas,
|
|
76
|
+
deleteGlobalRecord,
|
|
77
|
+
updateGlobalRecord,
|
|
78
|
+
getRecordProfileDetails,
|
|
79
|
+
getGlobalRecordByPolicyNumber,
|
|
80
|
+
publishGlobalRecord,
|
|
81
|
+
getGlobalRecordLinkedRecords,
|
|
82
|
+
splitToNewGlobalRecord
|
|
83
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const SERVICE_AREAS = {
|
|
2
|
-
'alabama': 'Alabama',
|
|
3
|
-
'arizona': 'Arizona',
|
|
4
|
-
'arkansas': 'Arkansas',
|
|
5
|
-
'california': 'California',
|
|
6
|
-
'connecticut': 'Connecticut',
|
|
7
|
-
'delaware': 'Delaware',
|
|
8
|
-
'florida': 'Florida',
|
|
9
|
-
'illinois': 'Illinois',
|
|
10
|
-
'newYork': 'New York',
|
|
11
|
-
'newJersey': 'New Jersey'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const GLOBAL_RECORD_STATUS = {
|
|
15
|
-
newGlobal: 'New Global',
|
|
16
|
-
newInfo: 'New Info',
|
|
17
|
-
published: 'Published'
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
module.exports = { SERVICE_AREAS, GLOBAL_RECORD_STATUS };
|
|
1
|
+
const SERVICE_AREAS = {
|
|
2
|
+
'alabama': 'Alabama',
|
|
3
|
+
'arizona': 'Arizona',
|
|
4
|
+
'arkansas': 'Arkansas',
|
|
5
|
+
'california': 'California',
|
|
6
|
+
'connecticut': 'Connecticut',
|
|
7
|
+
'delaware': 'Delaware',
|
|
8
|
+
'florida': 'Florida',
|
|
9
|
+
'illinois': 'Illinois',
|
|
10
|
+
'newYork': 'New York',
|
|
11
|
+
'newJersey': 'New Jersey'
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const GLOBAL_RECORD_STATUS = {
|
|
15
|
+
newGlobal: 'New Global',
|
|
16
|
+
newInfo: 'New Info',
|
|
17
|
+
published: 'Published'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
module.exports = { SERVICE_AREAS, GLOBAL_RECORD_STATUS };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const models = require('./models/global.record.model');
|
|
2
|
-
const services = require('./api/global.record.service');
|
|
3
|
-
const consts = require('./consts');
|
|
4
|
-
const utils = require('./utils/util');
|
|
5
|
-
|
|
6
|
-
module.exports = { services, models, consts, utils };
|
|
1
|
+
const models = require('./models/global.record.model');
|
|
2
|
+
const services = require('./api/global.record.service');
|
|
3
|
+
const consts = require('./consts');
|
|
4
|
+
const utils = require('./utils/util');
|
|
5
|
+
|
|
6
|
+
module.exports = { services, models, consts, utils };
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
class CreateGlobalRecordModel {
|
|
2
|
-
constructor(
|
|
3
|
-
header,
|
|
4
|
-
expirationDate,
|
|
5
|
-
glPolicyNumbers,
|
|
6
|
-
numberOfAssociatedRequests,
|
|
7
|
-
numberOfFilledMandatory,
|
|
8
|
-
{
|
|
9
|
-
id,
|
|
10
|
-
recordName,
|
|
11
|
-
additionalContacts,
|
|
12
|
-
brokerEmails,
|
|
13
|
-
publishDate,
|
|
14
|
-
serviceAreas,
|
|
15
|
-
primaryEmail,
|
|
16
|
-
dba,
|
|
17
|
-
lastPublishUserName,
|
|
18
|
-
__v,
|
|
19
|
-
recordType
|
|
20
|
-
} = {}
|
|
21
|
-
) {
|
|
22
|
-
this.id = id;
|
|
23
|
-
this.header = header;
|
|
24
|
-
this.recordName = recordName;
|
|
25
|
-
this.additionalContacts = additionalContacts;
|
|
26
|
-
this.expirationDate = expirationDate;
|
|
27
|
-
this.publishDate = publishDate;
|
|
28
|
-
this.glPolicyNumbers = glPolicyNumbers;
|
|
29
|
-
this.numberOfAssociatedRequests = numberOfAssociatedRequests;
|
|
30
|
-
this.brokerEmails = brokerEmails;
|
|
31
|
-
this.numberOfFilledMandatory = numberOfFilledMandatory;
|
|
32
|
-
this.serviceAreas = serviceAreas;
|
|
33
|
-
this.primaryEmail = primaryEmail;
|
|
34
|
-
this.dba = dba;
|
|
35
|
-
this.lastPublishUserName = lastPublishUserName;
|
|
36
|
-
this.__v = __v;
|
|
37
|
-
this.recordType = recordType;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
module.exports = {
|
|
42
|
-
CreateGlobalRecordModel
|
|
43
|
-
};
|
|
1
|
+
class CreateGlobalRecordModel {
|
|
2
|
+
constructor(
|
|
3
|
+
header,
|
|
4
|
+
expirationDate,
|
|
5
|
+
glPolicyNumbers,
|
|
6
|
+
numberOfAssociatedRequests,
|
|
7
|
+
numberOfFilledMandatory,
|
|
8
|
+
{
|
|
9
|
+
id,
|
|
10
|
+
recordName,
|
|
11
|
+
additionalContacts,
|
|
12
|
+
brokerEmails,
|
|
13
|
+
publishDate,
|
|
14
|
+
serviceAreas,
|
|
15
|
+
primaryEmail,
|
|
16
|
+
dba,
|
|
17
|
+
lastPublishUserName,
|
|
18
|
+
__v,
|
|
19
|
+
recordType
|
|
20
|
+
} = {}
|
|
21
|
+
) {
|
|
22
|
+
this.id = id;
|
|
23
|
+
this.header = header;
|
|
24
|
+
this.recordName = recordName;
|
|
25
|
+
this.additionalContacts = additionalContacts;
|
|
26
|
+
this.expirationDate = expirationDate;
|
|
27
|
+
this.publishDate = publishDate;
|
|
28
|
+
this.glPolicyNumbers = glPolicyNumbers;
|
|
29
|
+
this.numberOfAssociatedRequests = numberOfAssociatedRequests;
|
|
30
|
+
this.brokerEmails = brokerEmails;
|
|
31
|
+
this.numberOfFilledMandatory = numberOfFilledMandatory;
|
|
32
|
+
this.serviceAreas = serviceAreas;
|
|
33
|
+
this.primaryEmail = primaryEmail;
|
|
34
|
+
this.dba = dba;
|
|
35
|
+
this.lastPublishUserName = lastPublishUserName;
|
|
36
|
+
this.__v = __v;
|
|
37
|
+
this.recordType = recordType;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = {
|
|
42
|
+
CreateGlobalRecordModel
|
|
43
|
+
};
|