@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,122 @@
|
|
|
1
|
+
// Canada
|
|
2
|
+
import { CanadaInheritanceTaxServiceImpl as CanadaInheritanceTaxService } from './canada/CanadaInheritanceTaxServiceImpl';
|
|
3
|
+
import {
|
|
4
|
+
Input as CanadaInheritanceTaxInput,
|
|
5
|
+
Rules as CanadaInheritanceTaxRules,
|
|
6
|
+
Result as CanadaInheritanceTaxResult,
|
|
7
|
+
} from './canada/domain/types';
|
|
8
|
+
|
|
9
|
+
// France
|
|
10
|
+
import { FranceInheritanceTaxServiceImpl as FranceInheritanceTaxService } from './france/FranceInheritanceTaxServiceImpl';
|
|
11
|
+
import {
|
|
12
|
+
Input as FranceInheritanceTaxInput,
|
|
13
|
+
Rules as FranceInheritanceTaxRules,
|
|
14
|
+
Result as FranceInheritanceTaxResult,
|
|
15
|
+
} from './france/domain/types';
|
|
16
|
+
|
|
17
|
+
// South Africa
|
|
18
|
+
import { SouthAfricaInheritanceTaxServiceImpl as SouthAfricaInheritanceTaxService } from './south-africa/SouthAfricaInheritanceTaxServiceImpl';
|
|
19
|
+
import {
|
|
20
|
+
Input as SouthAfricaInheritanceTaxInput,
|
|
21
|
+
Rules as SouthAfricaInheritanceTaxRules,
|
|
22
|
+
Result as SouthAfricaInheritanceTaxResult,
|
|
23
|
+
} from './south-africa/domain/types';
|
|
24
|
+
|
|
25
|
+
// Australia
|
|
26
|
+
import { AustraliaInheritanceTaxServiceImpl as AustraliaInheritanceTaxService } from './australia/AustraliaInheritanceTaxServiceImpl';
|
|
27
|
+
import {
|
|
28
|
+
Input as AustraliaInheritanceTaxInput,
|
|
29
|
+
Rules as AustraliaInheritanceTaxRules,
|
|
30
|
+
Result as AustraliaInheritanceTaxResult,
|
|
31
|
+
} from './australia/domain/types';
|
|
32
|
+
|
|
33
|
+
// UK
|
|
34
|
+
import { UKInheritanceTaxServiceImpl as UKInheritanceTaxService } from './uk/UKInheritanceTaxServiceImpl';
|
|
35
|
+
import {
|
|
36
|
+
Input as UKInheritanceTaxInput,
|
|
37
|
+
Rules as UKInheritanceTaxRules,
|
|
38
|
+
Result as UKInheritanceTaxResult,
|
|
39
|
+
} from './uk/domain/types';
|
|
40
|
+
|
|
41
|
+
// USA
|
|
42
|
+
import { USAInheritanceTaxServiceImpl as USAInheritanceTaxService } from './usa/USAInheritanceTaxServiceImpl';
|
|
43
|
+
import {
|
|
44
|
+
Input as USAInheritanceTaxInput,
|
|
45
|
+
Rules as USAInheritanceTaxRules,
|
|
46
|
+
Result as USAInheritanceTaxResult,
|
|
47
|
+
} from './usa/domain/types';
|
|
48
|
+
|
|
49
|
+
// Germany
|
|
50
|
+
import { GermanyInheritanceTaxServiceImpl as GermanyInheritanceTaxService } from './germany/GermanyInheritanceTaxServiceImpl';
|
|
51
|
+
import {
|
|
52
|
+
Input as GermanyInheritanceTaxInput,
|
|
53
|
+
Rules as GermanyInheritanceTaxRules,
|
|
54
|
+
Result as GermanyInheritanceTaxResult,
|
|
55
|
+
} from './germany/domain/types';
|
|
56
|
+
|
|
57
|
+
// Spain
|
|
58
|
+
import { SpainInheritanceTaxServiceImpl as SpainInheritanceTaxService } from './spain/SpainInheritanceTaxServiceImpl';
|
|
59
|
+
import {
|
|
60
|
+
Input as SpainInheritanceTaxInput,
|
|
61
|
+
Rules as SpainInheritanceTaxRules,
|
|
62
|
+
Result as SpainInheritanceTaxResult,
|
|
63
|
+
} from './spain/domain/types';
|
|
64
|
+
|
|
65
|
+
// Japan
|
|
66
|
+
import { JapanInheritanceTaxServiceImpl as JapanInheritanceTaxService } from './japan/JapanInheritanceTaxServiceImpl';
|
|
67
|
+
import {
|
|
68
|
+
Input as JapanInheritanceTaxInput,
|
|
69
|
+
Rules as JapanInheritanceTaxRules,
|
|
70
|
+
Result as JapanInheritanceTaxResult,
|
|
71
|
+
} from './japan/domain/types';
|
|
72
|
+
|
|
73
|
+
// Netherlands
|
|
74
|
+
import { NetherlandsInheritanceTaxServiceImpl as NetherlandsInheritanceTaxService } from './netherlands/NetherlandsInheritanceTaxServiceImpl';
|
|
75
|
+
import {
|
|
76
|
+
Input as NetherlandsInheritanceTaxInput,
|
|
77
|
+
Rules as NetherlandsInheritanceTaxRules,
|
|
78
|
+
Result as NetherlandsInheritanceTaxResult,
|
|
79
|
+
} from './netherlands/domain/types';
|
|
80
|
+
|
|
81
|
+
export {
|
|
82
|
+
CanadaInheritanceTaxService,
|
|
83
|
+
CanadaInheritanceTaxInput,
|
|
84
|
+
CanadaInheritanceTaxRules,
|
|
85
|
+
CanadaInheritanceTaxResult,
|
|
86
|
+
FranceInheritanceTaxService,
|
|
87
|
+
FranceInheritanceTaxInput,
|
|
88
|
+
FranceInheritanceTaxRules,
|
|
89
|
+
FranceInheritanceTaxResult,
|
|
90
|
+
SouthAfricaInheritanceTaxService,
|
|
91
|
+
SouthAfricaInheritanceTaxInput,
|
|
92
|
+
SouthAfricaInheritanceTaxRules,
|
|
93
|
+
SouthAfricaInheritanceTaxResult,
|
|
94
|
+
AustraliaInheritanceTaxService,
|
|
95
|
+
AustraliaInheritanceTaxInput,
|
|
96
|
+
AustraliaInheritanceTaxRules,
|
|
97
|
+
AustraliaInheritanceTaxResult,
|
|
98
|
+
UKInheritanceTaxService,
|
|
99
|
+
UKInheritanceTaxInput,
|
|
100
|
+
UKInheritanceTaxRules,
|
|
101
|
+
UKInheritanceTaxResult,
|
|
102
|
+
USAInheritanceTaxService,
|
|
103
|
+
USAInheritanceTaxInput,
|
|
104
|
+
USAInheritanceTaxRules,
|
|
105
|
+
USAInheritanceTaxResult,
|
|
106
|
+
GermanyInheritanceTaxService,
|
|
107
|
+
GermanyInheritanceTaxInput,
|
|
108
|
+
GermanyInheritanceTaxRules,
|
|
109
|
+
GermanyInheritanceTaxResult,
|
|
110
|
+
SpainInheritanceTaxService,
|
|
111
|
+
SpainInheritanceTaxInput,
|
|
112
|
+
SpainInheritanceTaxRules,
|
|
113
|
+
SpainInheritanceTaxResult,
|
|
114
|
+
JapanInheritanceTaxService,
|
|
115
|
+
JapanInheritanceTaxInput,
|
|
116
|
+
JapanInheritanceTaxRules,
|
|
117
|
+
JapanInheritanceTaxResult,
|
|
118
|
+
NetherlandsInheritanceTaxService,
|
|
119
|
+
NetherlandsInheritanceTaxInput,
|
|
120
|
+
NetherlandsInheritanceTaxRules,
|
|
121
|
+
NetherlandsInheritanceTaxResult,
|
|
122
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { JapanInheritanceTaxService } from "./JapanInheritanceTaxService";
|
|
3
|
+
import { Input, Result, Rules, TaxBracket } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class JapanInheritanceTaxServiceImpl implements JapanInheritanceTaxService {
|
|
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 estate = this._input.estateValue;
|
|
16
|
+
const heirs = Math.max(1, this._input.numberOfStatutoryHeirs);
|
|
17
|
+
const exemption = this._rules.baseExemption + this._rules.perHeirExemption * heirs;
|
|
18
|
+
|
|
19
|
+
if (estate <= 0 || estate <= exemption) {
|
|
20
|
+
return {
|
|
21
|
+
taxableEstate: 0,
|
|
22
|
+
inheritanceTax: 0,
|
|
23
|
+
effectiveRate: 0,
|
|
24
|
+
breakdowns: [],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const taxableEstate = estate - exemption;
|
|
29
|
+
const { tax, breakdowns } = this.applyBrackets(taxableEstate, this._rules.taxBrackets);
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
taxableEstate,
|
|
33
|
+
inheritanceTax: tax,
|
|
34
|
+
effectiveRate: estate > 0 ? (tax / estate) * 100 : 0,
|
|
35
|
+
breakdowns,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private applyBrackets(
|
|
40
|
+
taxableAmount: number,
|
|
41
|
+
brackets: TaxBracket[],
|
|
42
|
+
): { tax: number; breakdowns: Breakdown[] } {
|
|
43
|
+
let tax = 0;
|
|
44
|
+
const breakdowns: Breakdown[] = [];
|
|
45
|
+
|
|
46
|
+
for (const bracket of brackets) {
|
|
47
|
+
if (taxableAmount <= bracket.from) break;
|
|
48
|
+
|
|
49
|
+
const upper = bracket.to ?? taxableAmount;
|
|
50
|
+
const taxable = Math.min(upper, taxableAmount) - bracket.from;
|
|
51
|
+
|
|
52
|
+
if (taxable > 0) {
|
|
53
|
+
const bracketTax = taxable * bracket.rate;
|
|
54
|
+
tax += bracketTax;
|
|
55
|
+
|
|
56
|
+
breakdowns.push({
|
|
57
|
+
from: `${bracket.from}`,
|
|
58
|
+
to: `${bracket.to ?? 'Above'}`,
|
|
59
|
+
rate: bracket.rate,
|
|
60
|
+
amount: bracketTax,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return { tax, breakdowns };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface TaxBracket {
|
|
4
|
+
from: number;
|
|
5
|
+
to: number | null;
|
|
6
|
+
rate: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Rules {
|
|
10
|
+
baseExemption: number;
|
|
11
|
+
perHeirExemption: number;
|
|
12
|
+
taxBrackets: TaxBracket[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Input {
|
|
16
|
+
estateValue: number;
|
|
17
|
+
numberOfStatutoryHeirs: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface Result {
|
|
21
|
+
taxableEstate: number;
|
|
22
|
+
inheritanceTax: number;
|
|
23
|
+
effectiveRate: number;
|
|
24
|
+
breakdowns: Breakdown[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { NetherlandsInheritanceTaxService } from "./NetherlandsInheritanceTaxService";
|
|
3
|
+
import { Input, Result, Rules, TaxBracket } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class NetherlandsInheritanceTaxServiceImpl implements NetherlandsInheritanceTaxService {
|
|
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 estate = this._input.estateValue;
|
|
16
|
+
const taxClass = this._rules.taxClasses[this._input.taxClass];
|
|
17
|
+
|
|
18
|
+
if (estate <= 0 || estate <= taxClass.exemption) {
|
|
19
|
+
return {
|
|
20
|
+
taxableEstate: 0,
|
|
21
|
+
inheritanceTax: 0,
|
|
22
|
+
effectiveRate: 0,
|
|
23
|
+
breakdowns: [],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const taxableEstate = estate - taxClass.exemption;
|
|
28
|
+
const { tax, breakdowns } = this.applyBrackets(taxableEstate, taxClass.brackets);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
taxableEstate,
|
|
32
|
+
inheritanceTax: tax,
|
|
33
|
+
effectiveRate: estate > 0 ? (tax / estate) * 100 : 0,
|
|
34
|
+
breakdowns,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private applyBrackets(
|
|
39
|
+
taxableAmount: number,
|
|
40
|
+
brackets: TaxBracket[],
|
|
41
|
+
): { tax: number; breakdowns: Breakdown[] } {
|
|
42
|
+
let tax = 0;
|
|
43
|
+
const breakdowns: Breakdown[] = [];
|
|
44
|
+
|
|
45
|
+
for (const bracket of brackets) {
|
|
46
|
+
if (taxableAmount <= bracket.from) break;
|
|
47
|
+
|
|
48
|
+
const upper = bracket.to ?? taxableAmount;
|
|
49
|
+
const taxable = Math.min(upper, taxableAmount) - bracket.from;
|
|
50
|
+
|
|
51
|
+
if (taxable > 0) {
|
|
52
|
+
const bracketTax = taxable * bracket.rate;
|
|
53
|
+
tax += bracketTax;
|
|
54
|
+
|
|
55
|
+
breakdowns.push({
|
|
56
|
+
from: `${bracket.from}`,
|
|
57
|
+
to: `${bracket.to ?? 'Above'}`,
|
|
58
|
+
rate: bracket.rate,
|
|
59
|
+
amount: bracketTax,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return { tax, breakdowns };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface TaxBracket {
|
|
4
|
+
from: number;
|
|
5
|
+
to: number | null;
|
|
6
|
+
rate: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface TaxClass {
|
|
10
|
+
exemption: number;
|
|
11
|
+
brackets: TaxBracket[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type TaxClassName = 'Partner' | 'Child' | 'Other';
|
|
15
|
+
|
|
16
|
+
export interface Rules {
|
|
17
|
+
taxClasses: {
|
|
18
|
+
Partner: TaxClass;
|
|
19
|
+
Child: TaxClass;
|
|
20
|
+
Other: TaxClass;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface Input {
|
|
25
|
+
estateValue: number;
|
|
26
|
+
taxClass: TaxClassName;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface Result {
|
|
30
|
+
taxableEstate: number;
|
|
31
|
+
inheritanceTax: number;
|
|
32
|
+
effectiveRate: number;
|
|
33
|
+
breakdowns: Breakdown[];
|
|
34
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { SouthAfricaInheritanceTaxService } from "./SouthAfricaInheritanceTaxService";
|
|
3
|
+
import { Input, Result, Rules, TaxBracket } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class SouthAfricaInheritanceTaxServiceImpl implements SouthAfricaInheritanceTaxService {
|
|
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 estate = this._input.estateValue;
|
|
16
|
+
const netEstate = estate - this._input.deductions;
|
|
17
|
+
|
|
18
|
+
if (netEstate <= 0 || netEstate <= this._rules.primaryAbatement) {
|
|
19
|
+
return {
|
|
20
|
+
taxableEstate: 0,
|
|
21
|
+
inheritanceTax: 0,
|
|
22
|
+
effectiveRate: 0,
|
|
23
|
+
breakdowns: [],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const taxableEstate = netEstate - this._rules.primaryAbatement;
|
|
28
|
+
const { tax, breakdowns } = this.applyBrackets(taxableEstate, this._rules.taxBrackets);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
taxableEstate,
|
|
32
|
+
inheritanceTax: tax,
|
|
33
|
+
effectiveRate: estate > 0 ? (tax / estate) * 100 : 0,
|
|
34
|
+
breakdowns,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private applyBrackets(
|
|
39
|
+
taxableAmount: number,
|
|
40
|
+
brackets: TaxBracket[],
|
|
41
|
+
): { tax: number; breakdowns: Breakdown[] } {
|
|
42
|
+
let tax = 0;
|
|
43
|
+
const breakdowns: Breakdown[] = [];
|
|
44
|
+
|
|
45
|
+
for (const bracket of brackets) {
|
|
46
|
+
if (taxableAmount <= bracket.from) break;
|
|
47
|
+
|
|
48
|
+
const upper = bracket.to ?? taxableAmount;
|
|
49
|
+
const taxable = Math.min(upper, taxableAmount) - bracket.from;
|
|
50
|
+
|
|
51
|
+
if (taxable > 0) {
|
|
52
|
+
const bracketTax = taxable * bracket.rate;
|
|
53
|
+
tax += bracketTax;
|
|
54
|
+
|
|
55
|
+
breakdowns.push({
|
|
56
|
+
from: `${bracket.from}`,
|
|
57
|
+
to: `${bracket.to ?? 'Above'}`,
|
|
58
|
+
rate: bracket.rate,
|
|
59
|
+
amount: bracketTax,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return { tax, breakdowns };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface TaxBracket {
|
|
4
|
+
from: number;
|
|
5
|
+
to: number | null;
|
|
6
|
+
rate: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Rules {
|
|
10
|
+
primaryAbatement: number;
|
|
11
|
+
taxBrackets: TaxBracket[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Input {
|
|
15
|
+
estateValue: number;
|
|
16
|
+
deductions: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface Result {
|
|
20
|
+
taxableEstate: number;
|
|
21
|
+
inheritanceTax: number;
|
|
22
|
+
effectiveRate: number;
|
|
23
|
+
breakdowns: Breakdown[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { SpainInheritanceTaxService } from "./SpainInheritanceTaxService";
|
|
3
|
+
import { Input, Result, Rules, TaxBracket } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class SpainInheritanceTaxServiceImpl implements SpainInheritanceTaxService {
|
|
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 estate = this._input.estateValue;
|
|
16
|
+
|
|
17
|
+
if (estate <= 0 || estate <= this._rules.exemption) {
|
|
18
|
+
return {
|
|
19
|
+
taxableEstate: 0,
|
|
20
|
+
inheritanceTax: 0,
|
|
21
|
+
effectiveRate: 0,
|
|
22
|
+
breakdowns: [],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const taxableEstate = estate - this._rules.exemption;
|
|
27
|
+
const { tax, breakdowns } = this.applyBrackets(taxableEstate, this._rules.taxBrackets);
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
taxableEstate,
|
|
31
|
+
inheritanceTax: tax,
|
|
32
|
+
effectiveRate: estate > 0 ? (tax / estate) * 100 : 0,
|
|
33
|
+
breakdowns,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private applyBrackets(
|
|
38
|
+
taxableAmount: number,
|
|
39
|
+
brackets: TaxBracket[],
|
|
40
|
+
): { tax: number; breakdowns: Breakdown[] } {
|
|
41
|
+
let tax = 0;
|
|
42
|
+
const breakdowns: Breakdown[] = [];
|
|
43
|
+
|
|
44
|
+
for (const bracket of brackets) {
|
|
45
|
+
if (taxableAmount <= bracket.from) break;
|
|
46
|
+
|
|
47
|
+
const upper = bracket.to ?? taxableAmount;
|
|
48
|
+
const taxable = Math.min(upper, taxableAmount) - bracket.from;
|
|
49
|
+
|
|
50
|
+
if (taxable > 0) {
|
|
51
|
+
const bracketTax = taxable * bracket.rate;
|
|
52
|
+
tax += bracketTax;
|
|
53
|
+
|
|
54
|
+
breakdowns.push({
|
|
55
|
+
from: `${bracket.from}`,
|
|
56
|
+
to: `${bracket.to ?? 'Above'}`,
|
|
57
|
+
rate: bracket.rate,
|
|
58
|
+
amount: bracketTax,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return { tax, breakdowns };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface TaxBracket {
|
|
4
|
+
from: number;
|
|
5
|
+
to: number | null;
|
|
6
|
+
rate: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Rules {
|
|
10
|
+
exemption: number;
|
|
11
|
+
taxBrackets: TaxBracket[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Input {
|
|
15
|
+
estateValue: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Result {
|
|
19
|
+
taxableEstate: number;
|
|
20
|
+
inheritanceTax: number;
|
|
21
|
+
effectiveRate: number;
|
|
22
|
+
breakdowns: Breakdown[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { UKInheritanceTaxService } from "./UKInheritanceTaxService";
|
|
3
|
+
import { Input, Result, Rules } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class UKInheritanceTaxServiceImpl implements UKInheritanceTaxService {
|
|
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 estate = this._input.estateValue;
|
|
16
|
+
|
|
17
|
+
if (estate <= 0 || estate <= this._rules.nilRateBand) {
|
|
18
|
+
return {
|
|
19
|
+
taxableEstate: 0,
|
|
20
|
+
inheritanceTax: 0,
|
|
21
|
+
effectiveRate: 0,
|
|
22
|
+
breakdowns: [],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const taxableEstate = estate - this._rules.nilRateBand;
|
|
27
|
+
const rate = this._input.charitableGivingPercent >= this._rules.charityThreshold
|
|
28
|
+
? this._rules.charityRate
|
|
29
|
+
: this._rules.standardRate;
|
|
30
|
+
const tax = taxableEstate * rate;
|
|
31
|
+
|
|
32
|
+
const breakdowns: Breakdown[] = [{
|
|
33
|
+
from: `${this._rules.nilRateBand}`,
|
|
34
|
+
to: 'Above',
|
|
35
|
+
rate,
|
|
36
|
+
amount: tax,
|
|
37
|
+
}];
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
taxableEstate,
|
|
41
|
+
inheritanceTax: tax,
|
|
42
|
+
effectiveRate: estate > 0 ? (tax / estate) * 100 : 0,
|
|
43
|
+
breakdowns,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Breakdown } from "../../domain/types";
|
|
2
|
+
|
|
3
|
+
export interface Rules {
|
|
4
|
+
nilRateBand: number;
|
|
5
|
+
standardRate: number;
|
|
6
|
+
charityRate: number;
|
|
7
|
+
charityThreshold: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface Input {
|
|
11
|
+
estateValue: number;
|
|
12
|
+
charitableGivingPercent: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Result {
|
|
16
|
+
taxableEstate: number;
|
|
17
|
+
inheritanceTax: number;
|
|
18
|
+
effectiveRate: number;
|
|
19
|
+
breakdowns: Breakdown[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Breakdown } from "../domain/types";
|
|
2
|
+
import { USAInheritanceTaxService } from "./USAInheritanceTaxService";
|
|
3
|
+
import { Input, Result, Rules, TaxBracket } from "./domain/types";
|
|
4
|
+
|
|
5
|
+
export class USAInheritanceTaxServiceImpl implements USAInheritanceTaxService {
|
|
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 estate = this._input.estateValue;
|
|
16
|
+
|
|
17
|
+
if (estate <= 0 || estate <= this._rules.exemption) {
|
|
18
|
+
return {
|
|
19
|
+
taxableEstate: 0,
|
|
20
|
+
inheritanceTax: 0,
|
|
21
|
+
effectiveRate: 0,
|
|
22
|
+
breakdowns: [],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const taxableEstate = estate - this._rules.exemption;
|
|
27
|
+
const { tax, breakdowns } = this.applyBrackets(taxableEstate, this._rules.taxBrackets);
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
taxableEstate,
|
|
31
|
+
inheritanceTax: tax,
|
|
32
|
+
effectiveRate: estate > 0 ? (tax / estate) * 100 : 0,
|
|
33
|
+
breakdowns,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private applyBrackets(
|
|
38
|
+
taxableAmount: number,
|
|
39
|
+
brackets: TaxBracket[],
|
|
40
|
+
): { tax: number; breakdowns: Breakdown[] } {
|
|
41
|
+
let tax = 0;
|
|
42
|
+
const breakdowns: Breakdown[] = [];
|
|
43
|
+
|
|
44
|
+
for (const bracket of brackets) {
|
|
45
|
+
if (taxableAmount <= bracket.from) break;
|
|
46
|
+
|
|
47
|
+
const upper = bracket.to ?? taxableAmount;
|
|
48
|
+
const taxable = Math.min(upper, taxableAmount) - bracket.from;
|
|
49
|
+
|
|
50
|
+
if (taxable > 0) {
|
|
51
|
+
const bracketTax = taxable * bracket.rate;
|
|
52
|
+
tax += bracketTax;
|
|
53
|
+
|
|
54
|
+
breakdowns.push({
|
|
55
|
+
from: `${bracket.from}`,
|
|
56
|
+
to: `${bracket.to ?? 'Above'}`,
|
|
57
|
+
rate: bracket.rate,
|
|
58
|
+
amount: bracketTax,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return { tax, breakdowns };
|
|
64
|
+
}
|
|
65
|
+
}
|