{"_id":"@edgarpan/monthly-payslip-generator","_rev":"2-24b6ab5b31092b3518731359d184a8de","name":"@edgarpan/monthly-payslip-generator","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.2":{"name":"@edgarpan/monthly-payslip-generator","version":"1.0.2","description":"This is a CLI that generates monthly payslip","main":"./lib/index.js","scripts":{"start":"nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts","build":"rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript","test":"jest","test:watch":"jest --watch","local":"npm run build && npm i -g ."},"repository":{"type":"git","url":"git+https://github.com/edgaryp/monthly-payslip-generator.git"},"author":{"name":"Edgar Pan","email":"edgaryp@me.com"},"license":"UNLICENSED","bugs":{"url":"https://github.com/edgaryp/monthly-payslip-generator/issues"},"homepage":"https://github.com/edgaryp/monthly-payslip-generator#readme","devDependencies":{"@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-node-resolve":"^13.0.6","@rollup/plugin-typescript":"^8.3.0","@types/clear":"^0.1.2","@types/commander":"^2.12.2","@types/figlet":"^1.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","jest":"^27.4.4","nodemon":"^2.0.15","rollup":"^2.61.1","rollup-plugin-preserve-shebangs":"^0.2.0","ts-jest":"^27.1.1","ts-node":"^10.4.0","tsconfig-paths":"^3.12.0","typescript":"^4.5.3"},"bin":{"monthly-payslip-generator":"lib/index.js","mpg":"lib/index.js"},"dependencies":{"clear":"^0.1.0","commander":"^8.3.0","figlet":"^1.5.2"},"gitHead":"5e40ab99b4c5d424577bf42e226ed1e198b52c60","_id":"@edgarpan/monthly-payslip-generator@1.0.2","_nodeVersion":"16.11.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-soQk24stfeTKIpRfb4hB2+rL13pvY+lSpCxNfuzn1rvg63EmdEboIEpg+asixA61SRAgo4NcCM+kla+zzK9ZqQ==","shasum":"09e6e773846b7744cb6e410d03191d974607ed9e","tarball":"https://registry.npmjs.org/@edgarpan/monthly-payslip-generator/-/monthly-payslip-generator-1.0.2.tgz","fileCount":4,"unpackedSize":179471,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtqGjCRA9TVsSAnZWagAAmrAP/3s0h3gVZdS+yYmXoJnQ\n732p2+qzLptOuWrcI54WfIb28Yvy0apGrSx+V/9+HwlJNxHizzygGLDK2ztB\nMJwHdE3OyYrCuqJCk0UadgXlxf8P/52dN0BhoSTowG9KtAxyc2QwbDPRs2M7\nS/pvDeD01VKd1EWVwNfzu3RJijY8MSaXQgWQg6eiTIlMx1GNtLBwrJDuvDoc\nQ1RbLORPcBKqBYV3HR72QoJTfVs5YTNlW22F7qjVa0sv6ggsc8vpmQiSODYv\n1YGRm9K4LgQsLy9ik8scs+sYX+E7byTmNaPRMwBvjYoxmUbc2CBeJA21O3SU\nTr5mTg/7fSXVHTv32dr0uvYXK5LK+qmT1tATV+gIWbAut5QPQ33qVGKN4OgB\nxzFWXfVC+aTHY34X/F7DIU7h7m5x188Mu3MdboCAyypbscbeg7QjB51EGk3S\neHGxwEr4vIwY9ruOBSt5RhixM/54C9MbzjQPiRQj00OeDIQB/UUAAWv7Q+BA\n8hfJcRznCPAkJmZ1EQFpKHDfR9WeYXIedmNsIgteYrd1HYlnRLIGC71E5kEd\nPZ+Dz8H13pkMdJu1e5mFbhuw9eBoONWdrtMk/xq05shY2LEDDXE/fGSAcpuN\nB3vU8P1r9kzEDvuvg7/8i0c3DZKEovB/XPPJLYQ1RrbWJQTWGQoLD+LIaRRg\nvOLz\r\n=LmBD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZZpZguHEh/YW75MrLG8tdjLGb4BGf/NuVPxUyxXxTAAiEAwpXROwePWBOobxc8ZIwlw+yPkcf7ye0VHPBa3+6KC6g="}]},"_npmUser":{"name":"edgaryp","email":"edgaryp@me.com"},"directories":{},"maintainers":[{"name":"edgaryp","email":"edgaryp@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/monthly-payslip-generator_1.0.2_1639358883747_0.04863364399628156"},"_hasShrinkwrap":false},"1.0.3":{"name":"@edgarpan/monthly-payslip-generator","version":"1.0.3","description":"This is a CLI that generates monthly payslip","main":"./lib/index.js","scripts":{"start":"nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts","build":"rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript","test":"jest","test:watch":"jest --watch","local":"npm run build && npm i -g ."},"repository":{"type":"git","url":"git+https://github.com/edgaryp/monthly-payslip-generator.git"},"author":{"name":"Edgar Pan","email":"edgaryp@me.com"},"license":"UNLICENSED","bugs":{"url":"https://github.com/edgaryp/monthly-payslip-generator/issues"},"homepage":"https://github.com/edgaryp/monthly-payslip-generator#readme","devDependencies":{"@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-node-resolve":"^13.0.6","@rollup/plugin-typescript":"^8.3.0","@types/clear":"^0.1.2","@types/commander":"^2.12.2","@types/figlet":"^1.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","jest":"^27.4.4","nodemon":"^2.0.15","rollup":"^2.61.1","rollup-plugin-preserve-shebangs":"^0.2.0","ts-jest":"^27.1.1","ts-node":"^10.4.0","tsconfig-paths":"^3.12.0","typescript":"^4.5.3"},"bin":{"monthly-payslip-generator":"lib/index.js","mpg":"lib/index.js"},"dependencies":{"clear":"^0.1.0","commander":"^8.3.0","figlet":"^1.5.2"},"gitHead":"1afa5ca49cc594178ce5a946db51ba636ddca163","_id":"@edgarpan/monthly-payslip-generator@1.0.3","_nodeVersion":"16.11.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-BWrQzJFTdysvj+5vVRZ7eF3SABsC5A619QLAs6AfnjFj1otj3Qll2xAiCvW0XPhXbbdKPxFDTMCwUB1nLZ+H0A==","shasum":"5e8aade8597370b3622105f8432fe1af616927ec","tarball":"https://registry.npmjs.org/@edgarpan/monthly-payslip-generator/-/monthly-payslip-generator-1.0.3.tgz","fileCount":4,"unpackedSize":179506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtqTbCRA9TVsSAnZWagAAwwgP/3XxFYQVSGePRFzTRt2t\nfe6OS8HO9pz5K5sUtezBgXZVzqk6/c1WJaZsRfdFx3SWShDFGZ5yAdE2LjAZ\ntPmGTbu1bJhjqGE/1QD0upVvBzeRnSsMDB3U+7wKxx7QCIGWFRteDSMRahzB\ndO3IaHxhgLHBc2otHLKMZJbyLj2aNt7lwLOP9QyV4IPiIXsLj8uv+nEOEZ91\nhtXB13q46E0z+K2hZNIT5sgmMgxdebKb5e8CBpCpSF4AqEyxtUV/mYjSnRfR\ngB5HmcBzfVUZonOHzIEGzvSvIL9kwtDWRMmNlkPb/Pz/PjCGHt9ANvC9TPJ7\n+ASmj254Dj49hfE124NgG9sEgLufWV1+88AMTRwSgK3J0S5BmEWKe1pFt6to\nDMCweu605rjIkbZQ3HddK10jITUQDgyy/5C/wiWXRzuLo8/iu02nE9HYNHkB\nRyUNHnewdTRR7aIVRw/MAWvuMUKddDOaccCSe/gf2RqHJMTGrADzI14o1B/m\nqjKHU4WHB0x2cwCZcNtscDdKGJcTQaiH4BYAwRtL8PJIPBB52gFt2p+GOPxh\n/xKqK9xLhTPM/weQEBVtZA46HOTJvBNtgrftRSW7/q6FrTGWrXN1tEP9Dl/G\nJtmA/nIF4c67zpCQAGeyXVg8jEZvaHG1DSOlN+Ozs7cnKi8EsgA0Z4O81YAe\noqkV\r\n=uIRF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHk6vim/afGiptRO0pbbjbnGmHEquklhi9dAj3SEcUIxAiEA6kKY09TvmAqyi5pUubfhItnOiyVKDeGrgW+LqXLX6BQ="}]},"_npmUser":{"name":"edgaryp","email":"edgaryp@me.com"},"directories":{},"maintainers":[{"name":"edgaryp","email":"edgaryp@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/monthly-payslip-generator_1.0.3_1639359707541_0.06116919927862274"},"_hasShrinkwrap":false}},"time":{"created":"2021-12-13T01:28:03.697Z","1.0.2":"2021-12-13T01:28:03.950Z","modified":"2022-04-05T06:41:35.963Z","1.0.3":"2021-12-13T01:41:47.698Z"},"maintainers":[{"name":"edgaryp","email":"edgaryp@me.com"}],"description":"This is a CLI that generates monthly payslip","homepage":"https://github.com/edgaryp/monthly-payslip-generator#readme","repository":{"type":"git","url":"git+https://github.com/edgaryp/monthly-payslip-generator.git"},"author":{"name":"Edgar Pan","email":"edgaryp@me.com"},"bugs":{"url":"https://github.com/edgaryp/monthly-payslip-generator/issues"},"license":"UNLICENSED","readme":"# Monthly Payslip Generator\n\nThis is CLI tool that generates monthly payslip by given annual salary.\n\n## Install globally\n\n```sh\n$ npm i -g @edgarpan/monthly-payslip-generator\n```\n\n## Usage\n\n```sh\n$ mpg \"Jon Snow\" 80000\n  __  __   ____     ____\n |  \\/  | |  _ \\   / ___|\n | |\\/| | | |_) | | |  _\n | |  | | |  __/  | |_| |\n |_|  |_| |_|      \\____|\n\n\n    Monthly Payslip for: Jon Snow\n    Gross Monthly Income: 6667\n    Monthly Income Tax: 833\n    Net Monthly Income: 5833\n```\n\n## Implementation\n\n<img src=\"./docs/implementation.jpeg\" alt=\"implementation\" width=\"600\"/>\n\n### Payslip\n\nEntry point of payslip generator.\n\n_**Arguments**_\n\n- `employeeName: string`: Employee name for the output\n- `annualSalary: number`: The calculator is default with annual salary. At the end of the calculation, monthly output is available.\n\n### IncomeTax\n\n`IncomeTax` does not have the knowledge of tax formula for each brackets. It only has the following responsibilities:\n\n- Summing the taxable income for each tax brackets\n- Provides the net income after the calculation\n\n_**Arguments**_\n\n- `income: IPeriodic`: Income received from `Payslip`. We named it as \"income\" because we have default it.\n- `brackets: BracketData[]`: This array of brackets allow the IncomeTax to sum the taxable income.\n\n### Bracket\n\n`Bracket` holds the taxable income calculation and the knowledge of if the bracket is taxable.\n\n_**Arguments**_\n\n- `income: IPeriodic`: This allows the bracket to identify if the bracket is taxable.\n- `bracket: BracketData`: An initial bracket data. This is currently hardcoded but can extended with API.\n\n### Periodic\n\nA uniform object for annual salary. It also has the ability to transform to monthly.\n\n_**Arguments**_\n\n- `annualValue: number`: `Periodic` accepts annual salary only as default.\n\n### Fixed tax rates\n\n| Taxable income       | Tax on this income            |\n| -------------------- | ----------------------------- |\n| $0 - $2 0,000        | $0                            |\n| $2 0,001 - $4 0,000  | 10c for each $1 over $20,000  |\n| $4 0,001 - $8 0,000  | 20c for each $1 over $40,000  |\n| $8 0,001 - $1 80,000 | 30c for each $1 over $80,000  |\n| $1 80,001 and over   | 40c for each $1 over $180,000 |\n\n### Rounding\n\nThe result of calculation will be rounded to the nearest one.\n\n_example: 838.274 will be 838_\n\n## Local development\n\n- Install dependencies\n  ```sh\n  $ npm install\n  ```\n- Start the development in watch mode\n  ```sh\n  $ npm run start -- <employee-name> <annual -salary>\n  ```\n","readmeFilename":"README.md"}