@getjones/test-infra 2.5.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 -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,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
|
+
};
|
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
const globalRecordServices = require('../api/global.record.service');
|
|
2
|
-
const globalRecordModels = require('../models/global.record.model');
|
|
3
|
-
|
|
4
|
-
const { CreateGlobalRecordModel } = globalRecordModels;
|
|
5
|
-
const { createGlobalRecord, getAllGlobalRecordsInPage } = globalRecordServices;
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
getCapitalLetterUnicodeValueList,
|
|
9
|
-
getUniqueNumber
|
|
10
|
-
} = require('../../../../common/utils/numberUtils');
|
|
11
|
-
|
|
12
|
-
const { SERVICE_AREAS } = require('../consts');
|
|
13
|
-
|
|
14
|
-
const createGlobalRecordConfig = (
|
|
15
|
-
name,
|
|
16
|
-
{ stateIndex, glPolicyNumbers } = {}
|
|
17
|
-
) => {
|
|
18
|
-
const serviceArea = getServiceAreaByIndex(stateIndex || 0);
|
|
19
|
-
const uniqueNumbers = glPolicyNumbers || getUniqueNumber();
|
|
20
|
-
const emailBase = name.replace(/\s+/g, '').toLowerCase();
|
|
21
|
-
return {
|
|
22
|
-
header: `${name}Header`,
|
|
23
|
-
recordName: `${name}Name`,
|
|
24
|
-
additionalContacts: [
|
|
25
|
-
`${emailBase}@additional1.jon`,
|
|
26
|
-
`${emailBase}@additional2.jon`
|
|
27
|
-
],
|
|
28
|
-
brokerEmails: [`${emailBase}@broker1.jon`, `${emailBase}@broker2.jon`],
|
|
29
|
-
expirationDate: '2030-12-09',
|
|
30
|
-
publishDate: '',
|
|
31
|
-
lastPublishUserName: '',
|
|
32
|
-
glPolicyNumbers: [uniqueNumbers.toString()],
|
|
33
|
-
numberOfAssociatedRequests: 0,
|
|
34
|
-
numberOfFilledMandatory: 0,
|
|
35
|
-
dba: '',
|
|
36
|
-
primaryEmail: '',
|
|
37
|
-
serviceAreas: [getServiceArea(serviceArea)],
|
|
38
|
-
__v: 0,
|
|
39
|
-
recordType: ['Vendors']
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const getServiceArea = state => {
|
|
44
|
-
return {
|
|
45
|
-
city: `${state}TestCity`,
|
|
46
|
-
state: state
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const createGlobalRecordConfigs = (
|
|
51
|
-
nameList,
|
|
52
|
-
{ stateIndexes, glPolicyNumbers } = {}
|
|
53
|
-
) => {
|
|
54
|
-
return nameList.map((name, index) =>
|
|
55
|
-
createGlobalRecordConfig(name, {
|
|
56
|
-
stateIndex: stateIndexes ? stateIndexes[index] : index,
|
|
57
|
-
glPolicyNumbers: glPolicyNumbers ? glPolicyNumbers[index] : null
|
|
58
|
-
})
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const createGlobalRecordModel = config => {
|
|
63
|
-
return new CreateGlobalRecordModel(
|
|
64
|
-
config.header,
|
|
65
|
-
config.expirationDate,
|
|
66
|
-
config.glPolicyNumbers,
|
|
67
|
-
config.numberOfAssociatedRequests,
|
|
68
|
-
config.numberOfFilledMandatory,
|
|
69
|
-
{
|
|
70
|
-
id: config.id,
|
|
71
|
-
recordName: config.recordName,
|
|
72
|
-
additionalContacts: config.additionalContacts,
|
|
73
|
-
brokerEmails: config.brokerEmails,
|
|
74
|
-
publishDate: config.publishDate,
|
|
75
|
-
serviceAreas: config.serviceAreas,
|
|
76
|
-
primaryEmail: config.primaryEmail,
|
|
77
|
-
dba: config.dba,
|
|
78
|
-
lastPublishUserName: config.lastPublishUserName,
|
|
79
|
-
__v: config.__v,
|
|
80
|
-
recordType: config.recordType
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const createGlobalRecordModels = configList => {
|
|
86
|
-
return configList.map(config => createGlobalRecordModel(config));
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const getCreateRandomGlobalRecordModels = nameList => {
|
|
90
|
-
const configList = createGlobalRecordConfigs(nameList);
|
|
91
|
-
return createGlobalRecordModels(configList);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const createGlobalRecords = async (globalRecordModelList, context) => {
|
|
95
|
-
const newGlobalRecodDetailsList = new Array();
|
|
96
|
-
for (globalRecordModel of globalRecordModelList) {
|
|
97
|
-
const newGlobalRecordDetails = await createGlobalRecord(
|
|
98
|
-
globalRecordModel,
|
|
99
|
-
context
|
|
100
|
-
);
|
|
101
|
-
newGlobalRecodDetailsList.push(newGlobalRecordDetails);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return newGlobalRecodDetailsList;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
const getGlobalRecordsByNumberOfPages = async (numberOfPages, context) => {
|
|
108
|
-
const allGlobalRecords = new Array();
|
|
109
|
-
|
|
110
|
-
for (let pageNumber = 1; pageNumber <= numberOfPages; pageNumber++) {
|
|
111
|
-
const allGlobalRecordsInPage = await getAllGlobalRecordsInPage(
|
|
112
|
-
pageNumber,
|
|
113
|
-
context
|
|
114
|
-
);
|
|
115
|
-
allGlobalRecords.push(allGlobalRecordsInPage);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return allGlobalRecords;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const getServiceAreaByIndex = stateIndex => {
|
|
122
|
-
return SERVICE_AREAS[Object.keys(SERVICE_AREAS)[stateIndex % 10]];
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const getGlobalRecordsDefaultNameList = (nameBase, listLength) => {
|
|
126
|
-
const letterUnicodeValueList = getCapitalLetterUnicodeValueList({
|
|
127
|
-
listLength
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
//How much times same letter will appear in one index on the array
|
|
131
|
-
const repeatTimes = 4;
|
|
132
|
-
return letterUnicodeValueList.map(
|
|
133
|
-
unicode =>
|
|
134
|
-
`${nameBase} ${String.fromCharCode(unicode).repeat(repeatTimes)}`
|
|
135
|
-
);
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
module.exports = {
|
|
139
|
-
createGlobalRecords,
|
|
140
|
-
createGlobalRecordConfig,
|
|
141
|
-
createGlobalRecordConfigs,
|
|
142
|
-
createGlobalRecordModel,
|
|
143
|
-
createGlobalRecordModels,
|
|
144
|
-
getCreateRandomGlobalRecordModels,
|
|
145
|
-
getGlobalRecordsDefaultNameList,
|
|
146
|
-
getGlobalRecordsByNumberOfPages,
|
|
147
|
-
getServiceArea
|
|
148
|
-
};
|
|
1
|
+
const globalRecordServices = require('../api/global.record.service');
|
|
2
|
+
const globalRecordModels = require('../models/global.record.model');
|
|
3
|
+
|
|
4
|
+
const { CreateGlobalRecordModel } = globalRecordModels;
|
|
5
|
+
const { createGlobalRecord, getAllGlobalRecordsInPage } = globalRecordServices;
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
getCapitalLetterUnicodeValueList,
|
|
9
|
+
getUniqueNumber
|
|
10
|
+
} = require('../../../../common/utils/numberUtils');
|
|
11
|
+
|
|
12
|
+
const { SERVICE_AREAS } = require('../consts');
|
|
13
|
+
|
|
14
|
+
const createGlobalRecordConfig = (
|
|
15
|
+
name,
|
|
16
|
+
{ stateIndex, glPolicyNumbers } = {}
|
|
17
|
+
) => {
|
|
18
|
+
const serviceArea = getServiceAreaByIndex(stateIndex || 0);
|
|
19
|
+
const uniqueNumbers = glPolicyNumbers || getUniqueNumber();
|
|
20
|
+
const emailBase = name.replace(/\s+/g, '').toLowerCase();
|
|
21
|
+
return {
|
|
22
|
+
header: `${name}Header`,
|
|
23
|
+
recordName: `${name}Name`,
|
|
24
|
+
additionalContacts: [
|
|
25
|
+
`${emailBase}@additional1.jon`,
|
|
26
|
+
`${emailBase}@additional2.jon`
|
|
27
|
+
],
|
|
28
|
+
brokerEmails: [`${emailBase}@broker1.jon`, `${emailBase}@broker2.jon`],
|
|
29
|
+
expirationDate: '2030-12-09',
|
|
30
|
+
publishDate: '',
|
|
31
|
+
lastPublishUserName: '',
|
|
32
|
+
glPolicyNumbers: [uniqueNumbers.toString()],
|
|
33
|
+
numberOfAssociatedRequests: 0,
|
|
34
|
+
numberOfFilledMandatory: 0,
|
|
35
|
+
dba: '',
|
|
36
|
+
primaryEmail: '',
|
|
37
|
+
serviceAreas: [getServiceArea(serviceArea)],
|
|
38
|
+
__v: 0,
|
|
39
|
+
recordType: ['Vendors']
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const getServiceArea = state => {
|
|
44
|
+
return {
|
|
45
|
+
city: `${state}TestCity`,
|
|
46
|
+
state: state
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const createGlobalRecordConfigs = (
|
|
51
|
+
nameList,
|
|
52
|
+
{ stateIndexes, glPolicyNumbers } = {}
|
|
53
|
+
) => {
|
|
54
|
+
return nameList.map((name, index) =>
|
|
55
|
+
createGlobalRecordConfig(name, {
|
|
56
|
+
stateIndex: stateIndexes ? stateIndexes[index] : index,
|
|
57
|
+
glPolicyNumbers: glPolicyNumbers ? glPolicyNumbers[index] : null
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const createGlobalRecordModel = config => {
|
|
63
|
+
return new CreateGlobalRecordModel(
|
|
64
|
+
config.header,
|
|
65
|
+
config.expirationDate,
|
|
66
|
+
config.glPolicyNumbers,
|
|
67
|
+
config.numberOfAssociatedRequests,
|
|
68
|
+
config.numberOfFilledMandatory,
|
|
69
|
+
{
|
|
70
|
+
id: config.id,
|
|
71
|
+
recordName: config.recordName,
|
|
72
|
+
additionalContacts: config.additionalContacts,
|
|
73
|
+
brokerEmails: config.brokerEmails,
|
|
74
|
+
publishDate: config.publishDate,
|
|
75
|
+
serviceAreas: config.serviceAreas,
|
|
76
|
+
primaryEmail: config.primaryEmail,
|
|
77
|
+
dba: config.dba,
|
|
78
|
+
lastPublishUserName: config.lastPublishUserName,
|
|
79
|
+
__v: config.__v,
|
|
80
|
+
recordType: config.recordType
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const createGlobalRecordModels = configList => {
|
|
86
|
+
return configList.map(config => createGlobalRecordModel(config));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const getCreateRandomGlobalRecordModels = nameList => {
|
|
90
|
+
const configList = createGlobalRecordConfigs(nameList);
|
|
91
|
+
return createGlobalRecordModels(configList);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const createGlobalRecords = async (globalRecordModelList, context) => {
|
|
95
|
+
const newGlobalRecodDetailsList = new Array();
|
|
96
|
+
for (globalRecordModel of globalRecordModelList) {
|
|
97
|
+
const newGlobalRecordDetails = await createGlobalRecord(
|
|
98
|
+
globalRecordModel,
|
|
99
|
+
context
|
|
100
|
+
);
|
|
101
|
+
newGlobalRecodDetailsList.push(newGlobalRecordDetails);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return newGlobalRecodDetailsList;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const getGlobalRecordsByNumberOfPages = async (numberOfPages, context) => {
|
|
108
|
+
const allGlobalRecords = new Array();
|
|
109
|
+
|
|
110
|
+
for (let pageNumber = 1; pageNumber <= numberOfPages; pageNumber++) {
|
|
111
|
+
const allGlobalRecordsInPage = await getAllGlobalRecordsInPage(
|
|
112
|
+
pageNumber,
|
|
113
|
+
context
|
|
114
|
+
);
|
|
115
|
+
allGlobalRecords.push(allGlobalRecordsInPage);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return allGlobalRecords;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const getServiceAreaByIndex = stateIndex => {
|
|
122
|
+
return SERVICE_AREAS[Object.keys(SERVICE_AREAS)[stateIndex % 10]];
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const getGlobalRecordsDefaultNameList = (nameBase, listLength) => {
|
|
126
|
+
const letterUnicodeValueList = getCapitalLetterUnicodeValueList({
|
|
127
|
+
listLength
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
//How much times same letter will appear in one index on the array
|
|
131
|
+
const repeatTimes = 4;
|
|
132
|
+
return letterUnicodeValueList.map(
|
|
133
|
+
unicode =>
|
|
134
|
+
`${nameBase} ${String.fromCharCode(unicode).repeat(repeatTimes)}`
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
module.exports = {
|
|
139
|
+
createGlobalRecords,
|
|
140
|
+
createGlobalRecordConfig,
|
|
141
|
+
createGlobalRecordConfigs,
|
|
142
|
+
createGlobalRecordModel,
|
|
143
|
+
createGlobalRecordModels,
|
|
144
|
+
getCreateRandomGlobalRecordModels,
|
|
145
|
+
getGlobalRecordsDefaultNameList,
|
|
146
|
+
getGlobalRecordsByNumberOfPages,
|
|
147
|
+
getServiceArea
|
|
148
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
-
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
|
-
|
|
4
|
-
const Endpoints = {
|
|
5
|
-
getHomePageChartsDataApi: () => `${backendUrl}/saas/user/properties/compliance-summary`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const getHomePageChartsData = context => {
|
|
9
|
-
return requests.postRequestHandler(Endpoints.getHomePageChartsDataApi(), {}, context);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
module.exports = { getHomePageChartsData };
|
|
1
|
+
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
+
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
|
+
|
|
4
|
+
const Endpoints = {
|
|
5
|
+
getHomePageChartsDataApi: () => `${backendUrl}/saas/user/properties/compliance-summary`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const getHomePageChartsData = context => {
|
|
9
|
+
return requests.postRequestHandler(Endpoints.getHomePageChartsDataApi(), {}, context);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
module.exports = { getHomePageChartsData };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const chartsAPI = require('./charts.api');
|
|
2
|
-
|
|
3
|
-
const getHomePageChartsData = context => {
|
|
4
|
-
return chartsAPI.getHomePageChartsData(context);
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
module.exports = { getHomePageChartsData };
|
|
1
|
+
const chartsAPI = require('./charts.api');
|
|
2
|
+
|
|
3
|
+
const getHomePageChartsData = context => {
|
|
4
|
+
return chartsAPI.getHomePageChartsData(context);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
module.exports = { getHomePageChartsData };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const services = require('./api/charts.service');
|
|
2
|
-
|
|
3
|
-
module.exports = { services };
|
|
1
|
+
const services = require('./api/charts.service');
|
|
2
|
+
|
|
3
|
+
module.exports = { services };
|