@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
|
@@ -12,4 +12,18 @@ import { USAMortgageServiceImpl as USAMortgageService } from './usa/USAMortgageS
|
|
|
12
12
|
import { MortgageRules as USAMortgageRules, MortgageInput as USAMortgageInput, MortgageOutput as USAMortgageOutput } from './usa/domain/types';
|
|
13
13
|
import { GermanyMortgageServiceImpl as GermanyMortgageService } from './germany/GermanyMortgageServiceImpl';
|
|
14
14
|
import { MortgageRules as GermanyMortgageRules, MortgageInput as GermanyMortgageInput, MortgageOutput as GermanyMortgageOutput } from './germany/domain/types';
|
|
15
|
-
|
|
15
|
+
import { BrazilMortgageServiceImpl as BrazilMortgageService } from './brazil/BrazilMortgageServiceImpl';
|
|
16
|
+
import { MortgageRules as BrazilMortgageRules, MortgageInput as BrazilMortgageInput, MortgageOutput as BrazilMortgageOutput } from './brazil/domain/types';
|
|
17
|
+
import { SpainMortgageServiceImpl as SpainMortgageService } from './spain/SpainMortgageServiceImpl';
|
|
18
|
+
import { MortgageRules as SpainMortgageRules, MortgageInput as SpainMortgageInput, MortgageOutput as SpainMortgageOutput } from './spain/domain/types';
|
|
19
|
+
import { IndiaMortgageServiceImpl as IndiaMortgageService } from './india/IndiaMortgageServiceImpl';
|
|
20
|
+
import { MortgageRules as IndiaMortgageRules, MortgageInput as IndiaMortgageInput, MortgageOutput as IndiaMortgageOutput } from './india/domain/types';
|
|
21
|
+
import { JapanMortgageServiceImpl as JapanMortgageService } from './japan/JapanMortgageServiceImpl';
|
|
22
|
+
import { MortgageRules as JapanMortgageRules, MortgageInput as JapanMortgageInput, MortgageOutput as JapanMortgageOutput } from './japan/domain/types';
|
|
23
|
+
import { IsraelMortgageServiceImpl as IsraelMortgageService } from './israel/IsraelMortgageServiceImpl';
|
|
24
|
+
import { MortgageRules as IsraelMortgageRules, MortgageInput as IsraelMortgageInput, MortgageOutput as IsraelMortgageOutput } from './israel/domain/types';
|
|
25
|
+
import { SwitzerlandMortgageServiceImpl as SwitzerlandMortgageService } from './switzerland/SwitzerlandMortgageServiceImpl';
|
|
26
|
+
import { MortgageRules as SwitzerlandMortgageRules, MortgageInput as SwitzerlandMortgageInput, MortgageOutput as SwitzerlandMortgageOutput } from './switzerland/domain/types';
|
|
27
|
+
import { NetherlandsMortgageServiceImpl as NetherlandsMortgageService } from './netherlands/NetherlandsMortgageServiceImpl';
|
|
28
|
+
import { MortgageRules as NetherlandsMortgageRules, MortgageInput as NetherlandsMortgageInput, MortgageOutput as NetherlandsMortgageOutput } from './netherlands/domain/types';
|
|
29
|
+
export { CanadaMortgageService, CanadaMortgageRules, CanadaMortgageCalculationInput, CanadaMortgageCalculationResult, FranceMortgageService, FranceMortgageRules, FranceMortgageInput, FranceMortgageCalculationResult, SouthAfricaMortgageService, SouthAfricaMortgageRules, SouthAfricaMortgageInput, SouthAfricaMortgageOutput, AustraliaMortgageService, AustraliaMortgageRules, AustraliaMortgageInput, AustraliaMortgageOutput, UKMortgageService, UKMortgageRules, UKMortgageInput, UKMortgageOutput, USAMortgageService, USAMortgageRules, USAMortgageInput, USAMortgageOutput, GermanyMortgageService, GermanyMortgageRules, GermanyMortgageInput, GermanyMortgageOutput, BrazilMortgageService, BrazilMortgageRules, BrazilMortgageInput, BrazilMortgageOutput, SpainMortgageService, SpainMortgageRules, SpainMortgageInput, SpainMortgageOutput, IndiaMortgageService, IndiaMortgageRules, IndiaMortgageInput, IndiaMortgageOutput, JapanMortgageService, JapanMortgageRules, JapanMortgageInput, JapanMortgageOutput, IsraelMortgageService, IsraelMortgageRules, IsraelMortgageInput, IsraelMortgageOutput, SwitzerlandMortgageService, SwitzerlandMortgageRules, SwitzerlandMortgageInput, SwitzerlandMortgageOutput, NetherlandsMortgageService, NetherlandsMortgageRules, NetherlandsMortgageInput, NetherlandsMortgageOutput, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IndiaMortgageService } from "./IndiaMortgageService";
|
|
2
|
+
import { MortgageInput, MortgageOutput, MortgageRules } from "./domain/types";
|
|
3
|
+
export declare class IndiaMortgageServiceImpl implements IndiaMortgageService {
|
|
4
|
+
calculate(input: MortgageInput, rules: MortgageRules): MortgageOutput;
|
|
5
|
+
private calculateAmortizationSchedule;
|
|
6
|
+
private calculatePayment;
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { OtherFees } from "../../domain/types";
|
|
2
|
+
export interface MortgageRules {
|
|
3
|
+
loanConstraints: LoanConstraints;
|
|
4
|
+
interest: InterestRules;
|
|
5
|
+
stampDuty: StampDutyRules;
|
|
6
|
+
}
|
|
7
|
+
export interface LoanConstraints {
|
|
8
|
+
maxLtvPercent: number;
|
|
9
|
+
maxAmortizationYears: number;
|
|
10
|
+
}
|
|
11
|
+
export interface InterestRules {
|
|
12
|
+
compounding: 'MONTHLY';
|
|
13
|
+
}
|
|
14
|
+
export interface StampDutyRules {
|
|
15
|
+
rate: number;
|
|
16
|
+
}
|
|
17
|
+
export interface AmortizationScheduleItem {
|
|
18
|
+
year: number;
|
|
19
|
+
principal: number;
|
|
20
|
+
interest: number;
|
|
21
|
+
balance: number;
|
|
22
|
+
}
|
|
23
|
+
export interface MortgageInput {
|
|
24
|
+
propertyPrice: number;
|
|
25
|
+
downPayment: number;
|
|
26
|
+
annualInterestRate: number;
|
|
27
|
+
amortizationYears: number;
|
|
28
|
+
isFirstTimeBuyer: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface MortgageOutput {
|
|
31
|
+
loanAmount: number;
|
|
32
|
+
totalMortgage: number;
|
|
33
|
+
monthlyPayment: number;
|
|
34
|
+
totalInterestPaid: number;
|
|
35
|
+
totalPaid: number;
|
|
36
|
+
stampDuty: number;
|
|
37
|
+
amortizationSchedule: AmortizationScheduleItem[];
|
|
38
|
+
otherFees: OtherFees;
|
|
39
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IsraelMortgageService } from "./IsraelMortgageService";
|
|
2
|
+
import { MortgageInput, MortgageOutput, MortgageRules } from "./domain/types";
|
|
3
|
+
export declare class IsraelMortgageServiceImpl implements IsraelMortgageService {
|
|
4
|
+
calculate(input: MortgageInput, rules: MortgageRules): MortgageOutput;
|
|
5
|
+
private calculatePurchaseTax;
|
|
6
|
+
private calculateAmortizationSchedule;
|
|
7
|
+
private calculatePayment;
|
|
8
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { OtherFees } from "../../domain/types";
|
|
2
|
+
export interface PurchaseTaxBracket {
|
|
3
|
+
upTo?: number;
|
|
4
|
+
above?: number;
|
|
5
|
+
rate: number;
|
|
6
|
+
}
|
|
7
|
+
export interface MortgageRules {
|
|
8
|
+
loanConstraints: {
|
|
9
|
+
maxLtvPercent: number;
|
|
10
|
+
maxAmortizationYears: number;
|
|
11
|
+
};
|
|
12
|
+
interest: {
|
|
13
|
+
compounding: 'MONTHLY';
|
|
14
|
+
};
|
|
15
|
+
purchaseTax: {
|
|
16
|
+
brackets: PurchaseTaxBracket[];
|
|
17
|
+
};
|
|
18
|
+
landRegistrationFeeRate: number;
|
|
19
|
+
}
|
|
20
|
+
export interface AmortizationScheduleItem {
|
|
21
|
+
year: number;
|
|
22
|
+
principal: number;
|
|
23
|
+
interest: number;
|
|
24
|
+
balance: number;
|
|
25
|
+
}
|
|
26
|
+
export interface MortgageInput {
|
|
27
|
+
propertyPrice: number;
|
|
28
|
+
downPayment: number;
|
|
29
|
+
annualInterestRate: number;
|
|
30
|
+
amortizationYears: number;
|
|
31
|
+
isFirstTimeBuyer: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface MortgageOutput {
|
|
34
|
+
loanAmount: number;
|
|
35
|
+
totalMortgage: number;
|
|
36
|
+
monthlyPayment: number;
|
|
37
|
+
totalInterestPaid: number;
|
|
38
|
+
totalPaid: number;
|
|
39
|
+
purchaseTax: number;
|
|
40
|
+
landRegistrationFee: number;
|
|
41
|
+
amortizationSchedule: AmortizationScheduleItem[];
|
|
42
|
+
otherFees: OtherFees;
|
|
43
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JapanMortgageService } from "./JapanMortgageService";
|
|
2
|
+
import { MortgageInput, MortgageOutput, MortgageRules } from "./domain/types";
|
|
3
|
+
export declare class JapanMortgageServiceImpl implements JapanMortgageService {
|
|
4
|
+
calculate(input: MortgageInput, rules: MortgageRules): MortgageOutput;
|
|
5
|
+
private calculateAmortizationSchedule;
|
|
6
|
+
private calculatePayment;
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { OtherFees } from "../../domain/types";
|
|
2
|
+
export interface MortgageRules {
|
|
3
|
+
loanConstraints: LoanConstraints;
|
|
4
|
+
interest: InterestRules;
|
|
5
|
+
acquisitionTax: AcquisitionTaxRules;
|
|
6
|
+
}
|
|
7
|
+
export interface LoanConstraints {
|
|
8
|
+
maxLtvPercent: number;
|
|
9
|
+
maxAmortizationYears: number;
|
|
10
|
+
}
|
|
11
|
+
export interface InterestRules {
|
|
12
|
+
compounding: 'MONTHLY';
|
|
13
|
+
}
|
|
14
|
+
export interface AcquisitionTaxRules {
|
|
15
|
+
rate: number;
|
|
16
|
+
}
|
|
17
|
+
export interface AmortizationScheduleItem {
|
|
18
|
+
year: number;
|
|
19
|
+
principal: number;
|
|
20
|
+
interest: number;
|
|
21
|
+
balance: number;
|
|
22
|
+
}
|
|
23
|
+
export interface MortgageInput {
|
|
24
|
+
propertyPrice: number;
|
|
25
|
+
downPayment: number;
|
|
26
|
+
annualInterestRate: number;
|
|
27
|
+
amortizationYears: number;
|
|
28
|
+
isFirstTimeBuyer: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface MortgageOutput {
|
|
31
|
+
loanAmount: number;
|
|
32
|
+
totalMortgage: number;
|
|
33
|
+
monthlyPayment: number;
|
|
34
|
+
totalInterestPaid: number;
|
|
35
|
+
totalPaid: number;
|
|
36
|
+
acquisitionTax: number;
|
|
37
|
+
amortizationSchedule: AmortizationScheduleItem[];
|
|
38
|
+
otherFees: OtherFees;
|
|
39
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NetherlandsMortgageService } from "./NetherlandsMortgageService";
|
|
2
|
+
import { MortgageInput, MortgageOutput, MortgageRules } from "./domain/types";
|
|
3
|
+
export declare class NetherlandsMortgageServiceImpl implements NetherlandsMortgageService {
|
|
4
|
+
calculate(input: MortgageInput, rules: MortgageRules): MortgageOutput;
|
|
5
|
+
private calculateAmortizationSchedule;
|
|
6
|
+
private calculatePayment;
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { OtherFees } from "../../domain/types";
|
|
2
|
+
export interface MortgageRules {
|
|
3
|
+
loanConstraints: {
|
|
4
|
+
maxLtvPercent: number;
|
|
5
|
+
maxAmortizationYears: number;
|
|
6
|
+
};
|
|
7
|
+
interest: {
|
|
8
|
+
compounding: 'MONTHLY';
|
|
9
|
+
};
|
|
10
|
+
transferTax: {
|
|
11
|
+
primaryResidenceRate: number;
|
|
12
|
+
otherRate: number;
|
|
13
|
+
};
|
|
14
|
+
notaryFeeRate: number;
|
|
15
|
+
landRegistryFeeRate: number;
|
|
16
|
+
}
|
|
17
|
+
export interface AmortizationScheduleItem {
|
|
18
|
+
year: number;
|
|
19
|
+
principal: number;
|
|
20
|
+
interest: number;
|
|
21
|
+
balance: number;
|
|
22
|
+
}
|
|
23
|
+
export interface MortgageInput {
|
|
24
|
+
propertyPrice: number;
|
|
25
|
+
downPayment: number;
|
|
26
|
+
annualInterestRate: number;
|
|
27
|
+
amortizationYears: number;
|
|
28
|
+
isPrimaryResidence: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface MortgageOutput {
|
|
31
|
+
loanAmount: number;
|
|
32
|
+
totalMortgage: number;
|
|
33
|
+
monthlyPayment: number;
|
|
34
|
+
totalInterestPaid: number;
|
|
35
|
+
totalPaid: number;
|
|
36
|
+
transferTax: number;
|
|
37
|
+
notaryFees: number;
|
|
38
|
+
landRegistryFee: number;
|
|
39
|
+
amortizationSchedule: AmortizationScheduleItem[];
|
|
40
|
+
otherFees: OtherFees;
|
|
41
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SpainMortgageService } from "./SpainMortgageService";
|
|
2
|
+
import { MortgageInput, MortgageOutput, MortgageRules } from "./domain/types";
|
|
3
|
+
export declare class SpainMortgageServiceImpl implements SpainMortgageService {
|
|
4
|
+
calculate(input: MortgageInput, rules: MortgageRules): MortgageOutput;
|
|
5
|
+
private calculateTransferTax;
|
|
6
|
+
private calculateAmortizationSchedule;
|
|
7
|
+
private calculatePayment;
|
|
8
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { OtherFees } from "../../domain/types";
|
|
2
|
+
export interface MortgageRules {
|
|
3
|
+
loanConstraints: LoanConstraints;
|
|
4
|
+
interest: InterestRules;
|
|
5
|
+
transferTax: TransferTaxRules;
|
|
6
|
+
}
|
|
7
|
+
export interface LoanConstraints {
|
|
8
|
+
maxLtvPercent: number;
|
|
9
|
+
maxAmortizationYears: number;
|
|
10
|
+
}
|
|
11
|
+
export interface InterestRules {
|
|
12
|
+
compounding: 'MONTHLY';
|
|
13
|
+
}
|
|
14
|
+
export interface TransferTaxBracket {
|
|
15
|
+
upTo?: number;
|
|
16
|
+
above?: number;
|
|
17
|
+
rate: number;
|
|
18
|
+
}
|
|
19
|
+
export interface TransferTaxRules {
|
|
20
|
+
brackets: TransferTaxBracket[];
|
|
21
|
+
}
|
|
22
|
+
export interface AmortizationScheduleItem {
|
|
23
|
+
year: number;
|
|
24
|
+
principal: number;
|
|
25
|
+
interest: number;
|
|
26
|
+
balance: number;
|
|
27
|
+
}
|
|
28
|
+
export interface MortgageInput {
|
|
29
|
+
propertyPrice: number;
|
|
30
|
+
downPayment: number;
|
|
31
|
+
annualInterestRate: number;
|
|
32
|
+
amortizationYears: number;
|
|
33
|
+
isFirstTimeBuyer: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface MortgageOutput {
|
|
36
|
+
loanAmount: number;
|
|
37
|
+
totalMortgage: number;
|
|
38
|
+
monthlyPayment: number;
|
|
39
|
+
totalInterestPaid: number;
|
|
40
|
+
totalPaid: number;
|
|
41
|
+
transferTax: number;
|
|
42
|
+
amortizationSchedule: AmortizationScheduleItem[];
|
|
43
|
+
otherFees: OtherFees;
|
|
44
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SwitzerlandMortgageService } from "./SwitzerlandMortgageService";
|
|
2
|
+
import { MortgageInput, MortgageOutput, MortgageRules } from "./domain/types";
|
|
3
|
+
export declare class SwitzerlandMortgageServiceImpl implements SwitzerlandMortgageService {
|
|
4
|
+
calculate(input: MortgageInput, rules: MortgageRules): MortgageOutput;
|
|
5
|
+
private calculateAmortizationSchedule;
|
|
6
|
+
private calculatePayment;
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { OtherFees } from "../../domain/types";
|
|
2
|
+
export interface MortgageRules {
|
|
3
|
+
loanConstraints: {
|
|
4
|
+
maxLtvPercent: number;
|
|
5
|
+
maxAmortizationYears: number;
|
|
6
|
+
};
|
|
7
|
+
interest: {
|
|
8
|
+
compounding: 'MONTHLY';
|
|
9
|
+
};
|
|
10
|
+
transferTaxRate: number;
|
|
11
|
+
notaryFeeRate: number;
|
|
12
|
+
landRegistryFeeRate: number;
|
|
13
|
+
}
|
|
14
|
+
export interface AmortizationScheduleItem {
|
|
15
|
+
year: number;
|
|
16
|
+
principal: number;
|
|
17
|
+
interest: number;
|
|
18
|
+
balance: number;
|
|
19
|
+
}
|
|
20
|
+
export interface MortgageInput {
|
|
21
|
+
propertyPrice: number;
|
|
22
|
+
downPayment: number;
|
|
23
|
+
annualInterestRate: number;
|
|
24
|
+
amortizationYears: number;
|
|
25
|
+
}
|
|
26
|
+
export interface MortgageOutput {
|
|
27
|
+
loanAmount: number;
|
|
28
|
+
totalMortgage: number;
|
|
29
|
+
monthlyPayment: number;
|
|
30
|
+
totalInterestPaid: number;
|
|
31
|
+
totalPaid: number;
|
|
32
|
+
transferTax: number;
|
|
33
|
+
notaryFees: number;
|
|
34
|
+
landRegistryFee: number;
|
|
35
|
+
amortizationSchedule: AmortizationScheduleItem[];
|
|
36
|
+
otherFees: OtherFees;
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Breakdown, Result } from "../domain/types";
|
|
2
|
+
import { BrazilCapitalGainsService } from "./BrazilCapitalGainsService";
|
|
3
|
+
import { CapitalGainsBracket, Input, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class BrazilCapitalGainsServiceImpl implements BrazilCapitalGainsService {
|
|
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
|
+
}
|
|
@@ -48,6 +48,41 @@ import {
|
|
|
48
48
|
} from './germany/domain/types';
|
|
49
49
|
import { Result } from './domain/types';
|
|
50
50
|
|
|
51
|
+
// Capital Gains - Brazil
|
|
52
|
+
import { BrazilCapitalGainsServiceImpl as BrazilCapitalGainsService } from './brazil/BrazilCapitalGainsServiceImpl';
|
|
53
|
+
import {
|
|
54
|
+
Input as BrazilCapitalGainsInput,
|
|
55
|
+
Rules as BrazilCapitalGainsRules
|
|
56
|
+
} from './brazil/domain/types';
|
|
57
|
+
|
|
58
|
+
// Capital Gains - Spain
|
|
59
|
+
import { SpainCapitalGainsServiceImpl as SpainCapitalGainsService } from './spain/SpainCapitalGainsServiceImpl';
|
|
60
|
+
import {
|
|
61
|
+
Input as SpainCapitalGainsInput,
|
|
62
|
+
Rules as SpainCapitalGainsRules
|
|
63
|
+
} from './spain/domain/types';
|
|
64
|
+
|
|
65
|
+
// Capital Gains - India
|
|
66
|
+
import { IndiaCapitalGainsServiceImpl as IndiaCapitalGainsService } from './india/IndiaCapitalGainsServiceImpl';
|
|
67
|
+
import {
|
|
68
|
+
Input as IndiaCapitalGainsInput,
|
|
69
|
+
Rules as IndiaCapitalGainsRules
|
|
70
|
+
} from './india/domain/types';
|
|
71
|
+
|
|
72
|
+
// Capital Gains - Japan
|
|
73
|
+
import { JapanCapitalGainsServiceImpl as JapanCapitalGainsService } from './japan/JapanCapitalGainsServiceImpl';
|
|
74
|
+
import {
|
|
75
|
+
Input as JapanCapitalGainsInput,
|
|
76
|
+
Rules as JapanCapitalGainsRules
|
|
77
|
+
} from './japan/domain/types';
|
|
78
|
+
|
|
79
|
+
// Capital Gains - Israel
|
|
80
|
+
import { IsraelCapitalGainsServiceImpl as IsraelCapitalGainsService } from './israel/IsraelCapitalGainsServiceImpl';
|
|
81
|
+
import {
|
|
82
|
+
Input as IsraelCapitalGainsInput,
|
|
83
|
+
Rules as IsraelCapitalGainsRules,
|
|
84
|
+
} from './israel/domain/types';
|
|
85
|
+
|
|
51
86
|
export {
|
|
52
87
|
CanadaCapitalGainsService,
|
|
53
88
|
CanadaCapitalGainsInput,
|
|
@@ -70,5 +105,20 @@ export {
|
|
|
70
105
|
GermanyCapitalGainsService,
|
|
71
106
|
GermanyCapitalGainsInput,
|
|
72
107
|
GermanyCapitalGainsRules,
|
|
108
|
+
BrazilCapitalGainsService,
|
|
109
|
+
BrazilCapitalGainsInput,
|
|
110
|
+
BrazilCapitalGainsRules,
|
|
111
|
+
SpainCapitalGainsService,
|
|
112
|
+
SpainCapitalGainsInput,
|
|
113
|
+
SpainCapitalGainsRules,
|
|
114
|
+
IndiaCapitalGainsService,
|
|
115
|
+
IndiaCapitalGainsInput,
|
|
116
|
+
IndiaCapitalGainsRules,
|
|
117
|
+
JapanCapitalGainsService,
|
|
118
|
+
JapanCapitalGainsInput,
|
|
119
|
+
JapanCapitalGainsRules,
|
|
120
|
+
IsraelCapitalGainsService,
|
|
121
|
+
IsraelCapitalGainsInput,
|
|
122
|
+
IsraelCapitalGainsRules,
|
|
73
123
|
Result
|
|
74
124
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Breakdown, Result } from "../domain/types";
|
|
2
|
+
import { IndiaCapitalGainsService } from "./IndiaCapitalGainsService";
|
|
3
|
+
import { Input, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class IndiaCapitalGainsServiceImpl implements IndiaCapitalGainsService {
|
|
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 isLongTerm = this._input.holdingPeriodMonths >= 12;
|
|
30
|
+
const breakdowns: Breakdown[] = [];
|
|
31
|
+
let tax = 0;
|
|
32
|
+
|
|
33
|
+
if (isLongTerm) {
|
|
34
|
+
const taxableGain = Math.max(0, gain - this._rules.longTermExemption);
|
|
35
|
+
tax = taxableGain * this._rules.longTermRate;
|
|
36
|
+
if (taxableGain > 0) {
|
|
37
|
+
breakdowns.push({
|
|
38
|
+
from: `${this._rules.longTermExemption}`,
|
|
39
|
+
to: 'Above',
|
|
40
|
+
rate: this._rules.longTermRate,
|
|
41
|
+
amount: tax,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
tax = gain * this._rules.shortTermRate;
|
|
46
|
+
breakdowns.push({
|
|
47
|
+
from: '0',
|
|
48
|
+
to: 'All',
|
|
49
|
+
rate: this._rules.shortTermRate,
|
|
50
|
+
amount: tax,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
taxableGain: gain,
|
|
56
|
+
capitalGainTax: tax,
|
|
57
|
+
socialContributions: 0,
|
|
58
|
+
netInvestmentIncomeTax: 0,
|
|
59
|
+
totalTax: tax,
|
|
60
|
+
effectiveRate: gain > 0 ? (tax / gain) * 100 : 0,
|
|
61
|
+
breakdowns,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|