stand_socotra_policy_transformer 3.0.2 → 3.0.4
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/__tests__/__utils__/payloads/ai_additional_insured_new.json +90 -0
- package/__tests__/__utils__/payloads/ai_expected_update.json +0 -0
- package/__tests__/__utils__/payloads/ai_old_payload.json +707 -0
- package/__tests__/package_version.test.js +1 -1
- package/__tests__/retool_utils/socotra_payload.test.js +12 -0
- package/dist/stand_underwriter.js +1 -1
- package/package.json +1 -1
- package/src/retool_utils/socotra_payloads.js +8 -2
package/package.json
CHANGED
|
@@ -78,8 +78,14 @@ class SocotraPayloadConverter {
|
|
|
78
78
|
let dwelling_exposure_locator = old_quote.exposures.find(obj => obj.name === 'dwelling')["locator"]
|
|
79
79
|
let payload = SocotraEntry.socotra_create_update_template(dwelling_exposure_locator)
|
|
80
80
|
this.entries.forEach(entry => {
|
|
81
|
-
if
|
|
82
|
-
|
|
81
|
+
// Check if the entry's retool_id is in the retool_payload keys
|
|
82
|
+
// For nested keys (e.g., "additional_insured_data.additionalInterest"), check if the parent key exists
|
|
83
|
+
const retool_id_parts = entry.retool_id ? entry.retool_id.split('.') : [];
|
|
84
|
+
const parent_key = retool_id_parts[0];
|
|
85
|
+
|
|
86
|
+
if (Object.keys(retool_payload).includes(entry.retool_id) ||
|
|
87
|
+
(parent_key && Object.keys(retool_payload).includes(parent_key))) {
|
|
88
|
+
if(entry instanceof SocotraGroupEntry){
|
|
83
89
|
entry.socotra_update(retool_payload, payload, old_payload)
|
|
84
90
|
} else{
|
|
85
91
|
entry.socotra_update(retool_payload, payload)
|