- make sure the latest node and npm version is installed. You can use
nvm install node
to install them. npm install
npm run compile
npm start PATH_TO_INPUT_CSV_FILE PATH_TO_OUTPUT_CSV_FILE
(you can usesample_input.csv
intest
directory) or simply runnpm run start-dev
which will usetest/sample_input.csv
as inputs and output totest/output.csv
npm test
to run all test cases
firstName,lastName,annualSalary,superRate,payPeriod
Blaine,Matis,10000000,8.88%,1/2012-12/2012
name,payPeriod,grossIncome,incomeTax,netIncome,super
Blaine Matis,01/01/2012-31/12/2012,10000000,4473547,5526453,888000
- Employee first and last names are all in English alphabet. International names can be easily supported by adding unicode point ranges to
nameRegex
- User will specify a payment period with a start and an end date, using format MM/YYYY (month and year). The end month is inclusive. For example, 8/2012-1/2013 means from 1 August of 2012 to 31 January of 2013.
- Payment calculation is performed on month level using the methodology illustrated in the problem description
- Each row of input csv file is processed individually. If an error happens when processing a row, that row is skipped in the output csv, and the error is reported to stderr
- The output csv file will contain a header
- User of this code is aware that tax rate data is valid only from 1 July 2012 to 30 June of 2013 (the 2012-2013 financial year). To calculate payment periods out of that time period may result in inaccurate results, and a warning will be displayed. User should update the tax rate data accordingly to support wider time range.
- node v6.7.0
- npm v3.10.3
- macOS v10.12