This is a console app to calculate monthly pay slip depends on annual income and tax rule.
-
Run
npm install -g yarn
in terminal to install yarn. -
Run
yarn install
in terminal to build this app. -
Run
yarn start
in terminal to run the app in the console. -
Run
yarn test
in terminal to run the test.
-
Follow SOLID principle, try to make code readable, maintainable and reusable.
-
Create multiple functions, each function has a single responsibility.
-
Inject the dependency of taxRateTable to the function calculateEmployeeMonthlyPayslip, so that if the tax rate updated, only taxRateTable need to be changed. More maintainable and scalable.
-
CamelCase naming convention, comments and documentations to make code more readable.
-
Use yarn instead of npm because yarn is faster.