@getjones/test-infra 2.11.10 → 2.12.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
CHANGED
|
@@ -43,6 +43,9 @@ 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',
|
|
46
49
|
indemnityPeriod: 'Indemnity Period',
|
|
47
50
|
actualLossSustained: 'Actual Loss Sustained',
|
|
48
51
|
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 =
|
|
40
|
+
const recordDetailsModel = contractors.services.getContractorDetailsModel(recordConfig);
|
|
41
41
|
const record = new contractors.models.edit.ContractorModel(
|
|
42
42
|
recordId,
|
|
43
43
|
requestData.record.recordType,
|
|
@@ -4,8 +4,10 @@ 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');
|
|
7
8
|
const httpResponseStatusCodes = require('../../../../common/httpResponseStatusCodes.json');
|
|
8
9
|
const { waitFor } = require('../../../../common/utils/timeUtils');
|
|
10
|
+
const utils = require('../utils');
|
|
9
11
|
|
|
10
12
|
const createContractor = async (createContractorModel, context) => {
|
|
11
13
|
validateType(createContractorModel, CreateContractorModel);
|
|
@@ -178,6 +180,11 @@ const getInviteLinkStatus = (encryptedData, context) => {
|
|
|
178
180
|
return contractorsAPI.getInviteLinkStatus(encryptedData, context);
|
|
179
181
|
};
|
|
180
182
|
|
|
183
|
+
const getContractorDetailsModel = recordConfig => {
|
|
184
|
+
const apiDetailsConfig = utils.getRecordDetailsConfigInApiFormat(recordConfig);
|
|
185
|
+
return new ContractorDetailsModel(apiDetailsConfig);
|
|
186
|
+
};
|
|
187
|
+
|
|
181
188
|
module.exports = {
|
|
182
189
|
createContractor,
|
|
183
190
|
changeRequirement,
|
|
@@ -207,5 +214,6 @@ module.exports = {
|
|
|
207
214
|
archiveByRecordId,
|
|
208
215
|
restoreByRecordId,
|
|
209
216
|
updateLastInviteActionDate,
|
|
210
|
-
getInviteLinkStatus
|
|
217
|
+
getInviteLinkStatus,
|
|
218
|
+
getContractorDetailsModel
|
|
211
219
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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 };
|