nik-christou / tax-calculator

Tax calculator for multiple countries
Apache License 2.0
1 stars 0 forks source link

Design a tax calculator class #5

Closed nik-christou closed 4 years ago

nik-christou commented 4 years ago
minas1 commented 4 years ago

I pushed some changes in the fb_issue-5 branch. Check it out. :)

Some notes:

  1. Currently in TaxCalculatorApp._calculateResults(), we don't have the value of the combo box that has the values Annual, Monthly. They are necessary for the calculator as well. Currently it assumes annual income.
  2. I added socialInsurancePercent to cyprus.json. It's 8.3%.
  3. I modified CountryLoader so that if the end bracket is -1, it sets the value to Number.POSITIVE_INFINITY. It helps with the calculations as it avoids special cases.
  4. I haven't written any tests - I don't know how :P

I probably won't be able to work on it tomorrow Feb 16th so if you want to take over it, feel free!

nik-christou commented 4 years ago

Nice commit :-) I pushed commit to:

  1. Selection from dropdown is stored as a SalaryType "enum" in SalaryDetails. Added statement to return results based on selection
  2. Added a new data class to hold both the monthly and annual results.
  3. Refactored "var" declarations to "let", refactored some class methods to static since no state is involved

So far I only know how to use karma for web component testing. Tax calculator is not a web component so I will also have to do some research how to test it :-)