@things-factory/accounting 9.0.0-beta.27 → 9.0.0-beta.29

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 (402) hide show
  1. package/dist-client/activities/activity-book-edit.d.ts +14 -0
  2. package/dist-client/activities/activity-book-edit.js +85 -0
  3. package/dist-client/activities/activity-book-edit.js.map +1 -0
  4. package/dist-client/activities/activity-book-view.d.ts +14 -0
  5. package/dist-client/activities/activity-book-view.js +85 -0
  6. package/dist-client/activities/activity-book-view.js.map +1 -0
  7. package/dist-client/activities/activity-expense-edit.d.ts +14 -0
  8. package/dist-client/activities/activity-expense-edit.js +85 -0
  9. package/dist-client/activities/activity-expense-edit.js.map +1 -0
  10. package/dist-client/activities/activity-expense-view.d.ts +14 -0
  11. package/dist-client/activities/activity-expense-view.js +85 -0
  12. package/dist-client/activities/activity-expense-view.js.map +1 -0
  13. package/dist-client/bootstrap.d.ts +1 -0
  14. package/dist-client/bootstrap.js +8 -0
  15. package/dist-client/bootstrap.js.map +1 -0
  16. package/dist-client/components/accounting-category-selector.d.ts +16 -0
  17. package/dist-client/components/accounting-category-selector.js +134 -0
  18. package/dist-client/components/accounting-category-selector.js.map +1 -0
  19. package/dist-client/components/accounting-category-view.d.ts +14 -0
  20. package/dist-client/components/accounting-category-view.js +81 -0
  21. package/dist-client/components/accounting-category-view.js.map +1 -0
  22. package/dist-client/grist-editors/grist-editor-accounting-category-object.d.ts +11 -0
  23. package/dist-client/grist-editors/grist-editor-accounting-category-object.js +71 -0
  24. package/dist-client/grist-editors/grist-editor-accounting-category-object.js.map +1 -0
  25. package/dist-client/grist-editors/grist-renderer-accounting-category-object.d.ts +2 -0
  26. package/dist-client/grist-editors/grist-renderer-accounting-category-object.js +9 -0
  27. package/dist-client/grist-editors/grist-renderer-accounting-category-object.js.map +1 -0
  28. package/dist-client/index.d.ts +0 -0
  29. package/dist-client/index.js +2 -0
  30. package/dist-client/index.js.map +1 -0
  31. package/dist-client/pages/account/account-importer.d.ts +22 -0
  32. package/dist-client/pages/account/account-importer.js +100 -0
  33. package/dist-client/pages/account/account-importer.js.map +1 -0
  34. package/dist-client/pages/account/account-list-page.d.ts +63 -0
  35. package/dist-client/pages/account/account-list-page.js +350 -0
  36. package/dist-client/pages/account/account-list-page.js.map +1 -0
  37. package/dist-client/pages/accounting-category/accounting-category-importer.d.ts +22 -0
  38. package/dist-client/pages/accounting-category/accounting-category-importer.js +100 -0
  39. package/dist-client/pages/accounting-category/accounting-category-importer.js.map +1 -0
  40. package/dist-client/pages/accounting-category/accounting-category-list-page.d.ts +63 -0
  41. package/dist-client/pages/accounting-category/accounting-category-list-page.js +354 -0
  42. package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -0
  43. package/dist-client/pages/accounting-category/accounting-category-tree-page.d.ts +46 -0
  44. package/dist-client/pages/accounting-category/accounting-category-tree-page.js +329 -0
  45. package/dist-client/pages/accounting-category/accounting-category-tree-page.js.map +1 -0
  46. package/dist-client/pages/accounting-document/accounting-document-importer.d.ts +23 -0
  47. package/dist-client/pages/accounting-document/accounting-document-importer.js +93 -0
  48. package/dist-client/pages/accounting-document/accounting-document-importer.js.map +1 -0
  49. package/dist-client/pages/accounting-document/accounting-document-list-page.d.ts +66 -0
  50. package/dist-client/pages/accounting-document/accounting-document-list-page.js +370 -0
  51. package/dist-client/pages/accounting-document/accounting-document-list-page.js.map +1 -0
  52. package/dist-client/pages/bank/bank-importer.d.ts +23 -0
  53. package/dist-client/pages/bank/bank-importer.js +93 -0
  54. package/dist-client/pages/bank/bank-importer.js.map +1 -0
  55. package/dist-client/pages/bank/bank-list-page.d.ts +66 -0
  56. package/dist-client/pages/bank/bank-list-page.js +370 -0
  57. package/dist-client/pages/bank/bank-list-page.js.map +1 -0
  58. package/dist-client/pages/bank-account/bank-account-importer.d.ts +23 -0
  59. package/dist-client/pages/bank-account/bank-account-importer.js +93 -0
  60. package/dist-client/pages/bank-account/bank-account-importer.js.map +1 -0
  61. package/dist-client/pages/bank-account/bank-account-list-page.d.ts +66 -0
  62. package/dist-client/pages/bank-account/bank-account-list-page.js +370 -0
  63. package/dist-client/pages/bank-account/bank-account-list-page.js.map +1 -0
  64. package/dist-client/pages/financial-institution/financial-institution-importer.d.ts +23 -0
  65. package/dist-client/pages/financial-institution/financial-institution-importer.js +93 -0
  66. package/dist-client/pages/financial-institution/financial-institution-importer.js.map +1 -0
  67. package/dist-client/pages/financial-institution/financial-institution-list-page.d.ts +66 -0
  68. package/dist-client/pages/financial-institution/financial-institution-list-page.js +370 -0
  69. package/dist-client/pages/financial-institution/financial-institution-list-page.js.map +1 -0
  70. package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +22 -0
  71. package/dist-client/pages/financial-statement/financial-statement-importer.js +100 -0
  72. package/dist-client/pages/financial-statement/financial-statement-importer.js.map +1 -0
  73. package/dist-client/pages/financial-statement/financial-statement-list-page.d.ts +63 -0
  74. package/dist-client/pages/financial-statement/financial-statement-list-page.js +324 -0
  75. package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +1 -0
  76. package/dist-client/pages/fiscal-month/fiscal-month-importer.d.ts +23 -0
  77. package/dist-client/pages/fiscal-month/fiscal-month-importer.js +93 -0
  78. package/dist-client/pages/fiscal-month/fiscal-month-importer.js.map +1 -0
  79. package/dist-client/pages/fiscal-month/fiscal-month-list-page.d.ts +66 -0
  80. package/dist-client/pages/fiscal-month/fiscal-month-list-page.js +370 -0
  81. package/dist-client/pages/fiscal-month/fiscal-month-list-page.js.map +1 -0
  82. package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.d.ts +23 -0
  83. package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js +93 -0
  84. package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js.map +1 -0
  85. package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.d.ts +66 -0
  86. package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js +370 -0
  87. package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js.map +1 -0
  88. package/dist-client/pages/fiscal-year/fiscal-year-importer.d.ts +23 -0
  89. package/dist-client/pages/fiscal-year/fiscal-year-importer.js +93 -0
  90. package/dist-client/pages/fiscal-year/fiscal-year-importer.js.map +1 -0
  91. package/dist-client/pages/fiscal-year/fiscal-year-list-page.d.ts +66 -0
  92. package/dist-client/pages/fiscal-year/fiscal-year-list-page.js +370 -0
  93. package/dist-client/pages/fiscal-year/fiscal-year-list-page.js.map +1 -0
  94. package/dist-client/pages/income-statement/income-statement-importer.d.ts +22 -0
  95. package/dist-client/pages/income-statement/income-statement-importer.js +100 -0
  96. package/dist-client/pages/income-statement/income-statement-importer.js.map +1 -0
  97. package/dist-client/pages/income-statement/income-statement-list-page.d.ts +63 -0
  98. package/dist-client/pages/income-statement/income-statement-list-page.js +324 -0
  99. package/dist-client/pages/income-statement/income-statement-list-page.js.map +1 -0
  100. package/dist-client/pages/payment/payment-importer.d.ts +23 -0
  101. package/dist-client/pages/payment/payment-importer.js +93 -0
  102. package/dist-client/pages/payment/payment-importer.js.map +1 -0
  103. package/dist-client/pages/payment/payment-list-page.d.ts +66 -0
  104. package/dist-client/pages/payment/payment-list-page.js +370 -0
  105. package/dist-client/pages/payment/payment-list-page.js.map +1 -0
  106. package/dist-client/pages/transaction/transaction-importer.d.ts +22 -0
  107. package/dist-client/pages/transaction/transaction-importer.js +100 -0
  108. package/dist-client/pages/transaction/transaction-importer.js.map +1 -0
  109. package/dist-client/pages/transaction/transaction-list-page.d.ts +63 -0
  110. package/dist-client/pages/transaction/transaction-list-page.js +324 -0
  111. package/dist-client/pages/transaction/transaction-list-page.js.map +1 -0
  112. package/dist-client/route.d.ts +1 -0
  113. package/dist-client/route.js +29 -0
  114. package/dist-client/route.js.map +1 -0
  115. package/dist-client/tsconfig.tsbuildinfo +1 -0
  116. package/dist-client/types/accounting-category.d.ts +16 -0
  117. package/dist-client/types/accounting-category.js +3 -0
  118. package/dist-client/types/accounting-category.js.map +1 -0
  119. package/dist-client/types/index.d.ts +1 -0
  120. package/dist-client/types/index.js +2 -0
  121. package/dist-client/types/index.js.map +1 -0
  122. package/dist-server/activities/activity-book.d.ts +58 -0
  123. package/dist-server/activities/activity-book.js +163 -0
  124. package/dist-server/activities/activity-book.js.map +1 -0
  125. package/dist-server/activities/activity-expense.d.ts +58 -0
  126. package/dist-server/activities/activity-expense.js +150 -0
  127. package/dist-server/activities/activity-expense.js.map +1 -0
  128. package/dist-server/activities/index.d.ts +1 -0
  129. package/dist-server/activities/index.js +19 -0
  130. package/dist-server/activities/index.js.map +1 -0
  131. package/dist-server/controllers/index.d.ts +1 -0
  132. package/dist-server/controllers/index.js +5 -0
  133. package/dist-server/controllers/index.js.map +1 -0
  134. package/dist-server/controllers/summary-statements.d.ts +4 -0
  135. package/dist-server/controllers/summary-statements.js +149 -0
  136. package/dist-server/controllers/summary-statements.js.map +1 -0
  137. package/dist-server/index.d.ts +5 -0
  138. package/dist-server/index.js +9 -0
  139. package/dist-server/index.js.map +1 -0
  140. package/dist-server/middlewares/index.d.ts +1 -0
  141. package/dist-server/middlewares/index.js +7 -0
  142. package/dist-server/middlewares/index.js.map +1 -0
  143. package/dist-server/migrations/1725200507196-seed-fiscal-entities.d.ts +5 -0
  144. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js +95 -0
  145. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js.map +1 -0
  146. package/dist-server/migrations/1725201467183-seed-accounts.d.ts +5 -0
  147. package/dist-server/migrations/1725201467183-seed-accounts.js +318 -0
  148. package/dist-server/migrations/1725201467183-seed-accounts.js.map +1 -0
  149. package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +5 -0
  150. package/dist-server/migrations/1725201567284-seed-country-codes.js +248 -0
  151. package/dist-server/migrations/1725201567284-seed-country-codes.js.map +1 -0
  152. package/dist-server/migrations/1725201667385-seed-financial-institutions.d.ts +5 -0
  153. package/dist-server/migrations/1725201667385-seed-financial-institutions.js +348 -0
  154. package/dist-server/migrations/1725201667385-seed-financial-institutions.js.map +1 -0
  155. package/dist-server/migrations/index.d.ts +1 -0
  156. package/dist-server/migrations/index.js +12 -0
  157. package/dist-server/migrations/index.js.map +1 -0
  158. package/dist-server/routes.d.ts +0 -0
  159. package/dist-server/routes.js +24 -0
  160. package/dist-server/routes.js.map +1 -0
  161. package/dist-server/service/account/account-history.d.ts +26 -0
  162. package/dist-server/service/account/account-history.js +128 -0
  163. package/dist-server/service/account/account-history.js.map +1 -0
  164. package/dist-server/service/account/account-mutation.d.ts +10 -0
  165. package/dist-server/service/account/account-mutation.js +134 -0
  166. package/dist-server/service/account/account-mutation.js.map +1 -0
  167. package/dist-server/service/account/account-query.d.ts +11 -0
  168. package/dist-server/service/account/account-query.js +81 -0
  169. package/dist-server/service/account/account-query.js.map +1 -0
  170. package/dist-server/service/account/account-type.d.ts +17 -0
  171. package/dist-server/service/account/account-type.js +65 -0
  172. package/dist-server/service/account/account-type.js.map +1 -0
  173. package/dist-server/service/account/account.d.ts +22 -0
  174. package/dist-server/service/account/account.js +113 -0
  175. package/dist-server/service/account/account.js.map +1 -0
  176. package/dist-server/service/account/event-subscriber.d.ts +7 -0
  177. package/dist-server/service/account/event-subscriber.js +21 -0
  178. package/dist-server/service/account/event-subscriber.js.map +1 -0
  179. package/dist-server/service/account/index.d.ts +7 -0
  180. package/dist-server/service/account/index.js +12 -0
  181. package/dist-server/service/account/index.js.map +1 -0
  182. package/dist-server/service/accounting-category/accounting-category-history.d.ts +26 -0
  183. package/dist-server/service/accounting-category/accounting-category-history.js +141 -0
  184. package/dist-server/service/accounting-category/accounting-category-history.js.map +1 -0
  185. package/dist-server/service/accounting-category/accounting-category-mutation.d.ts +10 -0
  186. package/dist-server/service/accounting-category/accounting-category-mutation.js +136 -0
  187. package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -0
  188. package/dist-server/service/accounting-category/accounting-category-query.d.ts +12 -0
  189. package/dist-server/service/accounting-category/accounting-category-query.js +102 -0
  190. package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -0
  191. package/dist-server/service/accounting-category/accounting-category-type.d.ts +19 -0
  192. package/dist-server/service/accounting-category/accounting-category-type.js +73 -0
  193. package/dist-server/service/accounting-category/accounting-category-type.js.map +1 -0
  194. package/dist-server/service/accounting-category/accounting-category.d.ts +21 -0
  195. package/dist-server/service/accounting-category/accounting-category.js +105 -0
  196. package/dist-server/service/accounting-category/accounting-category.js.map +1 -0
  197. package/dist-server/service/accounting-category/event-subscriber.d.ts +7 -0
  198. package/dist-server/service/accounting-category/event-subscriber.js +21 -0
  199. package/dist-server/service/accounting-category/event-subscriber.js.map +1 -0
  200. package/dist-server/service/accounting-category/index.d.ts +7 -0
  201. package/dist-server/service/accounting-category/index.js +12 -0
  202. package/dist-server/service/accounting-category/index.js.map +1 -0
  203. package/dist-server/service/accounting-document/accounting-document-history.d.ts +26 -0
  204. package/dist-server/service/accounting-document/accounting-document-history.js +134 -0
  205. package/dist-server/service/accounting-document/accounting-document-history.js.map +1 -0
  206. package/dist-server/service/accounting-document/accounting-document-mutation.d.ts +10 -0
  207. package/dist-server/service/accounting-document/accounting-document-mutation.js +128 -0
  208. package/dist-server/service/accounting-document/accounting-document-mutation.js.map +1 -0
  209. package/dist-server/service/accounting-document/accounting-document-query.d.ts +11 -0
  210. package/dist-server/service/accounting-document/accounting-document-query.js +79 -0
  211. package/dist-server/service/accounting-document/accounting-document-query.js.map +1 -0
  212. package/dist-server/service/accounting-document/accounting-document-type.d.ts +20 -0
  213. package/dist-server/service/accounting-document/accounting-document-type.js +74 -0
  214. package/dist-server/service/accounting-document/accounting-document-type.js.map +1 -0
  215. package/dist-server/service/accounting-document/accounting-document.d.ts +21 -0
  216. package/dist-server/service/accounting-document/accounting-document.js +104 -0
  217. package/dist-server/service/accounting-document/accounting-document.js.map +1 -0
  218. package/dist-server/service/accounting-document/event-subscriber.d.ts +7 -0
  219. package/dist-server/service/accounting-document/event-subscriber.js +21 -0
  220. package/dist-server/service/accounting-document/event-subscriber.js.map +1 -0
  221. package/dist-server/service/accounting-document/index.d.ts +7 -0
  222. package/dist-server/service/accounting-document/index.js +12 -0
  223. package/dist-server/service/accounting-document/index.js.map +1 -0
  224. package/dist-server/service/bank-account/bank-account-history.d.ts +34 -0
  225. package/dist-server/service/bank-account/bank-account-history.js +172 -0
  226. package/dist-server/service/bank-account/bank-account-history.js.map +1 -0
  227. package/dist-server/service/bank-account/bank-account-mutation.d.ts +10 -0
  228. package/dist-server/service/bank-account/bank-account-mutation.js +128 -0
  229. package/dist-server/service/bank-account/bank-account-mutation.js.map +1 -0
  230. package/dist-server/service/bank-account/bank-account-query.d.ts +11 -0
  231. package/dist-server/service/bank-account/bank-account-query.js +79 -0
  232. package/dist-server/service/bank-account/bank-account-query.js.map +1 -0
  233. package/dist-server/service/bank-account/bank-account-type.d.ts +39 -0
  234. package/dist-server/service/bank-account/bank-account-type.js +153 -0
  235. package/dist-server/service/bank-account/bank-account-type.js.map +1 -0
  236. package/dist-server/service/bank-account/bank-account.d.ts +38 -0
  237. package/dist-server/service/bank-account/bank-account.js +164 -0
  238. package/dist-server/service/bank-account/bank-account.js.map +1 -0
  239. package/dist-server/service/bank-account/event-subscriber.d.ts +7 -0
  240. package/dist-server/service/bank-account/event-subscriber.js +21 -0
  241. package/dist-server/service/bank-account/event-subscriber.js.map +1 -0
  242. package/dist-server/service/bank-account/index.d.ts +7 -0
  243. package/dist-server/service/bank-account/index.js +12 -0
  244. package/dist-server/service/bank-account/index.js.map +1 -0
  245. package/dist-server/service/common-type.d.ts +5 -0
  246. package/dist-server/service/common-type.js +15 -0
  247. package/dist-server/service/common-type.js.map +1 -0
  248. package/dist-server/service/financial-institution/financial-institution-mutation.d.ts +10 -0
  249. package/dist-server/service/financial-institution/financial-institution-mutation.js +169 -0
  250. package/dist-server/service/financial-institution/financial-institution-mutation.js.map +1 -0
  251. package/dist-server/service/financial-institution/financial-institution-query.d.ts +12 -0
  252. package/dist-server/service/financial-institution/financial-institution-query.js +97 -0
  253. package/dist-server/service/financial-institution/financial-institution-query.js.map +1 -0
  254. package/dist-server/service/financial-institution/financial-institution-type.d.ts +32 -0
  255. package/dist-server/service/financial-institution/financial-institution-type.js +126 -0
  256. package/dist-server/service/financial-institution/financial-institution-type.js.map +1 -0
  257. package/dist-server/service/financial-institution/financial-institution.d.ts +34 -0
  258. package/dist-server/service/financial-institution/financial-institution.js +137 -0
  259. package/dist-server/service/financial-institution/financial-institution.js.map +1 -0
  260. package/dist-server/service/financial-institution/index.d.ts +6 -0
  261. package/dist-server/service/financial-institution/index.js +10 -0
  262. package/dist-server/service/financial-institution/index.js.map +1 -0
  263. package/dist-server/service/financial-statement/event-subscriber.d.ts +7 -0
  264. package/dist-server/service/financial-statement/event-subscriber.js +21 -0
  265. package/dist-server/service/financial-statement/event-subscriber.js.map +1 -0
  266. package/dist-server/service/financial-statement/financial-statement-history.d.ts +27 -0
  267. package/dist-server/service/financial-statement/financial-statement-history.js +141 -0
  268. package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -0
  269. package/dist-server/service/financial-statement/financial-statement-line-item.d.ts +19 -0
  270. package/dist-server/service/financial-statement/financial-statement-line-item.js +94 -0
  271. package/dist-server/service/financial-statement/financial-statement-line-item.js.map +1 -0
  272. package/dist-server/service/financial-statement/financial-statement-mutation.d.ts +10 -0
  273. package/dist-server/service/financial-statement/financial-statement-mutation.js +136 -0
  274. package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -0
  275. package/dist-server/service/financial-statement/financial-statement-query.d.ts +11 -0
  276. package/dist-server/service/financial-statement/financial-statement-query.js +81 -0
  277. package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -0
  278. package/dist-server/service/financial-statement/financial-statement-type.d.ts +20 -0
  279. package/dist-server/service/financial-statement/financial-statement-type.js +77 -0
  280. package/dist-server/service/financial-statement/financial-statement-type.js.map +1 -0
  281. package/dist-server/service/financial-statement/financial-statement.d.ts +27 -0
  282. package/dist-server/service/financial-statement/financial-statement.js +132 -0
  283. package/dist-server/service/financial-statement/financial-statement.js.map +1 -0
  284. package/dist-server/service/financial-statement/index.d.ts +8 -0
  285. package/dist-server/service/financial-statement/index.js +13 -0
  286. package/dist-server/service/financial-statement/index.js.map +1 -0
  287. package/dist-server/service/fiscal-month/fiscal-month-mutation.d.ts +10 -0
  288. package/dist-server/service/fiscal-month/fiscal-month-mutation.js +134 -0
  289. package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -0
  290. package/dist-server/service/fiscal-month/fiscal-month-query.d.ts +11 -0
  291. package/dist-server/service/fiscal-month/fiscal-month-query.js +83 -0
  292. package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -0
  293. package/dist-server/service/fiscal-month/fiscal-month-type.d.ts +26 -0
  294. package/dist-server/service/fiscal-month/fiscal-month-type.js +98 -0
  295. package/dist-server/service/fiscal-month/fiscal-month-type.js.map +1 -0
  296. package/dist-server/service/fiscal-month/fiscal-month.d.ts +22 -0
  297. package/dist-server/service/fiscal-month/fiscal-month.js +99 -0
  298. package/dist-server/service/fiscal-month/fiscal-month.js.map +1 -0
  299. package/dist-server/service/fiscal-month/index.d.ts +6 -0
  300. package/dist-server/service/fiscal-month/index.js +10 -0
  301. package/dist-server/service/fiscal-month/index.js.map +1 -0
  302. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.d.ts +10 -0
  303. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +134 -0
  304. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -0
  305. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.d.ts +11 -0
  306. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +85 -0
  307. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -0
  308. package/dist-server/service/fiscal-quarter/fiscal-quarter-type.d.ts +24 -0
  309. package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js +90 -0
  310. package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js.map +1 -0
  311. package/dist-server/service/fiscal-quarter/fiscal-quarter.d.ts +21 -0
  312. package/dist-server/service/fiscal-quarter/fiscal-quarter.js +94 -0
  313. package/dist-server/service/fiscal-quarter/fiscal-quarter.js.map +1 -0
  314. package/dist-server/service/fiscal-quarter/index.d.ts +6 -0
  315. package/dist-server/service/fiscal-quarter/index.js +10 -0
  316. package/dist-server/service/fiscal-quarter/index.js.map +1 -0
  317. package/dist-server/service/fiscal-year/fiscal-year-mutation.d.ts +10 -0
  318. package/dist-server/service/fiscal-year/fiscal-year-mutation.js +134 -0
  319. package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -0
  320. package/dist-server/service/fiscal-year/fiscal-year-query.d.ts +11 -0
  321. package/dist-server/service/fiscal-year/fiscal-year-query.js +81 -0
  322. package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -0
  323. package/dist-server/service/fiscal-year/fiscal-year-type.d.ts +22 -0
  324. package/dist-server/service/fiscal-year/fiscal-year-type.js +82 -0
  325. package/dist-server/service/fiscal-year/fiscal-year-type.js.map +1 -0
  326. package/dist-server/service/fiscal-year/fiscal-year.d.ts +20 -0
  327. package/dist-server/service/fiscal-year/fiscal-year.js +89 -0
  328. package/dist-server/service/fiscal-year/fiscal-year.js.map +1 -0
  329. package/dist-server/service/fiscal-year/index.d.ts +6 -0
  330. package/dist-server/service/fiscal-year/index.js +10 -0
  331. package/dist-server/service/fiscal-year/index.js.map +1 -0
  332. package/dist-server/service/income-statement/event-subscriber.d.ts +7 -0
  333. package/dist-server/service/income-statement/event-subscriber.js +21 -0
  334. package/dist-server/service/income-statement/event-subscriber.js.map +1 -0
  335. package/dist-server/service/income-statement/income-statement-history.d.ts +28 -0
  336. package/dist-server/service/income-statement/income-statement-history.js +146 -0
  337. package/dist-server/service/income-statement/income-statement-history.js.map +1 -0
  338. package/dist-server/service/income-statement/income-statement-line-item.d.ts +19 -0
  339. package/dist-server/service/income-statement/income-statement-line-item.js +96 -0
  340. package/dist-server/service/income-statement/income-statement-line-item.js.map +1 -0
  341. package/dist-server/service/income-statement/income-statement-mutation.d.ts +10 -0
  342. package/dist-server/service/income-statement/income-statement-mutation.js +136 -0
  343. package/dist-server/service/income-statement/income-statement-mutation.js.map +1 -0
  344. package/dist-server/service/income-statement/income-statement-query.d.ts +11 -0
  345. package/dist-server/service/income-statement/income-statement-query.js +81 -0
  346. package/dist-server/service/income-statement/income-statement-query.js.map +1 -0
  347. package/dist-server/service/income-statement/income-statement-type.d.ts +20 -0
  348. package/dist-server/service/income-statement/income-statement-type.js +77 -0
  349. package/dist-server/service/income-statement/income-statement-type.js.map +1 -0
  350. package/dist-server/service/income-statement/income-statement.d.ts +28 -0
  351. package/dist-server/service/income-statement/income-statement.js +137 -0
  352. package/dist-server/service/income-statement/income-statement.js.map +1 -0
  353. package/dist-server/service/income-statement/index.d.ts +8 -0
  354. package/dist-server/service/income-statement/index.js +13 -0
  355. package/dist-server/service/income-statement/index.js.map +1 -0
  356. package/dist-server/service/index.d.ts +16 -0
  357. package/dist-server/service/index.js +74 -0
  358. package/dist-server/service/index.js.map +1 -0
  359. package/dist-server/service/payment/event-subscriber.d.ts +7 -0
  360. package/dist-server/service/payment/event-subscriber.js +21 -0
  361. package/dist-server/service/payment/event-subscriber.js.map +1 -0
  362. package/dist-server/service/payment/index.d.ts +7 -0
  363. package/dist-server/service/payment/index.js +12 -0
  364. package/dist-server/service/payment/index.js.map +1 -0
  365. package/dist-server/service/payment/payment-history.d.ts +37 -0
  366. package/dist-server/service/payment/payment-history.js +179 -0
  367. package/dist-server/service/payment/payment-history.js.map +1 -0
  368. package/dist-server/service/payment/payment-mutation.d.ts +10 -0
  369. package/dist-server/service/payment/payment-mutation.js +134 -0
  370. package/dist-server/service/payment/payment-mutation.js.map +1 -0
  371. package/dist-server/service/payment/payment-query.d.ts +11 -0
  372. package/dist-server/service/payment/payment-query.js +81 -0
  373. package/dist-server/service/payment/payment-query.js.map +1 -0
  374. package/dist-server/service/payment/payment-type.d.ts +30 -0
  375. package/dist-server/service/payment/payment-type.js +114 -0
  376. package/dist-server/service/payment/payment-type.js.map +1 -0
  377. package/dist-server/service/payment/payment.d.ts +42 -0
  378. package/dist-server/service/payment/payment.js +181 -0
  379. package/dist-server/service/payment/payment.js.map +1 -0
  380. package/dist-server/service/transaction/event-subscriber.d.ts +7 -0
  381. package/dist-server/service/transaction/event-subscriber.js +21 -0
  382. package/dist-server/service/transaction/event-subscriber.js.map +1 -0
  383. package/dist-server/service/transaction/index.d.ts +8 -0
  384. package/dist-server/service/transaction/index.js +12 -0
  385. package/dist-server/service/transaction/index.js.map +1 -0
  386. package/dist-server/service/transaction/transaction-history.d.ts +36 -0
  387. package/dist-server/service/transaction/transaction-history.js +184 -0
  388. package/dist-server/service/transaction/transaction-history.js.map +1 -0
  389. package/dist-server/service/transaction/transaction-mutation.d.ts +10 -0
  390. package/dist-server/service/transaction/transaction-mutation.js +134 -0
  391. package/dist-server/service/transaction/transaction-mutation.js.map +1 -0
  392. package/dist-server/service/transaction/transaction-query.d.ts +11 -0
  393. package/dist-server/service/transaction/transaction-query.js +81 -0
  394. package/dist-server/service/transaction/transaction-query.js.map +1 -0
  395. package/dist-server/service/transaction/transaction-type.d.ts +19 -0
  396. package/dist-server/service/transaction/transaction-type.js +73 -0
  397. package/dist-server/service/transaction/transaction-type.js.map +1 -0
  398. package/dist-server/service/transaction/transaction.d.ts +57 -0
  399. package/dist-server/service/transaction/transaction.js +241 -0
  400. package/dist-server/service/transaction/transaction.js.map +1 -0
  401. package/dist-server/tsconfig.tsbuildinfo +1 -0
  402. package/package.json +5 -5
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankAccount = exports.OwnerType = exports.AccountType = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const type_graphql_1 = require("type-graphql");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ var AccountType;
10
+ (function (AccountType) {
11
+ AccountType["Bank"] = "Bank";
12
+ AccountType["Card"] = "Card";
13
+ })(AccountType || (exports.AccountType = AccountType = {}));
14
+ (0, type_graphql_1.registerEnumType)(AccountType, {
15
+ name: 'AccountType',
16
+ description: 'Type of the account (Bank or Card)'
17
+ });
18
+ var OwnerType;
19
+ (function (OwnerType) {
20
+ OwnerType["Company"] = "Company";
21
+ OwnerType["Vendor"] = "Vendor";
22
+ OwnerType["Employee"] = "Employee";
23
+ })(OwnerType || (exports.OwnerType = OwnerType = {}));
24
+ (0, type_graphql_1.registerEnumType)(OwnerType, {
25
+ name: 'OwnerType',
26
+ description: 'Type of the owner of the bank account'
27
+ });
28
+ let BankAccount = class BankAccount {
29
+ constructor() {
30
+ this.version = 1;
31
+ }
32
+ };
33
+ exports.BankAccount = BankAccount;
34
+ tslib_1.__decorate([
35
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
36
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
37
+ tslib_1.__metadata("design:type", String)
38
+ ], BankAccount.prototype, "id", void 0);
39
+ tslib_1.__decorate([
40
+ (0, typeorm_1.VersionColumn)(),
41
+ (0, type_graphql_1.Field)({ nullable: true }),
42
+ tslib_1.__metadata("design:type", Number)
43
+ ], BankAccount.prototype, "version", void 0);
44
+ tslib_1.__decorate([
45
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
46
+ (0, type_graphql_1.Field)({ nullable: true }),
47
+ tslib_1.__metadata("design:type", shell_1.Domain)
48
+ ], BankAccount.prototype, "domain", void 0);
49
+ tslib_1.__decorate([
50
+ (0, typeorm_1.RelationId)((bankAccount) => bankAccount.domain),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], BankAccount.prototype, "domainId", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ nullable: false }),
55
+ (0, type_graphql_1.Field)({ nullable: true }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], BankAccount.prototype, "name", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.Column)({ nullable: true }),
60
+ (0, type_graphql_1.Field)({ nullable: true }),
61
+ tslib_1.__metadata("design:type", String)
62
+ ], BankAccount.prototype, "description", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.Column)({ nullable: true }),
65
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Name of the account holder' }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], BankAccount.prototype, "accountHolderName", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.Column)({ nullable: false }),
70
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Bank account number' }),
71
+ tslib_1.__metadata("design:type", String)
72
+ ], BankAccount.prototype, "accountNumber", void 0);
73
+ tslib_1.__decorate([
74
+ (0, typeorm_1.Column)({ nullable: false }),
75
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Bank name' }),
76
+ tslib_1.__metadata("design:type", String)
77
+ ], BankAccount.prototype, "bankName", void 0);
78
+ tslib_1.__decorate([
79
+ (0, typeorm_1.Column)({ nullable: false }),
80
+ (0, type_graphql_1.Field)(type => AccountType, { description: 'Type of the account (Bank or Card)' }),
81
+ tslib_1.__metadata("design:type", String)
82
+ ], BankAccount.prototype, "accountType", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.Column)({ nullable: true }),
85
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Currency of the account' }),
86
+ tslib_1.__metadata("design:type", String)
87
+ ], BankAccount.prototype, "currency", void 0);
88
+ tslib_1.__decorate([
89
+ (0, typeorm_1.Column)({ nullable: false, default: false }),
90
+ (0, type_graphql_1.Field)({ nullable: true }),
91
+ tslib_1.__metadata("design:type", Boolean)
92
+ ], BankAccount.prototype, "active", void 0);
93
+ tslib_1.__decorate([
94
+ (0, typeorm_1.Column)({ nullable: false }),
95
+ (0, type_graphql_1.Field)(type => OwnerType, { description: 'Type of the owner of the bank account' }),
96
+ tslib_1.__metadata("design:type", String)
97
+ ], BankAccount.prototype, "ownerType", void 0);
98
+ tslib_1.__decorate([
99
+ (0, typeorm_1.Column)({ nullable: false }),
100
+ (0, type_graphql_1.Field)({ description: 'ID of the owner of the bank account' }),
101
+ tslib_1.__metadata("design:type", String)
102
+ ], BankAccount.prototype, "ownerId", void 0);
103
+ tslib_1.__decorate([
104
+ (0, typeorm_1.Column)({ nullable: true }),
105
+ (0, type_graphql_1.Field)({ nullable: true, description: 'IBAN of the bank account' }),
106
+ tslib_1.__metadata("design:type", String)
107
+ ], BankAccount.prototype, "iban", void 0);
108
+ tslib_1.__decorate([
109
+ (0, typeorm_1.Column)({ nullable: true }),
110
+ (0, type_graphql_1.Field)({ nullable: true, description: 'BIC of the bank account' }),
111
+ tslib_1.__metadata("design:type", String)
112
+ ], BankAccount.prototype, "bic", void 0);
113
+ tslib_1.__decorate([
114
+ (0, typeorm_1.Column)({ nullable: true }),
115
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Country of the bank account' }),
116
+ tslib_1.__metadata("design:type", String)
117
+ ], BankAccount.prototype, "country", void 0);
118
+ tslib_1.__decorate([
119
+ (0, typeorm_1.Column)({ nullable: true }),
120
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Cover image of the bank account' }),
121
+ tslib_1.__metadata("design:type", String)
122
+ ], BankAccount.prototype, "image", void 0);
123
+ tslib_1.__decorate([
124
+ (0, typeorm_1.CreateDateColumn)(),
125
+ (0, type_graphql_1.Field)({ nullable: true }),
126
+ tslib_1.__metadata("design:type", Date)
127
+ ], BankAccount.prototype, "createdAt", void 0);
128
+ tslib_1.__decorate([
129
+ (0, typeorm_1.UpdateDateColumn)(),
130
+ (0, type_graphql_1.Field)({ nullable: true }),
131
+ tslib_1.__metadata("design:type", Date)
132
+ ], BankAccount.prototype, "updatedAt", void 0);
133
+ tslib_1.__decorate([
134
+ (0, typeorm_1.DeleteDateColumn)(),
135
+ (0, type_graphql_1.Field)({ nullable: true }),
136
+ tslib_1.__metadata("design:type", Date)
137
+ ], BankAccount.prototype, "deletedAt", void 0);
138
+ tslib_1.__decorate([
139
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
140
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
141
+ tslib_1.__metadata("design:type", auth_base_1.User)
142
+ ], BankAccount.prototype, "creator", void 0);
143
+ tslib_1.__decorate([
144
+ (0, typeorm_1.RelationId)((bankAccount) => bankAccount.creator),
145
+ tslib_1.__metadata("design:type", String)
146
+ ], BankAccount.prototype, "creatorId", void 0);
147
+ tslib_1.__decorate([
148
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
149
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
150
+ tslib_1.__metadata("design:type", auth_base_1.User)
151
+ ], BankAccount.prototype, "updater", void 0);
152
+ tslib_1.__decorate([
153
+ (0, typeorm_1.RelationId)((bankAccount) => bankAccount.updater),
154
+ tslib_1.__metadata("design:type", String)
155
+ ], BankAccount.prototype, "updaterId", void 0);
156
+ exports.BankAccount = BankAccount = tslib_1.__decorate([
157
+ (0, typeorm_1.Entity)(),
158
+ (0, typeorm_1.Index)('ix_bank_account_0', (bankAccount) => [bankAccount.domain, bankAccount.name], {
159
+ where: '"deleted_at" IS NULL',
160
+ unique: true
161
+ }),
162
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for BankAccount' })
163
+ ], BankAccount);
164
+ //# sourceMappingURL=bank-account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bank-account.js","sourceRoot":"","sources":["../../../server/service/bank-account/bank-account.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAA,+BAAgB,EAAC,WAAW,EAAE;IAC5B,IAAI,EAAE,aAAa;IACnB,W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I,EAAE,CAAC;sCAC9B,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC5C;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC5C;sBAhGP,WAAW;IANvB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE;QAChG,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;GACzC,WAAW,CAiGvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n VersionColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum AccountType {\n Bank = 'Bank',\n Card = 'Card'\n}\n\nregisterEnumType(AccountType, {\n name: 'AccountType',\n description: 'Type of the account (Bank or Card)'\n})\n\nexport enum OwnerType {\n Company = 'Company',\n Vendor = 'Vendor',\n Employee = 'Employee'\n}\n\nregisterEnumType(OwnerType, {\n name: 'OwnerType',\n description: 'Type of the owner of the bank account'\n})\n\n@Entity()\n@Index('ix_bank_account_0', (bankAccount: BankAccount) => [bankAccount.domain, bankAccount.name], {\n where: '\"deleted_at\" IS NULL',\n unique: true\n})\n@ObjectType({ description: 'Entity for BankAccount' })\nexport class BankAccount {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((bankAccount: BankAccount) => bankAccount.domain)\n domainId?: string\n\n @Column({ nullable: false })\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Name of the account holder' })\n accountHolderName?: string // 계좌 소유자의 이름\n\n @Column({ nullable: false })\n @Field({ nullable: true, description: 'Bank account number' })\n accountNumber?: string\n\n @Column({ nullable: false })\n @Field({ nullable: true, description: 'Bank name' })\n bankName?: string\n\n @Column({ nullable: false })\n @Field(type => AccountType, { description: 'Type of the account (Bank or Card)' })\n accountType: AccountType\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Currency of the account' })\n currency?: string\n\n @Column({ nullable: false, default: false })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: false })\n @Field(type => OwnerType, { description: 'Type of the owner of the bank account' })\n ownerType: OwnerType\n\n @Column({ nullable: false })\n @Field({ description: 'ID of the owner of the bank account' })\n ownerId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'IBAN of the bank account' })\n iban?: string // 은행 계좌의 IBAN\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'BIC of the bank account' })\n bic?: string // 은행 계좌의 BIC\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Country of the bank account' })\n country?: string // 은행 계좌의 국적\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Cover image of the bank account' })\n image?: string // 은행 계좌의 커버이미지\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((bankAccount: BankAccount) => bankAccount.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((bankAccount: BankAccount) => bankAccount.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { HistoryEntitySubscriber } from '@operato/typeorm-history';
2
+ import { BankAccount } from './bank-account';
3
+ import { BankAccountHistory } from './bank-account-history';
4
+ export declare class BankAccountHistoryEntitySubscriber extends HistoryEntitySubscriber<BankAccount, BankAccountHistory> {
5
+ get entity(): typeof BankAccount;
6
+ get historyEntity(): typeof BankAccountHistory;
7
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankAccountHistoryEntitySubscriber = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const typeorm_history_1 = require("@operato/typeorm-history");
7
+ const bank_account_1 = require("./bank-account");
8
+ const bank_account_history_1 = require("./bank-account-history");
9
+ let BankAccountHistoryEntitySubscriber = class BankAccountHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
10
+ get entity() {
11
+ return bank_account_1.BankAccount;
12
+ }
13
+ get historyEntity() {
14
+ return bank_account_history_1.BankAccountHistory;
15
+ }
16
+ };
17
+ exports.BankAccountHistoryEntitySubscriber = BankAccountHistoryEntitySubscriber;
18
+ exports.BankAccountHistoryEntitySubscriber = BankAccountHistoryEntitySubscriber = tslib_1.__decorate([
19
+ (0, typeorm_1.EventSubscriber)()
20
+ ], BankAccountHistoryEntitySubscriber);
21
+ //# sourceMappingURL=event-subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/bank-account/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,iDAA4C;AAC5C,iEAA2D;AAGpD,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,yCAAwD;IAC9G,IAAW,MAAM;QACf,OAAO,0BAAW,CAAA;IACpB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,yCAAkB,CAAA;IAC3B,CAAC;CACF,CAAA;AARY,gFAAkC;6CAAlC,kCAAkC;IAD9C,IAAA,yBAAe,GAAE;GACL,kCAAkC,CAQ9C","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { BankAccount } from './bank-account'\nimport { BankAccountHistory } from './bank-account-history'\n\n@EventSubscriber()\nexport class BankAccountHistoryEntitySubscriber extends HistoryEntitySubscriber<BankAccount, BankAccountHistory> {\n public get entity() {\n return BankAccount\n }\n\n public get historyEntity() {\n return BankAccountHistory\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { BankAccount } from './bank-account';
2
+ import { BankAccountHistoryEntitySubscriber } from './event-subscriber';
3
+ import { BankAccountQuery } from './bank-account-query';
4
+ import { BankAccountMutation } from './bank-account-mutation';
5
+ export declare const entities: (typeof BankAccount)[];
6
+ export declare const resolvers: (typeof BankAccountQuery | typeof BankAccountMutation)[];
7
+ export declare const subscribers: (typeof BankAccountHistoryEntitySubscriber)[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const bank_account_1 = require("./bank-account");
5
+ const bank_account_history_1 = require("./bank-account-history");
6
+ const event_subscriber_1 = require("./event-subscriber");
7
+ const bank_account_query_1 = require("./bank-account-query");
8
+ const bank_account_mutation_1 = require("./bank-account-mutation");
9
+ exports.entities = [bank_account_1.BankAccount, bank_account_history_1.BankAccountHistory];
10
+ exports.resolvers = [bank_account_query_1.BankAccountQuery, bank_account_mutation_1.BankAccountMutation];
11
+ exports.subscribers = [event_subscriber_1.BankAccountHistoryEntitySubscriber];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/bank-account/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,iEAA2D;AAC3D,yDAAuE;AACvE,6DAAuD;AACvD,mEAA6D;AAEhD,QAAA,QAAQ,GAAG,CAAC,0BAAW,EAAE,yCAAkB,CAAC,CAAA;AAC5C,QAAA,SAAS,GAAG,CAAC,qCAAgB,EAAE,2CAAmB,CAAC,CAAA;AACnD,QAAA,WAAW,GAAG,CAAC,qDAAkC,CAAC,CAAA","sourcesContent":["import { BankAccount } from './bank-account'\nimport { BankAccountHistory } from './bank-account-history'\nimport { BankAccountHistoryEntitySubscriber } from './event-subscriber'\nimport { BankAccountQuery } from './bank-account-query'\nimport { BankAccountMutation } from './bank-account-mutation'\n\nexport const entities = [BankAccount, BankAccountHistory]\nexport const resolvers = [BankAccountQuery, BankAccountMutation]\nexport const subscribers = [BankAccountHistoryEntitySubscriber]\n"]}
@@ -0,0 +1,5 @@
1
+ export declare enum FiscalStatus {
2
+ OPEN = "OPEN",
3
+ CLOSED = "CLOSED",
4
+ FINALIZED = "FINALIZED"
5
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FiscalStatus = void 0;
4
+ const type_graphql_1 = require("type-graphql");
5
+ var FiscalStatus;
6
+ (function (FiscalStatus) {
7
+ FiscalStatus["OPEN"] = "OPEN";
8
+ FiscalStatus["CLOSED"] = "CLOSED";
9
+ FiscalStatus["FINALIZED"] = "FINALIZED";
10
+ })(FiscalStatus || (exports.FiscalStatus = FiscalStatus = {}));
11
+ (0, type_graphql_1.registerEnumType)(FiscalStatus, {
12
+ name: 'FiscalStatus',
13
+ description: 'The status of a fiscal period (OPEN, CLOSED, FINALIZED)'
14
+ });
15
+ //# sourceMappingURL=common-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-type.js","sourceRoot":"","sources":["../../server/service/common-type.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAE/C,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED,IAAA,+BAAgB,EAAC,YAAY,EAAE;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,yDAAyD;CACvE,CAAC,CAAA","sourcesContent":["import { registerEnumType } from 'type-graphql'\n\nexport enum FiscalStatus {\n OPEN = 'OPEN',\n CLOSED = 'CLOSED',\n FINALIZED = 'FINALIZED'\n}\n\nregisterEnumType(FiscalStatus, {\n name: 'FiscalStatus',\n description: 'The status of a fiscal period (OPEN, CLOSED, FINALIZED)'\n})\n"]}
@@ -0,0 +1,10 @@
1
+ import { FinancialInstitution } from './financial-institution';
2
+ import { NewFinancialInstitution, FinancialInstitutionPatch } from './financial-institution-type';
3
+ export declare class FinancialInstitutionMutation {
4
+ createFinancialInstitution(financialInstitution: NewFinancialInstitution, context: ResolverContext): Promise<FinancialInstitution>;
5
+ updateFinancialInstitution(id: string, patch: FinancialInstitutionPatch, context: ResolverContext): Promise<FinancialInstitution>;
6
+ updateMultipleFinancialInstitution(patches: FinancialInstitutionPatch[], context: ResolverContext): Promise<FinancialInstitution[]>;
7
+ deleteFinancialInstitution(id: string, context: ResolverContext): Promise<boolean>;
8
+ deleteFinancialInstitutions(ids: string[], context: ResolverContext): Promise<boolean>;
9
+ importFinancialInstitutions(financialInstitutions: FinancialInstitutionPatch[], context: ResolverContext): Promise<boolean>;
10
+ }
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FinancialInstitutionMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const typeorm_1 = require("typeorm");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const attachment_base_1 = require("@things-factory/attachment-base");
9
+ const financial_institution_1 = require("./financial-institution");
10
+ const financial_institution_type_1 = require("./financial-institution-type");
11
+ let FinancialInstitutionMutation = class FinancialInstitutionMutation {
12
+ async createFinancialInstitution(financialInstitution, context) {
13
+ const { domain, user, tx } = context.state;
14
+ const result = await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx).save(Object.assign(Object.assign({}, financialInstitution), { domain, creator: user, updater: user }));
15
+ if (financialInstitution.thumbnail) {
16
+ await (0, attachment_base_1.createAttachment)(null, {
17
+ attachment: {
18
+ file: financialInstitution.thumbnail,
19
+ refType: financial_institution_1.FinancialInstitution.name,
20
+ refBy: result.id
21
+ }
22
+ }, context);
23
+ }
24
+ return result;
25
+ }
26
+ async updateFinancialInstitution(id, patch, context) {
27
+ const { domain, user, tx } = context.state;
28
+ const repository = (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx);
29
+ const financialInstitution = await repository.findOne({
30
+ where: { domain: { id: domain.id }, id }
31
+ });
32
+ const result = await repository.save(Object.assign(Object.assign(Object.assign({}, financialInstitution), patch), { updater: user }));
33
+ if (patch.thumbnail) {
34
+ await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [result.id] }, context);
35
+ await (0, attachment_base_1.createAttachment)(null, {
36
+ attachment: {
37
+ file: patch.thumbnail,
38
+ refType: financial_institution_1.FinancialInstitution.name,
39
+ refBy: result.id
40
+ }
41
+ }, context);
42
+ }
43
+ return result;
44
+ }
45
+ async updateMultipleFinancialInstitution(patches, context) {
46
+ const { domain, user, tx } = context.state;
47
+ let results = [];
48
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
49
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
50
+ const financialInstitutionRepo = (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx);
51
+ if (_createRecords.length > 0) {
52
+ for (let i = 0; i < _createRecords.length; i++) {
53
+ const newRecord = _createRecords[i];
54
+ const result = await financialInstitutionRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
55
+ if (newRecord.thumbnail) {
56
+ await (0, attachment_base_1.createAttachment)(null, {
57
+ attachment: {
58
+ file: newRecord.thumbnail,
59
+ refType: financial_institution_1.FinancialInstitution.name,
60
+ refBy: result.id
61
+ }
62
+ }, context);
63
+ }
64
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
65
+ }
66
+ }
67
+ if (_updateRecords.length > 0) {
68
+ for (let i = 0; i < _updateRecords.length; i++) {
69
+ const updateRecord = _updateRecords[i];
70
+ const financialInstitution = await financialInstitutionRepo.findOneBy({ id: updateRecord.id });
71
+ const result = await financialInstitutionRepo.save(Object.assign(Object.assign(Object.assign({}, financialInstitution), updateRecord), { updater: user }));
72
+ if (updateRecord.thumbnail) {
73
+ await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [result.id] }, context);
74
+ await (0, attachment_base_1.createAttachment)(null, {
75
+ attachment: {
76
+ file: updateRecord.thumbnail,
77
+ refType: financial_institution_1.FinancialInstitution.name,
78
+ refBy: result.id
79
+ }
80
+ }, context);
81
+ }
82
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
83
+ }
84
+ }
85
+ return results;
86
+ }
87
+ async deleteFinancialInstitution(id, context) {
88
+ const { domain, tx } = context.state;
89
+ await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx).delete({ domain: { id: domain.id }, id });
90
+ await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
91
+ return true;
92
+ }
93
+ async deleteFinancialInstitutions(ids, context) {
94
+ const { domain, tx } = context.state;
95
+ await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx).delete({
96
+ domain: { id: domain.id },
97
+ id: (0, typeorm_1.In)(ids)
98
+ });
99
+ await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: ids }, context);
100
+ return true;
101
+ }
102
+ async importFinancialInstitutions(financialInstitutions, context) {
103
+ const { domain, tx } = context.state;
104
+ await Promise.all(financialInstitutions.map(async (financialInstitution) => {
105
+ const createdFinancialInstitution = await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx).save(Object.assign({ domain }, financialInstitution));
106
+ }));
107
+ return true;
108
+ }
109
+ };
110
+ exports.FinancialInstitutionMutation = FinancialInstitutionMutation;
111
+ tslib_1.__decorate([
112
+ (0, type_graphql_1.Directive)('@transaction'),
113
+ (0, type_graphql_1.Mutation)(returns => financial_institution_1.FinancialInstitution, { description: 'To create new FinancialInstitution' }),
114
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('financialInstitution')),
115
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
116
+ tslib_1.__metadata("design:type", Function),
117
+ tslib_1.__metadata("design:paramtypes", [financial_institution_type_1.NewFinancialInstitution, Object]),
118
+ tslib_1.__metadata("design:returntype", Promise)
119
+ ], FinancialInstitutionMutation.prototype, "createFinancialInstitution", null);
120
+ tslib_1.__decorate([
121
+ (0, type_graphql_1.Directive)('@transaction'),
122
+ (0, type_graphql_1.Mutation)(returns => financial_institution_1.FinancialInstitution, { description: 'To modify FinancialInstitution information' }),
123
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
124
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
125
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
126
+ tslib_1.__metadata("design:type", Function),
127
+ tslib_1.__metadata("design:paramtypes", [String, financial_institution_type_1.FinancialInstitutionPatch, Object]),
128
+ tslib_1.__metadata("design:returntype", Promise)
129
+ ], FinancialInstitutionMutation.prototype, "updateFinancialInstitution", null);
130
+ tslib_1.__decorate([
131
+ (0, type_graphql_1.Directive)('@transaction'),
132
+ (0, type_graphql_1.Mutation)(returns => [financial_institution_1.FinancialInstitution], { description: "To modify multiple FinancialInstitutions' information" }),
133
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [financial_institution_type_1.FinancialInstitutionPatch])),
134
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
135
+ tslib_1.__metadata("design:type", Function),
136
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
137
+ tslib_1.__metadata("design:returntype", Promise)
138
+ ], FinancialInstitutionMutation.prototype, "updateMultipleFinancialInstitution", null);
139
+ tslib_1.__decorate([
140
+ (0, type_graphql_1.Directive)('@transaction'),
141
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete FinancialInstitution' }),
142
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
143
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
144
+ tslib_1.__metadata("design:type", Function),
145
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
146
+ tslib_1.__metadata("design:returntype", Promise)
147
+ ], FinancialInstitutionMutation.prototype, "deleteFinancialInstitution", null);
148
+ tslib_1.__decorate([
149
+ (0, type_graphql_1.Directive)('@transaction'),
150
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple FinancialInstitutions' }),
151
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
152
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
153
+ tslib_1.__metadata("design:type", Function),
154
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
155
+ tslib_1.__metadata("design:returntype", Promise)
156
+ ], FinancialInstitutionMutation.prototype, "deleteFinancialInstitutions", null);
157
+ tslib_1.__decorate([
158
+ (0, type_graphql_1.Directive)('@transaction'),
159
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple FinancialInstitutions' }),
160
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('financialInstitutions', type => [financial_institution_type_1.FinancialInstitutionPatch])),
161
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
162
+ tslib_1.__metadata("design:type", Function),
163
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
164
+ tslib_1.__metadata("design:returntype", Promise)
165
+ ], FinancialInstitutionMutation.prototype, "importFinancialInstitutions", null);
166
+ exports.FinancialInstitutionMutation = FinancialInstitutionMutation = tslib_1.__decorate([
167
+ (0, type_graphql_1.Resolver)(financial_institution_1.FinancialInstitution)
168
+ ], FinancialInstitutionMutation);
169
+ //# sourceMappingURL=financial-institution-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"financial-institution-mutation.js","sourceRoot":"","sources":["../../../server/service/financial-institution/financial-institution-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,iDAAqD;AAErD,qEAA0F;AAC1F,mEAA8D;AAC9D,6EAAiG;AAG1F,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAGjC,AAAN,KAAK,CAAC,0BAA0B,CAA8B,oBAA6C,EAAS,OAAwB;QAC1I,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAa,EAAC,4CAAoB,EAAE,EAAE,CAAC,CAAC,IAAI,iCAC5D,oBAAoB,KACvB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,IAAI,oBAAoB,CAAC,SAAS,EAAE,CAAC;YACnC,MAAM,IAAA,kCAAgB,EACpB,IAAI,EACJ;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,oBAAoB,CAAC,SAAS;oBACpC,OAAO,EAAE,4CAAoB,CAAC,IAAI;oBAClC,KAAK,EAAE,MAAM,CAAC,EAAE;iBACjB;aACF,EACD,OAAO,CACR,CAAA;QACH,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,0BAA0B,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C,CAAA;IACjE,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+EAWP;uCA3LU,4BAA4B;IADxC,IAAA,uBAAQ,EAAC,4CAAoB,CAAC;GAClB,4BAA4B,CA4LxC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { getRepository } from '@things-factory/shell'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\nimport { FinancialInstitution } from './financial-institution'\nimport { NewFinancialInstitution, FinancialInstitutionPatch } from './financial-institution-type'\n\n@Resolver(FinancialInstitution)\nexport class FinancialInstitutionMutation {\n @Directive('@transaction')\n @Mutation(returns => FinancialInstitution, { description: 'To create new FinancialInstitution' })\n async createFinancialInstitution(@Arg('financialInstitution') financialInstitution: NewFinancialInstitution, @Ctx() context: ResolverContext): Promise<FinancialInstitution> {\n const { domain, user, tx } = context.state\n\n const result = await getRepository(FinancialInstitution, tx).save({\n ...financialInstitution,\n domain,\n creator: user,\n updater: user\n })\n\n if (financialInstitution.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: financialInstitution.thumbnail,\n refType: FinancialInstitution.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => FinancialInstitution, { description: 'To modify FinancialInstitution information' })\n async updateFinancialInstitution(\n @Arg('id') id: string,\n @Arg('patch') patch: FinancialInstitutionPatch,\n @Ctx() context: ResolverContext\n ): Promise<FinancialInstitution> {\n const { domain, user, tx } = context.state\n\n const repository = getRepository(FinancialInstitution, tx)\n const financialInstitution = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...financialInstitution,\n ...patch,\n updater: user\n })\n\n if (patch.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: patch.thumbnail,\n refType: FinancialInstitution.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [FinancialInstitution], { description: \"To modify multiple FinancialInstitutions' information\" })\n async updateMultipleFinancialInstitution(\n @Arg('patches', type => [FinancialInstitutionPatch]) patches: FinancialInstitutionPatch[],\n @Ctx() context: ResolverContext\n ): Promise<FinancialInstitution[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const financialInstitutionRepo = getRepository(FinancialInstitution, tx)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await financialInstitutionRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n if (newRecord.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: newRecord.thumbnail,\n refType: FinancialInstitution.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const financialInstitution = await financialInstitutionRepo.findOneBy({ id: updateRecord.id })\n\n const result = await financialInstitutionRepo.save({\n ...financialInstitution,\n ...updateRecord,\n updater: user\n })\n\n if (updateRecord.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: updateRecord.thumbnail,\n refType: FinancialInstitution.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete FinancialInstitution' })\n async deleteFinancialInstitution(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(FinancialInstitution, tx).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple FinancialInstitutions' })\n async deleteFinancialInstitutions(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(FinancialInstitution, tx).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple FinancialInstitutions' })\n async importFinancialInstitutions(\n @Arg('financialInstitutions', type => [FinancialInstitutionPatch]) financialInstitutions: FinancialInstitutionPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n financialInstitutions.map(async (financialInstitution: FinancialInstitutionPatch) => {\n const createdFinancialInstitution: FinancialInstitution = await getRepository(FinancialInstitution, tx).save({ domain, ...financialInstitution })\n })\n )\n\n return true\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { Domain, ListParam } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { FinancialInstitution } from './financial-institution';
4
+ import { FinancialInstitutionList } from './financial-institution-type';
5
+ export declare class FinancialInstitutionQuery {
6
+ financialInstitution(id: string, context: ResolverContext): Promise<FinancialInstitution>;
7
+ financialInstitutions(params: ListParam, context: ResolverContext): Promise<FinancialInstitutionList>;
8
+ thumbnail(financialInstitution: FinancialInstitution): Promise<string | undefined>;
9
+ domain(financialInstitution: FinancialInstitution): Promise<Domain>;
10
+ updater(financialInstitution: FinancialInstitution): Promise<User>;
11
+ creator(financialInstitution: FinancialInstitution): Promise<User>;
12
+ }
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FinancialInstitutionQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const attachment_base_1 = require("@things-factory/attachment-base");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ const financial_institution_1 = require("./financial-institution");
10
+ const financial_institution_type_1 = require("./financial-institution-type");
11
+ let FinancialInstitutionQuery = class FinancialInstitutionQuery {
12
+ async financialInstitution(id, context) {
13
+ const { domain } = context.state;
14
+ return await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution).findOne({
15
+ where: { domain: { id: domain.id }, id }
16
+ });
17
+ }
18
+ async financialInstitutions(params, context) {
19
+ const { domain } = context.state;
20
+ const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
21
+ domain,
22
+ params,
23
+ repository: await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution),
24
+ searchables: ['name', 'description']
25
+ });
26
+ const [items, total] = await queryBuilder.getManyAndCount();
27
+ return { items, total };
28
+ }
29
+ async thumbnail(financialInstitution) {
30
+ const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).findOne({
31
+ where: {
32
+ domain: { id: financialInstitution.domainId },
33
+ refType: financial_institution_1.FinancialInstitution.name,
34
+ refBy: financialInstitution.id
35
+ }
36
+ });
37
+ return attachment === null || attachment === void 0 ? void 0 : attachment.fullpath;
38
+ }
39
+ async domain(financialInstitution) {
40
+ return financialInstitution.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: financialInstitution.domainId }));
41
+ }
42
+ async updater(financialInstitution) {
43
+ return financialInstitution.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: financialInstitution.updaterId }));
44
+ }
45
+ async creator(financialInstitution) {
46
+ return financialInstitution.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: financialInstitution.creatorId }));
47
+ }
48
+ };
49
+ exports.FinancialInstitutionQuery = FinancialInstitutionQuery;
50
+ tslib_1.__decorate([
51
+ (0, type_graphql_1.Query)(returns => financial_institution_1.FinancialInstitution, { nullable: true, description: 'To fetch a FinancialInstitution' }),
52
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
53
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
54
+ tslib_1.__metadata("design:type", Function),
55
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
56
+ tslib_1.__metadata("design:returntype", Promise)
57
+ ], FinancialInstitutionQuery.prototype, "financialInstitution", null);
58
+ tslib_1.__decorate([
59
+ (0, type_graphql_1.Query)(returns => financial_institution_type_1.FinancialInstitutionList, { description: 'To fetch multiple FinancialInstitutions' }),
60
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
61
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
62
+ tslib_1.__metadata("design:type", Function),
63
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
64
+ tslib_1.__metadata("design:returntype", Promise)
65
+ ], FinancialInstitutionQuery.prototype, "financialInstitutions", null);
66
+ tslib_1.__decorate([
67
+ (0, type_graphql_1.FieldResolver)(type => String),
68
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
69
+ tslib_1.__metadata("design:type", Function),
70
+ tslib_1.__metadata("design:paramtypes", [financial_institution_1.FinancialInstitution]),
71
+ tslib_1.__metadata("design:returntype", Promise)
72
+ ], FinancialInstitutionQuery.prototype, "thumbnail", null);
73
+ tslib_1.__decorate([
74
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
75
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
76
+ tslib_1.__metadata("design:type", Function),
77
+ tslib_1.__metadata("design:paramtypes", [financial_institution_1.FinancialInstitution]),
78
+ tslib_1.__metadata("design:returntype", Promise)
79
+ ], FinancialInstitutionQuery.prototype, "domain", null);
80
+ tslib_1.__decorate([
81
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
82
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
83
+ tslib_1.__metadata("design:type", Function),
84
+ tslib_1.__metadata("design:paramtypes", [financial_institution_1.FinancialInstitution]),
85
+ tslib_1.__metadata("design:returntype", Promise)
86
+ ], FinancialInstitutionQuery.prototype, "updater", null);
87
+ tslib_1.__decorate([
88
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
89
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
90
+ tslib_1.__metadata("design:type", Function),
91
+ tslib_1.__metadata("design:paramtypes", [financial_institution_1.FinancialInstitution]),
92
+ tslib_1.__metadata("design:returntype", Promise)
93
+ ], FinancialInstitutionQuery.prototype, "creator", null);
94
+ exports.FinancialInstitutionQuery = FinancialInstitutionQuery = tslib_1.__decorate([
95
+ (0, type_graphql_1.Resolver)(financial_institution_1.FinancialInstitution)
96
+ ], FinancialInstitutionQuery);
97
+ //# sourceMappingURL=financial-institution-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"financial-institution-query.js","sourceRoot":"","sources":["../../../server/service/financial-institution/financial-institution-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,mEAA8D;AAC9D,6EAAuE;AAGhE,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAE9B,AAAN,KAAK,CAAC,oBAAoB,CAAY,EAAU,EAAS,OAAwB;QAC/E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,4CAAoB,CAAC,CAAC,OAAO,CAAC;YACvD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,qBAAqB,CAA0B,MAAiB,EAAS,OAAwB;QACrG,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MA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ieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { FinancialInstitution } from './financial-institution'\nimport { FinancialInstitutionList } from './financial-institution-type'\n\n@Resolver(FinancialInstitution)\nexport class FinancialInstitutionQuery {\n @Query(returns => FinancialInstitution!, { nullable: true, description: 'To fetch a FinancialInstitution' })\n async financialInstitution(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<FinancialInstitution> {\n const { domain } = context.state\n\n return await getRepository(FinancialInstitution).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => FinancialInstitutionList, { description: 'To fetch multiple FinancialInstitutions' })\n async financialInstitutions(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<FinancialInstitutionList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(FinancialInstitution),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() financialInstitution: FinancialInstitution): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: financialInstitution.domainId },\n refType: FinancialInstitution.name,\n refBy: financialInstitution.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() financialInstitution: FinancialInstitution): Promise<Domain> {\n return financialInstitution.domainId && (await getRepository(Domain).findOneBy({ id: financialInstitution.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() financialInstitution: FinancialInstitution): Promise<User> {\n return financialInstitution.updaterId && (await getRepository(User).findOneBy({ id: financialInstitution.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() financialInstitution: FinancialInstitution): Promise<User> {\n return financialInstitution.creatorId && (await getRepository(User).findOneBy({ id: financialInstitution.creatorId }))\n }\n}\n"]}