@novha/calc-engines 7.0.0 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all-commits.bundle +0 -0
- package/dist/capital-gains/brazil/BrazilCapitalGainsService.js +3 -0
- package/dist/capital-gains/brazil/BrazilCapitalGainsServiceImpl.js +56 -0
- package/dist/capital-gains/brazil/domain/types.js +3 -0
- package/dist/capital-gains/index.js +17 -2
- package/dist/capital-gains/india/IndiaCapitalGainsService.js +3 -0
- package/dist/capital-gains/india/IndiaCapitalGainsServiceImpl.js +58 -0
- package/dist/capital-gains/india/domain/types.js +3 -0
- package/dist/capital-gains/israel/IsraelCapitalGainsService.js +3 -0
- package/dist/capital-gains/israel/IsraelCapitalGainsServiceImpl.js +56 -0
- package/dist/capital-gains/israel/domain/types.js +3 -0
- package/dist/capital-gains/japan/JapanCapitalGainsService.js +3 -0
- package/dist/capital-gains/japan/JapanCapitalGainsServiceImpl.js +41 -0
- package/dist/capital-gains/japan/domain/types.js +3 -0
- package/dist/capital-gains/spain/SpainCapitalGainsService.js +3 -0
- package/dist/capital-gains/spain/SpainCapitalGainsServiceImpl.js +56 -0
- package/dist/capital-gains/spain/domain/types.js +3 -0
- package/dist/corporate/brazil/BrazilCorporateTaxService.js +3 -0
- package/dist/corporate/brazil/BrazilCorporateTaxServiceImpl.js +33 -0
- package/dist/corporate/brazil/domain/types.js +3 -0
- package/dist/corporate/index.js +19 -2
- package/dist/corporate/india/IndiaCorporateTaxService.js +3 -0
- package/dist/corporate/india/IndiaCorporateTaxServiceImpl.js +29 -0
- package/dist/corporate/india/domain/types.js +3 -0
- package/dist/corporate/israel/IsraelCorporateTaxService.js +3 -0
- package/dist/corporate/israel/IsraelCorporateTaxServiceImpl.js +29 -0
- package/dist/corporate/israel/domain/types.js +3 -0
- package/dist/corporate/japan/JapanCorporateTaxService.js +3 -0
- package/dist/corporate/japan/JapanCorporateTaxServiceImpl.js +29 -0
- package/dist/corporate/japan/domain/types.js +3 -0
- package/dist/corporate/netherlands/NetherlandsCorporateTaxService.js +3 -0
- package/dist/corporate/netherlands/NetherlandsCorporateTaxServiceImpl.js +40 -0
- package/dist/corporate/netherlands/domain/types.js +3 -0
- package/dist/corporate/spain/SpainCorporateTaxService.js +3 -0
- package/dist/corporate/spain/SpainCorporateTaxServiceImpl.js +29 -0
- package/dist/corporate/spain/domain/types.js +3 -0
- package/dist/corporate/switzerland/SwitzerlandCorporateTaxService.js +3 -0
- package/dist/corporate/switzerland/SwitzerlandCorporateTaxServiceImpl.js +29 -0
- package/dist/corporate/switzerland/domain/types.js +3 -0
- package/dist/income-tax/brazil/BrazilIncomeTaxService.js +3 -0
- package/dist/income-tax/brazil/BrazilIncomeTaxServiceImpl.js +78 -0
- package/dist/income-tax/brazil/domain/types.js +3 -0
- package/dist/income-tax/index.js +23 -2
- package/dist/income-tax/india/IndiaIncomeTaxService.js +3 -0
- package/dist/income-tax/india/IndiaIncomeTaxServiceImpl.js +75 -0
- package/dist/income-tax/india/domain/types.js +3 -0
- package/dist/income-tax/israel/IsraelIncomeTaxService.js +3 -0
- package/dist/income-tax/israel/IsraelIncomeTaxServiceImpl.js +62 -0
- package/dist/income-tax/israel/domain/types.js +3 -0
- package/dist/income-tax/japan/JapanIncomeTaxService.js +3 -0
- package/dist/income-tax/japan/JapanIncomeTaxServiceImpl.js +75 -0
- package/dist/income-tax/japan/domain/types.js +3 -0
- package/dist/income-tax/netherlands/NetherlandsIncomeTaxService.js +3 -0
- package/dist/income-tax/netherlands/NetherlandsIncomeTaxServiceImpl.js +62 -0
- package/dist/income-tax/netherlands/domain/types.js +3 -0
- package/dist/income-tax/spain/SpainIncomeTaxService.js +3 -0
- package/dist/income-tax/spain/SpainIncomeTaxServiceImpl.js +62 -0
- package/dist/income-tax/spain/domain/types.js +3 -0
- package/dist/income-tax/switzerland/SwitzerlandIncomeTaxService.js +3 -0
- package/dist/income-tax/switzerland/SwitzerlandIncomeTaxServiceImpl.js +62 -0
- package/dist/income-tax/switzerland/domain/types.js +3 -0
- package/dist/inheritance-tax/index.js +11 -2
- package/dist/inheritance-tax/japan/JapanInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/japan/JapanInheritanceTaxServiceImpl.js +53 -0
- package/dist/inheritance-tax/japan/domain/types.js +3 -0
- package/dist/inheritance-tax/netherlands/NetherlandsInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/netherlands/NetherlandsInheritanceTaxServiceImpl.js +52 -0
- package/dist/inheritance-tax/netherlands/domain/types.js +3 -0
- package/dist/inheritance-tax/spain/SpainInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/spain/SpainInheritanceTaxServiceImpl.js +51 -0
- package/dist/inheritance-tax/spain/domain/types.js +3 -0
- package/dist/mortgage/brazil/BrazilMortgageService.js +3 -0
- package/dist/mortgage/brazil/BrazilMortgageServiceImpl.js +76 -0
- package/dist/mortgage/brazil/domain/types.js +3 -0
- package/dist/mortgage/index.js +23 -2
- package/dist/mortgage/india/IndiaMortgageService.js +3 -0
- package/dist/mortgage/india/IndiaMortgageServiceImpl.js +76 -0
- package/dist/mortgage/india/domain/types.js +3 -0
- package/dist/mortgage/israel/IsraelMortgageService.js +3 -0
- package/dist/mortgage/israel/IsraelMortgageServiceImpl.js +100 -0
- package/dist/mortgage/israel/domain/types.js +3 -0
- package/dist/mortgage/japan/JapanMortgageService.js +3 -0
- package/dist/mortgage/japan/JapanMortgageServiceImpl.js +76 -0
- package/dist/mortgage/japan/domain/types.js +3 -0
- package/dist/mortgage/netherlands/NetherlandsMortgageService.js +3 -0
- package/dist/mortgage/netherlands/NetherlandsMortgageServiceImpl.js +83 -0
- package/dist/mortgage/netherlands/domain/types.js +3 -0
- package/dist/mortgage/spain/SpainMortgageService.js +3 -0
- package/dist/mortgage/spain/SpainMortgageServiceImpl.js +96 -0
- package/dist/mortgage/spain/domain/types.js +3 -0
- package/dist/mortgage/switzerland/SwitzerlandMortgageService.js +3 -0
- package/dist/mortgage/switzerland/SwitzerlandMortgageServiceImpl.js +80 -0
- package/dist/mortgage/switzerland/domain/types.js +3 -0
- package/dist/types/capital-gains/brazil/BrazilCapitalGainsService.d.ts +4 -0
- package/dist/types/capital-gains/brazil/BrazilCapitalGainsServiceImpl.d.ts +10 -0
- package/dist/types/capital-gains/brazil/domain/types.d.ts +11 -0
- package/dist/types/capital-gains/index.d.ts +11 -1
- package/dist/types/capital-gains/india/IndiaCapitalGainsService.d.ts +4 -0
- package/dist/types/capital-gains/india/IndiaCapitalGainsServiceImpl.d.ts +9 -0
- package/dist/types/capital-gains/india/domain/types.d.ts +9 -0
- package/dist/types/capital-gains/israel/IsraelCapitalGainsService.d.ts +4 -0
- package/dist/types/capital-gains/israel/IsraelCapitalGainsServiceImpl.d.ts +10 -0
- package/dist/types/capital-gains/israel/domain/types.d.ts +11 -0
- package/dist/types/capital-gains/japan/JapanCapitalGainsService.d.ts +4 -0
- package/dist/types/capital-gains/japan/JapanCapitalGainsServiceImpl.d.ts +9 -0
- package/dist/types/capital-gains/japan/domain/types.d.ts +6 -0
- package/dist/types/capital-gains/spain/SpainCapitalGainsService.d.ts +4 -0
- package/dist/types/capital-gains/spain/SpainCapitalGainsServiceImpl.d.ts +10 -0
- package/dist/types/capital-gains/spain/domain/types.d.ts +11 -0
- package/dist/types/corporate/brazil/BrazilCorporateTaxService.d.ts +4 -0
- package/dist/types/corporate/brazil/BrazilCorporateTaxServiceImpl.d.ts +8 -0
- package/dist/types/corporate/brazil/domain/types.d.ts +19 -0
- package/dist/types/corporate/index.d.ts +15 -1
- package/dist/types/corporate/india/IndiaCorporateTaxService.d.ts +4 -0
- package/dist/types/corporate/india/IndiaCorporateTaxServiceImpl.d.ts +8 -0
- package/dist/types/corporate/india/domain/types.d.ts +15 -0
- package/dist/types/corporate/israel/IsraelCorporateTaxService.d.ts +4 -0
- package/dist/types/corporate/israel/IsraelCorporateTaxServiceImpl.d.ts +8 -0
- package/dist/types/corporate/israel/domain/types.d.ts +15 -0
- package/dist/types/corporate/japan/JapanCorporateTaxService.d.ts +4 -0
- package/dist/types/corporate/japan/JapanCorporateTaxServiceImpl.d.ts +8 -0
- package/dist/types/corporate/japan/domain/types.d.ts +15 -0
- package/dist/types/corporate/netherlands/NetherlandsCorporateTaxService.d.ts +4 -0
- package/dist/types/corporate/netherlands/NetherlandsCorporateTaxServiceImpl.d.ts +8 -0
- package/dist/types/corporate/netherlands/domain/types.d.ts +17 -0
- package/dist/types/corporate/spain/SpainCorporateTaxService.d.ts +4 -0
- package/dist/types/corporate/spain/SpainCorporateTaxServiceImpl.d.ts +8 -0
- package/dist/types/corporate/spain/domain/types.d.ts +15 -0
- package/dist/types/corporate/switzerland/SwitzerlandCorporateTaxService.d.ts +4 -0
- package/dist/types/corporate/switzerland/SwitzerlandCorporateTaxServiceImpl.d.ts +8 -0
- package/dist/types/corporate/switzerland/domain/types.d.ts +15 -0
- package/dist/types/income-tax/brazil/BrazilIncomeTaxService.d.ts +4 -0
- package/dist/types/income-tax/brazil/BrazilIncomeTaxServiceImpl.d.ts +11 -0
- package/dist/types/income-tax/brazil/domain/types.d.ts +18 -0
- package/dist/types/income-tax/index.d.ts +15 -1
- package/dist/types/income-tax/india/IndiaIncomeTaxService.d.ts +4 -0
- package/dist/types/income-tax/india/IndiaIncomeTaxServiceImpl.d.ts +10 -0
- package/dist/types/income-tax/india/domain/types.d.ts +16 -0
- package/dist/types/income-tax/israel/IsraelIncomeTaxService.d.ts +4 -0
- package/dist/types/income-tax/israel/IsraelIncomeTaxServiceImpl.d.ts +10 -0
- package/dist/types/income-tax/israel/domain/types.d.ts +16 -0
- package/dist/types/income-tax/japan/JapanIncomeTaxService.d.ts +4 -0
- package/dist/types/income-tax/japan/JapanIncomeTaxServiceImpl.d.ts +10 -0
- package/dist/types/income-tax/japan/domain/types.d.ts +16 -0
- package/dist/types/income-tax/netherlands/NetherlandsIncomeTaxService.d.ts +4 -0
- package/dist/types/income-tax/netherlands/NetherlandsIncomeTaxServiceImpl.d.ts +10 -0
- package/dist/types/income-tax/netherlands/domain/types.d.ts +16 -0
- package/dist/types/income-tax/spain/SpainIncomeTaxService.d.ts +4 -0
- package/dist/types/income-tax/spain/SpainIncomeTaxServiceImpl.d.ts +10 -0
- package/dist/types/income-tax/spain/domain/types.d.ts +16 -0
- package/dist/types/income-tax/switzerland/SwitzerlandIncomeTaxService.d.ts +4 -0
- package/dist/types/income-tax/switzerland/SwitzerlandIncomeTaxServiceImpl.d.ts +10 -0
- package/dist/types/income-tax/switzerland/domain/types.d.ts +16 -0
- package/dist/types/inheritance-tax/index.d.ts +7 -1
- package/dist/types/inheritance-tax/japan/JapanInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/japan/JapanInheritanceTaxServiceImpl.d.ts +9 -0
- package/dist/types/inheritance-tax/japan/domain/types.d.ts +21 -0
- package/dist/types/inheritance-tax/netherlands/NetherlandsInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/netherlands/NetherlandsInheritanceTaxServiceImpl.d.ts +9 -0
- package/dist/types/inheritance-tax/netherlands/domain/types.d.ts +28 -0
- package/dist/types/inheritance-tax/spain/SpainInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/spain/SpainInheritanceTaxServiceImpl.d.ts +9 -0
- package/dist/types/inheritance-tax/spain/domain/types.d.ts +19 -0
- package/dist/types/mortgage/brazil/BrazilMortgageService.d.ts +4 -0
- package/dist/types/mortgage/brazil/BrazilMortgageServiceImpl.d.ts +7 -0
- package/dist/types/mortgage/brazil/domain/types.d.ts +39 -0
- package/dist/types/mortgage/index.d.ts +15 -1
- package/dist/types/mortgage/india/IndiaMortgageService.d.ts +4 -0
- package/dist/types/mortgage/india/IndiaMortgageServiceImpl.d.ts +7 -0
- package/dist/types/mortgage/india/domain/types.d.ts +39 -0
- package/dist/types/mortgage/israel/IsraelMortgageService.d.ts +4 -0
- package/dist/types/mortgage/israel/IsraelMortgageServiceImpl.d.ts +8 -0
- package/dist/types/mortgage/israel/domain/types.d.ts +43 -0
- package/dist/types/mortgage/japan/JapanMortgageService.d.ts +4 -0
- package/dist/types/mortgage/japan/JapanMortgageServiceImpl.d.ts +7 -0
- package/dist/types/mortgage/japan/domain/types.d.ts +39 -0
- package/dist/types/mortgage/netherlands/NetherlandsMortgageService.d.ts +4 -0
- package/dist/types/mortgage/netherlands/NetherlandsMortgageServiceImpl.d.ts +7 -0
- package/dist/types/mortgage/netherlands/domain/types.d.ts +41 -0
- package/dist/types/mortgage/spain/SpainMortgageService.d.ts +4 -0
- package/dist/types/mortgage/spain/SpainMortgageServiceImpl.d.ts +8 -0
- package/dist/types/mortgage/spain/domain/types.d.ts +44 -0
- package/dist/types/mortgage/switzerland/SwitzerlandMortgageService.d.ts +4 -0
- package/dist/types/mortgage/switzerland/SwitzerlandMortgageServiceImpl.d.ts +7 -0
- package/dist/types/mortgage/switzerland/domain/types.d.ts +37 -0
- package/package.json +1 -1
- package/src/capital-gains/brazil/BrazilCapitalGainsService.ts +5 -0
- package/src/capital-gains/brazil/BrazilCapitalGainsServiceImpl.ts +69 -0
- package/src/capital-gains/brazil/domain/types.ts +15 -0
- package/src/capital-gains/index.ts +50 -0
- package/src/capital-gains/india/IndiaCapitalGainsService.ts +5 -0
- package/src/capital-gains/india/IndiaCapitalGainsServiceImpl.ts +64 -0
- package/src/capital-gains/india/domain/types.ts +12 -0
- package/src/capital-gains/israel/IsraelCapitalGainsService.ts +5 -0
- package/src/capital-gains/israel/IsraelCapitalGainsServiceImpl.ts +69 -0
- package/src/capital-gains/israel/domain/types.ts +15 -0
- package/src/capital-gains/japan/JapanCapitalGainsService.ts +5 -0
- package/src/capital-gains/japan/JapanCapitalGainsServiceImpl.ts +47 -0
- package/src/capital-gains/japan/domain/types.ts +9 -0
- package/src/capital-gains/spain/SpainCapitalGainsService.ts +5 -0
- package/src/capital-gains/spain/SpainCapitalGainsServiceImpl.ts +69 -0
- package/src/capital-gains/spain/domain/types.ts +15 -0
- package/src/corporate/brazil/BrazilCorporateTaxService.ts +5 -0
- package/src/corporate/brazil/BrazilCorporateTaxServiceImpl.ts +40 -0
- package/src/corporate/brazil/domain/types.ts +16 -0
- package/src/corporate/index.ts +81 -1
- package/src/corporate/india/IndiaCorporateTaxService.ts +5 -0
- package/src/corporate/india/IndiaCorporateTaxServiceImpl.ts +35 -0
- package/src/corporate/india/domain/types.ts +15 -0
- package/src/corporate/israel/IsraelCorporateTaxService.ts +5 -0
- package/src/corporate/israel/IsraelCorporateTaxServiceImpl.ts +35 -0
- package/src/corporate/israel/domain/types.ts +15 -0
- package/src/corporate/japan/JapanCorporateTaxService.ts +5 -0
- package/src/corporate/japan/JapanCorporateTaxServiceImpl.ts +35 -0
- package/src/corporate/japan/domain/types.ts +15 -0
- package/src/corporate/netherlands/NetherlandsCorporateTaxService.ts +5 -0
- package/src/corporate/netherlands/NetherlandsCorporateTaxServiceImpl.ts +48 -0
- package/src/corporate/netherlands/domain/types.ts +21 -0
- package/src/corporate/spain/SpainCorporateTaxService.ts +5 -0
- package/src/corporate/spain/SpainCorporateTaxServiceImpl.ts +35 -0
- package/src/corporate/spain/domain/types.ts +15 -0
- package/src/corporate/switzerland/SwitzerlandCorporateTaxService.ts +5 -0
- package/src/corporate/switzerland/SwitzerlandCorporateTaxServiceImpl.ts +35 -0
- package/src/corporate/switzerland/domain/types.ts +15 -0
- package/src/income-tax/brazil/BrazilIncomeTaxService.ts +5 -0
- package/src/income-tax/brazil/BrazilIncomeTaxServiceImpl.ts +91 -0
- package/src/income-tax/brazil/domain/types.ts +21 -0
- package/src/income-tax/index.ts +70 -0
- package/src/income-tax/india/IndiaIncomeTaxService.ts +5 -0
- package/src/income-tax/india/IndiaIncomeTaxServiceImpl.ts +87 -0
- package/src/income-tax/india/domain/types.ts +16 -0
- package/src/income-tax/israel/IsraelIncomeTaxService.ts +5 -0
- package/src/income-tax/israel/IsraelIncomeTaxServiceImpl.ts +75 -0
- package/src/income-tax/israel/domain/types.ts +16 -0
- package/src/income-tax/japan/JapanIncomeTaxService.ts +5 -0
- package/src/income-tax/japan/JapanIncomeTaxServiceImpl.ts +87 -0
- package/src/income-tax/japan/domain/types.ts +16 -0
- package/src/income-tax/netherlands/NetherlandsIncomeTaxService.ts +5 -0
- package/src/income-tax/netherlands/NetherlandsIncomeTaxServiceImpl.ts +75 -0
- package/src/income-tax/netherlands/domain/types.ts +16 -0
- package/src/income-tax/spain/SpainIncomeTaxService.ts +5 -0
- package/src/income-tax/spain/SpainIncomeTaxServiceImpl.ts +75 -0
- package/src/income-tax/spain/domain/types.ts +16 -0
- package/src/income-tax/switzerland/SwitzerlandIncomeTaxService.ts +5 -0
- package/src/income-tax/switzerland/SwitzerlandIncomeTaxServiceImpl.ts +75 -0
- package/src/income-tax/switzerland/domain/types.ts +16 -0
- package/src/inheritance-tax/index.ts +36 -0
- package/src/inheritance-tax/japan/JapanInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/japan/JapanInheritanceTaxServiceImpl.ts +67 -0
- package/src/inheritance-tax/japan/domain/types.ts +25 -0
- package/src/inheritance-tax/netherlands/NetherlandsInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/netherlands/NetherlandsInheritanceTaxServiceImpl.ts +66 -0
- package/src/inheritance-tax/netherlands/domain/types.ts +34 -0
- package/src/inheritance-tax/spain/SpainInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/spain/SpainInheritanceTaxServiceImpl.ts +65 -0
- package/src/inheritance-tax/spain/domain/types.ts +23 -0
- package/src/mortgage/brazil/BrazilMortgageService.ts +5 -0
- package/src/mortgage/brazil/BrazilMortgageServiceImpl.ts +101 -0
- package/src/mortgage/brazil/domain/types.ts +46 -0
- package/src/mortgage/index.ts +85 -1
- package/src/mortgage/india/IndiaMortgageService.ts +5 -0
- package/src/mortgage/india/IndiaMortgageServiceImpl.ts +101 -0
- package/src/mortgage/india/domain/types.ts +46 -0
- package/src/mortgage/israel/IsraelMortgageService.ts +5 -0
- package/src/mortgage/israel/IsraelMortgageServiceImpl.ts +132 -0
- package/src/mortgage/israel/domain/types.ts +41 -0
- package/src/mortgage/japan/JapanMortgageService.ts +5 -0
- package/src/mortgage/japan/JapanMortgageServiceImpl.ts +101 -0
- package/src/mortgage/japan/domain/types.ts +46 -0
- package/src/mortgage/netherlands/NetherlandsMortgageService.ts +5 -0
- package/src/mortgage/netherlands/NetherlandsMortgageServiceImpl.ts +109 -0
- package/src/mortgage/netherlands/domain/types.ts +37 -0
- package/src/mortgage/spain/SpainMortgageService.ts +5 -0
- package/src/mortgage/spain/SpainMortgageServiceImpl.ts +130 -0
- package/src/mortgage/spain/domain/types.ts +52 -0
- package/src/mortgage/switzerland/SwitzerlandMortgageService.ts +5 -0
- package/src/mortgage/switzerland/SwitzerlandMortgageServiceImpl.ts +106 -0
- package/src/mortgage/switzerland/domain/types.ts +36 -0
- package/test/brazil-capital-gains.test.ts +65 -0
- package/test/brazil-corporate-tax.test.ts +63 -0
- package/test/brazil-income-tax.test.ts +85 -0
- package/test/brazil-mortgage.test.ts +70 -0
- package/test/india-capital-gains.test.ts +71 -0
- package/test/india-corporate-tax.test.ts +54 -0
- package/test/india-income-tax.test.ts +78 -0
- package/test/india-mortgage.test.ts +70 -0
- package/test/israel-capital-gains.test.ts +45 -0
- package/test/israel-corporate-tax.test.ts +49 -0
- package/test/israel-income-tax.test.ts +76 -0
- package/test/israel-mortgage.test.ts +80 -0
- package/test/japan-capital-gains.test.ts +55 -0
- package/test/japan-corporate-tax.test.ts +54 -0
- package/test/japan-income-tax.test.ts +76 -0
- package/test/japan-inheritance-tax.test.ts +74 -0
- package/test/japan-mortgage.test.ts +69 -0
- package/test/netherlands-corporate-tax.test.ts +54 -0
- package/test/netherlands-income-tax.test.ts +54 -0
- package/test/netherlands-inheritance-tax.test.ts +79 -0
- package/test/netherlands-mortgage.test.ts +79 -0
- package/test/spain-capital-gains.test.ts +66 -0
- package/test/spain-corporate-tax.test.ts +54 -0
- package/test/spain-income-tax.test.ts +84 -0
- package/test/spain-inheritance-tax.test.ts +78 -0
- package/test/spain-mortgage.test.ts +70 -0
- package/test/switzerland-corporate-tax.test.ts +39 -0
- package/test/switzerland-income-tax.test.ts +66 -0
- package/test/switzerland-mortgage.test.ts +70 -0
- package/dist/domain/types.js +0 -10
- package/dist/types/domain/types.d.ts +0 -41
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Breakdown, Result } from "../domain/types";
|
|
2
|
+
import { IsraelCapitalGainsService } from "./IsraelCapitalGainsService";
|
|
3
|
+
import { CapitalGainsBracket, Input, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class IsraelCapitalGainsServiceImpl implements IsraelCapitalGainsService {
|
|
6
|
+
private _input: Input;
|
|
7
|
+
private _rules: Rules;
|
|
8
|
+
|
|
9
|
+
constructor(input: Input, rules: Rules) {
|
|
10
|
+
this._input = input;
|
|
11
|
+
this._rules = rules;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
calculate(): Result {
|
|
15
|
+
const gain = this._input.capitalGain;
|
|
16
|
+
|
|
17
|
+
if (gain <= 0) {
|
|
18
|
+
return {
|
|
19
|
+
taxableGain: 0,
|
|
20
|
+
capitalGainTax: 0,
|
|
21
|
+
socialContributions: 0,
|
|
22
|
+
netInvestmentIncomeTax: 0,
|
|
23
|
+
totalTax: 0,
|
|
24
|
+
effectiveRate: 0,
|
|
25
|
+
breakdowns: [],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const { tax, breakdowns } = this.applyBrackets(gain, this._rules.brackets);
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
taxableGain: gain,
|
|
33
|
+
capitalGainTax: tax,
|
|
34
|
+
socialContributions: 0,
|
|
35
|
+
netInvestmentIncomeTax: 0,
|
|
36
|
+
totalTax: tax,
|
|
37
|
+
effectiveRate: (tax / gain) * 100,
|
|
38
|
+
breakdowns,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private applyBrackets(
|
|
43
|
+
gain: number,
|
|
44
|
+
brackets: CapitalGainsBracket[],
|
|
45
|
+
): { tax: number; breakdowns: Breakdown[] } {
|
|
46
|
+
let tax = 0;
|
|
47
|
+
const breakdowns: Breakdown[] = [];
|
|
48
|
+
|
|
49
|
+
for (const bracket of brackets) {
|
|
50
|
+
if (gain <= bracket.from) break;
|
|
51
|
+
|
|
52
|
+
const upper = bracket.to ?? gain;
|
|
53
|
+
const taxable = Math.min(upper, gain) - bracket.from;
|
|
54
|
+
|
|
55
|
+
if (taxable > 0) {
|
|
56
|
+
const bracketTax = taxable * bracket.rate;
|
|
57
|
+
tax += bracketTax;
|
|
58
|
+
breakdowns.push({
|
|
59
|
+
from: `${bracket.from}`,
|
|
60
|
+
to: `${bracket.to ?? 'Above'}`,
|
|
61
|
+
rate: bracket.rate,
|
|
62
|
+
amount: bracketTax,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return { tax, breakdowns };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface CapitalGainsBracket {
|
|
4
|
+
from: number;
|
|
5
|
+
to: number | null;
|
|
6
|
+
rate: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Rules {
|
|
10
|
+
brackets: CapitalGainsBracket[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Input {
|
|
14
|
+
capitalGain: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Breakdown, Result } from "../domain/types";
|
|
2
|
+
import { JapanCapitalGainsService } from "./JapanCapitalGainsService";
|
|
3
|
+
import { Input, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class JapanCapitalGainsServiceImpl implements JapanCapitalGainsService {
|
|
6
|
+
private _input: Input;
|
|
7
|
+
private _rules: Rules;
|
|
8
|
+
|
|
9
|
+
constructor(input: Input, rules: Rules) {
|
|
10
|
+
this._input = input;
|
|
11
|
+
this._rules = rules;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
calculate(): Result {
|
|
15
|
+
const gain = this._input.capitalGain;
|
|
16
|
+
|
|
17
|
+
if (gain <= 0) {
|
|
18
|
+
return {
|
|
19
|
+
taxableGain: 0,
|
|
20
|
+
capitalGainTax: 0,
|
|
21
|
+
socialContributions: 0,
|
|
22
|
+
netInvestmentIncomeTax: 0,
|
|
23
|
+
totalTax: 0,
|
|
24
|
+
effectiveRate: 0,
|
|
25
|
+
breakdowns: [],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const tax = gain * this._rules.flatRate;
|
|
30
|
+
const breakdowns: Breakdown[] = [{
|
|
31
|
+
from: '0',
|
|
32
|
+
to: 'All',
|
|
33
|
+
rate: this._rules.flatRate,
|
|
34
|
+
amount: tax,
|
|
35
|
+
}];
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
taxableGain: gain,
|
|
39
|
+
capitalGainTax: tax,
|
|
40
|
+
socialContributions: 0,
|
|
41
|
+
netInvestmentIncomeTax: 0,
|
|
42
|
+
totalTax: tax,
|
|
43
|
+
effectiveRate: (tax / gain) * 100,
|
|
44
|
+
breakdowns,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Breakdown, Result } from "../domain/types";
|
|
2
|
+
import { SpainCapitalGainsService } from "./SpainCapitalGainsService";
|
|
3
|
+
import { CapitalGainsBracket, Input, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class SpainCapitalGainsServiceImpl implements SpainCapitalGainsService {
|
|
6
|
+
private _input: Input;
|
|
7
|
+
private _rules: Rules;
|
|
8
|
+
|
|
9
|
+
constructor(input: Input, rules: Rules) {
|
|
10
|
+
this._input = input;
|
|
11
|
+
this._rules = rules;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
calculate(): Result {
|
|
15
|
+
const gain = this._input.capitalGain;
|
|
16
|
+
|
|
17
|
+
if (gain <= 0) {
|
|
18
|
+
return {
|
|
19
|
+
taxableGain: 0,
|
|
20
|
+
capitalGainTax: 0,
|
|
21
|
+
socialContributions: 0,
|
|
22
|
+
netInvestmentIncomeTax: 0,
|
|
23
|
+
totalTax: 0,
|
|
24
|
+
effectiveRate: 0,
|
|
25
|
+
breakdowns: [],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const { tax, breakdowns } = this.applyBrackets(gain, this._rules.brackets);
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
taxableGain: gain,
|
|
33
|
+
capitalGainTax: tax,
|
|
34
|
+
socialContributions: 0,
|
|
35
|
+
netInvestmentIncomeTax: 0,
|
|
36
|
+
totalTax: tax,
|
|
37
|
+
effectiveRate: (tax / gain) * 100,
|
|
38
|
+
breakdowns,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private applyBrackets(
|
|
43
|
+
gain: number,
|
|
44
|
+
brackets: CapitalGainsBracket[],
|
|
45
|
+
): { tax: number; breakdowns: Breakdown[] } {
|
|
46
|
+
let tax = 0;
|
|
47
|
+
const breakdowns: Breakdown[] = [];
|
|
48
|
+
|
|
49
|
+
for (const bracket of brackets) {
|
|
50
|
+
if (gain <= bracket.from) break;
|
|
51
|
+
|
|
52
|
+
const upper = bracket.to ?? gain;
|
|
53
|
+
const taxable = Math.min(upper, gain) - bracket.from;
|
|
54
|
+
|
|
55
|
+
if (taxable > 0) {
|
|
56
|
+
const bracketTax = taxable * bracket.rate;
|
|
57
|
+
tax += bracketTax;
|
|
58
|
+
breakdowns.push({
|
|
59
|
+
from: `${bracket.from}`,
|
|
60
|
+
to: `${bracket.to ?? 'Above'}`,
|
|
61
|
+
rate: bracket.rate,
|
|
62
|
+
amount: bracketTax,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return { tax, breakdowns };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface CapitalGainsBracket {
|
|
4
|
+
from: number;
|
|
5
|
+
to: number | null;
|
|
6
|
+
rate: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Rules {
|
|
10
|
+
brackets: CapitalGainsBracket[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Input {
|
|
14
|
+
capitalGain: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { BrazilCorporateTaxService } from "./BrazilCorporateTaxService";
|
|
3
|
+
import { Input, Result, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class BrazilCorporateTaxServiceImpl implements BrazilCorporateTaxService {
|
|
6
|
+
private _input: Input;
|
|
7
|
+
private _rules: Rules;
|
|
8
|
+
|
|
9
|
+
constructor(input: Input, rules: Rules) {
|
|
10
|
+
this._input = input;
|
|
11
|
+
this._rules = rules;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
calculate(): Result {
|
|
15
|
+
const income = this._input.taxableIncome;
|
|
16
|
+
|
|
17
|
+
if (income <= 0) {
|
|
18
|
+
return { corporateTax: 0, effectiveTaxRate: 0, breakdowns: [] };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const irpjBase = income * this._rules.irpj.baseRate;
|
|
22
|
+
const surcharge = income > this._rules.irpj.surchargeThreshold
|
|
23
|
+
? (income - this._rules.irpj.surchargeThreshold) * this._rules.irpj.surchargeRate
|
|
24
|
+
: 0;
|
|
25
|
+
const csll = income * this._rules.csll.rate;
|
|
26
|
+
const corporateTax = irpjBase + surcharge + csll;
|
|
27
|
+
|
|
28
|
+
const breakdowns: Breakdown[] = [
|
|
29
|
+
{ from: '0', to: 'All', rate: this._rules.irpj.baseRate, amount: irpjBase },
|
|
30
|
+
{ from: `${this._rules.irpj.surchargeThreshold}`, to: 'Surcharge', rate: this._rules.irpj.surchargeRate, amount: surcharge },
|
|
31
|
+
{ from: '0', to: 'CSLL', rate: this._rules.csll.rate, amount: csll },
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
corporateTax,
|
|
36
|
+
effectiveTaxRate: (corporateTax / income) * 100,
|
|
37
|
+
breakdowns,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface Rules {
|
|
4
|
+
irpj: { baseRate: number; surchargeRate: number; surchargeThreshold: number };
|
|
5
|
+
csll: { rate: number };
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface Input {
|
|
9
|
+
taxableIncome: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface Result {
|
|
13
|
+
corporateTax: number;
|
|
14
|
+
effectiveTaxRate: number;
|
|
15
|
+
breakdowns: Breakdown[];
|
|
16
|
+
}
|
package/src/corporate/index.ts
CHANGED
|
@@ -47,6 +47,58 @@ import {
|
|
|
47
47
|
Result as CanadaCorporateTaxResult,
|
|
48
48
|
} from './canada/domain/types';
|
|
49
49
|
|
|
50
|
+
import { BrazilCorporateTaxServiceImpl as BrazilCorporateTaxService } from './brazil/BrazilCorporateTaxServiceImpl';
|
|
51
|
+
import {
|
|
52
|
+
Input as BrazilCorporateTaxInput,
|
|
53
|
+
Rules as BrazilCorporateTaxRules,
|
|
54
|
+
Result as BrazilCorporateTaxResult,
|
|
55
|
+
} from './brazil/domain/types';
|
|
56
|
+
|
|
57
|
+
import { SpainCorporateTaxServiceImpl as SpainCorporateTaxService } from './spain/SpainCorporateTaxServiceImpl';
|
|
58
|
+
import {
|
|
59
|
+
Input as SpainCorporateTaxInput,
|
|
60
|
+
Rules as SpainCorporateTaxRules,
|
|
61
|
+
Result as SpainCorporateTaxResult,
|
|
62
|
+
} from './spain/domain/types';
|
|
63
|
+
|
|
64
|
+
import { IndiaCorporateTaxServiceImpl as IndiaCorporateTaxService } from './india/IndiaCorporateTaxServiceImpl';
|
|
65
|
+
import {
|
|
66
|
+
Input as IndiaCorporateTaxInput,
|
|
67
|
+
Rules as IndiaCorporateTaxRules,
|
|
68
|
+
Result as IndiaCorporateTaxResult,
|
|
69
|
+
} from './india/domain/types';
|
|
70
|
+
|
|
71
|
+
import { JapanCorporateTaxServiceImpl as JapanCorporateTaxService } from './japan/JapanCorporateTaxServiceImpl';
|
|
72
|
+
import {
|
|
73
|
+
Input as JapanCorporateTaxInput,
|
|
74
|
+
Rules as JapanCorporateTaxRules,
|
|
75
|
+
Result as JapanCorporateTaxResult,
|
|
76
|
+
} from './japan/domain/types';
|
|
77
|
+
|
|
78
|
+
// Israel
|
|
79
|
+
import { IsraelCorporateTaxServiceImpl as IsraelCorporateTaxService } from './israel/IsraelCorporateTaxServiceImpl';
|
|
80
|
+
import {
|
|
81
|
+
Input as IsraelCorporateTaxInput,
|
|
82
|
+
Rules as IsraelCorporateTaxRules,
|
|
83
|
+
Result as IsraelCorporateTaxResult,
|
|
84
|
+
} from './israel/domain/types';
|
|
85
|
+
|
|
86
|
+
// Switzerland
|
|
87
|
+
import { SwitzerlandCorporateTaxServiceImpl as SwitzerlandCorporateTaxService } from './switzerland/SwitzerlandCorporateTaxServiceImpl';
|
|
88
|
+
import {
|
|
89
|
+
Input as SwitzerlandCorporateTaxInput,
|
|
90
|
+
Rules as SwitzerlandCorporateTaxRules,
|
|
91
|
+
Result as SwitzerlandCorporateTaxResult,
|
|
92
|
+
} from './switzerland/domain/types';
|
|
93
|
+
|
|
94
|
+
// Netherlands
|
|
95
|
+
import { NetherlandsCorporateTaxServiceImpl as NetherlandsCorporateTaxService } from './netherlands/NetherlandsCorporateTaxServiceImpl';
|
|
96
|
+
import {
|
|
97
|
+
Input as NetherlandsCorporateTaxInput,
|
|
98
|
+
Rules as NetherlandsCorporateTaxRules,
|
|
99
|
+
Result as NetherlandsCorporateTaxResult,
|
|
100
|
+
} from './netherlands/domain/types';
|
|
101
|
+
|
|
50
102
|
export {
|
|
51
103
|
USACorporateTaxService,
|
|
52
104
|
USACorporateTaxInput,
|
|
@@ -75,5 +127,33 @@ export {
|
|
|
75
127
|
CanadaCorporateTaxService,
|
|
76
128
|
CanadaCorporateTaxInput,
|
|
77
129
|
CanadaCorporateTaxRules,
|
|
78
|
-
CanadaCorporateTaxResult
|
|
130
|
+
CanadaCorporateTaxResult,
|
|
131
|
+
BrazilCorporateTaxService,
|
|
132
|
+
BrazilCorporateTaxInput,
|
|
133
|
+
BrazilCorporateTaxRules,
|
|
134
|
+
BrazilCorporateTaxResult,
|
|
135
|
+
SpainCorporateTaxService,
|
|
136
|
+
SpainCorporateTaxInput,
|
|
137
|
+
SpainCorporateTaxRules,
|
|
138
|
+
SpainCorporateTaxResult,
|
|
139
|
+
IndiaCorporateTaxService,
|
|
140
|
+
IndiaCorporateTaxInput,
|
|
141
|
+
IndiaCorporateTaxRules,
|
|
142
|
+
IndiaCorporateTaxResult,
|
|
143
|
+
JapanCorporateTaxService,
|
|
144
|
+
JapanCorporateTaxInput,
|
|
145
|
+
JapanCorporateTaxRules,
|
|
146
|
+
JapanCorporateTaxResult,
|
|
147
|
+
IsraelCorporateTaxService,
|
|
148
|
+
IsraelCorporateTaxInput,
|
|
149
|
+
IsraelCorporateTaxRules,
|
|
150
|
+
IsraelCorporateTaxResult,
|
|
151
|
+
SwitzerlandCorporateTaxService,
|
|
152
|
+
SwitzerlandCorporateTaxInput,
|
|
153
|
+
SwitzerlandCorporateTaxRules,
|
|
154
|
+
SwitzerlandCorporateTaxResult,
|
|
155
|
+
NetherlandsCorporateTaxService,
|
|
156
|
+
NetherlandsCorporateTaxInput,
|
|
157
|
+
NetherlandsCorporateTaxRules,
|
|
158
|
+
NetherlandsCorporateTaxResult,
|
|
79
159
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { IndiaCorporateTaxService } from "./IndiaCorporateTaxService";
|
|
3
|
+
import { Input, Result, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class IndiaCorporateTaxServiceImpl implements IndiaCorporateTaxService {
|
|
6
|
+
private _input: Input;
|
|
7
|
+
private _rules: Rules;
|
|
8
|
+
|
|
9
|
+
constructor(input: Input, rules: Rules) {
|
|
10
|
+
this._input = input;
|
|
11
|
+
this._rules = rules;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
calculate(): Result {
|
|
15
|
+
const income = this._input.taxableIncome;
|
|
16
|
+
|
|
17
|
+
if (income <= 0) {
|
|
18
|
+
return { corporateTax: 0, effectiveTaxRate: 0, breakdowns: [] };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const tax = income * this._rules.regime.rate;
|
|
22
|
+
const breakdowns: Breakdown[] = [{
|
|
23
|
+
from: '0',
|
|
24
|
+
to: 'All',
|
|
25
|
+
rate: this._rules.regime.rate,
|
|
26
|
+
amount: tax,
|
|
27
|
+
}];
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
corporateTax: tax,
|
|
31
|
+
effectiveTaxRate: (tax / income) * 100,
|
|
32
|
+
breakdowns,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface Rules {
|
|
4
|
+
regime: { type: 'flat'; rate: number };
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Input {
|
|
8
|
+
taxableIncome: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Result {
|
|
12
|
+
corporateTax: number;
|
|
13
|
+
effectiveTaxRate: number;
|
|
14
|
+
breakdowns: Breakdown[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { IsraelCorporateTaxService } from "./IsraelCorporateTaxService";
|
|
3
|
+
import { Input, Result, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class IsraelCorporateTaxServiceImpl implements IsraelCorporateTaxService {
|
|
6
|
+
private _input: Input;
|
|
7
|
+
private _rules: Rules;
|
|
8
|
+
|
|
9
|
+
constructor(input: Input, rules: Rules) {
|
|
10
|
+
this._input = input;
|
|
11
|
+
this._rules = rules;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
calculate(): Result {
|
|
15
|
+
const income = this._input.taxableIncome;
|
|
16
|
+
|
|
17
|
+
if (income <= 0) {
|
|
18
|
+
return { corporateTax: 0, effectiveTaxRate: 0, breakdowns: [] };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const tax = income * this._rules.regime.rate;
|
|
22
|
+
const breakdowns: Breakdown[] = [{
|
|
23
|
+
from: '0',
|
|
24
|
+
to: 'All',
|
|
25
|
+
rate: this._rules.regime.rate,
|
|
26
|
+
amount: tax,
|
|
27
|
+
}];
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
corporateTax: tax,
|
|
31
|
+
effectiveTaxRate: (tax / income) * 100,
|
|
32
|
+
breakdowns,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface Rules {
|
|
4
|
+
regime: { type: 'flat'; rate: number };
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Input {
|
|
8
|
+
taxableIncome: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Result {
|
|
12
|
+
corporateTax: number;
|
|
13
|
+
effectiveTaxRate: number;
|
|
14
|
+
breakdowns: Breakdown[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { JapanCorporateTaxService } from "./JapanCorporateTaxService";
|
|
3
|
+
import { Input, Result, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class JapanCorporateTaxServiceImpl implements JapanCorporateTaxService {
|
|
6
|
+
private _input: Input;
|
|
7
|
+
private _rules: Rules;
|
|
8
|
+
|
|
9
|
+
constructor(input: Input, rules: Rules) {
|
|
10
|
+
this._input = input;
|
|
11
|
+
this._rules = rules;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
calculate(): Result {
|
|
15
|
+
const income = this._input.taxableIncome;
|
|
16
|
+
|
|
17
|
+
if (income <= 0) {
|
|
18
|
+
return { corporateTax: 0, effectiveTaxRate: 0, breakdowns: [] };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const tax = income * this._rules.regime.rate;
|
|
22
|
+
const breakdowns: Breakdown[] = [{
|
|
23
|
+
from: '0',
|
|
24
|
+
to: 'All',
|
|
25
|
+
rate: this._rules.regime.rate,
|
|
26
|
+
amount: tax,
|
|
27
|
+
}];
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
corporateTax: tax,
|
|
31
|
+
effectiveTaxRate: (tax / income) * 100,
|
|
32
|
+
breakdowns,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface Rules {
|
|
4
|
+
regime: { type: 'flat'; rate: number };
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Input {
|
|
8
|
+
taxableIncome: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Result {
|
|
12
|
+
corporateTax: number;
|
|
13
|
+
effectiveTaxRate: number;
|
|
14
|
+
breakdowns: Breakdown[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { NetherlandsCorporateTaxService } from "./NetherlandsCorporateTaxService";
|
|
3
|
+
import { Input, Result, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class NetherlandsCorporateTaxServiceImpl implements NetherlandsCorporateTaxService {
|
|
6
|
+
private _input: Input;
|
|
7
|
+
private _rules: Rules;
|
|
8
|
+
|
|
9
|
+
constructor(input: Input, rules: Rules) {
|
|
10
|
+
this._input = input;
|
|
11
|
+
this._rules = rules;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
calculate(): Result {
|
|
15
|
+
const income = this._input.taxableIncome;
|
|
16
|
+
|
|
17
|
+
if (income <= 0) {
|
|
18
|
+
return { corporateTax: 0, effectiveTaxRate: 0, breakdowns: [] };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let tax = 0;
|
|
22
|
+
const breakdowns: Breakdown[] = [];
|
|
23
|
+
|
|
24
|
+
for (const tier of this._rules.tiers) {
|
|
25
|
+
if (income <= tier.from) break;
|
|
26
|
+
|
|
27
|
+
const upper = tier.to ?? income;
|
|
28
|
+
const taxable = Math.min(upper, income) - tier.from;
|
|
29
|
+
|
|
30
|
+
if (taxable > 0) {
|
|
31
|
+
const tierTax = taxable * tier.rate;
|
|
32
|
+
tax += tierTax;
|
|
33
|
+
breakdowns.push({
|
|
34
|
+
from: `${tier.from}`,
|
|
35
|
+
to: `${tier.to ?? 'Above'}`,
|
|
36
|
+
rate: tier.rate,
|
|
37
|
+
amount: tierTax,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
corporateTax: tax,
|
|
44
|
+
effectiveTaxRate: (tax / income) * 100,
|
|
45
|
+
breakdowns,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface TaxTier {
|
|
4
|
+
from: number;
|
|
5
|
+
to: number | null;
|
|
6
|
+
rate: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Rules {
|
|
10
|
+
tiers: TaxTier[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Input {
|
|
14
|
+
taxableIncome: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface Result {
|
|
18
|
+
corporateTax: number;
|
|
19
|
+
effectiveTaxRate: number;
|
|
20
|
+
breakdowns: Breakdown[];
|
|
21
|
+
}
|