Skip to content

guiguan/employee-monthly-payslip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation & Usage

  1. make sure the latest node and npm version is installed. You can use nvm install node to install them.
  2. npm install
  3. npm run compile
  4. npm start PATH_TO_INPUT_CSV_FILE PATH_TO_OUTPUT_CSV_FILE (you can use sample_input.csv in test directory) or simply run npm run start-dev which will use test/sample_input.csv as inputs and output to test/output.csv
  5. npm test to run all test cases

Input CSV File Format

firstName,lastName,annualSalary,superRate,payPeriod
Blaine,Matis,10000000,8.88%,1/2012-12/2012

Output CSV File Format

name,payPeriod,grossIncome,incomeTax,netIncome,super
Blaine Matis,01/01/2012-31/12/2012,10000000,4473547,5526453,888000

Assumptions

  • 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.

Building and testing environment

  • node v6.7.0
  • npm v3.10.3
  • macOS v10.12

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published