@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.
Files changed (391) hide show
  1. package/all-commits.bundle +0 -0
  2. package/dist/capital-gains/brazil/BrazilCapitalGainsService.js +3 -0
  3. package/dist/capital-gains/brazil/BrazilCapitalGainsServiceImpl.js +56 -0
  4. package/dist/capital-gains/brazil/domain/types.js +3 -0
  5. package/dist/capital-gains/canada/CanadaCapitalGainsServiceImpl.js +29 -17
  6. package/dist/capital-gains/index.js +17 -2
  7. package/dist/capital-gains/india/IndiaCapitalGainsService.js +3 -0
  8. package/dist/capital-gains/india/IndiaCapitalGainsServiceImpl.js +58 -0
  9. package/dist/capital-gains/india/domain/types.js +3 -0
  10. package/dist/capital-gains/israel/IsraelCapitalGainsService.js +3 -0
  11. package/dist/capital-gains/israel/IsraelCapitalGainsServiceImpl.js +56 -0
  12. package/dist/capital-gains/israel/domain/types.js +3 -0
  13. package/dist/capital-gains/japan/JapanCapitalGainsService.js +3 -0
  14. package/dist/capital-gains/japan/JapanCapitalGainsServiceImpl.js +41 -0
  15. package/dist/capital-gains/japan/domain/types.js +3 -0
  16. package/dist/capital-gains/spain/SpainCapitalGainsService.js +3 -0
  17. package/dist/capital-gains/spain/SpainCapitalGainsServiceImpl.js +56 -0
  18. package/dist/capital-gains/spain/domain/types.js +3 -0
  19. package/dist/corporate/brazil/BrazilCorporateTaxService.js +3 -0
  20. package/dist/corporate/brazil/BrazilCorporateTaxServiceImpl.js +33 -0
  21. package/dist/corporate/brazil/domain/types.js +3 -0
  22. package/dist/corporate/index.js +19 -2
  23. package/dist/corporate/india/IndiaCorporateTaxService.js +3 -0
  24. package/dist/corporate/india/IndiaCorporateTaxServiceImpl.js +29 -0
  25. package/dist/corporate/india/domain/types.js +3 -0
  26. package/dist/corporate/israel/IsraelCorporateTaxService.js +3 -0
  27. package/dist/corporate/israel/IsraelCorporateTaxServiceImpl.js +29 -0
  28. package/dist/corporate/israel/domain/types.js +3 -0
  29. package/dist/corporate/japan/JapanCorporateTaxService.js +3 -0
  30. package/dist/corporate/japan/JapanCorporateTaxServiceImpl.js +29 -0
  31. package/dist/corporate/japan/domain/types.js +3 -0
  32. package/dist/corporate/netherlands/NetherlandsCorporateTaxService.js +3 -0
  33. package/dist/corporate/netherlands/NetherlandsCorporateTaxServiceImpl.js +40 -0
  34. package/dist/corporate/netherlands/domain/types.js +3 -0
  35. package/dist/corporate/spain/SpainCorporateTaxService.js +3 -0
  36. package/dist/corporate/spain/SpainCorporateTaxServiceImpl.js +29 -0
  37. package/dist/corporate/spain/domain/types.js +3 -0
  38. package/dist/corporate/switzerland/SwitzerlandCorporateTaxService.js +3 -0
  39. package/dist/corporate/switzerland/SwitzerlandCorporateTaxServiceImpl.js +29 -0
  40. package/dist/corporate/switzerland/domain/types.js +3 -0
  41. package/dist/income-tax/brazil/BrazilIncomeTaxService.js +3 -0
  42. package/dist/income-tax/brazil/BrazilIncomeTaxServiceImpl.js +78 -0
  43. package/dist/income-tax/brazil/domain/types.js +3 -0
  44. package/dist/income-tax/index.js +23 -2
  45. package/dist/income-tax/india/IndiaIncomeTaxService.js +3 -0
  46. package/dist/income-tax/india/IndiaIncomeTaxServiceImpl.js +75 -0
  47. package/dist/income-tax/india/domain/types.js +3 -0
  48. package/dist/income-tax/israel/IsraelIncomeTaxService.js +3 -0
  49. package/dist/income-tax/israel/IsraelIncomeTaxServiceImpl.js +62 -0
  50. package/dist/income-tax/israel/domain/types.js +3 -0
  51. package/dist/income-tax/japan/JapanIncomeTaxService.js +3 -0
  52. package/dist/income-tax/japan/JapanIncomeTaxServiceImpl.js +75 -0
  53. package/dist/income-tax/japan/domain/types.js +3 -0
  54. package/dist/income-tax/netherlands/NetherlandsIncomeTaxService.js +3 -0
  55. package/dist/income-tax/netherlands/NetherlandsIncomeTaxServiceImpl.js +62 -0
  56. package/dist/income-tax/netherlands/domain/types.js +3 -0
  57. package/dist/income-tax/spain/SpainIncomeTaxService.js +3 -0
  58. package/dist/income-tax/spain/SpainIncomeTaxServiceImpl.js +62 -0
  59. package/dist/income-tax/spain/domain/types.js +3 -0
  60. package/dist/income-tax/switzerland/SwitzerlandIncomeTaxService.js +3 -0
  61. package/dist/income-tax/switzerland/SwitzerlandIncomeTaxServiceImpl.js +62 -0
  62. package/dist/income-tax/switzerland/domain/types.js +3 -0
  63. package/dist/index.js +3 -2
  64. package/dist/inheritance-tax/australia/AustraliaInheritanceTaxService.js +3 -0
  65. package/dist/inheritance-tax/australia/AustraliaInheritanceTaxServiceImpl.js +19 -0
  66. package/dist/inheritance-tax/australia/domain/types.js +3 -0
  67. package/dist/inheritance-tax/canada/CanadaInheritanceTaxService.js +3 -0
  68. package/dist/inheritance-tax/canada/CanadaInheritanceTaxServiceImpl.js +51 -0
  69. package/dist/inheritance-tax/canada/domain/types.js +3 -0
  70. package/dist/inheritance-tax/domain/types.js +3 -0
  71. package/dist/inheritance-tax/france/FranceInheritanceTaxService.js +3 -0
  72. package/dist/inheritance-tax/france/FranceInheritanceTaxServiceImpl.js +52 -0
  73. package/dist/inheritance-tax/france/domain/types.js +3 -0
  74. package/dist/inheritance-tax/germany/GermanyInheritanceTaxService.js +3 -0
  75. package/dist/inheritance-tax/germany/GermanyInheritanceTaxServiceImpl.js +52 -0
  76. package/dist/inheritance-tax/germany/domain/types.js +3 -0
  77. package/dist/inheritance-tax/index.js +34 -0
  78. package/dist/inheritance-tax/japan/JapanInheritanceTaxService.js +3 -0
  79. package/dist/inheritance-tax/japan/JapanInheritanceTaxServiceImpl.js +53 -0
  80. package/dist/inheritance-tax/japan/domain/types.js +3 -0
  81. package/dist/inheritance-tax/netherlands/NetherlandsInheritanceTaxService.js +3 -0
  82. package/dist/inheritance-tax/netherlands/NetherlandsInheritanceTaxServiceImpl.js +52 -0
  83. package/dist/inheritance-tax/netherlands/domain/types.js +3 -0
  84. package/dist/inheritance-tax/south-africa/SouthAfricaInheritanceTaxService.js +3 -0
  85. package/dist/inheritance-tax/south-africa/SouthAfricaInheritanceTaxServiceImpl.js +52 -0
  86. package/dist/inheritance-tax/south-africa/domain/types.js +3 -0
  87. package/dist/inheritance-tax/spain/SpainInheritanceTaxService.js +3 -0
  88. package/dist/inheritance-tax/spain/SpainInheritanceTaxServiceImpl.js +51 -0
  89. package/dist/inheritance-tax/spain/domain/types.js +3 -0
  90. package/dist/inheritance-tax/uk/UKInheritanceTaxService.js +3 -0
  91. package/dist/inheritance-tax/uk/UKInheritanceTaxServiceImpl.js +39 -0
  92. package/dist/inheritance-tax/uk/domain/types.js +3 -0
  93. package/dist/inheritance-tax/usa/USAInheritanceTaxService.js +3 -0
  94. package/dist/inheritance-tax/usa/USAInheritanceTaxServiceImpl.js +51 -0
  95. package/dist/inheritance-tax/usa/domain/types.js +3 -0
  96. package/dist/mortgage/brazil/BrazilMortgageService.js +3 -0
  97. package/dist/mortgage/brazil/BrazilMortgageServiceImpl.js +76 -0
  98. package/dist/mortgage/brazil/domain/types.js +3 -0
  99. package/dist/mortgage/index.js +23 -2
  100. package/dist/mortgage/india/IndiaMortgageService.js +3 -0
  101. package/dist/mortgage/india/IndiaMortgageServiceImpl.js +76 -0
  102. package/dist/mortgage/india/domain/types.js +3 -0
  103. package/dist/mortgage/israel/IsraelMortgageService.js +3 -0
  104. package/dist/mortgage/israel/IsraelMortgageServiceImpl.js +100 -0
  105. package/dist/mortgage/israel/domain/types.js +3 -0
  106. package/dist/mortgage/japan/JapanMortgageService.js +3 -0
  107. package/dist/mortgage/japan/JapanMortgageServiceImpl.js +76 -0
  108. package/dist/mortgage/japan/domain/types.js +3 -0
  109. package/dist/mortgage/netherlands/NetherlandsMortgageService.js +3 -0
  110. package/dist/mortgage/netherlands/NetherlandsMortgageServiceImpl.js +83 -0
  111. package/dist/mortgage/netherlands/domain/types.js +3 -0
  112. package/dist/mortgage/spain/SpainMortgageService.js +3 -0
  113. package/dist/mortgage/spain/SpainMortgageServiceImpl.js +96 -0
  114. package/dist/mortgage/spain/domain/types.js +3 -0
  115. package/dist/mortgage/switzerland/SwitzerlandMortgageService.js +3 -0
  116. package/dist/mortgage/switzerland/SwitzerlandMortgageServiceImpl.js +80 -0
  117. package/dist/mortgage/switzerland/domain/types.js +3 -0
  118. package/dist/shared/domain/types.js +2 -1
  119. package/dist/types/capital-gains/brazil/BrazilCapitalGainsService.d.ts +4 -0
  120. package/dist/types/capital-gains/brazil/BrazilCapitalGainsServiceImpl.d.ts +10 -0
  121. package/dist/types/capital-gains/brazil/domain/types.d.ts +11 -0
  122. package/dist/types/capital-gains/canada/CanadaCapitalGainsServiceImpl.d.ts +1 -1
  123. package/dist/types/capital-gains/index.d.ts +11 -1
  124. package/dist/types/capital-gains/india/IndiaCapitalGainsService.d.ts +4 -0
  125. package/dist/types/capital-gains/india/IndiaCapitalGainsServiceImpl.d.ts +9 -0
  126. package/dist/types/capital-gains/india/domain/types.d.ts +9 -0
  127. package/dist/types/capital-gains/israel/IsraelCapitalGainsService.d.ts +4 -0
  128. package/dist/types/capital-gains/israel/IsraelCapitalGainsServiceImpl.d.ts +10 -0
  129. package/dist/types/capital-gains/israel/domain/types.d.ts +11 -0
  130. package/dist/types/capital-gains/japan/JapanCapitalGainsService.d.ts +4 -0
  131. package/dist/types/capital-gains/japan/JapanCapitalGainsServiceImpl.d.ts +9 -0
  132. package/dist/types/capital-gains/japan/domain/types.d.ts +6 -0
  133. package/dist/types/capital-gains/spain/SpainCapitalGainsService.d.ts +4 -0
  134. package/dist/types/capital-gains/spain/SpainCapitalGainsServiceImpl.d.ts +10 -0
  135. package/dist/types/capital-gains/spain/domain/types.d.ts +11 -0
  136. package/dist/types/corporate/brazil/BrazilCorporateTaxService.d.ts +4 -0
  137. package/dist/types/corporate/brazil/BrazilCorporateTaxServiceImpl.d.ts +8 -0
  138. package/dist/types/corporate/brazil/domain/types.d.ts +19 -0
  139. package/dist/types/corporate/index.d.ts +15 -1
  140. package/dist/types/corporate/india/IndiaCorporateTaxService.d.ts +4 -0
  141. package/dist/types/corporate/india/IndiaCorporateTaxServiceImpl.d.ts +8 -0
  142. package/dist/types/corporate/india/domain/types.d.ts +15 -0
  143. package/dist/types/corporate/israel/IsraelCorporateTaxService.d.ts +4 -0
  144. package/dist/types/corporate/israel/IsraelCorporateTaxServiceImpl.d.ts +8 -0
  145. package/dist/types/corporate/israel/domain/types.d.ts +15 -0
  146. package/dist/types/corporate/japan/JapanCorporateTaxService.d.ts +4 -0
  147. package/dist/types/corporate/japan/JapanCorporateTaxServiceImpl.d.ts +8 -0
  148. package/dist/types/corporate/japan/domain/types.d.ts +15 -0
  149. package/dist/types/corporate/netherlands/NetherlandsCorporateTaxService.d.ts +4 -0
  150. package/dist/types/corporate/netherlands/NetherlandsCorporateTaxServiceImpl.d.ts +8 -0
  151. package/dist/types/corporate/netherlands/domain/types.d.ts +17 -0
  152. package/dist/types/corporate/spain/SpainCorporateTaxService.d.ts +4 -0
  153. package/dist/types/corporate/spain/SpainCorporateTaxServiceImpl.d.ts +8 -0
  154. package/dist/types/corporate/spain/domain/types.d.ts +15 -0
  155. package/dist/types/corporate/switzerland/SwitzerlandCorporateTaxService.d.ts +4 -0
  156. package/dist/types/corporate/switzerland/SwitzerlandCorporateTaxServiceImpl.d.ts +8 -0
  157. package/dist/types/corporate/switzerland/domain/types.d.ts +15 -0
  158. package/dist/types/income-tax/brazil/BrazilIncomeTaxService.d.ts +4 -0
  159. package/dist/types/income-tax/brazil/BrazilIncomeTaxServiceImpl.d.ts +11 -0
  160. package/dist/types/income-tax/brazil/domain/types.d.ts +18 -0
  161. package/dist/types/income-tax/index.d.ts +15 -1
  162. package/dist/types/income-tax/india/IndiaIncomeTaxService.d.ts +4 -0
  163. package/dist/types/income-tax/india/IndiaIncomeTaxServiceImpl.d.ts +10 -0
  164. package/dist/types/income-tax/india/domain/types.d.ts +16 -0
  165. package/dist/types/income-tax/israel/IsraelIncomeTaxService.d.ts +4 -0
  166. package/dist/types/income-tax/israel/IsraelIncomeTaxServiceImpl.d.ts +10 -0
  167. package/dist/types/income-tax/israel/domain/types.d.ts +16 -0
  168. package/dist/types/income-tax/japan/JapanIncomeTaxService.d.ts +4 -0
  169. package/dist/types/income-tax/japan/JapanIncomeTaxServiceImpl.d.ts +10 -0
  170. package/dist/types/income-tax/japan/domain/types.d.ts +16 -0
  171. package/dist/types/income-tax/netherlands/NetherlandsIncomeTaxService.d.ts +4 -0
  172. package/dist/types/income-tax/netherlands/NetherlandsIncomeTaxServiceImpl.d.ts +10 -0
  173. package/dist/types/income-tax/netherlands/domain/types.d.ts +16 -0
  174. package/dist/types/income-tax/spain/SpainIncomeTaxService.d.ts +4 -0
  175. package/dist/types/income-tax/spain/SpainIncomeTaxServiceImpl.d.ts +10 -0
  176. package/dist/types/income-tax/spain/domain/types.d.ts +16 -0
  177. package/dist/types/income-tax/switzerland/SwitzerlandIncomeTaxService.d.ts +4 -0
  178. package/dist/types/income-tax/switzerland/SwitzerlandIncomeTaxServiceImpl.d.ts +10 -0
  179. package/dist/types/income-tax/switzerland/domain/types.d.ts +16 -0
  180. package/dist/types/index.d.ts +1 -0
  181. package/dist/types/inheritance-tax/australia/AustraliaInheritanceTaxService.d.ts +4 -0
  182. package/dist/types/inheritance-tax/australia/AustraliaInheritanceTaxServiceImpl.d.ts +8 -0
  183. package/dist/types/inheritance-tax/australia/domain/types.d.ts +13 -0
  184. package/dist/types/inheritance-tax/canada/CanadaInheritanceTaxService.d.ts +4 -0
  185. package/dist/types/inheritance-tax/canada/CanadaInheritanceTaxServiceImpl.d.ts +9 -0
  186. package/dist/types/inheritance-tax/canada/domain/types.d.ts +20 -0
  187. package/dist/types/inheritance-tax/domain/types.d.ts +17 -0
  188. package/dist/types/inheritance-tax/france/FranceInheritanceTaxService.d.ts +4 -0
  189. package/dist/types/inheritance-tax/france/FranceInheritanceTaxServiceImpl.d.ts +9 -0
  190. package/dist/types/inheritance-tax/france/domain/types.d.ts +29 -0
  191. package/dist/types/inheritance-tax/germany/GermanyInheritanceTaxService.d.ts +4 -0
  192. package/dist/types/inheritance-tax/germany/GermanyInheritanceTaxServiceImpl.d.ts +9 -0
  193. package/dist/types/inheritance-tax/germany/domain/types.d.ts +28 -0
  194. package/dist/types/inheritance-tax/index.d.ts +21 -0
  195. package/dist/types/inheritance-tax/japan/JapanInheritanceTaxService.d.ts +4 -0
  196. package/dist/types/inheritance-tax/japan/JapanInheritanceTaxServiceImpl.d.ts +9 -0
  197. package/dist/types/inheritance-tax/japan/domain/types.d.ts +21 -0
  198. package/dist/types/inheritance-tax/netherlands/NetherlandsInheritanceTaxService.d.ts +4 -0
  199. package/dist/types/inheritance-tax/netherlands/NetherlandsInheritanceTaxServiceImpl.d.ts +9 -0
  200. package/dist/types/inheritance-tax/netherlands/domain/types.d.ts +28 -0
  201. package/dist/types/inheritance-tax/south-africa/SouthAfricaInheritanceTaxService.d.ts +4 -0
  202. package/dist/types/inheritance-tax/south-africa/SouthAfricaInheritanceTaxServiceImpl.d.ts +9 -0
  203. package/dist/types/inheritance-tax/south-africa/domain/types.d.ts +20 -0
  204. package/dist/types/inheritance-tax/spain/SpainInheritanceTaxService.d.ts +4 -0
  205. package/dist/types/inheritance-tax/spain/SpainInheritanceTaxServiceImpl.d.ts +9 -0
  206. package/dist/types/inheritance-tax/spain/domain/types.d.ts +19 -0
  207. package/dist/types/inheritance-tax/uk/UKInheritanceTaxService.d.ts +4 -0
  208. package/dist/types/inheritance-tax/uk/UKInheritanceTaxServiceImpl.d.ts +8 -0
  209. package/dist/types/inheritance-tax/uk/domain/types.d.ts +17 -0
  210. package/dist/types/inheritance-tax/usa/USAInheritanceTaxService.d.ts +4 -0
  211. package/dist/types/inheritance-tax/usa/USAInheritanceTaxServiceImpl.d.ts +9 -0
  212. package/dist/types/inheritance-tax/usa/domain/types.d.ts +19 -0
  213. package/dist/types/mortgage/brazil/BrazilMortgageService.d.ts +4 -0
  214. package/dist/types/mortgage/brazil/BrazilMortgageServiceImpl.d.ts +7 -0
  215. package/dist/types/mortgage/brazil/domain/types.d.ts +39 -0
  216. package/dist/types/mortgage/index.d.ts +15 -1
  217. package/dist/types/mortgage/india/IndiaMortgageService.d.ts +4 -0
  218. package/dist/types/mortgage/india/IndiaMortgageServiceImpl.d.ts +7 -0
  219. package/dist/types/mortgage/india/domain/types.d.ts +39 -0
  220. package/dist/types/mortgage/israel/IsraelMortgageService.d.ts +4 -0
  221. package/dist/types/mortgage/israel/IsraelMortgageServiceImpl.d.ts +8 -0
  222. package/dist/types/mortgage/israel/domain/types.d.ts +43 -0
  223. package/dist/types/mortgage/japan/JapanMortgageService.d.ts +4 -0
  224. package/dist/types/mortgage/japan/JapanMortgageServiceImpl.d.ts +7 -0
  225. package/dist/types/mortgage/japan/domain/types.d.ts +39 -0
  226. package/dist/types/mortgage/netherlands/NetherlandsMortgageService.d.ts +4 -0
  227. package/dist/types/mortgage/netherlands/NetherlandsMortgageServiceImpl.d.ts +7 -0
  228. package/dist/types/mortgage/netherlands/domain/types.d.ts +41 -0
  229. package/dist/types/mortgage/spain/SpainMortgageService.d.ts +4 -0
  230. package/dist/types/mortgage/spain/SpainMortgageServiceImpl.d.ts +8 -0
  231. package/dist/types/mortgage/spain/domain/types.d.ts +44 -0
  232. package/dist/types/mortgage/switzerland/SwitzerlandMortgageService.d.ts +4 -0
  233. package/dist/types/mortgage/switzerland/SwitzerlandMortgageServiceImpl.d.ts +7 -0
  234. package/dist/types/mortgage/switzerland/domain/types.d.ts +37 -0
  235. package/dist/types/shared/domain/types.d.ts +2 -1
  236. package/package.json +1 -1
  237. package/src/capital-gains/brazil/BrazilCapitalGainsService.ts +5 -0
  238. package/src/capital-gains/brazil/BrazilCapitalGainsServiceImpl.ts +69 -0
  239. package/src/capital-gains/brazil/domain/types.ts +15 -0
  240. package/src/capital-gains/canada/CanadaCapitalGainsServiceImpl.ts +34 -21
  241. package/src/capital-gains/index.ts +50 -0
  242. package/src/capital-gains/india/IndiaCapitalGainsService.ts +5 -0
  243. package/src/capital-gains/india/IndiaCapitalGainsServiceImpl.ts +64 -0
  244. package/src/capital-gains/india/domain/types.ts +12 -0
  245. package/src/capital-gains/israel/IsraelCapitalGainsService.ts +5 -0
  246. package/src/capital-gains/israel/IsraelCapitalGainsServiceImpl.ts +69 -0
  247. package/src/capital-gains/israel/domain/types.ts +15 -0
  248. package/src/capital-gains/japan/JapanCapitalGainsService.ts +5 -0
  249. package/src/capital-gains/japan/JapanCapitalGainsServiceImpl.ts +47 -0
  250. package/src/capital-gains/japan/domain/types.ts +9 -0
  251. package/src/capital-gains/spain/SpainCapitalGainsService.ts +5 -0
  252. package/src/capital-gains/spain/SpainCapitalGainsServiceImpl.ts +69 -0
  253. package/src/capital-gains/spain/domain/types.ts +15 -0
  254. package/src/corporate/brazil/BrazilCorporateTaxService.ts +5 -0
  255. package/src/corporate/brazil/BrazilCorporateTaxServiceImpl.ts +40 -0
  256. package/src/corporate/brazil/domain/types.ts +16 -0
  257. package/src/corporate/index.ts +81 -1
  258. package/src/corporate/india/IndiaCorporateTaxService.ts +5 -0
  259. package/src/corporate/india/IndiaCorporateTaxServiceImpl.ts +35 -0
  260. package/src/corporate/india/domain/types.ts +15 -0
  261. package/src/corporate/israel/IsraelCorporateTaxService.ts +5 -0
  262. package/src/corporate/israel/IsraelCorporateTaxServiceImpl.ts +35 -0
  263. package/src/corporate/israel/domain/types.ts +15 -0
  264. package/src/corporate/japan/JapanCorporateTaxService.ts +5 -0
  265. package/src/corporate/japan/JapanCorporateTaxServiceImpl.ts +35 -0
  266. package/src/corporate/japan/domain/types.ts +15 -0
  267. package/src/corporate/netherlands/NetherlandsCorporateTaxService.ts +5 -0
  268. package/src/corporate/netherlands/NetherlandsCorporateTaxServiceImpl.ts +48 -0
  269. package/src/corporate/netherlands/domain/types.ts +21 -0
  270. package/src/corporate/spain/SpainCorporateTaxService.ts +5 -0
  271. package/src/corporate/spain/SpainCorporateTaxServiceImpl.ts +35 -0
  272. package/src/corporate/spain/domain/types.ts +15 -0
  273. package/src/corporate/switzerland/SwitzerlandCorporateTaxService.ts +5 -0
  274. package/src/corporate/switzerland/SwitzerlandCorporateTaxServiceImpl.ts +35 -0
  275. package/src/corporate/switzerland/domain/types.ts +15 -0
  276. package/src/income-tax/brazil/BrazilIncomeTaxService.ts +5 -0
  277. package/src/income-tax/brazil/BrazilIncomeTaxServiceImpl.ts +91 -0
  278. package/src/income-tax/brazil/domain/types.ts +21 -0
  279. package/src/income-tax/index.ts +70 -0
  280. package/src/income-tax/india/IndiaIncomeTaxService.ts +5 -0
  281. package/src/income-tax/india/IndiaIncomeTaxServiceImpl.ts +87 -0
  282. package/src/income-tax/india/domain/types.ts +16 -0
  283. package/src/income-tax/israel/IsraelIncomeTaxService.ts +5 -0
  284. package/src/income-tax/israel/IsraelIncomeTaxServiceImpl.ts +75 -0
  285. package/src/income-tax/israel/domain/types.ts +16 -0
  286. package/src/income-tax/japan/JapanIncomeTaxService.ts +5 -0
  287. package/src/income-tax/japan/JapanIncomeTaxServiceImpl.ts +87 -0
  288. package/src/income-tax/japan/domain/types.ts +16 -0
  289. package/src/income-tax/netherlands/NetherlandsIncomeTaxService.ts +5 -0
  290. package/src/income-tax/netherlands/NetherlandsIncomeTaxServiceImpl.ts +75 -0
  291. package/src/income-tax/netherlands/domain/types.ts +16 -0
  292. package/src/income-tax/spain/SpainIncomeTaxService.ts +5 -0
  293. package/src/income-tax/spain/SpainIncomeTaxServiceImpl.ts +75 -0
  294. package/src/income-tax/spain/domain/types.ts +16 -0
  295. package/src/income-tax/switzerland/SwitzerlandIncomeTaxService.ts +5 -0
  296. package/src/income-tax/switzerland/SwitzerlandIncomeTaxServiceImpl.ts +75 -0
  297. package/src/income-tax/switzerland/domain/types.ts +16 -0
  298. package/src/index.ts +1 -0
  299. package/src/inheritance-tax/australia/AustraliaInheritanceTaxService.ts +5 -0
  300. package/src/inheritance-tax/australia/AustraliaInheritanceTaxServiceImpl.ts +21 -0
  301. package/src/inheritance-tax/australia/domain/types.ts +16 -0
  302. package/src/inheritance-tax/canada/CanadaInheritanceTaxService.ts +5 -0
  303. package/src/inheritance-tax/canada/CanadaInheritanceTaxServiceImpl.ts +65 -0
  304. package/src/inheritance-tax/canada/domain/types.ts +24 -0
  305. package/src/inheritance-tax/domain/types.ts +19 -0
  306. package/src/inheritance-tax/france/FranceInheritanceTaxService.ts +5 -0
  307. package/src/inheritance-tax/france/FranceInheritanceTaxServiceImpl.ts +66 -0
  308. package/src/inheritance-tax/france/domain/types.ts +35 -0
  309. package/src/inheritance-tax/germany/GermanyInheritanceTaxService.ts +5 -0
  310. package/src/inheritance-tax/germany/GermanyInheritanceTaxServiceImpl.ts +66 -0
  311. package/src/inheritance-tax/germany/domain/types.ts +34 -0
  312. package/src/inheritance-tax/index.ts +122 -0
  313. package/src/inheritance-tax/japan/JapanInheritanceTaxService.ts +5 -0
  314. package/src/inheritance-tax/japan/JapanInheritanceTaxServiceImpl.ts +67 -0
  315. package/src/inheritance-tax/japan/domain/types.ts +25 -0
  316. package/src/inheritance-tax/netherlands/NetherlandsInheritanceTaxService.ts +5 -0
  317. package/src/inheritance-tax/netherlands/NetherlandsInheritanceTaxServiceImpl.ts +66 -0
  318. package/src/inheritance-tax/netherlands/domain/types.ts +34 -0
  319. package/src/inheritance-tax/south-africa/SouthAfricaInheritanceTaxService.ts +5 -0
  320. package/src/inheritance-tax/south-africa/SouthAfricaInheritanceTaxServiceImpl.ts +66 -0
  321. package/src/inheritance-tax/south-africa/domain/types.ts +24 -0
  322. package/src/inheritance-tax/spain/SpainInheritanceTaxService.ts +5 -0
  323. package/src/inheritance-tax/spain/SpainInheritanceTaxServiceImpl.ts +65 -0
  324. package/src/inheritance-tax/spain/domain/types.ts +23 -0
  325. package/src/inheritance-tax/uk/UKInheritanceTaxService.ts +5 -0
  326. package/src/inheritance-tax/uk/UKInheritanceTaxServiceImpl.ts +46 -0
  327. package/src/inheritance-tax/uk/domain/types.ts +20 -0
  328. package/src/inheritance-tax/usa/USAInheritanceTaxService.ts +5 -0
  329. package/src/inheritance-tax/usa/USAInheritanceTaxServiceImpl.ts +65 -0
  330. package/src/inheritance-tax/usa/domain/types.ts +23 -0
  331. package/src/mortgage/brazil/BrazilMortgageService.ts +5 -0
  332. package/src/mortgage/brazil/BrazilMortgageServiceImpl.ts +101 -0
  333. package/src/mortgage/brazil/domain/types.ts +46 -0
  334. package/src/mortgage/index.ts +85 -1
  335. package/src/mortgage/india/IndiaMortgageService.ts +5 -0
  336. package/src/mortgage/india/IndiaMortgageServiceImpl.ts +101 -0
  337. package/src/mortgage/india/domain/types.ts +46 -0
  338. package/src/mortgage/israel/IsraelMortgageService.ts +5 -0
  339. package/src/mortgage/israel/IsraelMortgageServiceImpl.ts +132 -0
  340. package/src/mortgage/israel/domain/types.ts +41 -0
  341. package/src/mortgage/japan/JapanMortgageService.ts +5 -0
  342. package/src/mortgage/japan/JapanMortgageServiceImpl.ts +101 -0
  343. package/src/mortgage/japan/domain/types.ts +46 -0
  344. package/src/mortgage/netherlands/NetherlandsMortgageService.ts +5 -0
  345. package/src/mortgage/netherlands/NetherlandsMortgageServiceImpl.ts +109 -0
  346. package/src/mortgage/netherlands/domain/types.ts +37 -0
  347. package/src/mortgage/spain/SpainMortgageService.ts +5 -0
  348. package/src/mortgage/spain/SpainMortgageServiceImpl.ts +130 -0
  349. package/src/mortgage/spain/domain/types.ts +52 -0
  350. package/src/mortgage/switzerland/SwitzerlandMortgageService.ts +5 -0
  351. package/src/mortgage/switzerland/SwitzerlandMortgageServiceImpl.ts +106 -0
  352. package/src/mortgage/switzerland/domain/types.ts +36 -0
  353. package/src/shared/domain/types.ts +1 -0
  354. package/test/australia-inheritance-tax.test.ts +35 -0
  355. package/test/brazil-capital-gains.test.ts +65 -0
  356. package/test/brazil-corporate-tax.test.ts +63 -0
  357. package/test/brazil-income-tax.test.ts +85 -0
  358. package/test/brazil-mortgage.test.ts +70 -0
  359. package/test/canada-inheritance-tax.test.ts +62 -0
  360. package/test/france-inheritance-tax.test.ts +101 -0
  361. package/test/germany-inheritance-tax.test.ts +100 -0
  362. package/test/india-capital-gains.test.ts +71 -0
  363. package/test/india-corporate-tax.test.ts +54 -0
  364. package/test/india-income-tax.test.ts +78 -0
  365. package/test/india-mortgage.test.ts +70 -0
  366. package/test/israel-capital-gains.test.ts +45 -0
  367. package/test/israel-corporate-tax.test.ts +49 -0
  368. package/test/israel-income-tax.test.ts +76 -0
  369. package/test/israel-mortgage.test.ts +80 -0
  370. package/test/japan-capital-gains.test.ts +55 -0
  371. package/test/japan-corporate-tax.test.ts +54 -0
  372. package/test/japan-income-tax.test.ts +76 -0
  373. package/test/japan-inheritance-tax.test.ts +74 -0
  374. package/test/japan-mortgage.test.ts +69 -0
  375. package/test/netherlands-corporate-tax.test.ts +54 -0
  376. package/test/netherlands-income-tax.test.ts +54 -0
  377. package/test/netherlands-inheritance-tax.test.ts +79 -0
  378. package/test/netherlands-mortgage.test.ts +79 -0
  379. package/test/south-africa-inheritance-tax.test.ts +81 -0
  380. package/test/spain-capital-gains.test.ts +66 -0
  381. package/test/spain-corporate-tax.test.ts +54 -0
  382. package/test/spain-income-tax.test.ts +84 -0
  383. package/test/spain-inheritance-tax.test.ts +78 -0
  384. package/test/spain-mortgage.test.ts +70 -0
  385. package/test/switzerland-corporate-tax.test.ts +39 -0
  386. package/test/switzerland-income-tax.test.ts +66 -0
  387. package/test/switzerland-mortgage.test.ts +70 -0
  388. package/test/uk-inheritance-tax.test.ts +72 -0
  389. package/test/usa-inheritance-tax.test.ts +90 -0
  390. package/dist/domain/types.js +0 -10
  391. package/dist/types/domain/types.d.ts +0 -41
@@ -0,0 +1,78 @@
1
+ import { SpainInheritanceTaxServiceImpl } from '../src/inheritance-tax/spain/SpainInheritanceTaxServiceImpl';
2
+ import { Input, Rules } from '../src/inheritance-tax/spain/domain/types';
3
+
4
+ const spainRules: Rules = {
5
+ exemption: 0,
6
+ taxBrackets: [
7
+ { from: 0, to: 7993.46, rate: 0.0765 },
8
+ { from: 7993.46, to: 31956.34, rate: 0.102 },
9
+ { from: 31956.34, to: 79881.68, rate: 0.153 },
10
+ { from: 79881.68, to: 239389.13, rate: 0.2125 },
11
+ { from: 239389.13, to: 398777.54, rate: 0.255 },
12
+ { from: 398777.54, to: 797555.08, rate: 0.2975 },
13
+ { from: 797555.08, to: null, rate: 0.34 },
14
+ ],
15
+ };
16
+
17
+ describe('SpainInheritanceTaxServiceImpl', () => {
18
+ it('returns zero tax for zero estate', () => {
19
+ const input: Input = { estateValue: 0 };
20
+ const service = new SpainInheritanceTaxServiceImpl(input, spainRules);
21
+ const result = service.calculate();
22
+
23
+ expect(result.inheritanceTax).toBe(0);
24
+ expect(result.taxableEstate).toBe(0);
25
+ expect(result.effectiveRate).toBe(0);
26
+ });
27
+
28
+ it('returns zero tax when estate is at or below the exemption', () => {
29
+ const rulesWithExemption: Rules = { ...spainRules, exemption: 100000 };
30
+ const input: Input = { estateValue: 80000 };
31
+ const service = new SpainInheritanceTaxServiceImpl(input, rulesWithExemption);
32
+ const result = service.calculate();
33
+
34
+ expect(result.inheritanceTax).toBe(0);
35
+ expect(result.taxableEstate).toBe(0);
36
+ });
37
+
38
+ it('correctly calculates tax for estate in first bracket', () => {
39
+ const input: Input = { estateValue: 5000 };
40
+ const service = new SpainInheritanceTaxServiceImpl(input, spainRules);
41
+ const result = service.calculate();
42
+
43
+ // 0-5000: 5000 * 0.0765 = 382.5
44
+ expect(result.taxableEstate).toBe(5000);
45
+ expect(result.inheritanceTax).toBeCloseTo(382.5, 2);
46
+ });
47
+
48
+ it('correctly calculates tax for estate spanning multiple brackets', () => {
49
+ const input: Input = { estateValue: 100000 };
50
+ const service = new SpainInheritanceTaxServiceImpl(input, spainRules);
51
+ const result = service.calculate();
52
+
53
+ // 0-7993.46: 7993.46 * 0.0765 ≈ 611.50
54
+ // 7993.46-31956.34: 23962.88 * 0.102 ≈ 2444.21
55
+ // 31956.34-79881.68: 47925.34 * 0.153 ≈ 7332.58
56
+ // 79881.68-100000: 20118.32 * 0.2125 ≈ 4275.14
57
+ // Total ≈ 14663.43
58
+ expect(result.taxableEstate).toBe(100000);
59
+ expect(result.inheritanceTax).toBeCloseTo(14663.43, 0);
60
+ });
61
+
62
+ it('effective rate equals inheritance tax divided by estate times 100', () => {
63
+ const input: Input = { estateValue: 100000 };
64
+ const service = new SpainInheritanceTaxServiceImpl(input, spainRules);
65
+ const result = service.calculate();
66
+
67
+ expect(result.effectiveRate).toBeCloseTo((result.inheritanceTax / 100000) * 100, 2);
68
+ });
69
+
70
+ it('taxable estate is reduced by the exemption amount', () => {
71
+ const rulesWithExemption: Rules = { ...spainRules, exemption: 20000 };
72
+ const input: Input = { estateValue: 50000 };
73
+ const service = new SpainInheritanceTaxServiceImpl(input, rulesWithExemption);
74
+ const result = service.calculate();
75
+
76
+ expect(result.taxableEstate).toBe(30000);
77
+ });
78
+ });
@@ -0,0 +1,70 @@
1
+ import { SpainMortgageServiceImpl } from '../src/mortgage/spain/SpainMortgageServiceImpl';
2
+ import { MortgageInput, MortgageRules } from '../src/mortgage/spain/domain/types';
3
+
4
+ const spainRules: MortgageRules = {
5
+ loanConstraints: { maxLtvPercent: 0.80, maxAmortizationYears: 30 },
6
+ interest: { compounding: 'MONTHLY' },
7
+ transferTax: { brackets: [{ above: 0, rate: 0.07 }] },
8
+ };
9
+
10
+ const input: MortgageInput = {
11
+ propertyPrice: 300000,
12
+ downPayment: 60000,
13
+ annualInterestRate: 3.5,
14
+ amortizationYears: 25,
15
+ isFirstTimeBuyer: false,
16
+ };
17
+
18
+ describe('SpainMortgageServiceImpl', () => {
19
+ it('correctly calculates the loan amount', () => {
20
+ const service = new SpainMortgageServiceImpl();
21
+ const result = service.calculate(input, spainRules);
22
+
23
+ // loanAmount = 300000 - 60000 = 240000
24
+ expect(result.loanAmount).toBe(240000);
25
+ });
26
+
27
+ it('correctly calculates transfer tax', () => {
28
+ const service = new SpainMortgageServiceImpl();
29
+ const result = service.calculate(input, spainRules);
30
+
31
+ // transferTax = (300000 - 0) * 0.07 = 21000
32
+ expect(result.transferTax).toBeCloseTo(21000, 2);
33
+ });
34
+
35
+ it('calculates a positive monthly payment', () => {
36
+ const service = new SpainMortgageServiceImpl();
37
+ const result = service.calculate(input, spainRules);
38
+
39
+ expect(result.monthlyPayment).toBeGreaterThan(0);
40
+ });
41
+
42
+ it('total paid is greater than the loan amount', () => {
43
+ const service = new SpainMortgageServiceImpl();
44
+ const result = service.calculate(input, spainRules);
45
+
46
+ expect(result.totalPaid).toBeGreaterThan(result.loanAmount);
47
+ });
48
+
49
+ it('total paid equals monthly payment multiplied by total payments', () => {
50
+ const service = new SpainMortgageServiceImpl();
51
+ const result = service.calculate(input, spainRules);
52
+
53
+ const expectedTotal = result.monthlyPayment * (input.amortizationYears * 12);
54
+ expect(result.totalPaid).toBeCloseTo(expectedTotal, 2);
55
+ });
56
+
57
+ it('amortization schedule has the correct number of years', () => {
58
+ const service = new SpainMortgageServiceImpl();
59
+ const result = service.calculate(input, spainRules);
60
+
61
+ expect(result.amortizationSchedule).toHaveLength(25);
62
+ });
63
+
64
+ it('throws an error when down payment equals or exceeds property price', () => {
65
+ const service = new SpainMortgageServiceImpl();
66
+ const badInput: MortgageInput = { ...input, downPayment: 300000 };
67
+
68
+ expect(() => service.calculate(badInput, spainRules)).toThrow();
69
+ });
70
+ });
@@ -0,0 +1,39 @@
1
+ import { SwitzerlandCorporateTaxServiceImpl } from '../src/corporate/switzerland/SwitzerlandCorporateTaxServiceImpl';
2
+ import { Input, Rules } from '../src/corporate/switzerland/domain/types';
3
+
4
+ const switzerlandRules: Rules = {
5
+ regime: { type: 'flat', rate: 0.085 },
6
+ };
7
+
8
+ describe('SwitzerlandCorporateTaxServiceImpl', () => {
9
+ it('returns zero tax for zero income', () => {
10
+ const input: Input = { taxableIncome: 0 };
11
+ const service = new SwitzerlandCorporateTaxServiceImpl(input, switzerlandRules);
12
+ const result = service.calculate();
13
+ expect(result.corporateTax).toBe(0);
14
+ expect(result.effectiveTaxRate).toBe(0);
15
+ expect(result.breakdowns).toHaveLength(0);
16
+ });
17
+
18
+ it('correctly applies the flat 8.5% rate', () => {
19
+ const input: Input = { taxableIncome: 1000000 };
20
+ const service = new SwitzerlandCorporateTaxServiceImpl(input, switzerlandRules);
21
+ const result = service.calculate();
22
+ expect(result.corporateTax).toBe(85000);
23
+ });
24
+
25
+ it('calculates effective tax rate as percentage', () => {
26
+ const input: Input = { taxableIncome: 1000000 };
27
+ const service = new SwitzerlandCorporateTaxServiceImpl(input, switzerlandRules);
28
+ const result = service.calculate();
29
+ expect(result.effectiveTaxRate).toBe(8.5);
30
+ });
31
+
32
+ it('returns one breakdown entry for flat rate calculation', () => {
33
+ const input: Input = { taxableIncome: 100000 };
34
+ const service = new SwitzerlandCorporateTaxServiceImpl(input, switzerlandRules);
35
+ const result = service.calculate();
36
+ expect(result.breakdowns).toHaveLength(1);
37
+ expect(result.breakdowns[0].rate).toBe(0.085);
38
+ });
39
+ });
@@ -0,0 +1,66 @@
1
+ import { SwitzerlandIncomeTaxServiceImpl } from '../src/income-tax/switzerland/SwitzerlandIncomeTaxServiceImpl';
2
+ import { IncomeTaxRules } from '../src/income-tax/switzerland/domain/types';
3
+
4
+ const switzerlandRules: IncomeTaxRules = {
5
+ taxBrackets: [
6
+ { from: 0, to: 14500, rate: 0 },
7
+ { from: 14500, to: 31600, rate: 0.0077 },
8
+ { from: 31600, to: 41400, rate: 0.0088 },
9
+ { from: 41400, to: 55200, rate: 0.0264 },
10
+ { from: 55200, to: 72500, rate: 0.0297 },
11
+ { from: 72500, to: 78100, rate: 0.0594 },
12
+ { from: 78100, to: 103600, rate: 0.066 },
13
+ { from: 103600, to: 134600, rate: 0.088 },
14
+ { from: 134600, to: 176000, rate: 0.11 },
15
+ { from: 176000, to: 755200, rate: 0.132 },
16
+ { from: 755200, to: null, rate: 0.115 },
17
+ ],
18
+ socialContributions: { rate: 0.053 },
19
+ };
20
+
21
+ describe('SwitzerlandIncomeTaxServiceImpl', () => {
22
+ it('returns zero tax for zero income', () => {
23
+ const service = new SwitzerlandIncomeTaxServiceImpl(0, switzerlandRules);
24
+ const result = service.calculateNetIncome();
25
+ expect(result.incomeTax).toBe(0);
26
+ expect(result.socialContributions).toBe(0);
27
+ expect(result.effectiveTaxRate).toBe(0);
28
+ });
29
+
30
+ it('returns zero tax for income below first taxable bracket', () => {
31
+ const service = new SwitzerlandIncomeTaxServiceImpl(10000, switzerlandRules);
32
+ const result = service.calculateNetIncome();
33
+ expect(result.incomeTax).toBe(0);
34
+ });
35
+
36
+ it('correctly calculates tax spanning multiple brackets', () => {
37
+ const service = new SwitzerlandIncomeTaxServiceImpl(50000, switzerlandRules);
38
+ const result = service.calculateNetIncome();
39
+ // 0-14500: 0
40
+ // 14500-31600: 17100 * 0.0077 = 131.67
41
+ // 31600-41400: 9800 * 0.0088 = 86.24
42
+ // 41400-50000: 8600 * 0.0264 = 227.04
43
+ // Total ≈ 444.95
44
+ expect(result.incomeTax).toBeGreaterThan(0);
45
+ expect(result.grossIncome).toBe(50000);
46
+ });
47
+
48
+ it('correctly calculates social contributions', () => {
49
+ const service = new SwitzerlandIncomeTaxServiceImpl(50000, switzerlandRules);
50
+ const result = service.calculateNetIncome();
51
+ // 50000 * 0.053 = 2650
52
+ expect(result.socialContributions).toBeCloseTo(2650, 2);
53
+ });
54
+
55
+ it('net income equals gross income minus total deductions', () => {
56
+ const service = new SwitzerlandIncomeTaxServiceImpl(100000, switzerlandRules);
57
+ const result = service.calculateNetIncome();
58
+ expect(result.netIncome).toBeCloseTo(result.grossIncome - result.totalDeductions, 2);
59
+ });
60
+
61
+ it('total deductions equals income tax plus social contributions', () => {
62
+ const service = new SwitzerlandIncomeTaxServiceImpl(100000, switzerlandRules);
63
+ const result = service.calculateNetIncome();
64
+ expect(result.totalDeductions).toBeCloseTo(result.incomeTax + result.socialContributions, 2);
65
+ });
66
+ });
@@ -0,0 +1,70 @@
1
+ import { SwitzerlandMortgageServiceImpl } from '../src/mortgage/switzerland/SwitzerlandMortgageServiceImpl';
2
+ import { MortgageInput, MortgageRules } from '../src/mortgage/switzerland/domain/types';
3
+
4
+ const switzerlandRules: MortgageRules = {
5
+ loanConstraints: { maxLtvPercent: 0.80, maxAmortizationYears: 25 },
6
+ interest: { compounding: 'MONTHLY' },
7
+ transferTaxRate: 0.0015,
8
+ notaryFeeRate: 0.005,
9
+ landRegistryFeeRate: 0.001,
10
+ };
11
+
12
+ const input: MortgageInput = {
13
+ propertyPrice: 800000,
14
+ downPayment: 160000,
15
+ annualInterestRate: 2.5,
16
+ amortizationYears: 20,
17
+ };
18
+
19
+ describe('SwitzerlandMortgageServiceImpl', () => {
20
+ it('correctly calculates the loan amount', () => {
21
+ const service = new SwitzerlandMortgageServiceImpl();
22
+ const result = service.calculate(input, switzerlandRules);
23
+ expect(result.loanAmount).toBe(640000);
24
+ });
25
+
26
+ it('correctly calculates transfer tax', () => {
27
+ const service = new SwitzerlandMortgageServiceImpl();
28
+ const result = service.calculate(input, switzerlandRules);
29
+ // 800000 * 0.0015 = 1200
30
+ expect(result.transferTax).toBeCloseTo(1200, 2);
31
+ });
32
+
33
+ it('correctly calculates notary fees', () => {
34
+ const service = new SwitzerlandMortgageServiceImpl();
35
+ const result = service.calculate(input, switzerlandRules);
36
+ // 800000 * 0.005 = 4000
37
+ expect(result.notaryFees).toBeCloseTo(4000, 2);
38
+ });
39
+
40
+ it('correctly calculates land registry fee', () => {
41
+ const service = new SwitzerlandMortgageServiceImpl();
42
+ const result = service.calculate(input, switzerlandRules);
43
+ // 800000 * 0.001 = 800
44
+ expect(result.landRegistryFee).toBeCloseTo(800, 2);
45
+ });
46
+
47
+ it('calculates a positive monthly payment', () => {
48
+ const service = new SwitzerlandMortgageServiceImpl();
49
+ const result = service.calculate(input, switzerlandRules);
50
+ expect(result.monthlyPayment).toBeGreaterThan(0);
51
+ });
52
+
53
+ it('total paid is greater than the loan amount', () => {
54
+ const service = new SwitzerlandMortgageServiceImpl();
55
+ const result = service.calculate(input, switzerlandRules);
56
+ expect(result.totalPaid).toBeGreaterThan(result.loanAmount);
57
+ });
58
+
59
+ it('amortization schedule has the correct number of years', () => {
60
+ const service = new SwitzerlandMortgageServiceImpl();
61
+ const result = service.calculate(input, switzerlandRules);
62
+ expect(result.amortizationSchedule).toHaveLength(20);
63
+ });
64
+
65
+ it('throws an error when down payment equals or exceeds property price', () => {
66
+ const service = new SwitzerlandMortgageServiceImpl();
67
+ const badInput: MortgageInput = { ...input, downPayment: 800000 };
68
+ expect(() => service.calculate(badInput, switzerlandRules)).toThrow();
69
+ });
70
+ });
@@ -0,0 +1,72 @@
1
+ import { UKInheritanceTaxServiceImpl } from '../src/inheritance-tax/uk/UKInheritanceTaxServiceImpl';
2
+ import { Input, Rules } from '../src/inheritance-tax/uk/domain/types';
3
+
4
+ const ukRules: Rules = {
5
+ nilRateBand: 325000,
6
+ standardRate: 0.40,
7
+ charityRate: 0.36,
8
+ charityThreshold: 10,
9
+ };
10
+
11
+ describe('UKInheritanceTaxServiceImpl', () => {
12
+ it('returns zero tax for estate below nil-rate band', () => {
13
+ const input: Input = { estateValue: 200000, charitableGivingPercent: 0 };
14
+ const service = new UKInheritanceTaxServiceImpl(input, ukRules);
15
+ const result = service.calculate();
16
+
17
+ expect(result.inheritanceTax).toBe(0);
18
+ expect(result.taxableEstate).toBe(0);
19
+ });
20
+
21
+ it('returns zero tax for estate at nil-rate band', () => {
22
+ const input: Input = { estateValue: 325000, charitableGivingPercent: 0 };
23
+ const service = new UKInheritanceTaxServiceImpl(input, ukRules);
24
+ const result = service.calculate();
25
+
26
+ expect(result.inheritanceTax).toBe(0);
27
+ });
28
+
29
+ it('applies 40% rate for estate above nil-rate band', () => {
30
+ const input: Input = { estateValue: 500000, charitableGivingPercent: 0 };
31
+ const service = new UKInheritanceTaxServiceImpl(input, ukRules);
32
+ const result = service.calculate();
33
+
34
+ // (500000 - 325000) * 0.40 = 70000
35
+ expect(result.taxableEstate).toBe(175000);
36
+ expect(result.inheritanceTax).toBe(70000);
37
+ });
38
+
39
+ it('applies 36% charity rate when charitable giving >= 10%', () => {
40
+ const input: Input = { estateValue: 500000, charitableGivingPercent: 10 };
41
+ const service = new UKInheritanceTaxServiceImpl(input, ukRules);
42
+ const result = service.calculate();
43
+
44
+ // (500000 - 325000) * 0.36 = 63000
45
+ expect(result.taxableEstate).toBe(175000);
46
+ expect(result.inheritanceTax).toBe(63000);
47
+ });
48
+
49
+ it('applies standard rate when charitable giving < 10%', () => {
50
+ const input: Input = { estateValue: 500000, charitableGivingPercent: 9 };
51
+ const service = new UKInheritanceTaxServiceImpl(input, ukRules);
52
+ const result = service.calculate();
53
+
54
+ expect(result.inheritanceTax).toBe(70000);
55
+ });
56
+
57
+ it('returns zero for zero estate', () => {
58
+ const input: Input = { estateValue: 0, charitableGivingPercent: 0 };
59
+ const service = new UKInheritanceTaxServiceImpl(input, ukRules);
60
+ const result = service.calculate();
61
+
62
+ expect(result.inheritanceTax).toBe(0);
63
+ });
64
+
65
+ it('calculates effective rate correctly', () => {
66
+ const input: Input = { estateValue: 1000000, charitableGivingPercent: 0 };
67
+ const service = new UKInheritanceTaxServiceImpl(input, ukRules);
68
+ const result = service.calculate();
69
+
70
+ expect(result.effectiveRate).toBe((result.inheritanceTax / 1000000) * 100);
71
+ });
72
+ });
@@ -0,0 +1,90 @@
1
+ import { USAInheritanceTaxServiceImpl } from '../src/inheritance-tax/usa/USAInheritanceTaxServiceImpl';
2
+ import { Input, Rules } from '../src/inheritance-tax/usa/domain/types';
3
+
4
+ const usaRules: Rules = {
5
+ exemption: 13610000,
6
+ taxBrackets: [
7
+ { from: 0, to: 10000, rate: 0.18 },
8
+ { from: 10000, to: 20000, rate: 0.20 },
9
+ { from: 20000, to: 40000, rate: 0.22 },
10
+ { from: 40000, to: 60000, rate: 0.24 },
11
+ { from: 60000, to: 80000, rate: 0.26 },
12
+ { from: 80000, to: 100000, rate: 0.28 },
13
+ { from: 100000, to: 150000, rate: 0.30 },
14
+ { from: 150000, to: 250000, rate: 0.32 },
15
+ { from: 250000, to: 500000, rate: 0.34 },
16
+ { from: 500000, to: 750000, rate: 0.36 },
17
+ { from: 750000, to: 1000000, rate: 0.38 },
18
+ { from: 1000000, to: null, rate: 0.40 },
19
+ ],
20
+ };
21
+
22
+ describe('USAInheritanceTaxServiceImpl', () => {
23
+ it('returns zero tax for estate below exemption', () => {
24
+ const input: Input = { estateValue: 10000000 };
25
+ const service = new USAInheritanceTaxServiceImpl(input, usaRules);
26
+ const result = service.calculate();
27
+
28
+ expect(result.inheritanceTax).toBe(0);
29
+ expect(result.taxableEstate).toBe(0);
30
+ expect(result.breakdowns).toHaveLength(0);
31
+ });
32
+
33
+ it('returns zero tax for estate at exactly the exemption', () => {
34
+ const input: Input = { estateValue: 13610000 };
35
+ const service = new USAInheritanceTaxServiceImpl(input, usaRules);
36
+ const result = service.calculate();
37
+
38
+ expect(result.inheritanceTax).toBe(0);
39
+ expect(result.taxableEstate).toBe(0);
40
+ });
41
+
42
+ it('correctly calculates tax for estate just above exemption', () => {
43
+ const input: Input = { estateValue: 13620000 }; // 10000 above exemption
44
+ const service = new USAInheritanceTaxServiceImpl(input, usaRules);
45
+ const result = service.calculate();
46
+
47
+ // 10000 * 0.18 = 1800
48
+ expect(result.taxableEstate).toBe(10000);
49
+ expect(result.inheritanceTax).toBe(1800);
50
+ });
51
+
52
+ it('correctly calculates tax with multiple brackets', () => {
53
+ const input: Input = { estateValue: 13660000 }; // 50000 above exemption
54
+ const service = new USAInheritanceTaxServiceImpl(input, usaRules);
55
+ const result = service.calculate();
56
+
57
+ // 10000 * 0.18 = 1800
58
+ // 10000 * 0.20 = 2000
59
+ // 20000 * 0.22 = 4400
60
+ // 10000 * 0.24 = 2400
61
+ // Total = 10600
62
+ expect(result.taxableEstate).toBe(50000);
63
+ expect(result.inheritanceTax).toBe(10600);
64
+ });
65
+
66
+ it('returns zero for zero estate', () => {
67
+ const input: Input = { estateValue: 0 };
68
+ const service = new USAInheritanceTaxServiceImpl(input, usaRules);
69
+ const result = service.calculate();
70
+
71
+ expect(result.inheritanceTax).toBe(0);
72
+ expect(result.effectiveRate).toBe(0);
73
+ });
74
+
75
+ it('returns zero for negative estate', () => {
76
+ const input: Input = { estateValue: -100000 };
77
+ const service = new USAInheritanceTaxServiceImpl(input, usaRules);
78
+ const result = service.calculate();
79
+
80
+ expect(result.inheritanceTax).toBe(0);
81
+ });
82
+
83
+ it('calculates effective rate correctly', () => {
84
+ const input: Input = { estateValue: 14610000 }; // 1,000,000 above exemption
85
+ const service = new USAInheritanceTaxServiceImpl(input, usaRules);
86
+ const result = service.calculate();
87
+
88
+ expect(result.effectiveRate).toBe((result.inheritanceTax / 14610000) * 100);
89
+ });
90
+ });
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CalculatorType = void 0;
4
- var CalculatorType;
5
- (function (CalculatorType) {
6
- CalculatorType["INCOME_TAX"] = "INCOME_TAX";
7
- CalculatorType["MORTGAGE"] = "MORTGAGE";
8
- CalculatorType["LOAN"] = "LOAN";
9
- })(CalculatorType || (exports.CalculatorType = CalculatorType = {}));
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZG9tYWluL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLElBQVksY0FJWDtBQUpELFdBQVksY0FBYztJQUN0QiwyQ0FBeUIsQ0FBQTtJQUN6Qix1Q0FBcUIsQ0FBQTtJQUNyQiwrQkFBYSxDQUFBO0FBQ2pCLENBQUMsRUFKVyxjQUFjLDhCQUFkLGNBQWMsUUFJekIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZW51bSBDYWxjdWxhdG9yVHlwZSB7XG4gICAgSU5DT01FX1RBWCA9ICdJTkNPTUVfVEFYJyxcbiAgICBNT1JUR0FHRSA9ICdNT1JUR0FHRScsXG4gICAgTE9BTiA9ICdMT0FOJ1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFJ1bGVNZXRhIHtcbiAgICBpZDogc3RyaW5nO1xuICAgIGNvdW50cnk6IHN0cmluZztcbiAgICByZWdpb246IHN0cmluZztcbiAgICBjYWxjdWxhdG9yOiBDYWxjdWxhdG9yVHlwZTtcbiAgICB2ZXJzaW9uOiBzdHJpbmc7XG4gICAgZWZmZWN0aXZlZnJvbTogc3RyaW5nO1xuICAgIGVmZmVjdGl2ZXRvOiBzdHJpbmcgfCBudWxsO1xuICAgIHNvdXJjZT86IFJ1bGVTb3VyY2VbXTtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBSdWxlU291cmNlIHtcbiAgICBuYW1lOiBzdHJpbmc7XG4gICAgdXJsOiBzdHJpbmc7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgUnVsZUlucHV0IHtcbiAgICBuYW1lOiBzdHJpbmc7XG4gICAgdHlwZTogJ251bWJlcicgfCAnc2VsZWN0JyB8ICd0ZXh0JztcbiAgICByZXF1aXJlZDogYm9vbGVhbjtcbiAgICB1bml0Pzogc3RyaW5nO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFJ1bGVPdXRwdXQge1xuICAgIG5hbWU6IHN0cmluZztcbiAgICB0eXBlOiAnbnVtYmVyJyB8ICdzdHJpbmcnO1xuICAgIHVuaXQ/OiBzdHJpbmc7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgVGF4QnJhY2tldCB7XG4gICAgZnJvbTogbnVtYmVyO1xuICAgIHRvOiBudW1iZXIgfCBudWxsO1xuICAgIHJhdGU6IG51bWJlcjtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBJbmNvbWVUYXhDYWxjdWxhdG9yU2NoZW1hPFQ+IHtcbiAgICBtZXRhOiBSdWxlTWV0YTtcbiAgICBpbnB1dHM6IFJ1bGVJbnB1dFtdO1xuICAgIG91dHB1dHM6IFJ1bGVPdXRwdXRbXTtcbiAgICBydWxlczogVDtcbn0iXX0=
@@ -1,41 +0,0 @@
1
- export declare enum CalculatorType {
2
- INCOME_TAX = "INCOME_TAX",
3
- MORTGAGE = "MORTGAGE",
4
- LOAN = "LOAN"
5
- }
6
- export interface RuleMeta {
7
- id: string;
8
- country: string;
9
- region: string;
10
- calculator: CalculatorType;
11
- version: string;
12
- effectivefrom: string;
13
- effectiveto: string | null;
14
- source?: RuleSource[];
15
- }
16
- export interface RuleSource {
17
- name: string;
18
- url: string;
19
- }
20
- export interface RuleInput {
21
- name: string;
22
- type: 'number' | 'select' | 'text';
23
- required: boolean;
24
- unit?: string;
25
- }
26
- export interface RuleOutput {
27
- name: string;
28
- type: 'number' | 'string';
29
- unit?: string;
30
- }
31
- export interface TaxBracket {
32
- from: number;
33
- to: number | null;
34
- rate: number;
35
- }
36
- export interface IncomeTaxCalculatorSchema<T> {
37
- meta: RuleMeta;
38
- inputs: RuleInput[];
39
- outputs: RuleOutput[];
40
- rules: T;
41
- }