@tomei/finance 0.6.114 → 0.8.0

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 (380) hide show
  1. package/dist/account/account.d.ts +1 -0
  2. package/dist/account/account.d.ts.map +1 -0
  3. package/dist/account/account.js.map +1 -1
  4. package/dist/account/account.repository.d.ts +1 -0
  5. package/dist/account/account.repository.d.ts.map +1 -0
  6. package/dist/account/account.repository.js +4 -1
  7. package/dist/account/account.repository.js.map +1 -1
  8. package/dist/account/interfaces/account-attr.interface.d.ts +1 -0
  9. package/dist/account/interfaces/account-attr.interface.d.ts.map +1 -0
  10. package/dist/account-system-entity/account-system-entity.d.ts +1 -0
  11. package/dist/account-system-entity/account-system-entity.d.ts.map +1 -0
  12. package/dist/account-system-entity/account-system-entity.js +4 -1
  13. package/dist/account-system-entity/account-system-entity.js.map +1 -1
  14. package/dist/account-system-entity/post-history.repository.d.ts +1 -0
  15. package/dist/account-system-entity/post-history.repository.d.ts.map +1 -0
  16. package/dist/account-system-entity/post-history.repository.js +4 -1
  17. package/dist/account-system-entity/post-history.repository.js.map +1 -1
  18. package/dist/config.d.ts +1 -0
  19. package/dist/config.d.ts.map +1 -0
  20. package/dist/config.js +17 -4
  21. package/dist/config.js.map +1 -1
  22. package/dist/customer/customer.d.ts +1 -0
  23. package/dist/customer/customer.d.ts.map +1 -0
  24. package/dist/customer/customer.js +38 -2
  25. package/dist/customer/customer.js.map +1 -1
  26. package/dist/customer/finance-customer.repository.d.ts +1 -0
  27. package/dist/customer/finance-customer.repository.d.ts.map +1 -0
  28. package/dist/customer/finance-customer.repository.js +4 -1
  29. package/dist/customer/finance-customer.repository.js.map +1 -1
  30. package/dist/customer/interfaces/customer.repository.interface.d.ts +1 -0
  31. package/dist/customer/interfaces/customer.repository.interface.d.ts.map +1 -0
  32. package/dist/customer/interfaces/finance-customer-attr.interface.d.ts +1 -0
  33. package/dist/customer/interfaces/finance-customer-attr.interface.d.ts.map +1 -0
  34. package/dist/customer/interfaces/finance-customer.repository.interface.d.ts +1 -0
  35. package/dist/customer/interfaces/finance-customer.repository.interface.d.ts.map +1 -0
  36. package/dist/database.d.ts +1 -0
  37. package/dist/database.d.ts.map +1 -0
  38. package/dist/database.js +18 -15
  39. package/dist/database.js.map +1 -1
  40. package/dist/document/document-item.d.ts +3 -2
  41. package/dist/document/document-item.d.ts.map +1 -0
  42. package/dist/document/document-item.js +1 -1
  43. package/dist/document/document-item.js.map +1 -1
  44. package/dist/document/document-item.repository.d.ts +1 -0
  45. package/dist/document/document-item.repository.d.ts.map +1 -0
  46. package/dist/document/document-item.repository.js +4 -1
  47. package/dist/document/document-item.repository.js.map +1 -1
  48. package/dist/document/document.d.ts +2 -1
  49. package/dist/document/document.d.ts.map +1 -0
  50. package/dist/document/document.js +242 -191
  51. package/dist/document/document.js.map +1 -1
  52. package/dist/document/document.repository.d.ts +1 -0
  53. package/dist/document/document.repository.d.ts.map +1 -0
  54. package/dist/document/document.repository.js +4 -1
  55. package/dist/document/document.repository.js.map +1 -1
  56. package/dist/document/interfaces/document-attr.interface.d.ts +1 -0
  57. package/dist/document/interfaces/document-attr.interface.d.ts.map +1 -0
  58. package/dist/document/interfaces/document-find-all.interface.d.ts +1 -0
  59. package/dist/document/interfaces/document-find-all.interface.d.ts.map +1 -0
  60. package/dist/document/interfaces/document-item-attr.interface.d.ts +1 -0
  61. package/dist/document/interfaces/document-item-attr.interface.d.ts.map +1 -0
  62. package/dist/document/interfaces/document-item.repository.interface.d.ts +1 -0
  63. package/dist/document/interfaces/document-item.repository.interface.d.ts.map +1 -0
  64. package/dist/document-tag/document-tag.d.ts +19 -0
  65. package/dist/document-tag/document-tag.d.ts.map +1 -0
  66. package/dist/document-tag/document-tag.js +68 -0
  67. package/dist/document-tag/document-tag.js.map +1 -0
  68. package/dist/document-tag/document-tag.repository.d.ts +6 -0
  69. package/dist/document-tag/document-tag.repository.d.ts.map +1 -0
  70. package/dist/document-tag/document-tag.repository.js +15 -0
  71. package/dist/document-tag/document-tag.repository.js.map +1 -0
  72. package/dist/document-tag/interfaces/document-tag-attr.interface.d.ts +8 -0
  73. package/dist/document-tag/interfaces/document-tag-attr.interface.d.ts.map +1 -0
  74. package/dist/document-tag/interfaces/document-tag-attr.interface.js +3 -0
  75. package/dist/document-tag/interfaces/document-tag-attr.interface.js.map +1 -0
  76. package/dist/enum/collect-payment-type.d.ts +1 -0
  77. package/dist/enum/collect-payment-type.d.ts.map +1 -0
  78. package/dist/enum/doc-type.enum.d.ts +1 -0
  79. package/dist/enum/doc-type.enum.d.ts.map +1 -0
  80. package/dist/enum/document-status.enum.d.ts +1 -0
  81. package/dist/enum/document-status.enum.d.ts.map +1 -0
  82. package/dist/enum/index.d.ts +2 -2
  83. package/dist/enum/index.d.ts.map +1 -0
  84. package/dist/enum/index.js +1 -3
  85. package/dist/enum/index.js.map +1 -1
  86. package/dist/enum/payment-method.enum.d.ts +1 -0
  87. package/dist/enum/payment-method.enum.d.ts.map +1 -0
  88. package/dist/enum/payment-status.enum.d.ts +1 -0
  89. package/dist/enum/payment-status.enum.d.ts.map +1 -0
  90. package/dist/enum/payment-type.enum.d.ts +1 -0
  91. package/dist/enum/payment-type.enum.d.ts.map +1 -0
  92. package/dist/enum/quick-book-client-scopes.enum.d.ts +1 -0
  93. package/dist/enum/quick-book-client-scopes.enum.d.ts.map +1 -0
  94. package/dist/enum/quick-book-client-scopes.enum.js +34 -1
  95. package/dist/enum/quick-book-client-scopes.enum.js.map +1 -1
  96. package/dist/enum/transaction-type.enum.d.ts +1 -0
  97. package/dist/enum/transaction-type.enum.d.ts.map +1 -0
  98. package/dist/finance-company/finance-company.d.ts +20 -17
  99. package/dist/finance-company/finance-company.d.ts.map +1 -0
  100. package/dist/finance-company/finance-company.js +89 -23
  101. package/dist/finance-company/finance-company.js.map +1 -1
  102. package/dist/finance-company/finance-company.repository.d.ts +1 -0
  103. package/dist/finance-company/finance-company.repository.d.ts.map +1 -0
  104. package/dist/finance-company/finance-company.repository.js +4 -1
  105. package/dist/finance-company/finance-company.repository.js.map +1 -1
  106. package/dist/helpers/login-user.d.ts +1 -0
  107. package/dist/helpers/login-user.d.ts.map +1 -0
  108. package/dist/helpers/typeof.d.ts +1 -0
  109. package/dist/helpers/typeof.d.ts.map +1 -0
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.d.ts.map +1 -0
  112. package/dist/index.js +51 -15
  113. package/dist/index.js.map +1 -1
  114. package/dist/interfaces/account-system.interface.d.ts +4 -0
  115. package/dist/interfaces/account-system.interface.d.ts.map +1 -0
  116. package/dist/interfaces/index.d.ts +1 -0
  117. package/dist/interfaces/index.d.ts.map +1 -0
  118. package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +1 -0
  119. package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts.map +1 -0
  120. package/dist/journal-entry/journal-entry.d.ts +1 -0
  121. package/dist/journal-entry/journal-entry.d.ts.map +1 -0
  122. package/dist/journal-entry/journal-entry.js +4 -1
  123. package/dist/journal-entry/journal-entry.js.map +1 -1
  124. package/dist/journal-entry/journal-entry.repository.d.ts +1 -0
  125. package/dist/journal-entry/journal-entry.repository.d.ts.map +1 -0
  126. package/dist/journal-entry/journal-entry.repository.js +4 -1
  127. package/dist/journal-entry/journal-entry.repository.js.map +1 -1
  128. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +1 -0
  129. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts.map +1 -0
  130. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts +1 -0
  131. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts.map +1 -0
  132. package/dist/ledger-transaction/ledger-transaction.d.ts +1 -0
  133. package/dist/ledger-transaction/ledger-transaction.d.ts.map +1 -0
  134. package/dist/ledger-transaction/ledger-transaction.repository.d.ts +1 -0
  135. package/dist/ledger-transaction/ledger-transaction.repository.d.ts.map +1 -0
  136. package/dist/ledger-transaction/ledger-transaction.repository.js +4 -1
  137. package/dist/ledger-transaction/ledger-transaction.repository.js.map +1 -1
  138. package/dist/models/account.entity.d.ts +1 -0
  139. package/dist/models/account.entity.d.ts.map +1 -0
  140. package/dist/models/account.entity.js +7 -4
  141. package/dist/models/account.entity.js.map +1 -1
  142. package/dist/models/customer.entity.d.ts +1 -0
  143. package/dist/models/customer.entity.d.ts.map +1 -0
  144. package/dist/models/customer.entity.js +4 -1
  145. package/dist/models/customer.entity.js.map +1 -1
  146. package/dist/models/document-item.entity.d.ts +1 -0
  147. package/dist/models/document-item.entity.d.ts.map +1 -0
  148. package/dist/models/document-item.entity.js +5 -2
  149. package/dist/models/document-item.entity.js.map +1 -1
  150. package/dist/models/document-tag.entity.d.ts +14 -0
  151. package/dist/models/document-tag.entity.d.ts.map +1 -0
  152. package/dist/models/document-tag.entity.js +64 -0
  153. package/dist/models/document-tag.entity.js.map +1 -0
  154. package/dist/models/document.entity.d.ts +3 -0
  155. package/dist/models/document.entity.d.ts.map +1 -0
  156. package/dist/models/document.entity.js +12 -4
  157. package/dist/models/document.entity.js.map +1 -1
  158. package/dist/models/finance-company.entity.d.ts +1 -0
  159. package/dist/models/finance-company.entity.d.ts.map +1 -0
  160. package/dist/models/finance-company.entity.js +5 -2
  161. package/dist/models/finance-company.entity.js.map +1 -1
  162. package/dist/models/journal-entry.entity.d.ts +1 -0
  163. package/dist/models/journal-entry.entity.d.ts.map +1 -0
  164. package/dist/models/journal-entry.entity.js +5 -2
  165. package/dist/models/journal-entry.entity.js.map +1 -1
  166. package/dist/models/ledger-transaction.entity.d.ts +1 -0
  167. package/dist/models/ledger-transaction.entity.d.ts.map +1 -0
  168. package/dist/models/ledger-transaction.entity.js +7 -4
  169. package/dist/models/ledger-transaction.entity.js.map +1 -1
  170. package/dist/models/payment-item.entity.d.ts +1 -0
  171. package/dist/models/payment-item.entity.d.ts.map +1 -0
  172. package/dist/models/payment-item.entity.js +4 -1
  173. package/dist/models/payment-item.entity.js.map +1 -1
  174. package/dist/models/payment-method-type.entity.d.ts +1 -0
  175. package/dist/models/payment-method-type.entity.d.ts.map +1 -0
  176. package/dist/models/payment-method-type.entity.js +5 -2
  177. package/dist/models/payment-method-type.entity.js.map +1 -1
  178. package/dist/models/payment-method.entity.d.ts +1 -0
  179. package/dist/models/payment-method.entity.d.ts.map +1 -0
  180. package/dist/models/payment-method.entity.js +5 -2
  181. package/dist/models/payment-method.entity.js.map +1 -1
  182. package/dist/models/payment-paid-with.entity.d.ts +1 -0
  183. package/dist/models/payment-paid-with.entity.d.ts.map +1 -0
  184. package/dist/models/payment-paid-with.entity.js +5 -2
  185. package/dist/models/payment-paid-with.entity.js.map +1 -1
  186. package/dist/models/payment.entity.d.ts +1 -0
  187. package/dist/models/payment.entity.d.ts.map +1 -0
  188. package/dist/models/payment.entity.js +6 -3
  189. package/dist/models/payment.entity.js.map +1 -1
  190. package/dist/models/post-history.entity.d.ts +1 -0
  191. package/dist/models/post-history.entity.d.ts.map +1 -0
  192. package/dist/models/tag-group.entity.d.ts +16 -0
  193. package/dist/models/tag-group.entity.d.ts.map +1 -0
  194. package/dist/models/tag-group.entity.js +95 -0
  195. package/dist/models/tag-group.entity.js.map +1 -0
  196. package/dist/models/tag.entity.d.ts +17 -0
  197. package/dist/models/tag.entity.d.ts.map +1 -0
  198. package/dist/models/tag.entity.js +100 -0
  199. package/dist/models/tag.entity.js.map +1 -0
  200. package/dist/models/tax.entity.d.ts +1 -0
  201. package/dist/models/tax.entity.d.ts.map +1 -0
  202. package/dist/models/tax.entity.js +4 -1
  203. package/dist/models/tax.entity.js.map +1 -1
  204. package/dist/payment/interfaces/payment-attr.interface.d.ts +1 -0
  205. package/dist/payment/interfaces/payment-attr.interface.d.ts.map +1 -0
  206. package/dist/payment/interfaces/payment-params.interface.d.ts +1 -0
  207. package/dist/payment/interfaces/payment-params.interface.d.ts.map +1 -0
  208. package/dist/payment/payment.d.ts +1 -0
  209. package/dist/payment/payment.d.ts.map +1 -0
  210. package/dist/payment/payment.js +5 -2
  211. package/dist/payment/payment.js.map +1 -1
  212. package/dist/payment/payment.repository.d.ts +1 -0
  213. package/dist/payment/payment.repository.d.ts.map +1 -0
  214. package/dist/payment/payment.repository.js +4 -1
  215. package/dist/payment/payment.repository.js.map +1 -1
  216. package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +1 -0
  217. package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts.map +1 -0
  218. package/dist/payment-item/payment-item.d.ts +1 -0
  219. package/dist/payment-item/payment-item.d.ts.map +1 -0
  220. package/dist/payment-item/payment-item.js +4 -4
  221. package/dist/payment-item/payment-item.repository.d.ts +1 -0
  222. package/dist/payment-item/payment-item.repository.d.ts.map +1 -0
  223. package/dist/payment-item/payment-item.repository.js +4 -1
  224. package/dist/payment-item/payment-item.repository.js.map +1 -1
  225. package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts +1 -0
  226. package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts.map +1 -0
  227. package/dist/payment-method/payment-method.d.ts +1 -0
  228. package/dist/payment-method/payment-method.d.ts.map +1 -0
  229. package/dist/payment-method/payment-method.js +4 -1
  230. package/dist/payment-method/payment-method.js.map +1 -1
  231. package/dist/payment-method/payment-method.repository.d.ts +1 -0
  232. package/dist/payment-method/payment-method.repository.d.ts.map +1 -0
  233. package/dist/payment-method/payment-method.repository.js +4 -1
  234. package/dist/payment-method/payment-method.repository.js.map +1 -1
  235. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts +1 -0
  236. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts.map +1 -0
  237. package/dist/payment-method-type/payment-method-type.d.ts +1 -0
  238. package/dist/payment-method-type/payment-method-type.d.ts.map +1 -0
  239. package/dist/payment-method-type/payment-method-type.repository.d.ts +1 -0
  240. package/dist/payment-method-type/payment-method-type.repository.d.ts.map +1 -0
  241. package/dist/payment-method-type/payment-method-type.repository.js +4 -1
  242. package/dist/payment-method-type/payment-method-type.repository.js.map +1 -1
  243. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts +1 -0
  244. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts.map +1 -0
  245. package/dist/payment-paid-with/payment-paid-with.d.ts +1 -0
  246. package/dist/payment-paid-with/payment-paid-with.d.ts.map +1 -0
  247. package/dist/payment-paid-with/payment-paid-with.repository.d.ts +1 -0
  248. package/dist/payment-paid-with/payment-paid-with.repository.d.ts.map +1 -0
  249. package/dist/payment-paid-with/payment-paid-with.repository.js +4 -1
  250. package/dist/payment-paid-with/payment-paid-with.repository.js.map +1 -1
  251. package/dist/tag/interfaces/tag-attr.interface.d.ts +14 -0
  252. package/dist/tag/interfaces/tag-attr.interface.d.ts.map +1 -0
  253. package/dist/tag/interfaces/tag-attr.interface.js +3 -0
  254. package/dist/tag/interfaces/tag-attr.interface.js.map +1 -0
  255. package/dist/tag/tag.d.ts +26 -0
  256. package/dist/tag/tag.d.ts.map +1 -0
  257. package/dist/tag/tag.js +110 -0
  258. package/dist/tag/tag.js.map +1 -0
  259. package/dist/tag/tag.repository.d.ts +6 -0
  260. package/dist/tag/tag.repository.d.ts.map +1 -0
  261. package/dist/tag/tag.repository.js +15 -0
  262. package/dist/tag/tag.repository.js.map +1 -0
  263. package/dist/tag-group/interfaces/tag-group-attr.interface.d.ts +13 -0
  264. package/dist/tag-group/interfaces/tag-group-attr.interface.d.ts.map +1 -0
  265. package/dist/tag-group/interfaces/tag-group-attr.interface.js +3 -0
  266. package/dist/tag-group/interfaces/tag-group-attr.interface.js.map +1 -0
  267. package/dist/tag-group/tag-group.d.ts +24 -0
  268. package/dist/tag-group/tag-group.d.ts.map +1 -0
  269. package/dist/tag-group/tag-group.js +82 -0
  270. package/dist/tag-group/tag-group.js.map +1 -0
  271. package/dist/tag-group/tag-group.repository.d.ts +6 -0
  272. package/dist/tag-group/tag-group.repository.d.ts.map +1 -0
  273. package/dist/tag-group/tag-group.repository.js +15 -0
  274. package/dist/tag-group/tag-group.repository.js.map +1 -0
  275. package/dist/tax/interfaces/tax-attr.interface.d.ts +1 -0
  276. package/dist/tax/interfaces/tax-attr.interface.d.ts.map +1 -0
  277. package/dist/tax/tax.d.ts +1 -0
  278. package/dist/tax/tax.d.ts.map +1 -0
  279. package/dist/tax/tax.repository.d.ts +1 -0
  280. package/dist/tax/tax.repository.d.ts.map +1 -0
  281. package/dist/tax/tax.repository.js +4 -1
  282. package/dist/tax/tax.repository.js.map +1 -1
  283. package/dist/test-document.d.ts +1 -0
  284. package/dist/test-document.d.ts.map +1 -0
  285. package/dist/test.d.ts +1 -0
  286. package/dist/test.d.ts.map +1 -0
  287. package/dist/tsconfig.tsbuildinfo +1 -1
  288. package/migrations/finance-document-tag-migration.js +46 -0
  289. package/migrations/finance-tag-group-migration.js +53 -0
  290. package/migrations/finance-tag-migration.js +63 -0
  291. package/package.json +18 -18
  292. package/.gitlab-ci.yml +0 -16
  293. package/.husky/commit-msg +0 -13
  294. package/.husky/pre-commit +0 -4
  295. package/.prettierrc +0 -5
  296. package/CONTRIBUTING.md +0 -31
  297. package/README.md +0 -13
  298. package/eslint.config.mjs +0 -58
  299. package/nest-cli.json +0 -19
  300. package/sonar-project.properties +0 -13
  301. package/src/account/account.repository.ts +0 -11
  302. package/src/account/account.ts +0 -307
  303. package/src/account/interfaces/account-attr.interface.ts +0 -31
  304. package/src/account-system-entity/account-system-entity.ts +0 -66
  305. package/src/account-system-entity/post-history.repository.ts +0 -11
  306. package/src/config.ts +0 -382
  307. package/src/customer/customer.ts +0 -311
  308. package/src/customer/finance-customer.repository.ts +0 -13
  309. package/src/customer/interfaces/customer.repository.interface.ts +0 -3
  310. package/src/customer/interfaces/finance-customer-attr.interface.ts +0 -10
  311. package/src/customer/interfaces/finance-customer.repository.interface.ts +0 -4
  312. package/src/database.ts +0 -48
  313. package/src/document/document-item.repository.ts +0 -11
  314. package/src/document/document-item.ts +0 -146
  315. package/src/document/document.repository.ts +0 -11
  316. package/src/document/document.ts +0 -1328
  317. package/src/document/interfaces/document-attr.interface.ts +0 -28
  318. package/src/document/interfaces/document-find-all.interface.ts +0 -14
  319. package/src/document/interfaces/document-item-attr.interface.ts +0 -26
  320. package/src/document/interfaces/document-item.repository.interface.ts +0 -4
  321. package/src/enum/collect-payment-type.ts +0 -4
  322. package/src/enum/doc-type.enum.ts +0 -8
  323. package/src/enum/document-status.enum.ts +0 -6
  324. package/src/enum/index.ts +0 -19
  325. package/src/enum/payment-method.enum.ts +0 -3
  326. package/src/enum/payment-status.enum.ts +0 -11
  327. package/src/enum/payment-type.enum.ts +0 -4
  328. package/src/enum/quick-book-client-scopes.enum.ts +0 -14
  329. package/src/enum/transaction-type.enum.ts +0 -4
  330. package/src/finance-company/finance-company.repository.ts +0 -11
  331. package/src/finance-company/finance-company.ts +0 -2434
  332. package/src/helpers/login-user.ts +0 -38
  333. package/src/helpers/typeof.ts +0 -35
  334. package/src/index.ts +0 -32
  335. package/src/interfaces/account-system.interface.ts +0 -51
  336. package/src/interfaces/index.ts +0 -3
  337. package/src/journal-entry/interfaces/journal-entry-attr.interface.ts +0 -12
  338. package/src/journal-entry/journal-entry.repository.ts +0 -17
  339. package/src/journal-entry/journal-entry.ts +0 -264
  340. package/src/ledger-transaction/interfaces/ledger-transaction-attr.interface.ts +0 -18
  341. package/src/ledger-transaction/interfaces/ledger-transaction.repository.interface.ts +0 -7
  342. package/src/ledger-transaction/ledger-transaction.repository.ts +0 -17
  343. package/src/ledger-transaction/ledger-transaction.ts +0 -182
  344. package/src/models/account.entity.ts +0 -206
  345. package/src/models/customer.entity.ts +0 -93
  346. package/src/models/document-item.entity.ts +0 -167
  347. package/src/models/document.entity.ts +0 -211
  348. package/src/models/finance-company.entity.ts +0 -69
  349. package/src/models/journal-entry.entity.ts +0 -110
  350. package/src/models/ledger-transaction.entity.ts +0 -148
  351. package/src/models/payment-item.entity.ts +0 -60
  352. package/src/models/payment-method-type.entity.ts +0 -70
  353. package/src/models/payment-method.entity.ts +0 -51
  354. package/src/models/payment-paid-with.entity.ts +0 -133
  355. package/src/models/payment.entity.ts +0 -165
  356. package/src/models/post-history.entity.ts +0 -41
  357. package/src/models/tax.entity.ts +0 -75
  358. package/src/payment/interfaces/payment-attr.interface.ts +0 -23
  359. package/src/payment/interfaces/payment-params.interface.ts +0 -8
  360. package/src/payment/payment.repository.ts +0 -11
  361. package/src/payment/payment.ts +0 -236
  362. package/src/payment-item/interfaces/payment-item-attr.interface.ts +0 -10
  363. package/src/payment-item/payment-item.repository.ts +0 -11
  364. package/src/payment-item/payment-item.ts +0 -134
  365. package/src/payment-method/interfaces/payment-method-attr.interface.ts +0 -5
  366. package/src/payment-method/payment-method.repository.ts +0 -11
  367. package/src/payment-method/payment-method.ts +0 -146
  368. package/src/payment-method-type/interfaces/payment-method-type-attr.interface.ts +0 -8
  369. package/src/payment-method-type/payment-method-type.repository.ts +0 -11
  370. package/src/payment-method-type/payment-method-type.ts +0 -79
  371. package/src/payment-paid-with/interfaces/payment-paid-with.interface.ts +0 -20
  372. package/src/payment-paid-with/payment-paid-with.repository.ts +0 -11
  373. package/src/payment-paid-with/payment-paid-with.ts +0 -74
  374. package/src/tax/interfaces/tax-attr.interface.ts +0 -10
  375. package/src/tax/tax.repository.ts +0 -11
  376. package/src/tax/tax.ts +0 -68
  377. package/src/test-document.ts +0 -25
  378. package/src/test.ts +0 -3
  379. package/tsconfig.build.json +0 -4
  380. package/tsconfig.json +0 -23
@@ -1,165 +0,0 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import {
3
- Column,
4
- DataType,
5
- HasMany,
6
- Model,
7
- Table,
8
- UpdatedAt,
9
- BelongsTo,
10
- } from 'sequelize-typescript';
11
- import { ForeignKey } from 'sequelize-typescript/dist/associations/foreign-key/foreign-key';
12
- import { PaymentType, PaymentStatus } from '../enum';
13
- import DocumentModel from './document.entity';
14
- import PaymentItemModel from './payment-item.entity';
15
- import PaymentPaidWithModel from './payment-paid-with.entity';
16
-
17
- @Table({
18
- tableName: 'finance_Payment',
19
- timestamps: true,
20
- createdAt: false,
21
- })
22
- export default class PaymentModel extends Model {
23
- @Column({
24
- primaryKey: true,
25
- allowNull: false,
26
- type: DataType.STRING(30),
27
- })
28
- PaymentId: string;
29
-
30
- @Column({
31
- allowNull: false,
32
- type: DataType.ENUM('Payment Received', 'Payout'),
33
- })
34
- PaymentType: PaymentType;
35
-
36
- @Column({
37
- allowNull: false,
38
- type: DataType.DATE,
39
- })
40
- PaymentDate: Date;
41
-
42
- @Column({
43
- allowNull: false,
44
- type: DataType.STRING(1000),
45
- })
46
- Description: string;
47
-
48
- @Column({
49
- allowNull: false,
50
- type: DataType.CHAR(3),
51
- })
52
- Currency: string;
53
-
54
- @Column({
55
- allowNull: false,
56
- type: DataType.DECIMAL(10, 2),
57
- })
58
- Amount: number;
59
-
60
- @Column({
61
- allowNull: false,
62
- type: DataType.STRING(30),
63
- })
64
- Status: PaymentStatus;
65
-
66
- @Column({
67
- allowNull: true,
68
- type: DataType.STRING(30),
69
- })
70
- ReceivedBy: string;
71
-
72
- @Column({
73
- allowNull: true,
74
- type: DataType.STRING(30),
75
- })
76
- IssuedBy: string;
77
-
78
- @ApiProperty({
79
- example: new Date(),
80
- description: 'Timestamp for latest data modification',
81
- })
82
- @UpdatedAt
83
- UpdatedAt: Date;
84
-
85
- @Column({
86
- allowNull: false,
87
- type: DataType.STRING(30),
88
- })
89
- UpdatedBy: string;
90
-
91
- @Column({
92
- allowNull: true,
93
- type: DataType.TEXT,
94
- })
95
- Remarks: string;
96
-
97
- @Column({
98
- allowNull: true,
99
- type: DataType.STRING(30),
100
- })
101
- RelatedObjectId: string;
102
-
103
- @Column({
104
- allowNull: true,
105
- type: DataType.STRING(200),
106
- })
107
- RelatedObjectType: string;
108
-
109
- @ApiProperty({ type: String, description: 'DocNo' })
110
- @ForeignKey(() => DocumentModel)
111
- @Column({
112
- allowNull: true,
113
- type: DataType.STRING(30),
114
- })
115
- ReceiptDocNo: string;
116
-
117
- @ApiProperty({
118
- type: String,
119
- description: 'Account Customer Id in API',
120
- })
121
- @Column({
122
- allowNull: true,
123
- type: DataType.STRING(30),
124
- })
125
- AccSystemRefId: string;
126
-
127
- @ApiProperty({
128
- example: 'N',
129
- description: 'PostedToAccSystemYN',
130
- })
131
- @Column({
132
- allowNull: false,
133
- type: DataType.ENUM('Y', 'N'),
134
- })
135
- PostedToAccSystemYN: string;
136
-
137
- @ApiProperty({
138
- example: '138140891dd211b288',
139
- description: 'PostedById',
140
- })
141
- @Column({
142
- allowNull: true,
143
- type: DataType.STRING(30),
144
- })
145
- PostedById: string;
146
-
147
- @ApiProperty({
148
- example: new Date(),
149
- description: 'PostedToAccSystem Date',
150
- })
151
- @Column({
152
- allowNull: true,
153
- type: DataType.DATE,
154
- })
155
- PostedDateTime: Date;
156
-
157
- @HasMany(() => PaymentItemModel)
158
- PaymentItems: PaymentItemModel[];
159
-
160
- @HasMany(() => PaymentPaidWithModel)
161
- PaymentPaidWiths: PaymentPaidWithModel[];
162
-
163
- @BelongsTo(() => DocumentModel)
164
- Document: DocumentModel;
165
- }
@@ -1,41 +0,0 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { Column, DataType, Model, Table } from 'sequelize-typescript';
3
-
4
- @Table({ tableName: 'finance_PostHistory', createdAt: false, updatedAt: false })
5
- export default class FinancePostHistoryModel extends Model {
6
- @ApiProperty({ type: String, description: 'PostId' })
7
- @Column({
8
- primaryKey: true,
9
- allowNull: false,
10
- type: DataType.STRING(30),
11
- })
12
- PostId: string;
13
-
14
- @ApiProperty({ type: Date })
15
- @Column({ allowNull: false, type: DataType.DATE })
16
- DateTime: Date;
17
-
18
- @ApiProperty({ type: String, description: 'ItemId' })
19
- @Column({ allowNull: false, type: DataType.STRING(30) })
20
- ItemId: string;
21
-
22
- @ApiProperty({ type: String, description: 'ItemType' })
23
- @Column({ allowNull: false, type: DataType.STRING(200) })
24
- ItemType: string;
25
-
26
- @ApiProperty({ type: String, description: 'ItemValue' })
27
- @Column({ allowNull: false, type: DataType.JSON })
28
- ItemValue: string;
29
-
30
- @ApiProperty()
31
- @Column({ allowNull: false, type: DataType.STRING(30) })
32
- PostedById: string;
33
-
34
- @ApiProperty()
35
- @Column({ allowNull: false, type: DataType.STRING(10) })
36
- AccSystemCode: string;
37
-
38
- @ApiProperty()
39
- @Column({ allowNull: false, type: DataType.STRING(30) })
40
- AccSystemRefId: string;
41
- }
@@ -1,75 +0,0 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import {
3
- BelongsTo,
4
- Column,
5
- CreatedAt,
6
- DataType,
7
- ForeignKey,
8
- Model,
9
- Table,
10
- UpdatedAt,
11
- } from 'sequelize-typescript';
12
- import FinanceCompanyModel from './finance-company.entity';
13
-
14
- @Table({ tableName: 'finance_Tax' })
15
- export default class FinanceTaxModel extends Model {
16
- @ApiProperty({ type: String, description: 'TaxCode' })
17
- @Column({
18
- primaryKey: true,
19
- allowNull: false,
20
- type: DataType.STRING(30),
21
- })
22
- TaxCode: string;
23
-
24
- @ApiProperty({ type: Number, description: 'TaxRate' })
25
- @Column({ allowNull: false, type: DataType.DECIMAL(10, 2) })
26
- TaxRate: number;
27
-
28
- @ApiProperty({ type: String, description: 'Description' })
29
- @Column({ allowNull: true, type: DataType.STRING(1000) })
30
- Description: string;
31
-
32
- @ForeignKey(() => FinanceCompanyModel)
33
- @Column({
34
- allowNull: false,
35
- type: DataType.STRING(30),
36
- })
37
- CompanyId: string;
38
-
39
- @ApiProperty({
40
- example: '138140891dd211b288d34bc7b4312a49',
41
- description: 'CreatedById.',
42
- })
43
- @Column({
44
- allowNull: false,
45
- type: DataType.STRING(30),
46
- })
47
- CreatedById: string;
48
-
49
- @ApiProperty({
50
- example: new Date(),
51
- description: 'Timestamp for data creation.',
52
- })
53
- @CreatedAt
54
- CreatedAt: Date;
55
-
56
- @ApiProperty({
57
- example: '138140891dd211b288d34bc7b4312a49',
58
- description: 'UpdatedById.',
59
- })
60
- @Column({
61
- allowNull: false,
62
- type: DataType.STRING(30),
63
- })
64
- UpdatedById: string;
65
-
66
- @ApiProperty({
67
- example: new Date(),
68
- description: 'Timestamp for latest data modification',
69
- })
70
- @UpdatedAt
71
- UpdatedAt: Date;
72
-
73
- @BelongsTo(() => FinanceCompanyModel)
74
- FinanceCompany: FinanceCompanyModel;
75
- }
@@ -1,23 +0,0 @@
1
- import { PaymentType, PaymentStatus } from '../../enum';
2
-
3
- export class IPaymentAttr {
4
- PaymentId: string;
5
- PaymentType: PaymentType;
6
- PaymentDate: Date;
7
- Description: string;
8
- Currency: string;
9
- Amount: number;
10
- Status: PaymentStatus;
11
- ReceivedBy?: string;
12
- IssuedBy?: string;
13
- RelatedObjectId?: string;
14
- RelatedObjectType?: string;
15
- ReceiptDocNo?: string;
16
- Remarks?: string;
17
- UpdatedAt: Date;
18
- UpdatedBy: string;
19
- AccSystemRefId?: string;
20
- PostedToAccSystemYN: string;
21
- PostedById?: string;
22
- PostedDateTime?: Date;
23
- }
@@ -1,8 +0,0 @@
1
- import { PaymentMethod, PaymentType } from '../../enum';
2
-
3
- export interface IPaymentParams {
4
- Currency?: string;
5
- Method?: PaymentMethod;
6
- MethodParty?: string;
7
- PaymentType?: PaymentType;
8
- }
@@ -1,11 +0,0 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import PaymentModel from '../models/payment.entity';
3
-
4
- export class PaymentRepository
5
- extends RepositoryBase<PaymentModel>
6
- implements IRepositoryBase<PaymentModel>
7
- {
8
- constructor() {
9
- super(PaymentModel);
10
- }
11
- }
@@ -1,236 +0,0 @@
1
- import { ObjectBase } from '@tomei/general';
2
- import { RecordNotFoundError } from '@tomei/general/dist/class/exceptions/record-not-found.error';
3
- import { PaymentType } from '../enum';
4
- import { IPaymentParams } from './interfaces/payment-params.interface';
5
- import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
6
- import { PaymentStatus } from '../enum/payment-status.enum';
7
- import { PaymentRepository } from './payment.repository';
8
- import { PaymentItemRepository } from '../payment-item/payment-item.repository';
9
- // import PaymentItemModel from '../models/payment-item.entity';
10
- import PaymentItem from '../payment-item/payment-item';
11
- import PaymentPaidWith from '../payment-paid-with/payment-paid-with';
12
- import { PaymentPaidWithRepository } from '../payment-paid-with/payment-paid-with.repository';
13
-
14
- export default class Payment extends AccountSystemEntity {
15
- private _PaymentId = 'New';
16
- PaymentType: PaymentType;
17
- PaymentDate: Date;
18
- MethodTypeId: string;
19
- Description = '';
20
- Currency = 'MYR';
21
- Amount = 0;
22
- Status: PaymentStatus;
23
- TransactionId: string;
24
- TransactionApprovalCode: string;
25
- TransactionAccountName: string;
26
- TransactionAccountNo: string;
27
- ReceivedBy = '';
28
- IssuedBy = '';
29
- UpdatedBy = '';
30
- UpdatedAt: Date;
31
- Remarks = '';
32
- RelatedObjectId = '';
33
- RelatedObjectType = '';
34
- ReceiptDocNo = '';
35
- protected _ObjectType: 'Payment';
36
-
37
- private static _RepositoryBase = new PaymentRepository();
38
- private static _PaymentItemRepository = new PaymentItemRepository();
39
- private static _PaymentPaidWithRepository = new PaymentPaidWithRepository();
40
-
41
- private _DbTransaction: any;
42
- private _PaymentItems = [];
43
- private _PaymentPaidWith = [];
44
-
45
- paymentItemRepository: PaymentItemRepository;
46
-
47
- public get PaymentId() {
48
- return this._PaymentId;
49
- }
50
-
51
- get ObjectType() {
52
- return this._ObjectType;
53
- }
54
-
55
- public set PaymentId(id: string) {
56
- this._PaymentId = id;
57
- }
58
-
59
- /* AccountSystemEntity Implementation */
60
- get RepositoryBase() {
61
- return Payment._RepositoryBase;
62
- }
63
-
64
- /* ObjectBase Implementation */
65
- get ObjectId() {
66
- return this.PaymentId;
67
- }
68
-
69
- get ObjectName() {
70
- return this.PaymentId;
71
- }
72
-
73
- get TableName() {
74
- return 'finance_Payment';
75
- }
76
-
77
- constructor(dbTransaction?: any, paymentId?: string) {
78
- super();
79
- if (dbTransaction) {
80
- this._DbTransaction = dbTransaction;
81
- }
82
- if (paymentId) {
83
- this.PaymentId = paymentId;
84
- }
85
- }
86
-
87
- static async initPayment(
88
- dbTransaction: any,
89
- paymentId: string,
90
- ): Promise<Payment> {
91
- try {
92
- const paymentData = await this._RepositoryBase.findOne({
93
- where: {
94
- PaymentId: paymentId,
95
- },
96
- transaction: dbTransaction,
97
- });
98
- if (paymentData) {
99
- const payment = new Payment(dbTransaction, paymentId);
100
- payment.PaymentType = paymentData.PaymentType;
101
- payment.PaymentDate = paymentData.PaymentDate;
102
- payment.Description = paymentData.Description;
103
- payment.Currency = paymentData.Currency;
104
- payment.Amount = paymentData.Amount;
105
- payment.Status = paymentData.Status;
106
- payment.ReceivedBy = paymentData.ReceivedBy;
107
- payment.IssuedBy = paymentData.IssuedBy;
108
- payment.UpdatedAt = paymentData.UpdatedAt;
109
- payment.UpdatedBy = paymentData.UpdatedBy;
110
- payment.Remarks = paymentData.Remarks;
111
- payment.RelatedObjectId = paymentData.RelatedObjectId;
112
- payment.RelatedObjectType = paymentData.RelatedObjectType;
113
- payment.ReceiptDocNo = paymentData.ReceiptDocNo;
114
- payment.AccSystemRefId = paymentData.AccSystemRefId;
115
- payment.PostedToAccSystemYN = paymentData.PostedToAccSystemYN;
116
- payment.PostedById = paymentData.PostedById;
117
- payment.PostedDateTime = paymentData.PostedDateTime;
118
- return payment;
119
- } else {
120
- const notFoundError = new RecordNotFoundError(
121
- 'PaymentErrMsg',
122
- 'No Record Found.',
123
- );
124
- throw notFoundError;
125
- }
126
- } catch (error) {
127
- console.log('Payment Class constructor err: ', error);
128
- }
129
- }
130
-
131
- async getPaymentItems(dbTransaction?: any): Promise<PaymentItem[]> {
132
- try {
133
- if (this.PaymentId !== 'New') {
134
- const paymentItems = await Payment._PaymentItemRepository.findAll({
135
- where: {
136
- PaymentId: this.PaymentId,
137
- },
138
- transaction: dbTransaction || this._DbTransaction,
139
- });
140
- const paymentItemObjects = paymentItems.map((paymentItem) => {
141
- const pi = new PaymentItem(
142
- new Payment(this._DbTransaction, paymentItem.PaymentId),
143
- {
144
- ObjectId: this.ObjectId,
145
- ObjectName: this.ObjectName,
146
- TableName: this.TableName,
147
- ObjectType: this.ObjectType,
148
- } as ObjectBase,
149
- );
150
- pi.PayForObjectType = paymentItem.PayForObjectType;
151
- pi.PayForObjectId = paymentItem.PayForObjectId;
152
- pi.Currency = paymentItem.Currency;
153
- pi.Amount = paymentItem.Amount;
154
- pi.Name = paymentItem.Name;
155
- pi.Description = paymentItem.Description;
156
-
157
- return pi;
158
- });
159
-
160
- this._PaymentItems = paymentItemObjects;
161
- return this._PaymentItems;
162
- } else {
163
- return this._PaymentItems;
164
- }
165
- } catch (error) {
166
- throw error;
167
- }
168
- }
169
-
170
- async getPaymentPaidWith(dbTransaction?: any): Promise<PaymentPaidWith[]> {
171
- try {
172
- if (this.PaymentId !== 'New') {
173
- const paymentPaidWithItems =
174
- await Payment._PaymentPaidWithRepository.findAll({
175
- where: {
176
- PaymentId: this.PaymentId,
177
- },
178
- transaction: dbTransaction || this._DbTransaction,
179
- });
180
- const paymentPaidWithObjects = paymentPaidWithItems.map(
181
- (paymentPaidWithItem) => {
182
- const ppw = new PaymentPaidWith(
183
- new Payment(this._DbTransaction, paymentPaidWithItem.PaymentId),
184
- paymentPaidWithItem.MethodTypeId,
185
- );
186
-
187
- ppw.Currency = paymentPaidWithItem.Currency;
188
- ppw.Amount = paymentPaidWithItem.Amount;
189
- ppw.Status = paymentPaidWithItem.Status;
190
- ppw.TransactionId = paymentPaidWithItem.TransactionId;
191
- ppw.RefBank = paymentPaidWithItem.RefBank;
192
- ppw.RefName = paymentPaidWithItem.RefName;
193
- ppw.RefNo = paymentPaidWithItem.RefNo;
194
- ppw.RefOther1 = paymentPaidWithItem.RefOther1;
195
- ppw.RefOther2 = paymentPaidWithItem.RefOther2;
196
- ppw.RefOther3 = paymentPaidWithItem.RefOther3;
197
- ppw.RefOther4 = paymentPaidWithItem.RefOther4;
198
- ppw.RefOther5 = paymentPaidWithItem.RefOther5;
199
- ppw.Remarks = paymentPaidWithItem.Remarks;
200
- ppw.PaymentMediaId = paymentPaidWithItem.PaymentMediaId;
201
-
202
- return ppw;
203
- },
204
- );
205
-
206
- this._PaymentPaidWith = paymentPaidWithObjects;
207
- return this._PaymentPaidWith;
208
- } else {
209
- return this._PaymentPaidWith;
210
- }
211
- } catch (error) {
212
- throw error;
213
- }
214
- }
215
-
216
- newPaymentItem(objectBeingPaidFor: ObjectBase): PaymentItem {
217
- const paymentItem = new PaymentItem(this, objectBeingPaidFor);
218
- this._PaymentItems.push(paymentItem);
219
- return paymentItem;
220
- }
221
-
222
- newPaymentPaidWith(paymentMethodTypeId: string) {
223
- const paymentPaidWith = new PaymentPaidWith(
224
- this,
225
- paymentMethodTypeId,
226
- this._DbTransaction,
227
- );
228
- this._PaymentPaidWith.push(paymentPaidWith);
229
- return paymentPaidWith;
230
- }
231
-
232
- init(Params: IPaymentParams): void {
233
- if (Params.Currency) this.Currency = Params.Currency;
234
- if (Params.PaymentType) this.PaymentType = Params.PaymentType;
235
- }
236
- }
@@ -1,10 +0,0 @@
1
- export class IPaymentItemAttr {
2
- PaymentId: string;
3
- PayForObjectId: string;
4
- PayForObjectType: string;
5
- Currency: string;
6
- Amount: number;
7
- Name?: string;
8
- Description: string;
9
- Remarks?: string;
10
- }
@@ -1,11 +0,0 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import PaymentItemModel from '../models/payment-item.entity';
3
-
4
- export class PaymentItemRepository
5
- extends RepositoryBase<PaymentItemModel>
6
- implements IRepositoryBase<PaymentItemModel>
7
- {
8
- constructor() {
9
- super(PaymentItemModel);
10
- }
11
- }