@novha/calc-engines 6.3.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/canada/CanadaCapitalGainsServiceImpl.js +29 -17
- 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/index.js +3 -2
- package/dist/inheritance-tax/australia/AustraliaInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/australia/AustraliaInheritanceTaxServiceImpl.js +19 -0
- package/dist/inheritance-tax/australia/domain/types.js +3 -0
- package/dist/inheritance-tax/canada/CanadaInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/canada/CanadaInheritanceTaxServiceImpl.js +51 -0
- package/dist/inheritance-tax/canada/domain/types.js +3 -0
- package/dist/inheritance-tax/domain/types.js +3 -0
- package/dist/inheritance-tax/france/FranceInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/france/FranceInheritanceTaxServiceImpl.js +52 -0
- package/dist/inheritance-tax/france/domain/types.js +3 -0
- package/dist/inheritance-tax/germany/GermanyInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/germany/GermanyInheritanceTaxServiceImpl.js +52 -0
- package/dist/inheritance-tax/germany/domain/types.js +3 -0
- package/dist/inheritance-tax/index.js +34 -0
- 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/south-africa/SouthAfricaInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/south-africa/SouthAfricaInheritanceTaxServiceImpl.js +52 -0
- package/dist/inheritance-tax/south-africa/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/inheritance-tax/uk/UKInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/uk/UKInheritanceTaxServiceImpl.js +39 -0
- package/dist/inheritance-tax/uk/domain/types.js +3 -0
- package/dist/inheritance-tax/usa/USAInheritanceTaxService.js +3 -0
- package/dist/inheritance-tax/usa/USAInheritanceTaxServiceImpl.js +51 -0
- package/dist/inheritance-tax/usa/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/shared/domain/types.js +2 -1
- 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/canada/CanadaCapitalGainsServiceImpl.d.ts +1 -1
- 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/index.d.ts +1 -0
- package/dist/types/inheritance-tax/australia/AustraliaInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/australia/AustraliaInheritanceTaxServiceImpl.d.ts +8 -0
- package/dist/types/inheritance-tax/australia/domain/types.d.ts +13 -0
- package/dist/types/inheritance-tax/canada/CanadaInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/canada/CanadaInheritanceTaxServiceImpl.d.ts +9 -0
- package/dist/types/inheritance-tax/canada/domain/types.d.ts +20 -0
- package/dist/types/inheritance-tax/domain/types.d.ts +17 -0
- package/dist/types/inheritance-tax/france/FranceInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/france/FranceInheritanceTaxServiceImpl.d.ts +9 -0
- package/dist/types/inheritance-tax/france/domain/types.d.ts +29 -0
- package/dist/types/inheritance-tax/germany/GermanyInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/germany/GermanyInheritanceTaxServiceImpl.d.ts +9 -0
- package/dist/types/inheritance-tax/germany/domain/types.d.ts +28 -0
- package/dist/types/inheritance-tax/index.d.ts +21 -0
- 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/south-africa/SouthAfricaInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/south-africa/SouthAfricaInheritanceTaxServiceImpl.d.ts +9 -0
- package/dist/types/inheritance-tax/south-africa/domain/types.d.ts +20 -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/inheritance-tax/uk/UKInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/uk/UKInheritanceTaxServiceImpl.d.ts +8 -0
- package/dist/types/inheritance-tax/uk/domain/types.d.ts +17 -0
- package/dist/types/inheritance-tax/usa/USAInheritanceTaxService.d.ts +4 -0
- package/dist/types/inheritance-tax/usa/USAInheritanceTaxServiceImpl.d.ts +9 -0
- package/dist/types/inheritance-tax/usa/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/dist/types/shared/domain/types.d.ts +2 -1
- 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/canada/CanadaCapitalGainsServiceImpl.ts +34 -21
- 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/index.ts +1 -0
- package/src/inheritance-tax/australia/AustraliaInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/australia/AustraliaInheritanceTaxServiceImpl.ts +21 -0
- package/src/inheritance-tax/australia/domain/types.ts +16 -0
- package/src/inheritance-tax/canada/CanadaInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/canada/CanadaInheritanceTaxServiceImpl.ts +65 -0
- package/src/inheritance-tax/canada/domain/types.ts +24 -0
- package/src/inheritance-tax/domain/types.ts +19 -0
- package/src/inheritance-tax/france/FranceInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/france/FranceInheritanceTaxServiceImpl.ts +66 -0
- package/src/inheritance-tax/france/domain/types.ts +35 -0
- package/src/inheritance-tax/germany/GermanyInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/germany/GermanyInheritanceTaxServiceImpl.ts +66 -0
- package/src/inheritance-tax/germany/domain/types.ts +34 -0
- package/src/inheritance-tax/index.ts +122 -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/south-africa/SouthAfricaInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/south-africa/SouthAfricaInheritanceTaxServiceImpl.ts +66 -0
- package/src/inheritance-tax/south-africa/domain/types.ts +24 -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/inheritance-tax/uk/UKInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/uk/UKInheritanceTaxServiceImpl.ts +46 -0
- package/src/inheritance-tax/uk/domain/types.ts +20 -0
- package/src/inheritance-tax/usa/USAInheritanceTaxService.ts +5 -0
- package/src/inheritance-tax/usa/USAInheritanceTaxServiceImpl.ts +65 -0
- package/src/inheritance-tax/usa/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/src/shared/domain/types.ts +1 -0
- package/test/australia-inheritance-tax.test.ts +35 -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/canada-inheritance-tax.test.ts +62 -0
- package/test/france-inheritance-tax.test.ts +101 -0
- package/test/germany-inheritance-tax.test.ts +100 -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/south-africa-inheritance-tax.test.ts +81 -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/test/uk-inheritance-tax.test.ts +72 -0
- package/test/usa-inheritance-tax.test.ts +90 -0
- package/dist/domain/types.js +0 -10
- package/dist/types/domain/types.d.ts +0 -41
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { JapanMortgageServiceImpl } from '../src/mortgage/japan/JapanMortgageServiceImpl';
|
|
2
|
+
import { MortgageInput, MortgageRules } from '../src/mortgage/japan/domain/types';
|
|
3
|
+
|
|
4
|
+
const japanRules: MortgageRules = {
|
|
5
|
+
loanConstraints: { maxLtvPercent: 0.80, maxAmortizationYears: 35 },
|
|
6
|
+
interest: { compounding: 'MONTHLY' },
|
|
7
|
+
acquisitionTax: { rate: 0.03 },
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const input: MortgageInput = {
|
|
11
|
+
propertyPrice: 50000000,
|
|
12
|
+
downPayment: 10000000,
|
|
13
|
+
annualInterestRate: 1.5,
|
|
14
|
+
amortizationYears: 30,
|
|
15
|
+
isFirstTimeBuyer: false,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe('JapanMortgageServiceImpl', () => {
|
|
19
|
+
it('correctly calculates the loan amount', () => {
|
|
20
|
+
const service = new JapanMortgageServiceImpl();
|
|
21
|
+
const result = service.calculate(input, japanRules);
|
|
22
|
+
|
|
23
|
+
// loanAmount = 50000000 - 10000000 = 40000000
|
|
24
|
+
expect(result.loanAmount).toBe(40000000);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('correctly calculates acquisition tax', () => {
|
|
28
|
+
const service = new JapanMortgageServiceImpl();
|
|
29
|
+
const result = service.calculate(input, japanRules);
|
|
30
|
+
|
|
31
|
+
// acquisitionTax = 50000000 * 0.03 = 1500000
|
|
32
|
+
expect(result.acquisitionTax).toBe(1500000);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('calculates a positive monthly payment', () => {
|
|
36
|
+
const service = new JapanMortgageServiceImpl();
|
|
37
|
+
const result = service.calculate(input, japanRules);
|
|
38
|
+
|
|
39
|
+
expect(result.monthlyPayment).toBeGreaterThan(0);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('total paid is greater than the loan amount', () => {
|
|
43
|
+
const service = new JapanMortgageServiceImpl();
|
|
44
|
+
const result = service.calculate(input, japanRules);
|
|
45
|
+
|
|
46
|
+
expect(result.totalPaid).toBeGreaterThan(result.loanAmount);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('total interest paid equals total paid minus loan amount', () => {
|
|
50
|
+
const service = new JapanMortgageServiceImpl();
|
|
51
|
+
const result = service.calculate(input, japanRules);
|
|
52
|
+
|
|
53
|
+
expect(result.totalInterestPaid).toBeCloseTo(result.totalPaid - result.loanAmount, 2);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('amortization schedule has the correct number of years', () => {
|
|
57
|
+
const service = new JapanMortgageServiceImpl();
|
|
58
|
+
const result = service.calculate(input, japanRules);
|
|
59
|
+
|
|
60
|
+
expect(result.amortizationSchedule).toHaveLength(30);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('throws an error when down payment equals or exceeds property price', () => {
|
|
64
|
+
const service = new JapanMortgageServiceImpl();
|
|
65
|
+
const badInput: MortgageInput = { ...input, downPayment: 50000000 };
|
|
66
|
+
|
|
67
|
+
expect(() => service.calculate(badInput, japanRules)).toThrow();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { NetherlandsCorporateTaxServiceImpl } from '../src/corporate/netherlands/NetherlandsCorporateTaxServiceImpl';
|
|
2
|
+
import { Input, Rules } from '../src/corporate/netherlands/domain/types';
|
|
3
|
+
|
|
4
|
+
const netherlandsRules: Rules = {
|
|
5
|
+
tiers: [
|
|
6
|
+
{ from: 0, to: 200000, rate: 0.19 },
|
|
7
|
+
{ from: 200000, to: null, rate: 0.258 },
|
|
8
|
+
],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
describe('NetherlandsCorporateTaxServiceImpl', () => {
|
|
12
|
+
it('returns zero tax for zero income', () => {
|
|
13
|
+
const input: Input = { taxableIncome: 0 };
|
|
14
|
+
const service = new NetherlandsCorporateTaxServiceImpl(input, netherlandsRules);
|
|
15
|
+
const result = service.calculate();
|
|
16
|
+
expect(result.corporateTax).toBe(0);
|
|
17
|
+
expect(result.effectiveTaxRate).toBe(0);
|
|
18
|
+
expect(result.breakdowns).toHaveLength(0);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('correctly calculates tax for income within first tier (19%)', () => {
|
|
22
|
+
const input: Input = { taxableIncome: 100000 };
|
|
23
|
+
const service = new NetherlandsCorporateTaxServiceImpl(input, netherlandsRules);
|
|
24
|
+
const result = service.calculate();
|
|
25
|
+
// 100000 * 0.19 = 19000
|
|
26
|
+
expect(result.corporateTax).toBe(19000);
|
|
27
|
+
expect(result.effectiveTaxRate).toBe(19);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('correctly calculates tax spanning both tiers', () => {
|
|
31
|
+
const input: Input = { taxableIncome: 300000 };
|
|
32
|
+
const service = new NetherlandsCorporateTaxServiceImpl(input, netherlandsRules);
|
|
33
|
+
const result = service.calculate();
|
|
34
|
+
// 0-200000: 200000 * 0.19 = 38000
|
|
35
|
+
// 200000-300000: 100000 * 0.258 = 25800
|
|
36
|
+
// Total = 63800
|
|
37
|
+
expect(result.corporateTax).toBe(63800);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('returns two breakdown entries when spanning both tiers', () => {
|
|
41
|
+
const input: Input = { taxableIncome: 300000 };
|
|
42
|
+
const service = new NetherlandsCorporateTaxServiceImpl(input, netherlandsRules);
|
|
43
|
+
const result = service.calculate();
|
|
44
|
+
expect(result.breakdowns).toHaveLength(2);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('effective tax rate is less than top rate for income spanning tiers', () => {
|
|
48
|
+
const input: Input = { taxableIncome: 300000 };
|
|
49
|
+
const service = new NetherlandsCorporateTaxServiceImpl(input, netherlandsRules);
|
|
50
|
+
const result = service.calculate();
|
|
51
|
+
expect(result.effectiveTaxRate).toBeLessThan(25.8);
|
|
52
|
+
expect(result.effectiveTaxRate).toBeGreaterThan(19);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { NetherlandsIncomeTaxServiceImpl } from '../src/income-tax/netherlands/NetherlandsIncomeTaxServiceImpl';
|
|
2
|
+
import { IncomeTaxRules } from '../src/income-tax/netherlands/domain/types';
|
|
3
|
+
|
|
4
|
+
const netherlandsRules: IncomeTaxRules = {
|
|
5
|
+
taxBrackets: [
|
|
6
|
+
{ from: 0, to: 75624, rate: 0.3697 },
|
|
7
|
+
{ from: 75624, to: null, rate: 0.495 },
|
|
8
|
+
],
|
|
9
|
+
socialContributions: { rate: 0 },
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
describe('NetherlandsIncomeTaxServiceImpl', () => {
|
|
13
|
+
it('returns zero tax for zero income', () => {
|
|
14
|
+
const service = new NetherlandsIncomeTaxServiceImpl(0, netherlandsRules);
|
|
15
|
+
const result = service.calculateNetIncome();
|
|
16
|
+
expect(result.incomeTax).toBe(0);
|
|
17
|
+
expect(result.socialContributions).toBe(0);
|
|
18
|
+
expect(result.effectiveTaxRate).toBe(0);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('correctly calculates income tax in first bracket', () => {
|
|
22
|
+
const service = new NetherlandsIncomeTaxServiceImpl(50000, netherlandsRules);
|
|
23
|
+
const result = service.calculateNetIncome();
|
|
24
|
+
// 50000 * 0.3697 = 18485
|
|
25
|
+
expect(result.incomeTax).toBeCloseTo(18485, 2);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('correctly calculates income tax spanning both brackets', () => {
|
|
29
|
+
const service = new NetherlandsIncomeTaxServiceImpl(100000, netherlandsRules);
|
|
30
|
+
const result = service.calculateNetIncome();
|
|
31
|
+
// 0-75624: 75624 * 0.3697 = 27958.19
|
|
32
|
+
// 75624-100000: 24376 * 0.495 = 12066.12
|
|
33
|
+
// Total ≈ 40024.31
|
|
34
|
+
expect(result.incomeTax).toBeCloseTo(40024.31, 1);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('social contributions are zero (included in brackets)', () => {
|
|
38
|
+
const service = new NetherlandsIncomeTaxServiceImpl(50000, netherlandsRules);
|
|
39
|
+
const result = service.calculateNetIncome();
|
|
40
|
+
expect(result.socialContributions).toBe(0);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('net income equals gross income minus income tax', () => {
|
|
44
|
+
const service = new NetherlandsIncomeTaxServiceImpl(50000, netherlandsRules);
|
|
45
|
+
const result = service.calculateNetIncome();
|
|
46
|
+
expect(result.netIncome).toBeCloseTo(result.grossIncome - result.totalDeductions, 2);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('effective tax rate calculation is correct', () => {
|
|
50
|
+
const service = new NetherlandsIncomeTaxServiceImpl(50000, netherlandsRules);
|
|
51
|
+
const result = service.calculateNetIncome();
|
|
52
|
+
expect(result.effectiveTaxRate).toBeCloseTo(result.incomeTax / result.grossIncome, 4);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { NetherlandsInheritanceTaxServiceImpl } from '../src/inheritance-tax/netherlands/NetherlandsInheritanceTaxServiceImpl';
|
|
2
|
+
import { Input, Rules } from '../src/inheritance-tax/netherlands/domain/types';
|
|
3
|
+
|
|
4
|
+
const netherlandsRules: Rules = {
|
|
5
|
+
taxClasses: {
|
|
6
|
+
Partner: {
|
|
7
|
+
exemption: 795156,
|
|
8
|
+
brackets: [
|
|
9
|
+
{ from: 0, to: 138642, rate: 0.10 },
|
|
10
|
+
{ from: 138642, to: null, rate: 0.20 },
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
Child: {
|
|
14
|
+
exemption: 25187,
|
|
15
|
+
brackets: [
|
|
16
|
+
{ from: 0, to: 138642, rate: 0.10 },
|
|
17
|
+
{ from: 138642, to: null, rate: 0.20 },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
Other: {
|
|
21
|
+
exemption: 2658,
|
|
22
|
+
brackets: [
|
|
23
|
+
{ from: 0, to: 138642, rate: 0.30 },
|
|
24
|
+
{ from: 138642, to: null, rate: 0.40 },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
describe('NetherlandsInheritanceTaxServiceImpl', () => {
|
|
31
|
+
it('returns zero tax for Partner estate below exemption', () => {
|
|
32
|
+
const input: Input = { estateValue: 500000, taxClass: 'Partner' };
|
|
33
|
+
const service = new NetherlandsInheritanceTaxServiceImpl(input, netherlandsRules);
|
|
34
|
+
const result = service.calculate();
|
|
35
|
+
expect(result.inheritanceTax).toBe(0);
|
|
36
|
+
expect(result.taxableEstate).toBe(0);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('correctly calculates Partner tax for estate above exemption', () => {
|
|
40
|
+
const input: Input = { estateValue: 933798, taxClass: 'Partner' }; // 138642 above exemption
|
|
41
|
+
const service = new NetherlandsInheritanceTaxServiceImpl(input, netherlandsRules);
|
|
42
|
+
const result = service.calculate();
|
|
43
|
+
// 138642 * 0.10 = 13864.2
|
|
44
|
+
expect(result.taxableEstate).toBe(138642);
|
|
45
|
+
expect(result.inheritanceTax).toBeCloseTo(13864.2, 2);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('correctly calculates Child tax with lower exemption', () => {
|
|
49
|
+
const input: Input = { estateValue: 125187, taxClass: 'Child' }; // 100000 above exemption
|
|
50
|
+
const service = new NetherlandsInheritanceTaxServiceImpl(input, netherlandsRules);
|
|
51
|
+
const result = service.calculate();
|
|
52
|
+
// 100000 * 0.10 = 10000
|
|
53
|
+
expect(result.taxableEstate).toBe(100000);
|
|
54
|
+
expect(result.inheritanceTax).toBe(10000);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('correctly calculates Other class with higher rates', () => {
|
|
58
|
+
const input: Input = { estateValue: 102658, taxClass: 'Other' }; // 100000 above exemption
|
|
59
|
+
const service = new NetherlandsInheritanceTaxServiceImpl(input, netherlandsRules);
|
|
60
|
+
const result = service.calculate();
|
|
61
|
+
// 100000 * 0.30 = 30000
|
|
62
|
+
expect(result.taxableEstate).toBe(100000);
|
|
63
|
+
expect(result.inheritanceTax).toBe(30000);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('returns zero for zero estate', () => {
|
|
67
|
+
const input: Input = { estateValue: 0, taxClass: 'Child' };
|
|
68
|
+
const service = new NetherlandsInheritanceTaxServiceImpl(input, netherlandsRules);
|
|
69
|
+
const result = service.calculate();
|
|
70
|
+
expect(result.inheritanceTax).toBe(0);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('calculates effective rate correctly', () => {
|
|
74
|
+
const input: Input = { estateValue: 1000000, taxClass: 'Child' };
|
|
75
|
+
const service = new NetherlandsInheritanceTaxServiceImpl(input, netherlandsRules);
|
|
76
|
+
const result = service.calculate();
|
|
77
|
+
expect(result.effectiveRate).toBe((result.inheritanceTax / 1000000) * 100);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { NetherlandsMortgageServiceImpl } from '../src/mortgage/netherlands/NetherlandsMortgageServiceImpl';
|
|
2
|
+
import { MortgageInput, MortgageRules } from '../src/mortgage/netherlands/domain/types';
|
|
3
|
+
|
|
4
|
+
const netherlandsRules: MortgageRules = {
|
|
5
|
+
loanConstraints: { maxLtvPercent: 1.0, maxAmortizationYears: 30 },
|
|
6
|
+
interest: { compounding: 'MONTHLY' },
|
|
7
|
+
transferTax: { primaryResidenceRate: 0.02, otherRate: 0.104 },
|
|
8
|
+
notaryFeeRate: 0.004,
|
|
9
|
+
landRegistryFeeRate: 0.001,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const input: MortgageInput = {
|
|
13
|
+
propertyPrice: 400000,
|
|
14
|
+
downPayment: 40000,
|
|
15
|
+
annualInterestRate: 3.0,
|
|
16
|
+
amortizationYears: 30,
|
|
17
|
+
isPrimaryResidence: true,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
describe('NetherlandsMortgageServiceImpl', () => {
|
|
21
|
+
it('correctly calculates the loan amount', () => {
|
|
22
|
+
const service = new NetherlandsMortgageServiceImpl();
|
|
23
|
+
const result = service.calculate(input, netherlandsRules);
|
|
24
|
+
expect(result.loanAmount).toBe(360000);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('correctly calculates transfer tax for primary residence', () => {
|
|
28
|
+
const service = new NetherlandsMortgageServiceImpl();
|
|
29
|
+
const result = service.calculate(input, netherlandsRules);
|
|
30
|
+
// 400000 * 0.02 = 8000
|
|
31
|
+
expect(result.transferTax).toBeCloseTo(8000, 2);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('correctly calculates transfer tax for non-primary residence', () => {
|
|
35
|
+
const service = new NetherlandsMortgageServiceImpl();
|
|
36
|
+
const nonPrimaryInput: MortgageInput = { ...input, isPrimaryResidence: false };
|
|
37
|
+
const result = service.calculate(nonPrimaryInput, netherlandsRules);
|
|
38
|
+
// 400000 * 0.104 = 41600
|
|
39
|
+
expect(result.transferTax).toBeCloseTo(41600, 2);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('correctly calculates notary fees', () => {
|
|
43
|
+
const service = new NetherlandsMortgageServiceImpl();
|
|
44
|
+
const result = service.calculate(input, netherlandsRules);
|
|
45
|
+
// 400000 * 0.004 = 1600
|
|
46
|
+
expect(result.notaryFees).toBeCloseTo(1600, 2);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('correctly calculates land registry fee', () => {
|
|
50
|
+
const service = new NetherlandsMortgageServiceImpl();
|
|
51
|
+
const result = service.calculate(input, netherlandsRules);
|
|
52
|
+
// 400000 * 0.001 = 400
|
|
53
|
+
expect(result.landRegistryFee).toBeCloseTo(400, 2);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('calculates a positive monthly payment', () => {
|
|
57
|
+
const service = new NetherlandsMortgageServiceImpl();
|
|
58
|
+
const result = service.calculate(input, netherlandsRules);
|
|
59
|
+
expect(result.monthlyPayment).toBeGreaterThan(0);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('total paid is greater than the loan amount', () => {
|
|
63
|
+
const service = new NetherlandsMortgageServiceImpl();
|
|
64
|
+
const result = service.calculate(input, netherlandsRules);
|
|
65
|
+
expect(result.totalPaid).toBeGreaterThan(result.loanAmount);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('amortization schedule has the correct number of years', () => {
|
|
69
|
+
const service = new NetherlandsMortgageServiceImpl();
|
|
70
|
+
const result = service.calculate(input, netherlandsRules);
|
|
71
|
+
expect(result.amortizationSchedule).toHaveLength(30);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('throws an error when down payment equals or exceeds property price', () => {
|
|
75
|
+
const service = new NetherlandsMortgageServiceImpl();
|
|
76
|
+
const badInput: MortgageInput = { ...input, downPayment: 400000 };
|
|
77
|
+
expect(() => service.calculate(badInput, netherlandsRules)).toThrow();
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { SouthAfricaInheritanceTaxServiceImpl } from '../src/inheritance-tax/south-africa/SouthAfricaInheritanceTaxServiceImpl';
|
|
2
|
+
import { Input, Rules } from '../src/inheritance-tax/south-africa/domain/types';
|
|
3
|
+
|
|
4
|
+
const southAfricaRules: Rules = {
|
|
5
|
+
primaryAbatement: 3500000,
|
|
6
|
+
taxBrackets: [
|
|
7
|
+
{ from: 0, to: 30000000, rate: 0.20 },
|
|
8
|
+
{ from: 30000000, to: null, rate: 0.25 },
|
|
9
|
+
],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
describe('SouthAfricaInheritanceTaxServiceImpl', () => {
|
|
13
|
+
it('returns zero tax for estate below primary abatement', () => {
|
|
14
|
+
const input: Input = { estateValue: 3000000, deductions: 0 };
|
|
15
|
+
const service = new SouthAfricaInheritanceTaxServiceImpl(input, southAfricaRules);
|
|
16
|
+
const result = service.calculate();
|
|
17
|
+
|
|
18
|
+
expect(result.inheritanceTax).toBe(0);
|
|
19
|
+
expect(result.taxableEstate).toBe(0);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('returns zero tax for estate at primary abatement', () => {
|
|
23
|
+
const input: Input = { estateValue: 3500000, deductions: 0 };
|
|
24
|
+
const service = new SouthAfricaInheritanceTaxServiceImpl(input, southAfricaRules);
|
|
25
|
+
const result = service.calculate();
|
|
26
|
+
|
|
27
|
+
expect(result.inheritanceTax).toBe(0);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('applies 20% rate for estate above abatement within first bracket', () => {
|
|
31
|
+
const input: Input = { estateValue: 13500000, deductions: 0 };
|
|
32
|
+
const service = new SouthAfricaInheritanceTaxServiceImpl(input, southAfricaRules);
|
|
33
|
+
const result = service.calculate();
|
|
34
|
+
|
|
35
|
+
// Taxable = 13500000 - 3500000 = 10000000
|
|
36
|
+
// 10000000 * 0.20 = 2000000
|
|
37
|
+
expect(result.taxableEstate).toBe(10000000);
|
|
38
|
+
expect(result.inheritanceTax).toBe(2000000);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('applies 25% rate for amounts above R30M bracket', () => {
|
|
42
|
+
const input: Input = { estateValue: 43500000, deductions: 0 };
|
|
43
|
+
const service = new SouthAfricaInheritanceTaxServiceImpl(input, southAfricaRules);
|
|
44
|
+
const result = service.calculate();
|
|
45
|
+
|
|
46
|
+
// Taxable = 43500000 - 3500000 = 40000000
|
|
47
|
+
// 30000000 * 0.20 = 6000000
|
|
48
|
+
// 10000000 * 0.25 = 2500000
|
|
49
|
+
// Total = 8500000
|
|
50
|
+
expect(result.taxableEstate).toBe(40000000);
|
|
51
|
+
expect(result.inheritanceTax).toBe(8500000);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('deductions reduce taxable estate', () => {
|
|
55
|
+
const input: Input = { estateValue: 13500000, deductions: 5000000 };
|
|
56
|
+
const service = new SouthAfricaInheritanceTaxServiceImpl(input, southAfricaRules);
|
|
57
|
+
const result = service.calculate();
|
|
58
|
+
|
|
59
|
+
// Net estate = 13500000 - 5000000 = 8500000
|
|
60
|
+
// Taxable = 8500000 - 3500000 = 5000000
|
|
61
|
+
// 5000000 * 0.20 = 1000000
|
|
62
|
+
expect(result.taxableEstate).toBe(5000000);
|
|
63
|
+
expect(result.inheritanceTax).toBe(1000000);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('returns zero for zero estate', () => {
|
|
67
|
+
const input: Input = { estateValue: 0, deductions: 0 };
|
|
68
|
+
const service = new SouthAfricaInheritanceTaxServiceImpl(input, southAfricaRules);
|
|
69
|
+
const result = service.calculate();
|
|
70
|
+
|
|
71
|
+
expect(result.inheritanceTax).toBe(0);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('calculates effective rate correctly', () => {
|
|
75
|
+
const input: Input = { estateValue: 13500000, deductions: 0 };
|
|
76
|
+
const service = new SouthAfricaInheritanceTaxServiceImpl(input, southAfricaRules);
|
|
77
|
+
const result = service.calculate();
|
|
78
|
+
|
|
79
|
+
expect(result.effectiveRate).toBe((result.inheritanceTax / 13500000) * 100);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SpainCapitalGainsServiceImpl } from '../src/capital-gains/spain/SpainCapitalGainsServiceImpl';
|
|
2
|
+
import { Input, Rules } from '../src/capital-gains/spain/domain/types';
|
|
3
|
+
|
|
4
|
+
const spainRules: Rules = {
|
|
5
|
+
brackets: [
|
|
6
|
+
{ from: 0, to: 6000, rate: 0.19 },
|
|
7
|
+
{ from: 6000, to: 50000, rate: 0.21 },
|
|
8
|
+
{ from: 50000, to: 200000, rate: 0.23 },
|
|
9
|
+
{ from: 200000, to: 300000, rate: 0.27 },
|
|
10
|
+
{ from: 300000, to: null, rate: 0.30 },
|
|
11
|
+
],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
describe('SpainCapitalGainsServiceImpl', () => {
|
|
15
|
+
it('returns zero tax for zero gain', () => {
|
|
16
|
+
const input: Input = { capitalGain: 0 };
|
|
17
|
+
const service = new SpainCapitalGainsServiceImpl(input, spainRules);
|
|
18
|
+
const result = service.calculate();
|
|
19
|
+
|
|
20
|
+
expect(result.taxableGain).toBe(0);
|
|
21
|
+
expect(result.capitalGainTax).toBe(0);
|
|
22
|
+
expect(result.totalTax).toBe(0);
|
|
23
|
+
expect(result.effectiveRate).toBe(0);
|
|
24
|
+
expect(result.breakdowns).toHaveLength(0);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('correctly calculates tax for gain in first bracket', () => {
|
|
28
|
+
const input: Input = { capitalGain: 3000 };
|
|
29
|
+
const service = new SpainCapitalGainsServiceImpl(input, spainRules);
|
|
30
|
+
const result = service.calculate();
|
|
31
|
+
|
|
32
|
+
// 0-3000: 3000 * 0.19 = 570
|
|
33
|
+
expect(result.capitalGainTax).toBe(570);
|
|
34
|
+
expect(result.totalTax).toBe(570);
|
|
35
|
+
expect(result.effectiveRate).toBeCloseTo(19, 2);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('correctly calculates tax spanning multiple brackets', () => {
|
|
39
|
+
const input: Input = { capitalGain: 100000 };
|
|
40
|
+
const service = new SpainCapitalGainsServiceImpl(input, spainRules);
|
|
41
|
+
const result = service.calculate();
|
|
42
|
+
|
|
43
|
+
// 0-6000: 6000 * 0.19 = 1140
|
|
44
|
+
// 6000-50000: 44000 * 0.21 = 9240
|
|
45
|
+
// 50000-100000: 50000 * 0.23 = 11500
|
|
46
|
+
// Total = 21880
|
|
47
|
+
expect(result.capitalGainTax).toBeCloseTo(21880, 2);
|
|
48
|
+
expect(result.totalTax).toBeCloseTo(21880, 2);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('taxable gain equals input capital gain', () => {
|
|
52
|
+
const input: Input = { capitalGain: 50000 };
|
|
53
|
+
const service = new SpainCapitalGainsServiceImpl(input, spainRules);
|
|
54
|
+
const result = service.calculate();
|
|
55
|
+
|
|
56
|
+
expect(result.taxableGain).toBe(50000);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('effective rate equals total tax divided by gain times 100', () => {
|
|
60
|
+
const input: Input = { capitalGain: 100000 };
|
|
61
|
+
const service = new SpainCapitalGainsServiceImpl(input, spainRules);
|
|
62
|
+
const result = service.calculate();
|
|
63
|
+
|
|
64
|
+
expect(result.effectiveRate).toBeCloseTo((result.capitalGainTax / 100000) * 100, 2);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SpainCorporateTaxServiceImpl } from '../src/corporate/spain/SpainCorporateTaxServiceImpl';
|
|
2
|
+
import { Input, Rules } from '../src/corporate/spain/domain/types';
|
|
3
|
+
|
|
4
|
+
const spainRules: Rules = {
|
|
5
|
+
regime: { type: 'flat', rate: 0.25 },
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
describe('SpainCorporateTaxServiceImpl', () => {
|
|
9
|
+
it('returns zero tax for zero income', () => {
|
|
10
|
+
const input: Input = { taxableIncome: 0 };
|
|
11
|
+
const service = new SpainCorporateTaxServiceImpl(input, spainRules);
|
|
12
|
+
const result = service.calculate();
|
|
13
|
+
|
|
14
|
+
expect(result.corporateTax).toBe(0);
|
|
15
|
+
expect(result.effectiveTaxRate).toBe(0);
|
|
16
|
+
expect(result.breakdowns).toHaveLength(0);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('correctly applies the flat 25% rate', () => {
|
|
20
|
+
const input: Input = { taxableIncome: 100000 };
|
|
21
|
+
const service = new SpainCorporateTaxServiceImpl(input, spainRules);
|
|
22
|
+
const result = service.calculate();
|
|
23
|
+
|
|
24
|
+
// 100000 * 0.25 = 25000
|
|
25
|
+
expect(result.corporateTax).toBe(25000);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('calculates effective tax rate as percentage', () => {
|
|
29
|
+
const input: Input = { taxableIncome: 100000 };
|
|
30
|
+
const service = new SpainCorporateTaxServiceImpl(input, spainRules);
|
|
31
|
+
const result = service.calculate();
|
|
32
|
+
|
|
33
|
+
expect(result.effectiveTaxRate).toBe(25);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('returns one breakdown entry for flat rate calculation', () => {
|
|
37
|
+
const input: Input = { taxableIncome: 100000 };
|
|
38
|
+
const service = new SpainCorporateTaxServiceImpl(input, spainRules);
|
|
39
|
+
const result = service.calculate();
|
|
40
|
+
|
|
41
|
+
expect(result.breakdowns).toHaveLength(1);
|
|
42
|
+
expect(result.breakdowns[0].rate).toBe(0.25);
|
|
43
|
+
expect(result.breakdowns[0].amount).toBe(25000);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('scales linearly with taxable income', () => {
|
|
47
|
+
const input: Input = { taxableIncome: 500000 };
|
|
48
|
+
const service = new SpainCorporateTaxServiceImpl(input, spainRules);
|
|
49
|
+
const result = service.calculate();
|
|
50
|
+
|
|
51
|
+
expect(result.corporateTax).toBe(125000);
|
|
52
|
+
expect(result.effectiveTaxRate).toBe(25);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { SpainIncomeTaxServiceImpl } from '../src/income-tax/spain/SpainIncomeTaxServiceImpl';
|
|
2
|
+
import { IncomeTaxRules } from '../src/income-tax/spain/domain/types';
|
|
3
|
+
|
|
4
|
+
const spainRules: IncomeTaxRules = {
|
|
5
|
+
taxBrackets: [
|
|
6
|
+
{ from: 0, to: 12450, rate: 0.19 },
|
|
7
|
+
{ from: 12450, to: 20200, rate: 0.24 },
|
|
8
|
+
{ from: 20200, to: 35200, rate: 0.30 },
|
|
9
|
+
{ from: 35200, to: 60000, rate: 0.37 },
|
|
10
|
+
{ from: 60000, to: 300000, rate: 0.45 },
|
|
11
|
+
{ from: 300000, to: null, rate: 0.47 },
|
|
12
|
+
],
|
|
13
|
+
socialContributions: { rate: 0.0635 },
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
describe('SpainIncomeTaxServiceImpl', () => {
|
|
17
|
+
it('returns zero tax for zero income', () => {
|
|
18
|
+
const service = new SpainIncomeTaxServiceImpl(0, spainRules);
|
|
19
|
+
const result = service.calculateNetIncome();
|
|
20
|
+
|
|
21
|
+
expect(result.incomeTax).toBe(0);
|
|
22
|
+
expect(result.socialContributions).toBe(0);
|
|
23
|
+
expect(result.totalDeductions).toBe(0);
|
|
24
|
+
expect(result.effectiveTaxRate).toBe(0);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('correctly calculates income tax for income in first bracket', () => {
|
|
28
|
+
const service = new SpainIncomeTaxServiceImpl(10000, spainRules);
|
|
29
|
+
const result = service.calculateNetIncome();
|
|
30
|
+
|
|
31
|
+
// 0-10000: 10000 * 0.19 = 1900
|
|
32
|
+
expect(result.incomeTax).toBeCloseTo(1900, 2);
|
|
33
|
+
expect(result.grossIncome).toBe(10000);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('correctly calculates social contributions', () => {
|
|
37
|
+
const service = new SpainIncomeTaxServiceImpl(10000, spainRules);
|
|
38
|
+
const result = service.calculateNetIncome();
|
|
39
|
+
|
|
40
|
+
// 10000 * 0.0635 = 635
|
|
41
|
+
expect(result.socialContributions).toBeCloseTo(635, 2);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('correctly calculates income tax spanning multiple brackets', () => {
|
|
45
|
+
const service = new SpainIncomeTaxServiceImpl(25000, spainRules);
|
|
46
|
+
const result = service.calculateNetIncome();
|
|
47
|
+
|
|
48
|
+
// 0-12450: 12450 * 0.19 = 2365.5
|
|
49
|
+
// 12450-20200: 7750 * 0.24 = 1860
|
|
50
|
+
// 20200-25000: 4800 * 0.30 = 1440
|
|
51
|
+
// Total = 5665.5
|
|
52
|
+
expect(result.incomeTax).toBeCloseTo(5665.5, 1);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('calculates effective tax rate as income tax divided by gross income', () => {
|
|
56
|
+
const service = new SpainIncomeTaxServiceImpl(25000, spainRules);
|
|
57
|
+
const result = service.calculateNetIncome();
|
|
58
|
+
|
|
59
|
+
expect(result.effectiveTaxRate).toBeCloseTo(result.incomeTax / result.grossIncome, 4);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('net income equals gross income minus total deductions', () => {
|
|
63
|
+
const service = new SpainIncomeTaxServiceImpl(25000, spainRules);
|
|
64
|
+
const result = service.calculateNetIncome();
|
|
65
|
+
|
|
66
|
+
expect(result.netIncome).toBeCloseTo(result.grossIncome - result.totalDeductions, 2);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('total deductions equals income tax plus social contributions', () => {
|
|
70
|
+
const service = new SpainIncomeTaxServiceImpl(25000, spainRules);
|
|
71
|
+
const result = service.calculateNetIncome();
|
|
72
|
+
|
|
73
|
+
expect(result.totalDeductions).toBeCloseTo(result.incomeTax + result.socialContributions, 2);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('applies highest bracket rate to income above 300000', () => {
|
|
77
|
+
const service = new SpainIncomeTaxServiceImpl(350000, spainRules);
|
|
78
|
+
const result = service.calculateNetIncome();
|
|
79
|
+
|
|
80
|
+
expect(result.incomeTax).toBeGreaterThan(0);
|
|
81
|
+
const lastBreakdown = result.taxBracketBreakdown[result.taxBracketBreakdown.length - 1];
|
|
82
|
+
expect(lastBreakdown.rate).toBe(0.47);
|
|
83
|
+
});
|
|
84
|
+
});
|