Skip to content

Commit

Permalink
Refactor income tax class (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
lourenci committed Dec 24, 2017
1 parent c7e5c70 commit 60fee48
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/services/IncomeTax.js
@@ -1,8 +1,8 @@
const taxes = [
{ days: 721, percent: 15 },
{ days: 361, percent: 17.5 },
{ days: 181, percent: 20 },
{ days: 0, percent: 22.5 },
{ day: 721, percent: 15 },
{ day: 361, percent: 17.5 },
{ day: 181, percent: 20 },
{ day: 0, percent: 22.5 }
]

class IncomeTax {
Expand All @@ -11,7 +11,7 @@ class IncomeTax {
}

ofValue (value) {
const tax = taxes.find((tax) => tax.days <= this.days)
const tax = taxes.find((tax) => tax.day <= this.days)
return value * (tax.percent / 100)
}
}
Expand Down

0 comments on commit 60fee48

Please sign in to comment.