@getjones/test-infra 2.10.9 → 2.10.12

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getjones/test-infra",
3
- "version": "2.10.9",
3
+ "version": "2.10.12",
4
4
  "description": "Providing internal and openapi interface",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -39,7 +39,8 @@ const POLICY_NAMES_MAP = {
39
39
  agreement: 'Agreement',
40
40
  certificateHolder: 'Certificate Holder',
41
41
  additionalInformation: 'Additional Information',
42
- additionalInsured: 'Additional Insured'
42
+ additionalInsured: 'Additional Insured',
43
+ businessInterruptionIncomeInsurance: 'Business Interruption / Income Insurance'
43
44
  };
44
45
 
45
46
  const ATTRIBUTE_NAMES_MAP = {
@@ -57,7 +58,10 @@ const ATTRIBUTE_NAMES_MAP = {
57
58
  amRating: 'AMBestRating',
58
59
  cancellationTerms: 'cancellationTerms',
59
60
  coiAuthentication: 'COIauthentication',
60
- signature: 'signature'
61
+ signature: 'signature',
62
+ indemnityPeriod: 'Indemnity Period',
63
+ actualLossSustained: 'Actual Loss Sustained',
64
+ extraExpense: 'Extra Expense'
61
65
  };
62
66
 
63
67
  const auditTriggerType = {
@@ -2,5 +2,6 @@
2
2
  "endorsment": "ENDORSMENT",
3
3
  "limit": "LIMIT",
4
4
  "boolean": "BOOLEAN",
5
- "multiple": "MULTIPLE"
5
+ "multiple": "MULTIPLE",
6
+ "numeric": "NUMERIC"
6
7
  }
@@ -5,22 +5,29 @@ const { AttributeModel, PolicyModel, AttributeTypes } = require('../models/polic
5
5
  const { CreateRequirementModel } = require('../models/create.requirement.model');
6
6
 
7
7
  const customAttributes = {
8
- Including: 'multiple'
8
+ Including: 'multiple',
9
+ indemnityPeriod: 'Indemnity Period'
9
10
  };
10
11
 
11
- const convertNumericValuesToNumberType = function(value) {
12
+ const convertNumericValuesToNumberType = function(value, attributeName) {
12
13
  if (dataTypeUtils.isString(value) && value.startsWith('$')) {
13
14
  return Number(value.replace(/[$,]/g, ''));
14
15
  }
15
16
 
17
+ if (attributeName === customAttributes.indemnityPeriod) {
18
+ return Number(value);
19
+ }
20
+
16
21
  return value;
17
22
  };
18
23
 
19
- const preparePolicyAttributesTypes = function(value) {
20
- const attributesValue = convertNumericValuesToNumberType(value);
24
+ const preparePolicyAttributesTypes = function(value, attributeName) {
25
+ const attributesValue = convertNumericValuesToNumberType(value, attributeName);
21
26
 
22
27
  if (dataTypeUtils.isNumber(attributesValue)) {
23
- return AttributeTypes.get(attributeTypes.limit);
28
+ return attributeName === customAttributes.indemnityPeriod ?
29
+ AttributeTypes.get(attributeTypes.numeric) :
30
+ AttributeTypes.get(attributeTypes.limit);
24
31
  }
25
32
 
26
33
  if (dataTypeUtils.isBoolean(attributesValue)) {
@@ -54,10 +61,10 @@ const parseRequirementConfig = function(config) {
54
61
 
55
62
  attributes.push({
56
63
  name: attributeName,
57
- type: preparePolicyAttributesTypes(config[policy][attribute]),
64
+ type: preparePolicyAttributesTypes(config[policy][attribute], attributeName),
58
65
  values: attributeName === customAttributes.Including ?
59
66
  config[policy][attribute].split(', ') :
60
- [convertNumericValuesToNumberType(config[policy][attribute])]
67
+ [convertNumericValuesToNumberType(config[policy][attribute], attributeName)]
61
68
  });
62
69
  };
63
70
  } else {