@getjones/test-infra 1.2.5 → 1.2.7
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/requests/apiKeyAuth/requests.js +38 -0
- package/src/common/requests/cookieAuth/requests.js +40 -0
- package/src/common/requests/requestHandlers.js +60 -0
- package/src/common/validations/errorValidation.js +10 -10
- package/src/common/validations/typeValidations.js +4 -4
- package/src/index.js +7 -3
- package/src/saas/internal-api/accounts/api/core/accounts.core.api.js +14 -14
- package/src/saas/internal-api/accounts/api/core/accounts.core.setup.js +36 -36
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.api.js +27 -27
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.setup.js +35 -35
- package/src/saas/internal-api/accounts/api/settings/settings.api.js +8 -8
- package/src/saas/internal-api/accounts/api/settings/settings.setup.js +9 -9
- package/src/saas/internal-api/accounts/index.js +4 -4
- package/src/saas/internal-api/accounts/models/core/create.account.model.js +8 -9
- package/src/saas/internal-api/accounts/models/settings/update.settings.model.js +11 -11
- package/src/saas/internal-api/auth/api/auth.api.js +4 -4
- package/src/saas/internal-api/auth/api/auth.setup.js +31 -22
- package/src/saas/internal-api/auth/index.js +1 -1
- package/src/saas/internal-api/coi/api/coi.api.js +14 -14
- package/src/saas/internal-api/coi/api/coi.setup.js +5 -5
- package/src/saas/internal-api/coi/index.js +1 -1
- package/src/saas/internal-api/coi/models/submit.coi.model.js +6 -6
- package/src/saas/internal-api/compliance/api/audit/audit.api.js +11 -11
- package/src/saas/internal-api/compliance/api/audit/audit.setup.js +5 -5
- package/src/saas/internal-api/compliance/api/convert/convert.api.js +6 -6
- package/src/saas/internal-api/compliance/api/convert/convert.setup.js +3 -3
- package/src/saas/internal-api/compliance/api/coverage/coverage.api.js +15 -15
- package/src/saas/internal-api/compliance/api/coverage/coverage.setup.js +9 -9
- package/src/saas/internal-api/compliance/api/waive/waive.api.js +9 -11
- package/src/saas/internal-api/compliance/api/waive/waive.setup.js +5 -5
- package/src/saas/internal-api/compliance/index.js +15 -6
- package/src/saas/internal-api/compliance/models/audit/audit.model.js +66 -66
- package/src/saas/internal-api/compliance/models/waive/waive.model.js +28 -28
- package/src/saas/internal-api/contractors/api/contractors.api.js +42 -42
- package/src/saas/internal-api/contractors/api/contractors.setup.js +27 -27
- package/src/saas/internal-api/contractors/index.js +2 -2
- package/src/saas/internal-api/contractors/models/create.contractor.model.js +13 -13
- package/src/saas/internal-api/contractors/models/edit.contractor.model.js +66 -68
- package/src/saas/internal-api/globalRecord/api/global.record.api.js +46 -0
- package/src/saas/internal-api/globalRecord/api/global.record.setup.js +57 -0
- package/src/saas/internal-api/globalRecord/index.js +4 -0
- package/src/saas/internal-api/globalRecord/models/global.record.model.js +37 -0
- package/src/saas/internal-api/homepageCharts/api/charts.api.js +4 -4
- package/src/saas/internal-api/homepageCharts/api/charts.setup.js +2 -2
- package/src/saas/internal-api/homepageCharts/index.js +1 -1
- package/src/saas/internal-api/projects/api/core/projects.api.js +13 -13
- package/src/saas/internal-api/projects/api/core/projects.setup.js +26 -26
- package/src/saas/internal-api/projects/api/settings/project.settings.api.js +6 -6
- package/src/saas/internal-api/projects/api/settings/project.settings.setup.js +5 -5
- package/src/saas/internal-api/projects/index.js +5 -5
- package/src/saas/internal-api/projects/models/core/create.project.model.js +19 -19
- package/src/saas/internal-api/projects/models/core/update.project.model.js +21 -21
- package/src/saas/internal-api/projects/models/settings/update.project.settings.model.js +27 -28
- package/src/saas/internal-api/recordNotes/api/record.notes.api.js +18 -18
- package/src/saas/internal-api/recordNotes/api/record.notes.setup.js +11 -11
- package/src/saas/internal-api/reports/api/reports.api.js +4 -4
- package/src/saas/internal-api/reports/api/reports.setup.js +2 -3
- package/src/saas/internal-api/reports/index.js +3 -3
- package/src/saas/internal-api/reports/models/report.model.js +23 -23
- package/src/saas/internal-api/requirements/api/requirements.api.js +11 -11
- package/src/saas/internal-api/requirements/api/requirements.setup.js +7 -7
- package/src/saas/internal-api/requirements/index.js +1 -1
- package/src/saas/internal-api/requirements/models/create.requirement.model.js +27 -28
- package/src/saas/internal-api/tabs/api/tabs.api.js +1 -1
- package/src/saas/internal-api/tabs/index.js +1 -1
- package/src/saas/internal-api/thread-scheduler/runner.js +17 -0
- package/src/saas/internal-api/users/api/users.api.js +9 -9
- package/src/saas/internal-api/users/models/edit.user.model.js +6 -6
- package/src/saas/internal-api/vendorProfile/api/vendor.profile.api.js +1 -1
- package/src/saas/openapi/accounts/accounts.api.js +5 -5
- package/src/saas/openapi/accounts/accounts.setup.js +4 -4
- package/src/saas/openapi/contractors/contractors.api.js +3 -3
- package/src/saas/openapi/contractors/contractors.setup.js +5 -5
- package/src/saas/openapi/projects/projects.api.js +25 -24
- package/src/saas/openapi/projects/projects.setup.js +15 -15
- package/src/saas/openapi/requirements/index.js +1 -1
- package/src/saas/openapi/requirements/models/copy.requirement.model.js +7 -7
- package/src/saas/openapi/requirements/requirements.api.js +3 -4
- package/src/saas/openapi/requirements/requirements.setup.js +11 -11
- package/src/saas/openapi/tabs/tabs.api.js +4 -4
- package/src/saas/openapi/tabs/tabs.setup.js +2 -2
- package/src/saas/internal-api/common/requests.js +0 -71
- package/src/saas/openapi/common/requests.js +0 -74
- package/src/saas/thread-scheduler/runner.js +0 -17
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
getGlobalRecordServiceArea: `${backendUrl}/saas/global-record/service-areas`,
|
|
11
|
+
deleteGlobalRecord: id => `${nodeBackendUrl}/global-record/id/${id}`,
|
|
12
|
+
updateGlobalRecord: id => `${nodeBackendUrl}/global-record/id/${id}`
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const getGlobalRecord = async (id, nodeBackendSecret) => {
|
|
16
|
+
return apiKeyAuthRequests.getRequestHandler(Endpoints.getGlobalRecordById(id), nodeBackendSecret);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const createGlobalRecord = async (globalRecord, nodeBackendSecret) => {
|
|
20
|
+
return apiKeyAuthRequests.postRequestHandler(Endpoints.createGlobalRecord, nodeBackendSecret, globalRecord);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const getAllGlobalRecords = async (data, pageNumber, itemsInPage, context) => {
|
|
24
|
+
return cookieAuthRequests.postRequestHandler(Endpoints.getAllGlobalRecords(pageNumber, itemsInPage), data, context);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const deleteGlobalRecord = async (id, context) => {
|
|
28
|
+
return cookieAuthRequests.deleteRequestHandler(Endpoints.deleteGlobalRecord(id), context);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const updateGlobalRecord = async (id, nodeBackendSecret, updatedGlobalRecord) => {
|
|
32
|
+
return apiKeyAuthRequests.putRequestHandler(Endpoints.updateGlobalRecord(id), nodeBackendSecret, updatedGlobalRecord);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const getGlobalRecordServiceArea = async context => {
|
|
36
|
+
return cookieAuthRequests.getRequestHandler(Endpoints.getGlobalRecordServiceArea, {}, context);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
module.exports = {
|
|
40
|
+
createGlobalRecord,
|
|
41
|
+
getGlobalRecord,
|
|
42
|
+
getAllGlobalRecords,
|
|
43
|
+
getGlobalRecordServiceArea,
|
|
44
|
+
deleteGlobalRecord,
|
|
45
|
+
updateGlobalRecord
|
|
46
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
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 createGlobalRecord = async createGlobalRecordModel => {
|
|
11
|
+
validateType(createGlobalRecordModel, CreateGlobalRecordModel);
|
|
12
|
+
return globalRecordAPI.createGlobalRecord(createGlobalRecordModel, nodeBackendSecret);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const getAllGlobalRecordsInPage = async (pageNumber, contxet, itemsInPage = 10) => {
|
|
16
|
+
const param = {};
|
|
17
|
+
return globalRecordAPI.getAllGlobalRecords(param, pageNumber, itemsInPage, contxet);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getAllGlobalRecordsInPageByServiceArea = async (serviceArea, pageNumber, contxet, itemsInPage = 10) => {
|
|
21
|
+
const data = Array.isArray(serviceArea) ? { serviceArea } : { serviceArea: new Array(serviceArea) };
|
|
22
|
+
return globalRecordAPI.getAllGlobalRecords(data, pageNumber, itemsInPage, contxet);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const getAllGlobalRecordsInPageBySearchTerm = async (searchTerm, pageNumber, context, itemsInPage = 10) => {
|
|
26
|
+
const data = searchTerm;
|
|
27
|
+
return globalRecordAPI.getAllGlobalRecords(data, pageNumber, itemsInPage, context);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getAllGlobalRecordsInPageByCombinedSearch = async (combinedSearch, pageNumber, context, itemsInPage = 10) => {
|
|
31
|
+
const data = combinedSearch;
|
|
32
|
+
return globalRecordAPI.getAllGlobalRecords(data, pageNumber, itemsInPage, context);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const getGlobalRecordServiceArea = async context => {
|
|
36
|
+
return globalRecordAPI.getGlobalRecordServiceArea(context);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const deleteGlobalRecord = async (id, context) => {
|
|
40
|
+
return globalRecordAPI.deleteGlobalRecord(id, context);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const updateGlobalRecord = async (id, updatedGlobalRecordModel) => {
|
|
44
|
+
return globalRecordAPI.updateGlobalRecord(id, nodeBackendSecret, updatedGlobalRecordModel);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
module.exports = {
|
|
48
|
+
createGlobalRecord,
|
|
49
|
+
getGlobalRecordById,
|
|
50
|
+
getAllGlobalRecordsInPage,
|
|
51
|
+
getAllGlobalRecordsInPageByServiceArea,
|
|
52
|
+
getAllGlobalRecordsInPageBySearchTerm,
|
|
53
|
+
getAllGlobalRecordsInPageByCombinedSearch,
|
|
54
|
+
getGlobalRecordServiceArea,
|
|
55
|
+
deleteGlobalRecord,
|
|
56
|
+
updateGlobalRecord
|
|
57
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
class CreateGlobalRecordModel {
|
|
2
|
+
constructor(
|
|
3
|
+
header,
|
|
4
|
+
expirationDate,
|
|
5
|
+
glPolicyNumber,
|
|
6
|
+
numberOfRequestsAssociated,
|
|
7
|
+
numberOfFilledMandatory,
|
|
8
|
+
{
|
|
9
|
+
recordName,
|
|
10
|
+
additionalEmail,
|
|
11
|
+
brokerEmail,
|
|
12
|
+
publishDate,
|
|
13
|
+
dismissDate,
|
|
14
|
+
serviceArea,
|
|
15
|
+
primaryEmail,
|
|
16
|
+
dba
|
|
17
|
+
} = {}
|
|
18
|
+
) {
|
|
19
|
+
this.header = header;
|
|
20
|
+
this.recordName = recordName;
|
|
21
|
+
this.additionalEmail = additionalEmail;
|
|
22
|
+
this.expirationDate = expirationDate;
|
|
23
|
+
this.publishDate = publishDate;
|
|
24
|
+
this.dismissDate = dismissDate;
|
|
25
|
+
this.glPolicyNumber = glPolicyNumber;
|
|
26
|
+
this.numberOfRequestsAssociated = numberOfRequestsAssociated;
|
|
27
|
+
this.brokerEmail = brokerEmail;
|
|
28
|
+
this.numberOfFilledMandatory = numberOfFilledMandatory;
|
|
29
|
+
this.serviceArea = serviceArea;
|
|
30
|
+
this.primaryEmail = primaryEmail,
|
|
31
|
+
this.dba = dba;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = {
|
|
36
|
+
CreateGlobalRecordModel
|
|
37
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const requests = require('
|
|
1
|
+
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
2
|
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
3
|
|
|
4
4
|
const Endpoints = {
|
|
5
|
-
|
|
5
|
+
getHomePageChartsDataApi: () => `${backendUrl}/saas/user/properties/compliance-summary`
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
const getHomePageChartsData = context => {
|
|
9
|
-
|
|
9
|
+
return requests.getRequestHandler(Endpoints.getHomePageChartsDataApi(), {}, context).then(res => res.data);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
module.exports = { getHomePageChartsData };
|
|
12
|
+
module.exports = { getHomePageChartsData };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const chartsAPI = require('./charts.api');
|
|
2
2
|
|
|
3
3
|
const getHomePageChartsData = async context => {
|
|
4
|
-
|
|
4
|
+
return chartsAPI.getHomePageChartsData(context);
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
module.exports = { getHomePageChartsData };
|
|
7
|
+
module.exports = { getHomePageChartsData };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
const requests = require('
|
|
1
|
+
const requests = require('../../../../../common/requests/cookieAuth/requests');
|
|
2
2
|
const { backendUrl } = require('../../../../../env').getEnv();
|
|
3
3
|
|
|
4
4
|
const Endpoints = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
create: `${backendUrl}/saas/project`,
|
|
6
|
+
delete: projectId => `${backendUrl}/saas/project/${projectId}`,
|
|
7
|
+
getByAccountId: `${backendUrl}/saas/project/list`,
|
|
8
|
+
update: `${backendUrl}/saas/project`,
|
|
9
|
+
getProjectByProjectId: projectId => `${backendUrl}/saas/project/${projectId}`
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const create = async (project, context) => {
|
|
13
|
-
|
|
13
|
+
return requests.putRequestHandler(Endpoints.create, project, context);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const getProjectsByAccountId = async (accountId, context) => {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const params = { userId: accountId };
|
|
18
|
+
return requests.getRequestHandler(Endpoints.getByAccountId, params, context).then(res => res.data);
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const getProjectByProjectId = async (projectId, context) => {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const params = { };
|
|
23
|
+
return requests.getRequestHandler(Endpoints.getProjectByProjectId(projectId), params, context).then(res => res.data);
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const deleteProjectById = async (projectId, context) => {
|
|
27
|
-
|
|
27
|
+
return requests.deleteRequestHandler(Endpoints.delete(projectId), context);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const update = async (project, context) => {
|
|
31
|
-
|
|
31
|
+
return requests.postRequestHandler(Endpoints.update, project, context);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
module.exports = { create, getProjectsByAccountId, deleteProjectById, update, getProjectByProjectId };
|
|
@@ -5,56 +5,56 @@ const CreateProjectModel = require('../../models/core/create.project.model');
|
|
|
5
5
|
const UpdateProjectModel = require('../../models/core/update.project.model');
|
|
6
6
|
|
|
7
7
|
const getProjectsByAccountName = async (accountName, context) => {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const accountId = await accounts.getAccountId(accountName, context);
|
|
9
|
+
return getProjectsByAccountId(accountId, context);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const getProjectsByAccountId = async (accountId, context) => {
|
|
13
|
-
|
|
13
|
+
return projectsApi.getProjectsByAccountId(accountId, context);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const getProjectByProjectId = async (projectId, context) => {
|
|
17
|
-
|
|
17
|
+
return projectsApi.getProjectByProjectId(projectId, context);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const getProjectsByName = async (accountId, projectName, context) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const projects = await getProjectsByAccountId(accountId, context);
|
|
22
|
+
const filteredProjects = projects.filter(project => project.projectName === projectName);
|
|
23
|
+
return filteredProjects;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const deleteProjectByName = async (accountId, projectName, context) => {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const projects = await getProjectsByName(accountId, projectName, context);
|
|
28
|
+
projects.map(async project => await projectsApi.deleteProjectById(project.projectId, context));
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const createProject = async (createProjectModel, context) => {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
validateType(createProjectModel, CreateProjectModel);
|
|
33
|
+
return projectsApi.create(createProjectModel, context);
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const getOrCreateProject = async (createProjectModel, context) => {
|
|
37
|
-
|
|
37
|
+
const existingProjects = await getProjectsByName(createProjectModel.userId, createProjectModel.projectName, context);
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
if (existingProjects.length > 0) {
|
|
40
|
+
return existingProjects[0];
|
|
41
|
+
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
return createProject(createProjectModel, context);
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
const updateProject = async (updateProjectModel, context) => {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
validateType(updateProjectModel, UpdateProjectModel);
|
|
48
|
+
return projectsApi.update(updateProjectModel, context);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
module.exports = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
getProjectsByAccountName,
|
|
53
|
+
getProjectsByAccountId,
|
|
54
|
+
createProject,
|
|
55
|
+
deleteProjectByName,
|
|
56
|
+
getOrCreateProject,
|
|
57
|
+
updateProject,
|
|
58
|
+
getProjectsByName,
|
|
59
|
+
getProjectByProjectId
|
|
60
60
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const requests = require('
|
|
1
|
+
const requests = require('../../../../../common/requests/cookieAuth/requests');
|
|
2
2
|
const { backendUrl } = require('../../../../../env').getEnv();
|
|
3
3
|
|
|
4
4
|
const Endpoints = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getByProjectId: projectId => `${backendUrl}/saas/project/${projectId}/settings`,
|
|
6
|
+
updateByProjectId: projectId => `${backendUrl}/saas/project/${projectId}/settings`
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
const getProjectSettingsByProjectId = async (projectId, context) => {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const params = { projectId };
|
|
11
|
+
return requests.getRequestHandler(Endpoints.getByProjectId(projectId), params, context).then(res => res.data);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const updateProjectSettingsByProjectId = async (settings, context) => {
|
|
15
|
-
|
|
15
|
+
return requests.putRequestHandler(Endpoints.updateByProjectId(settings.projectId), settings, context);
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
module.exports = { getProjectSettingsByProjectId, updateProjectSettingsByProjectId };
|
|
@@ -3,15 +3,15 @@ const { validateType } = require('../../../../../common/validations/typeValidati
|
|
|
3
3
|
const UpdateProjectSettingsModel = require('../../models/settings/update.project.settings.model');
|
|
4
4
|
|
|
5
5
|
const updateProjectSettings = async (updateProjectSettingsModel, context) => {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
validateType(updateProjectSettingsModel, UpdateProjectSettingsModel);
|
|
7
|
+
return updateProjectSettingsByProjectId(updateProjectSettingsModel, context);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const getProjectSettings = async (projectId, context) => {
|
|
11
|
-
|
|
11
|
+
return getProjectSettingsByProjectId(projectId, context);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
module.exports = {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
updateProjectSettings,
|
|
16
|
+
getProjectSettings
|
|
17
17
|
};
|
|
@@ -8,12 +8,12 @@ const coreModels = { CreateProjectModel, UpdateProjectModel };
|
|
|
8
8
|
const settingsModels = { UpdateProjectSettingsModel };
|
|
9
9
|
|
|
10
10
|
const services = {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
core: projectService,
|
|
12
|
+
settings: projectSettingsService
|
|
13
13
|
};
|
|
14
14
|
const models = {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
core: coreModels,
|
|
16
|
+
settings: settingsModels
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
module.exports = { models, services };
|
|
19
|
+
module.exports = { models, services };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
function CreateProjectModel(accountId, name, description, address, number, startDate, endDate,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
city, state, zipCode, companyNameForProject, certificateHolder = '', additionalInsured = '',
|
|
3
|
+
tenantSolutionEnabled = 0, onboardingEnabled = 0, automaticRenewalEnabled = 0) {
|
|
4
|
+
this.projectName = name;
|
|
5
|
+
this.userId = accountId;
|
|
6
|
+
this.regionOrDivision = description;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
this.address = address;
|
|
9
|
+
this.projectNumber = number;
|
|
10
|
+
this.projectStartDate = startDate;
|
|
11
|
+
this.projectEndDate = endDate;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
this.city = city;
|
|
14
|
+
this.state = state;
|
|
15
|
+
this.zipCode = zipCode;
|
|
16
|
+
this.companyNameForProject = companyNameForProject;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
this.certificateHolder = certificateHolder;
|
|
19
|
+
this.additionalInsured = additionalInsured;
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
this.tenantSolutionEnabled = tenantSolutionEnabled;
|
|
22
|
+
this.onboardingEnabled = onboardingEnabled;
|
|
23
|
+
this.automaticRenewalEnabled = automaticRenewalEnabled;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
module.exports = CreateProjectModel;
|
|
26
|
+
module.exports = CreateProjectModel;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
function UpdateProjectModel(accountId, projectId, name, description, address, number, startDate, endDate,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
city, state, zipCode, companyNameForProject, certificateHolder = '', additionalInsured = '',
|
|
3
|
+
tenantSolutionEnabled = 0, onboardingEnabled = 0, automaticRenewalEnabled = 0, onboardedVendors = 0) {
|
|
4
|
+
this.projectId = projectId;
|
|
5
|
+
this.projectName = name;
|
|
6
|
+
this.userId = accountId;
|
|
7
|
+
this.regionOrDivision = description;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
this.address = address;
|
|
10
|
+
this.projectNumber = number;
|
|
11
|
+
this.projectStartDate = startDate;
|
|
12
|
+
this.projectEndDate = endDate;
|
|
13
|
+
this.onboardedVendors = onboardedVendors;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
this.city = city;
|
|
16
|
+
this.state = state;
|
|
17
|
+
this.zipCode = zipCode;
|
|
18
|
+
this.companyNameForProject = companyNameForProject;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
this.certificateHolder = certificateHolder;
|
|
21
|
+
this.additionalInsured = additionalInsured;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
this.tenantSolutionEnabled = tenantSolutionEnabled;
|
|
24
|
+
this.onboardingEnabled = onboardingEnabled;
|
|
25
|
+
this.automaticRenewalEnabled = automaticRenewalEnabled;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
module.exports = UpdateProjectModel;
|
|
28
|
+
module.exports = UpdateProjectModel;
|
|
@@ -1,40 +1,39 @@
|
|
|
1
|
-
|
|
2
1
|
function UpdateProjectSettingsModel({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
autoGaps = defaultAutoGaps,
|
|
3
|
+
autoRenewals = false,
|
|
4
|
+
marketplace = defaultMarketplace,
|
|
5
|
+
ocrEnabled = false,
|
|
6
|
+
onboardingPhase = false,
|
|
7
|
+
projectId = null,
|
|
8
|
+
qrEnabled = false,
|
|
9
|
+
tenantSolution = false,
|
|
10
|
+
autocompleteAddVendors = defaultAutocompleteAddVendors
|
|
12
11
|
|
|
13
12
|
}) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
this.autoGaps = autoGaps;
|
|
14
|
+
this.autoRenewals = autoRenewals;
|
|
15
|
+
this.marketplace = marketplace;
|
|
16
|
+
this.ocrEnabled = ocrEnabled;
|
|
17
|
+
this.onboardingPhase = onboardingPhase;
|
|
18
|
+
this.projectId = projectId;
|
|
19
|
+
this.qrEnabled = qrEnabled;
|
|
20
|
+
this.tenantSolution = tenantSolution;
|
|
21
|
+
this.autocompleteAddVendors = autocompleteAddVendors;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
module.exports = UpdateProjectSettingsModel;
|
|
26
25
|
|
|
27
26
|
const defaultMarketplace = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
marketplaceEnabled: false,
|
|
28
|
+
marketplacePreApproved: false,
|
|
29
|
+
marketplaceOnboardedVendors: false
|
|
31
30
|
};
|
|
32
31
|
const defaultAutoGaps = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
Guests: false,
|
|
33
|
+
Tenants: false,
|
|
34
|
+
Vendors: false
|
|
36
35
|
};
|
|
37
36
|
const defaultAutocompleteAddVendors = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
37
|
+
autocompleteAddVendorsForPm: false,
|
|
38
|
+
autocompleteAddVendorsForTenants: false
|
|
39
|
+
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
const requests = require('
|
|
1
|
+
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
2
|
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
3
|
|
|
4
4
|
const Endpoints = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
create: recordId => `${backendUrl}/saas/contractors/${recordId}/notes`,
|
|
6
|
+
getNotesByRecordId: recordId => `${backendUrl}/saas/contractors/${recordId}/notes`,
|
|
7
|
+
getNotesCountByRecordId: recordId => `${backendUrl}/saas/contractors/${recordId}/notes/count`,
|
|
8
|
+
deleteByNoteId: noteId => `${backendUrl}/saas/contractors/notes/${noteId}`,
|
|
9
|
+
updateByNoteId: noteId => `${backendUrl}/saas/contractors/notes/${noteId}`
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const createRecordNote = async (recordId, data, context) => {
|
|
13
|
-
|
|
13
|
+
return requests.postRequestHandler(Endpoints.create(recordId), data, context);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const getNotesByRecordId = async (recordId, context) => {
|
|
17
|
-
|
|
17
|
+
return requests.getRequestHandler(Endpoints.getNotesByRecordId(recordId), {}, context);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const getNotesCountByRecordId = async (recordId, context) => {
|
|
21
|
-
|
|
21
|
+
return requests.getRequestHandler(Endpoints.getNotesCountByRecordId(recordId), {}, context);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const deleteByNoteId = async (id, data, context) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const headers = {};
|
|
26
|
+
const params = {};
|
|
27
|
+
return requests.deleteRequestHandler(Endpoints.deleteByNoteId(id), context, headers, params, data);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const updateByNoteId = async (id, data, context) => {
|
|
31
|
-
|
|
31
|
+
return requests.putRequestHandler(Endpoints.updateByNoteId(id), data, context);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
module.exports = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
createRecordNote,
|
|
36
|
+
getNotesByRecordId,
|
|
37
|
+
getNotesCountByRecordId,
|
|
38
|
+
deleteByNoteId,
|
|
39
|
+
updateByNoteId
|
|
40
40
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
const recordNotesAPI = require('./record.notes.api');
|
|
2
2
|
|
|
3
3
|
const createRecordNote = async (recordId, data, context) => {
|
|
4
|
-
|
|
4
|
+
return recordNotesAPI.createRecordNote(recordId, data, context);
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
const getNotesByRecordId = async (recordId, context) => {
|
|
8
|
-
|
|
8
|
+
return recordNotesAPI.getNotesByRecordId(recordId, context);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const getNotesCountByRecordId = async (recordId, context) => {
|
|
12
|
-
|
|
12
|
+
return recordNotesAPI.getNotesCountByRecordId(recordId, context);
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const deleteByNoteId = async (noteId, data, context) => {
|
|
16
|
-
|
|
16
|
+
return recordNotesAPI.deleteByNoteId(noteId, data, context);
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const updateByNoteId = async (noteId, data, context) => {
|
|
20
|
-
|
|
20
|
+
return recordNotesAPI.updateByNoteId(noteId, data, context);
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
module.exports = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
24
|
+
createRecordNote,
|
|
25
|
+
getNotesByRecordId,
|
|
26
|
+
getNotesCountByRecordId,
|
|
27
|
+
deleteByNoteId,
|
|
28
|
+
updateByNoteId
|
|
29
|
+
};
|