Created
June 13, 2018 07:54
-
-
Save abel-masila/c3ca09a24951bbdc8d1615e668a384bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getInsurerValue = (insurer, conveyance, packaging, icc) => { | |
var value = 0; | |
var is_containerised = packaging === 'CONTAINERISED'; | |
if (icc === 'ICC-A') { | |
if (conveyance === Config.CONVEYANCE.AIR) { | |
value = insurer.icc_a.air_value; | |
} else if (conveyance === Config.CONVEYANCE.SEA && is_containerised) { | |
value = insurer.icc_a.sea_containerised_value; | |
} else if (conveyance === Config.CONVEYANCE.SEA && !is_containerised) { | |
value = insurer.icc_a.sea_non_containerised_value; | |
} | |
} else if (icc === 'ICC-B') { | |
if (conveyance === Config.CONVEYANCE.AIR) { | |
value = insurer.icc_b.air_value; | |
} else if (conveyance === Config.CONVEYANCE.SEA && is_containerised) { | |
value = insurer.icc_b.sea_containerised_value; | |
} else if (conveyance === Config.CONVEYANCE.SEA && !is_containerised) { | |
value = insurer.icc_b.sea_non_containerised_value; | |
} | |
} else if (icc === 'ICC-C') { | |
if (conveyance === Config.CONVEYANCE.AIR) { | |
value = insurer.icc_c.air_value; | |
} else if (conveyance === Config.CONVEYANCE.SEA && is_containerised) { | |
value = insurer.icc_c.sea_containerised_value; | |
} else if (conveyance === Config.CONVEYANCE.SEA && !is_containerised) { | |
value = insurer.icc_c.sea_non_containerised_value; | |
} | |
} | |
return value; | |
}; |
BransonGitomeh
commented
Jun 13, 2018
const filteredInsurers = quotes.filter((insurer, key) => {
const premium = revisedPremiumCalculation(
insurer,
selected_goods,
conveyance,
packaging,
transshipment,
warehousing,
currency_rate.rate,
other_rates,
icc_class
).premium;
if (!isNaN(premium)) {
return insurer;
}
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment