quote-calculator-js-lib
KASKO Spreadsheet Quote Calculator Lib.
When in doubt, consult documentation!
Requirements
Usage
yarn add @kasko/quote-calculator-js
Example:
import { Calculator } from '@kasko/quote-calculator-js';
const calculator = new Calculator();
(async () => {
const path = './kasko-demo.xlsx';
const input = {
duration: 'P5Y',
policy_start_date: '2018-02-10',
};
const config = {
tax_rate: 0.05
};
await calculator.init(path, input, config);
const validation = calculator.validateInput();
const output = calculator.getOutput();
})()
Development
Installation
yarn install
Building
yarn build
Developing with real pricing:
First you must edit the development file /index.js
to take correct input and pricing file.
Then run build command.
And finally run:
yarn start
To execute that development file and see the result.
Testing
Single run (of everything):
yarn test
Testing formulas
yarn test:formulas
Testing pricing
yarn test:pricing
Running generic tests
yarn test:generic