{"size": 399, "ext": "js", "max_stars_repo_path": "src/projects/personal-finance/stores/Taxes.js", "max_stars_repo_name": "joshfreemanIO/joshfreeman.io", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/projects/personal-finance/stores/Taxes.js", "max_issues_repo_name": "joshfreemanIO/joshfreeman.io", "max_issues_repo_issues_event_min_datetime": "2020-07-19T09:42:39.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T22:52:45.000Z", "max_forks_repo_path": "src/projects/personal-finance/stores/Taxes.js", "max_forks_repo_name": "joshfreemanIO/www.joshfreeman.io", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 11, "max_forks_count": null, "avg_line_length": 17.347826087, "max_line_length": 48, "alphanum_fraction": 0.5513784461}
import { types } from 'mobx-state-tree'

const Taxes = types
  .model()
  .views(self => ({
    get taxableIncome() {
      return 100000
    },
    taxForBracket(rate, min, max) {
      if (self.taxableIncome > max) {
        return rate * max
      }

      if (self.taxableIncome > min) {
        return rate * (self.taxableIncome - min)
      }

      return 0
    }
  }))

export default Taxes
