stand_socotra_policy_transformer 2.0.12 → 3.0.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/__tests__/__utils__/payloads/sample_retool_socotra_subset.json +1 -0
- package/__tests__/__utils__/payloads/versions/v2/sample_new_quote.json +215 -0
- package/__tests__/__utils__/payloads/versions/v2/sample_retool.json +165 -0
- package/__tests__/__utils__/payloads/versions/v2/sample_retool_socotra_subset.json +159 -0
- package/__tests__/__utils__/payloads/versions/v2/sample_socotra_quote.json +779 -0
- package/__tests__/__utils__/payloads/versions/v2/sample_update_quote.json +18 -0
- package/__tests__/package_version.test.js +1 -1
- package/__tests__/retool_utils/socotra_payload.test.js +5 -5
- package/__tests__/retool_utils/versions/entries_v2.test.js +51 -0
- package/dist/stand_underwriter.js +1 -1
- package/package.json +1 -1
- package/src/index.js +6 -1
- package/src/retool_utils/versions/stand_v3_entries.js +211 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -2,8 +2,13 @@ const {underwrite, knockout_names} = require('./underwriter')
|
|
|
2
2
|
const {SocotraPayloadConverter} = require('./retool_utils/socotra_payloads')
|
|
3
3
|
const {entries_v1} = require('./retool_utils/versions/stand_v1_entries')
|
|
4
4
|
const {entries_v2} = require('./retool_utils/versions/stand_v2_entries')
|
|
5
|
+
const {entries_v3} = require('./retool_utils/versions/stand_v3_entries')
|
|
5
6
|
const { version } = require('../package.json');
|
|
6
7
|
|
|
7
|
-
const transformer_hash = {
|
|
8
|
+
const transformer_hash = {
|
|
9
|
+
'1': new SocotraPayloadConverter(entries_v1),
|
|
10
|
+
'2': new SocotraPayloadConverter(entries_v2),
|
|
11
|
+
'3': new SocotraPayloadConverter(entries_v3)
|
|
12
|
+
}
|
|
8
13
|
|
|
9
14
|
module.exports = {underwrite, knockout_names, transformer_hash, package_version: version}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
const {SocotraEntry} = require("../socotra_structure_helper");
|
|
2
|
+
|
|
3
|
+
function solar_panel_functions() {
|
|
4
|
+
let to_socotra_map = {0: "No", "1+": "Yes"}
|
|
5
|
+
let to_retool_map = {"No": 0, "Yes": "1+"}
|
|
6
|
+
return [(x) => to_retool_map[x], (x) => to_socotra_map[x]]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
entries_v3 = [
|
|
10
|
+
new SocotraEntry("quote_name", "quote_name", "quote.name"),
|
|
11
|
+
new SocotraEntry("socotra_config_version", "config_version", "quote.version"),
|
|
12
|
+
new SocotraEntry("fire_deductible", "wf_deductible", "exposure.dwelling.fields", parseFloat),
|
|
13
|
+
new SocotraEntry("other_deductible", "aop_deductible", "exposure.dwelling.fields", parseInt),
|
|
14
|
+
new SocotraEntry("water_deductible", "water_deductible", "exposure.dwelling.fields", parseInt),
|
|
15
|
+
new SocotraEntry("num_stories", "number_of_stories", "exposure.dwelling.fields"),
|
|
16
|
+
new SocotraEntry("num_bath", "number_of_bathrooms", "exposure.dwelling.fields"),
|
|
17
|
+
new SocotraEntry("square_feet", "square_feet", "exposure.dwelling.fields", undefined, parseInt),
|
|
18
|
+
new SocotraEntry("stand_protect_discount", "stand_protect_discount", "exposure.dwelling.fields"),
|
|
19
|
+
new SocotraEntry("multi_policy_discount", "multi_policy_discount", "exposure.dwelling.fields"),
|
|
20
|
+
new SocotraEntry(undefined, "has_any_claim_history", "exposure.dwelling.fields", (x) => undefined, x => "No"),
|
|
21
|
+
new SocotraEntry("roof_rating", "roof_rating", "exposure.dwelling.fields"),
|
|
22
|
+
new SocotraEntry("slab_plumbing", "slab_plumbing", "exposure.dwelling.fields"),
|
|
23
|
+
new SocotraEntry("foundation_type", "foundation_type", "exposure.dwelling.fields"),
|
|
24
|
+
new SocotraEntry("siding_material", "siding_material", "exposure.dwelling.fields"),
|
|
25
|
+
new SocotraEntry("distance_to_fire_department", "dist_to_fire_department", "exposure.dwelling.fields"),
|
|
26
|
+
new SocotraEntry("protection_class", "protection_class", "exposure.dwelling.fields"),
|
|
27
|
+
new SocotraEntry("purchase_year", "property_purchase_year", "exposure.dwelling.fields", undefined, parseInt),
|
|
28
|
+
new SocotraEntry("roof_material", "roof_material", "exposure.dwelling.fields"),
|
|
29
|
+
new SocotraEntry("presence_of_fence", "fence", "exposure.dwelling.fields"),
|
|
30
|
+
new SocotraEntry("year_built", "year_built", "exposure.dwelling.fields"),
|
|
31
|
+
new SocotraEntry("construction_type", "construction_type", "exposure.dwelling.fields"),
|
|
32
|
+
// new SocotraEntry("No", "has_any_claim_history", "exposure.dwelling.fields"),
|
|
33
|
+
new SocotraEntry("water_damage_limit", "water_damage_limit", "exposure.dwelling.fields"),
|
|
34
|
+
new SocotraEntry("extended_dwelling_coverage", "extended_dwelling_coverage", "exposure.dwelling.fields"),
|
|
35
|
+
new SocotraEntry("sprinkler", "sprinkler", "exposure.dwelling.fields"),
|
|
36
|
+
new SocotraEntry("smoke", "smoke", "exposure.dwelling.fields"),
|
|
37
|
+
new SocotraEntry("fire_alarm", "fire_alarm_type", "exposure.dwelling.fields"),
|
|
38
|
+
new SocotraEntry("fire_ext", "fire_ext", "exposure.dwelling.fields"),
|
|
39
|
+
new SocotraEntry("deadbolt", "dead_bolt", "exposure.dwelling.fields"),
|
|
40
|
+
new SocotraEntry(undefined, "24_hour_security_guard", "exposure.dwelling.fields", (x) => undefined, (x) => "No"),
|
|
41
|
+
new SocotraEntry("theft_alarm", "theft_alarm_type", "exposure.dwelling.fields"),
|
|
42
|
+
new SocotraEntry("distance_to_neighboring_home", "distance_to_nearest_home_ft", "exposure.dwelling.fields"),
|
|
43
|
+
new SocotraEntry("chimney_spark_arrestors", "chimney_mesh_cover", "exposure.dwelling.fields"),
|
|
44
|
+
new SocotraEntry("ember_resistant_vents", "ember_vents", "exposure.dwelling.fields"),
|
|
45
|
+
new SocotraEntry("enclosed_eaves", "enclosed_eaves", "exposure.dwelling.fields"),
|
|
46
|
+
new SocotraEntry("fuel_tank_distance", "propane_tank_proximity", "exposure.dwelling.fields"),
|
|
47
|
+
new SocotraEntry("ground_clearance", "exterior_clearance", "exposure.dwelling.fields"),
|
|
48
|
+
new SocotraEntry("windows_frame_type", "window_frame_type", "exposure.dwelling.fields"),
|
|
49
|
+
new SocotraEntry("windows_type", "window_glass_type", "exposure.dwelling.fields"),
|
|
50
|
+
|
|
51
|
+
new SocotraEntry("replacement_cost", "full_replacement_value", "policy.fields", parseInt),
|
|
52
|
+
new SocotraEntry("street_address", "address", "policy.fields"),
|
|
53
|
+
new SocotraEntry("state", "state", "policy.fields"),
|
|
54
|
+
new SocotraEntry("is_rental", "is_rental", "policy.fields"),
|
|
55
|
+
new SocotraEntry("pool_type", "swimming_pool_type", "policy.fields"),
|
|
56
|
+
new SocotraEntry("has_home_business", "home_business", "policy.fields"),
|
|
57
|
+
new SocotraEntry("occupation", "occupation", "policy.fields"),
|
|
58
|
+
new SocotraEntry("water_shutoff", "water_shutoff_system", "policy.fields"),
|
|
59
|
+
new SocotraEntry("waterflow_alarm", "waterflow_alarm", "policy.fields"),
|
|
60
|
+
new SocotraEntry("city", "city", "policy.fields"),
|
|
61
|
+
new SocotraEntry("electrical_updated_year", "electrical_last_updated", "policy.fields"),
|
|
62
|
+
new SocotraEntry("coverage_b", "coverage_b", "policy.fields", parseInt),
|
|
63
|
+
new SocotraEntry("coverage_c", "coverage_c", "policy.fields", parseInt),
|
|
64
|
+
new SocotraEntry("coverage_a", "coverage_a", "policy.fields", parseInt),
|
|
65
|
+
new SocotraEntry("retrofitted", "retrofit_1997", "policy.fields"),
|
|
66
|
+
new SocotraEntry("roof_replacement_year", "roof_replaced_year", "policy.fields"),
|
|
67
|
+
new SocotraEntry("seismic_shutoff", "seismic_shutoff", "policy.fields"),
|
|
68
|
+
new SocotraEntry("coverage_f", "coverage_f", "policy.fields"),
|
|
69
|
+
new SocotraEntry("bellweather_wf_score", "bellweather_wf_score", "policy.fields"),
|
|
70
|
+
new SocotraEntry("first_street_score", "first_street_wf_score", "policy.fields", parseInt),
|
|
71
|
+
new SocotraEntry("degree_of_slope", "degrees_of_slope", "policy.fields"),
|
|
72
|
+
new SocotraEntry("number_of_bankrupcies", "bankruptcies_judgements_liens", "policy.fields"),
|
|
73
|
+
new SocotraEntry("coverage_d", "coverage_d", "policy.fields", parseInt),
|
|
74
|
+
new SocotraEntry("coverage_e", "coverage_e", "policy.fields"),
|
|
75
|
+
new SocotraEntry("gre_wf_score", "gre_wf_score", "policy.fields", parseFloat),
|
|
76
|
+
// new SocotraEntry("2024-07-04", "prevPolicyExpiration", "policy.fields"),
|
|
77
|
+
new SocotraEntry("state", "state", "policy.fields"),
|
|
78
|
+
// new SocotraEntry("has_steel_braided_hoses", "steel_braided_hoses", "policy.fields"),
|
|
79
|
+
// new SocotraEntry("No", "hasFraudConviction", "policy.fields"),
|
|
80
|
+
new SocotraEntry("core_logic_wf_score", "core_logic_score", "policy.fields", parseInt),
|
|
81
|
+
new SocotraEntry(undefined, "channel", "policy.fields", (x) => undefined, (x) => "Broker"),
|
|
82
|
+
new SocotraEntry(undefined, "coverageForm", "policy.fields", (x) => undefined, (x) => "HO-5 Comprehensive"),
|
|
83
|
+
new SocotraEntry("zip", "zip", "policy.fields"),
|
|
84
|
+
new SocotraEntry("has_underground_fuel_tank", "underground_fuel_tank", "policy.fields"),
|
|
85
|
+
new SocotraEntry("residence_type", "dwelling_use_type", "policy.fields"),
|
|
86
|
+
new SocotraEntry("attractive_nuisance", "has_attractive_nuisance", "policy.fields"),
|
|
87
|
+
// new SocotraEntry("No", "circuit_breaker", "policy.fields"),
|
|
88
|
+
new SocotraEntry("zesty_l2", "zesty_l2", "policy.fields", parseInt),
|
|
89
|
+
new SocotraEntry("zesty_l1", "zesty_l1", "policy.fields", parseInt),
|
|
90
|
+
// new SocotraEntry("Yes", "hasContinuousCoverage", "policy.fields"),
|
|
91
|
+
// new SocotraEntry("Safeco", "pastCarrier", "policy.fields"),
|
|
92
|
+
new SocotraEntry("water_heater_update_year", "water_heaters_last_updated", "policy.fields"),
|
|
93
|
+
new SocotraEntry("plumbing_updated_year", "plumbing_last_updated", "policy.fields"),
|
|
94
|
+
new SocotraEntry("home_heating_update_year", "home_heater_last_updated", "policy.fields", undefined, (x) => x === "" ? null : x),
|
|
95
|
+
new SocotraEntry("insured_dob", "date_of_birth", "policy.fields"),
|
|
96
|
+
new SocotraEntry("gre_arf", "arf", "policy.fields", parseFloat),
|
|
97
|
+
new SocotraEntry("insured_dob", "date_of_birth", "policy.fields"),
|
|
98
|
+
new SocotraEntry("flood_score", "first_street_flood_score", "policy.fields"),
|
|
99
|
+
// new SocotraEntry("Yes", "beenPreviouslyInsured", "policy.fields"),
|
|
100
|
+
new SocotraEntry("home_heating_source", "heating_source", "policy.fields"),
|
|
101
|
+
new SocotraEntry("horses", "has_horses", "policy.fields"),
|
|
102
|
+
new SocotraEntry("is_under_renovation", "renovation", "policy.fields"),
|
|
103
|
+
new SocotraEntry("pool_type", "swimming_pool_type", "policy.fields"),
|
|
104
|
+
new SocotraEntry("residence_type", "dwelling_use_type", "policy.fields"),
|
|
105
|
+
new SocotraEntry("previous_insurance_company", "pastCarrier", "policy.fields"),
|
|
106
|
+
new SocotraEntry("previous_policy_expiration_date", "prevPolicyExpiration", "policy.fields"),
|
|
107
|
+
new SocotraEntry("previous_premium", "prevPolicyPremium", "policy.fields", undefined, parseInt),
|
|
108
|
+
new SocotraEntry("fireshed_ID", "fireshed_id", "policy.fields"),
|
|
109
|
+
new SocotraEntry("fireshed_code", "fireshed_code", "policy.fields"),
|
|
110
|
+
new SocotraEntry("fireshed_capacity", "fireshed_capacity", "policy.fields", parseFloat),
|
|
111
|
+
new SocotraEntry("county", "county", "policy.fields"),
|
|
112
|
+
new SocotraEntry("ensemble_mean", "wf_score_mean", "policy.fields", parseFloat),
|
|
113
|
+
new SocotraEntry("ensemble_variance", "wf_score_variance", "policy.fields", parseFloat),
|
|
114
|
+
new SocotraEntry("wildfire_category", "wf_score_category", "policy.fields"),
|
|
115
|
+
new SocotraEntry("has_additional_insured", "has_co_applicant", "policy.fields"),
|
|
116
|
+
new SocotraEntry("months_unoccupied", "months_unoccupied", "policy.fields", (x) => x == null ? "0" : x),
|
|
117
|
+
new SocotraEntry("multifamily_unit_count", "multi_family_unit_count", "policy.fields", undefined, parseInt),
|
|
118
|
+
new SocotraEntry("spouse_first_name", "has_co_applicant", "policy.fields", (x) => null, (x) => x ? "Yes" : "No"),
|
|
119
|
+
new SocotraEntry("spouse_first_name", "co_applicant_first_name", "policy.fields"),
|
|
120
|
+
new SocotraEntry("spouse_last_name", "co_applicant_last_name", "policy.fields"),
|
|
121
|
+
new SocotraEntry("spouse_email", "co_applicant_email", "policy.fields"),
|
|
122
|
+
new SocotraEntry("co_applicant_address", "co_applicant_address", "policy.fields"),
|
|
123
|
+
new SocotraEntry("spouse_phone_number", "co_applicant_phone_number", "policy.fields"),
|
|
124
|
+
new SocotraEntry("number_of_mortgages", "num_mortgages", "policy.fields"),
|
|
125
|
+
new SocotraEntry("past_liens", "bankruptcies_judgements_liens", "policy.fields"),
|
|
126
|
+
new SocotraEntry("property_id", "retool_property_id", "policy.fields"),
|
|
127
|
+
new SocotraEntry("primary_dwelling_insured", "primary_insured_by_stand", "policy.fields"),
|
|
128
|
+
new SocotraEntry("lat", "latitude", "policy.fields", parseFloat),
|
|
129
|
+
new SocotraEntry("lng", "longitude", "policy.fields", parseFloat),
|
|
130
|
+
new SocotraEntry("count_of_solar_panels", "has_solar_panels", "exposure.dwelling.fields", ...solar_panel_functions()),
|
|
131
|
+
|
|
132
|
+
new SocotraEntry("producer_license_number", "producer_license_number", "policy.fields"),
|
|
133
|
+
new SocotraEntry("producer_id", "producerId", "policy.fields"),
|
|
134
|
+
new SocotraEntry("producer_email", "producerEmail", "policy.fields"),
|
|
135
|
+
new SocotraEntry("producer_name", "producerName", "policy.fields"),
|
|
136
|
+
new SocotraEntry("producer_ascend_id", "producer_ascend_id", "policy.fields"),
|
|
137
|
+
new SocotraEntry("producer_license_number", "producer_license_number", "policy.fields"),
|
|
138
|
+
new SocotraEntry("producer_phone_number", "producer_phone_number", "policy.fields"),
|
|
139
|
+
new SocotraEntry("producer_state", "producer_state", "policy.fields"),
|
|
140
|
+
new SocotraEntry("producer_commission", "commissionRate", "policy.fields"),
|
|
141
|
+
new SocotraEntry("producer_zip", "producer_zip", "policy.fields"),
|
|
142
|
+
new SocotraEntry("producer_city", "producer_city", "policy.fields"),
|
|
143
|
+
new SocotraEntry("producer_street_address", "producer_street_address", "policy.fields"),
|
|
144
|
+
new SocotraEntry("producer_street_address2", "producer_street_address_2", "policy.fields"),
|
|
145
|
+
|
|
146
|
+
new SocotraEntry("broker_license_number", "distributor_license_number", "policy.fields"),
|
|
147
|
+
new SocotraEntry("broker_name", "distributor_name", "policy.fields"),
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
new SocotraEntry("premium_calculated", "indicated_policy_cost", "policy.fields"),
|
|
151
|
+
new SocotraEntry("withdrawal_reasons", "withdrawal_reason", "policy.fields.array"),
|
|
152
|
+
new SocotraEntry("rejection_reasons", "declination_reason", "policy.fields.array"),
|
|
153
|
+
new SocotraEntry("competing_carrier", "competing_carrier", "policy.fields"),
|
|
154
|
+
new SocotraEntry("competing_pricing", "competing_pricing", "policy.fields"),
|
|
155
|
+
|
|
156
|
+
new SocotraEntry("stand_second_approval", "stand_second_approval", "policy.fields"),
|
|
157
|
+
new SocotraEntry("fronting_carrier_approval", "fronting_carrier_approval", "policy.fields"),
|
|
158
|
+
new SocotraEntry("reinsurance_carrier_approved", "reinsurance_carrier_approved", "policy.fields"),
|
|
159
|
+
new SocotraEntry("reinsurance_rate", "reinsurance_rate", "policy.fields"),
|
|
160
|
+
|
|
161
|
+
new SocotraEntry("is_agreed_value", "is_agreed_value", "policy.fields"),
|
|
162
|
+
new SocotraEntry("is_difference_in_condition", "is_difference_in_condition", "policy.fields"),
|
|
163
|
+
new SocotraEntry("lead_source", "lead_source", "policy.fields", (x) => null),
|
|
164
|
+
|
|
165
|
+
new SocotraEntry("start_date", "startTimestamp", "effective_date"),
|
|
166
|
+
new SocotraEntry("payment_schedule", "paymentScheduleName", "payment_schedule"),
|
|
167
|
+
|
|
168
|
+
//For sure
|
|
169
|
+
new SocotraEntry("billing_email", "billing_email", "policy.fields"),
|
|
170
|
+
new SocotraEntry("account_manager_name", "billing_contact_name", "policy.fields"),
|
|
171
|
+
new SocotraEntry("co_applicant_occupation", "co_applicant_occupation", "policy.fields"),
|
|
172
|
+
new SocotraEntry("is_firewise_community", "is_firewise_community", "exposure.dwelling.fields"), //YES NO
|
|
173
|
+
new SocotraEntry("count_domestic_employees", "count_domestic_employees", "policy.fields" ),
|
|
174
|
+
new SocotraEntry("domestic_employees_duties", "domestic_employees_duties", "policy.fields" ),
|
|
175
|
+
new SocotraEntry("high_risk_tree_type", "high_risk_tree_type", "exposure.dwelling.fields" ),
|
|
176
|
+
new SocotraEntry("exterior_door_material", "exterior_door_material", "exposure.dwelling.fields" ),
|
|
177
|
+
new SocotraEntry("trellis_pergola_material", "trellis_pergola_material", "exposure.dwelling.fields" ),
|
|
178
|
+
new SocotraEntry("mulch_type", "mulch_type", "exposure.dwelling.fields" ),
|
|
179
|
+
new SocotraEntry("farming_activity", "farming_type", "policy.fields" ),
|
|
180
|
+
new SocotraEntry("deck_type", "deck_type", "exposure.dwelling.fields" ),
|
|
181
|
+
new SocotraEntry("has_fence_attached", "has_fence_attached", "exposure.dwelling.fields" ), // YES NO
|
|
182
|
+
new SocotraEntry("gutter_material", "gutter_material", "exposure.dwelling.fields" ),
|
|
183
|
+
new SocotraEntry("has_gutter_guards_installed", "has_gutter_guards_installed", "exposure.dwelling.fields" ), // YES NO
|
|
184
|
+
new SocotraEntry("gutter_guards_type", "gutter_guards_type", "exposure.dwelling.fields" ),
|
|
185
|
+
new SocotraEntry("construction_renovations_details", "construction_renovations_details", "exposure.dwelling.fields" ),
|
|
186
|
+
new SocotraEntry("year_retrofitted", "year_retrofitted", "policy.fields" ),
|
|
187
|
+
new SocotraEntry("alarm_company", "alarm_company", "exposure.dwelling.fields" ),
|
|
188
|
+
new SocotraEntry("eaves_material", "eaves_material", "exposure.dwelling.fields" ),
|
|
189
|
+
new SocotraEntry("exterior_sprinkler_type", "exterior_sprinkler_type", "exposure.dwelling.fields" ),
|
|
190
|
+
// Defensible space request - in feet
|
|
191
|
+
new SocotraEntry("defensible_space", "defensible_space", "exposure.dwelling.fields"),
|
|
192
|
+
|
|
193
|
+
//Delete steel braided hoses And toilet
|
|
194
|
+
new SocotraEntry("water_supply_hoses_type", "water_supply_hoses_type", "policy.fields"),
|
|
195
|
+
new SocotraEntry("water_supply_fittings_type", "water_supply_fittings_type", "policy.fields"),
|
|
196
|
+
new SocotraEntry("prior_status_reason", "prev_policy_status", "policy.fields"),
|
|
197
|
+
new SocotraEntry("prior_policy_status", "prev_policy_status", "policy.fields"),
|
|
198
|
+
//TODO figure out how to connect AI Data
|
|
199
|
+
//TODO figure out how to connect claims
|
|
200
|
+
|
|
201
|
+
//Maybe
|
|
202
|
+
// bite history
|
|
203
|
+
// new SocotraEntry("occupation_additional_context", "occupation_additional_context", "policy.fields")
|
|
204
|
+
|
|
205
|
+
]
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
module.exports = {entries_v3}
|