@getjones/test-infra 2.12.0 → 2.12.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 +1 -1
- package/src/defaults/configs/polices.js +0 -3
- package/src/factory/records/records.js +1 -1
- package/src/saas/internal-api/contractors/api/contractors.service.js +1 -9
- package/src/saas/internal-api/tabs/api/tabs.service.js +2 -2
- package/src/saas/internal-api/tabs/models/tabs.model.js +3 -2
- package/src/saas/internal-api/contractors/utils.js +0 -25
package/package.json
CHANGED
|
@@ -43,9 +43,6 @@ const attributeNames = {
|
|
|
43
43
|
occur: 'Occur',
|
|
44
44
|
text: 'text',
|
|
45
45
|
limit: 'limit',
|
|
46
|
-
AdditionalInsuredEndorsement: 'Additional Insured Endorsement',
|
|
47
|
-
PrimaryNonContributoryProvision: 'Primary Non-Contributory Provision',
|
|
48
|
-
PrimaryNonContributoryEndorsement: 'Primary Non-Contributory Endorsement',
|
|
49
46
|
indemnityPeriod: 'Indemnity Period',
|
|
50
47
|
actualLossSustained: 'Actual Loss Sustained',
|
|
51
48
|
extraExpense: 'Extra Expense'
|
|
@@ -37,7 +37,7 @@ const prepareRecord = async (recordCompany, recordEmail, status, tabId, requirem
|
|
|
37
37
|
|
|
38
38
|
if (recordConfig) {
|
|
39
39
|
const tabModel = new requests.models.TabModel(requestData.tab.type);
|
|
40
|
-
const recordDetailsModel = contractors.
|
|
40
|
+
const recordDetailsModel = new contractors.models.edit.ContractorDetailsModel(recordConfig);
|
|
41
41
|
const record = new contractors.models.edit.ContractorModel(
|
|
42
42
|
recordId,
|
|
43
43
|
requestData.record.recordType,
|
|
@@ -4,10 +4,8 @@ const { RequestModel } = require('../../requests/models/edit.request.model');
|
|
|
4
4
|
const { validateType } = require('../../../../common/validations/typeValidations');
|
|
5
5
|
const { RecordModifyDateVerificationModel } = require('../models/verification.contractor.model');
|
|
6
6
|
const { AssignRequirementModel } = require('../models/assign.requirement.model');
|
|
7
|
-
const { ContractorDetailsModel } = require('../models/edit.contractor.model');
|
|
8
7
|
const httpResponseStatusCodes = require('../../../../common/httpResponseStatusCodes.json');
|
|
9
8
|
const { waitFor } = require('../../../../common/utils/timeUtils');
|
|
10
|
-
const utils = require('../utils');
|
|
11
9
|
|
|
12
10
|
const createContractor = async (createContractorModel, context) => {
|
|
13
11
|
validateType(createContractorModel, CreateContractorModel);
|
|
@@ -180,11 +178,6 @@ const getInviteLinkStatus = (encryptedData, context) => {
|
|
|
180
178
|
return contractorsAPI.getInviteLinkStatus(encryptedData, context);
|
|
181
179
|
};
|
|
182
180
|
|
|
183
|
-
const getContractorDetailsModel = recordConfig => {
|
|
184
|
-
const apiDetailsConfig = utils.getRecordDetailsConfigInApiFormat(recordConfig);
|
|
185
|
-
return new ContractorDetailsModel(apiDetailsConfig);
|
|
186
|
-
};
|
|
187
|
-
|
|
188
181
|
module.exports = {
|
|
189
182
|
createContractor,
|
|
190
183
|
changeRequirement,
|
|
@@ -214,6 +207,5 @@ module.exports = {
|
|
|
214
207
|
archiveByRecordId,
|
|
215
208
|
restoreByRecordId,
|
|
216
209
|
updateLastInviteActionDate,
|
|
217
|
-
getInviteLinkStatus
|
|
218
|
-
getContractorDetailsModel
|
|
210
|
+
getInviteLinkStatus
|
|
219
211
|
};
|
|
@@ -34,8 +34,8 @@ const getOrCreateTab = async (projectId, tabName, tabType, context) => {
|
|
|
34
34
|
return createResponse.data;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const updateTab = async (projectId,
|
|
38
|
-
const tabModel = new UpdateTabModel(projectId,
|
|
37
|
+
const updateTab = async ({ id, projectId, name, type, context, dateModified }) => {
|
|
38
|
+
const tabModel = new UpdateTabModel({ id, projectId, name, type, dateModified });
|
|
39
39
|
return tabsAPI.updateTab(tabModel, context);
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -7,11 +7,12 @@ class CreateTabModel {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
class UpdateTabModel {
|
|
10
|
-
constructor(projectId, tabName, tabType, tabId) {
|
|
10
|
+
constructor({ projectId, name: tabName, type: tabType, id: tabId, dateModified } = {}) {
|
|
11
|
+
this.tabId = tabId;
|
|
11
12
|
this.projectId = projectId;
|
|
12
13
|
this.tabName = tabName;
|
|
13
14
|
this.type = tabType;
|
|
14
|
-
this.
|
|
15
|
+
this.dateModified = dateModified;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const getRecordDetailsConfigInApiFormat = function(config) {
|
|
2
|
-
apiConfig = {};
|
|
3
|
-
apiConfig['company'] = config['Company Name'] || config.companyName || config.company;
|
|
4
|
-
apiConfig['emailAddress'] = config['Primary Email'] || config['Email Address'] || config['emailAddress'] || config['email'];
|
|
5
|
-
apiConfig['firstName'] = config['First Name'] || config.firstName || config.fName;
|
|
6
|
-
apiConfig['lastName'] = config['Last Name'] || config.lastName || config.lName;
|
|
7
|
-
apiConfig['dba'] = config['DBA'] || config['DBA (Optional)'] || config.dba;
|
|
8
|
-
apiConfig['address'] = config['Address'] || config.address || config.location;
|
|
9
|
-
apiConfig['city'] = config['City'] || config.city;
|
|
10
|
-
apiConfig['state'] = config['State'] || config.state;
|
|
11
|
-
apiConfig['zipCode'] = config['Zip Code'] || config.zipCode;
|
|
12
|
-
apiConfig['phoneNumber'] = config['Phone Number'] || config['Phone Number (Optional)'] || config.phoneNumber || config.phone;
|
|
13
|
-
apiConfig['externalRecordId'] = config['Record ID'] || config.recordId || config.externalRecordId;
|
|
14
|
-
apiConfig['projectDescription'] = config['Project Description'] || config.projectDescription || config.descriptionOfOperations;
|
|
15
|
-
apiConfig['startDate'] = config['Start Date'] || config.startDate;
|
|
16
|
-
apiConfig['endDate'] = config['End Date'] || config.endDate;
|
|
17
|
-
apiConfig['additionalEmails'] = config['Additional Emails'] || config.additionalEmails;
|
|
18
|
-
apiConfig['tenantBusinessName'] = config['Tenant Company Name'] || config.tenantCompanyName || config.tenantBusinessName;
|
|
19
|
-
apiConfig['tenantEmailAddress'] = config['Tenant Email Address'] || config.tenantEmailAddress;
|
|
20
|
-
|
|
21
|
-
Object.keys(apiConfig).forEach(key => apiConfig[key] === undefined && delete apiConfig[key]);
|
|
22
|
-
return apiConfig;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
module.exports = { getRecordDetailsConfigInApiFormat };
|