@things-factory/accounting 8.0.0-alpha.1 → 8.0.0-alpha.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (362) hide show
  1. package/client/bootstrap.ts +10 -1
  2. package/client/components/accounting-category-selector.ts +136 -0
  3. package/client/components/accounting-category-view.ts +75 -0
  4. package/client/grist-editors/grist-editor-accounting-category-object.ts +83 -0
  5. package/client/grist-editors/grist-renderer-accounting-category-object.ts +13 -0
  6. package/client/pages/account/account-list-page.ts +33 -2
  7. package/client/pages/accounting-category/accounting-category-list-page.ts +31 -1
  8. package/client/pages/accounting-category/accounting-category-tree-page.ts +338 -0
  9. package/client/pages/accounting-document/accounting-document-importer.ts +90 -0
  10. package/client/pages/accounting-document/accounting-document-list-page.ts +398 -0
  11. package/client/pages/bank/bank-importer.ts +90 -0
  12. package/client/pages/{ledger/ledger-list-page.ts → bank/bank-list-page.ts} +118 -57
  13. package/client/pages/{ledger/ledger-importer.ts → bank-account/bank-account-importer.ts} +10 -17
  14. package/client/pages/bank-account/bank-account-list-page.ts +398 -0
  15. package/client/pages/financial-institution/financial-institution-importer.ts +90 -0
  16. package/client/pages/financial-institution/financial-institution-list-page.ts +398 -0
  17. package/client/pages/payment/payment-importer.ts +90 -0
  18. package/client/pages/payment/payment-list-page.ts +398 -0
  19. package/client/route.ts +0 -4
  20. package/client/types/accounting-category.ts +23 -0
  21. package/client/types/index.ts +1 -0
  22. package/dist-client/bootstrap.js +7 -1
  23. package/dist-client/bootstrap.js.map +1 -1
  24. package/dist-client/components/accounting-category-selector.d.ts +16 -0
  25. package/dist-client/components/accounting-category-selector.js +134 -0
  26. package/dist-client/components/accounting-category-selector.js.map +1 -0
  27. package/dist-client/components/accounting-category-view.d.ts +14 -0
  28. package/dist-client/components/accounting-category-view.js +81 -0
  29. package/dist-client/components/accounting-category-view.js.map +1 -0
  30. package/dist-client/grist-editors/grist-editor-accounting-category-object.d.ts +11 -0
  31. package/dist-client/grist-editors/grist-editor-accounting-category-object.js +71 -0
  32. package/dist-client/grist-editors/grist-editor-accounting-category-object.js.map +1 -0
  33. package/dist-client/grist-editors/grist-renderer-accounting-category-object.d.ts +2 -0
  34. package/dist-client/grist-editors/grist-renderer-accounting-category-object.js +9 -0
  35. package/dist-client/grist-editors/grist-renderer-accounting-category-object.js.map +1 -0
  36. package/dist-client/pages/account/account-list-page.js +33 -2
  37. package/dist-client/pages/account/account-list-page.js.map +1 -1
  38. package/dist-client/pages/accounting-category/accounting-category-list-page.js +31 -1
  39. package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -1
  40. package/dist-client/pages/accounting-category/accounting-category-tree-page.d.ts +46 -0
  41. package/dist-client/pages/accounting-category/accounting-category-tree-page.js +329 -0
  42. package/dist-client/pages/accounting-category/accounting-category-tree-page.js.map +1 -0
  43. package/dist-client/pages/accounting-document/accounting-document-importer.d.ts +23 -0
  44. package/dist-client/pages/accounting-document/accounting-document-importer.js +93 -0
  45. package/dist-client/pages/accounting-document/accounting-document-importer.js.map +1 -0
  46. package/dist-client/pages/accounting-document/accounting-document-list-page.d.ts +66 -0
  47. package/dist-client/pages/accounting-document/accounting-document-list-page.js +370 -0
  48. package/dist-client/pages/accounting-document/accounting-document-list-page.js.map +1 -0
  49. package/dist-client/pages/{ledger/ledger-importer.d.ts → bank/bank-importer.d.ts} +3 -2
  50. package/dist-client/pages/{ledger/ledger-importer.js → bank/bank-importer.js} +14 -21
  51. package/dist-client/pages/bank/bank-importer.js.map +1 -0
  52. package/dist-client/pages/{ledger/ledger-list-page.d.ts → bank/bank-list-page.d.ts} +12 -8
  53. package/dist-client/pages/{ledger/ledger-list-page.js → bank/bank-list-page.js} +114 -67
  54. package/dist-client/pages/bank/bank-list-page.js.map +1 -0
  55. package/dist-client/pages/bank-account/bank-account-importer.d.ts +23 -0
  56. package/dist-client/pages/bank-account/bank-account-importer.js +93 -0
  57. package/dist-client/pages/bank-account/bank-account-importer.js.map +1 -0
  58. package/dist-client/pages/bank-account/bank-account-list-page.d.ts +66 -0
  59. package/dist-client/pages/bank-account/bank-account-list-page.js +370 -0
  60. package/dist-client/pages/bank-account/bank-account-list-page.js.map +1 -0
  61. package/dist-client/pages/financial-institution/financial-institution-importer.d.ts +23 -0
  62. package/dist-client/pages/financial-institution/financial-institution-importer.js +93 -0
  63. package/dist-client/pages/financial-institution/financial-institution-importer.js.map +1 -0
  64. package/dist-client/pages/financial-institution/financial-institution-list-page.d.ts +66 -0
  65. package/dist-client/pages/financial-institution/financial-institution-list-page.js +370 -0
  66. package/dist-client/pages/financial-institution/financial-institution-list-page.js.map +1 -0
  67. package/dist-client/pages/payment/payment-importer.d.ts +23 -0
  68. package/dist-client/pages/payment/payment-importer.js +93 -0
  69. package/dist-client/pages/payment/payment-importer.js.map +1 -0
  70. package/dist-client/pages/payment/payment-list-page.d.ts +66 -0
  71. package/dist-client/pages/payment/payment-list-page.js +370 -0
  72. package/dist-client/pages/payment/payment-list-page.js.map +1 -0
  73. package/dist-client/route.d.ts +1 -1
  74. package/dist-client/route.js +0 -3
  75. package/dist-client/route.js.map +1 -1
  76. package/dist-client/tsconfig.tsbuildinfo +1 -1
  77. package/dist-client/types/accounting-category.d.ts +16 -0
  78. package/dist-client/types/accounting-category.js +3 -0
  79. package/dist-client/types/accounting-category.js.map +1 -0
  80. package/dist-client/types/index.d.ts +1 -0
  81. package/dist-client/types/index.js +2 -0
  82. package/dist-client/types/index.js.map +1 -0
  83. package/dist-server/activities/activity-book.js +31 -19
  84. package/dist-server/activities/activity-book.js.map +1 -1
  85. package/dist-server/controllers/summary-statements.js +13 -7
  86. package/dist-server/controllers/summary-statements.js.map +1 -1
  87. package/dist-server/index.d.ts +1 -0
  88. package/dist-server/index.js +1 -0
  89. package/dist-server/index.js.map +1 -1
  90. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js +3 -3
  91. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js.map +1 -1
  92. package/dist-server/migrations/1725201467183-seed-accounts.js +31 -31
  93. package/dist-server/migrations/1725201467183-seed-accounts.js.map +1 -1
  94. package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +5 -0
  95. package/dist-server/migrations/1725201567284-seed-country-codes.js +248 -0
  96. package/dist-server/migrations/1725201567284-seed-country-codes.js.map +1 -0
  97. package/dist-server/migrations/1725201667385-seed-financial-institutions.d.ts +5 -0
  98. package/dist-server/migrations/1725201667385-seed-financial-institutions.js +348 -0
  99. package/dist-server/migrations/1725201667385-seed-financial-institutions.js.map +1 -0
  100. package/dist-server/routes.d.ts +0 -1
  101. package/dist-server/routes.js +0 -1
  102. package/dist-server/routes.js.map +1 -1
  103. package/dist-server/service/account/account-history.d.ts +4 -1
  104. package/dist-server/service/account/account-history.js +14 -4
  105. package/dist-server/service/account/account-history.js.map +1 -1
  106. package/dist-server/service/account/account-mutation.js +13 -9
  107. package/dist-server/service/account/account-mutation.js.map +1 -1
  108. package/dist-server/service/account/account-query.js +2 -0
  109. package/dist-server/service/account/account-query.js.map +1 -1
  110. package/dist-server/service/account/account.d.ts +1 -1
  111. package/dist-server/service/account/account.js +15 -4
  112. package/dist-server/service/account/account.js.map +1 -1
  113. package/dist-server/service/account/index.d.ts +1 -2
  114. package/dist-server/service/accounting-category/accounting-category-history.d.ts +26 -0
  115. package/dist-server/service/accounting-category/accounting-category-history.js +136 -0
  116. package/dist-server/service/accounting-category/accounting-category-history.js.map +1 -0
  117. package/dist-server/service/accounting-category/accounting-category-mutation.js +12 -8
  118. package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -1
  119. package/dist-server/service/accounting-category/accounting-category-query.d.ts +1 -0
  120. package/dist-server/service/accounting-category/accounting-category-query.js +23 -0
  121. package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
  122. package/dist-server/service/accounting-category/accounting-category.d.ts +1 -0
  123. package/dist-server/service/accounting-category/accounting-category.js +14 -3
  124. package/dist-server/service/accounting-category/accounting-category.js.map +1 -1
  125. package/dist-server/service/accounting-category/event-subscriber.d.ts +7 -0
  126. package/dist-server/service/accounting-category/event-subscriber.js +21 -0
  127. package/dist-server/service/accounting-category/event-subscriber.js.map +1 -0
  128. package/dist-server/service/accounting-category/index.d.ts +2 -1
  129. package/dist-server/service/accounting-category/index.js +4 -2
  130. package/dist-server/service/accounting-category/index.js.map +1 -1
  131. package/dist-server/service/accounting-document/accounting-document-history.d.ts +26 -0
  132. package/dist-server/service/accounting-document/accounting-document-history.js +129 -0
  133. package/dist-server/service/accounting-document/accounting-document-history.js.map +1 -0
  134. package/dist-server/service/accounting-document/accounting-document-mutation.d.ts +10 -0
  135. package/dist-server/service/accounting-document/accounting-document-mutation.js +128 -0
  136. package/dist-server/service/accounting-document/accounting-document-mutation.js.map +1 -0
  137. package/dist-server/service/accounting-document/accounting-document-query.d.ts +11 -0
  138. package/dist-server/service/accounting-document/accounting-document-query.js +79 -0
  139. package/dist-server/service/accounting-document/accounting-document-query.js.map +1 -0
  140. package/dist-server/service/accounting-document/accounting-document-type.d.ts +20 -0
  141. package/dist-server/service/accounting-document/accounting-document-type.js +74 -0
  142. package/dist-server/service/accounting-document/accounting-document-type.js.map +1 -0
  143. package/dist-server/service/accounting-document/accounting-document.d.ts +21 -0
  144. package/dist-server/service/accounting-document/accounting-document.js +104 -0
  145. package/dist-server/service/accounting-document/accounting-document.js.map +1 -0
  146. package/dist-server/service/accounting-document/event-subscriber.d.ts +7 -0
  147. package/dist-server/service/accounting-document/event-subscriber.js +21 -0
  148. package/dist-server/service/accounting-document/event-subscriber.js.map +1 -0
  149. package/dist-server/service/accounting-document/index.d.ts +7 -0
  150. package/dist-server/service/accounting-document/index.js +12 -0
  151. package/dist-server/service/accounting-document/index.js.map +1 -0
  152. package/dist-server/service/bank-account/bank-account-history.d.ts +34 -0
  153. package/dist-server/service/bank-account/bank-account-history.js +172 -0
  154. package/dist-server/service/bank-account/bank-account-history.js.map +1 -0
  155. package/dist-server/service/bank-account/bank-account-mutation.d.ts +10 -0
  156. package/dist-server/service/bank-account/bank-account-mutation.js +128 -0
  157. package/dist-server/service/bank-account/bank-account-mutation.js.map +1 -0
  158. package/dist-server/service/bank-account/bank-account-query.d.ts +11 -0
  159. package/dist-server/service/bank-account/bank-account-query.js +79 -0
  160. package/dist-server/service/bank-account/bank-account-query.js.map +1 -0
  161. package/dist-server/service/bank-account/bank-account-type.d.ts +39 -0
  162. package/dist-server/service/bank-account/bank-account-type.js +153 -0
  163. package/dist-server/service/bank-account/bank-account-type.js.map +1 -0
  164. package/dist-server/service/bank-account/bank-account.d.ts +38 -0
  165. package/dist-server/service/bank-account/bank-account.js +164 -0
  166. package/dist-server/service/bank-account/bank-account.js.map +1 -0
  167. package/dist-server/service/bank-account/event-subscriber.d.ts +7 -0
  168. package/dist-server/service/bank-account/event-subscriber.js +21 -0
  169. package/dist-server/service/bank-account/event-subscriber.js.map +1 -0
  170. package/dist-server/service/bank-account/index.d.ts +7 -0
  171. package/dist-server/service/bank-account/index.js +12 -0
  172. package/dist-server/service/bank-account/index.js.map +1 -0
  173. package/dist-server/service/financial-institution/financial-institution-mutation.d.ts +10 -0
  174. package/dist-server/service/financial-institution/financial-institution-mutation.js +169 -0
  175. package/dist-server/service/financial-institution/financial-institution-mutation.js.map +1 -0
  176. package/dist-server/service/financial-institution/financial-institution-query.d.ts +12 -0
  177. package/dist-server/service/financial-institution/financial-institution-query.js +97 -0
  178. package/dist-server/service/financial-institution/financial-institution-query.js.map +1 -0
  179. package/dist-server/service/financial-institution/financial-institution-type.d.ts +32 -0
  180. package/dist-server/service/financial-institution/financial-institution-type.js +126 -0
  181. package/dist-server/service/financial-institution/financial-institution-type.js.map +1 -0
  182. package/dist-server/service/financial-institution/financial-institution.d.ts +34 -0
  183. package/dist-server/service/financial-institution/financial-institution.js +137 -0
  184. package/dist-server/service/financial-institution/financial-institution.js.map +1 -0
  185. package/dist-server/service/financial-institution/index.d.ts +6 -0
  186. package/dist-server/service/financial-institution/index.js +10 -0
  187. package/dist-server/service/financial-institution/index.js.map +1 -0
  188. package/dist-server/service/financial-statement/financial-statement-history.d.ts +9 -6
  189. package/dist-server/service/financial-statement/financial-statement-history.js +30 -20
  190. package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
  191. package/dist-server/service/financial-statement/financial-statement-line-item.d.ts +19 -0
  192. package/dist-server/service/financial-statement/financial-statement-line-item.js +94 -0
  193. package/dist-server/service/financial-statement/financial-statement-line-item.js.map +1 -0
  194. package/dist-server/service/financial-statement/financial-statement-mutation.js +12 -8
  195. package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -1
  196. package/dist-server/service/financial-statement/financial-statement-query.js +2 -0
  197. package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
  198. package/dist-server/service/financial-statement/financial-statement.d.ts +2 -0
  199. package/dist-server/service/financial-statement/financial-statement.js +45 -24
  200. package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
  201. package/dist-server/service/financial-statement/index.d.ts +2 -2
  202. package/dist-server/service/financial-statement/index.js +2 -1
  203. package/dist-server/service/financial-statement/index.js.map +1 -1
  204. package/dist-server/service/fiscal-month/fiscal-month-mutation.js +6 -0
  205. package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -1
  206. package/dist-server/service/fiscal-month/fiscal-month-query.js +2 -0
  207. package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -1
  208. package/dist-server/service/fiscal-month/fiscal-month.js +1 -1
  209. package/dist-server/service/fiscal-month/fiscal-month.js.map +1 -1
  210. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +6 -0
  211. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -1
  212. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +2 -0
  213. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -1
  214. package/dist-server/service/fiscal-quarter/fiscal-quarter.js +1 -1
  215. package/dist-server/service/fiscal-quarter/fiscal-quarter.js.map +1 -1
  216. package/dist-server/service/fiscal-year/fiscal-year-mutation.js +6 -0
  217. package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -1
  218. package/dist-server/service/fiscal-year/fiscal-year-query.js +2 -0
  219. package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -1
  220. package/dist-server/service/fiscal-year/fiscal-year.js +1 -1
  221. package/dist-server/service/fiscal-year/fiscal-year.js.map +1 -1
  222. package/dist-server/service/income-statement/income-statement-history.d.ts +9 -5
  223. package/dist-server/service/income-statement/income-statement-history.js +35 -20
  224. package/dist-server/service/income-statement/income-statement-history.js.map +1 -1
  225. package/dist-server/service/income-statement/income-statement-line-item.d.ts +19 -0
  226. package/dist-server/service/income-statement/income-statement-line-item.js +96 -0
  227. package/dist-server/service/income-statement/income-statement-line-item.js.map +1 -0
  228. package/dist-server/service/income-statement/income-statement-mutation.js +12 -8
  229. package/dist-server/service/income-statement/income-statement-mutation.js.map +1 -1
  230. package/dist-server/service/income-statement/income-statement-query.js +2 -0
  231. package/dist-server/service/income-statement/income-statement-query.js.map +1 -1
  232. package/dist-server/service/income-statement/income-statement.d.ts +2 -0
  233. package/dist-server/service/income-statement/income-statement.js +46 -26
  234. package/dist-server/service/income-statement/income-statement.js.map +1 -1
  235. package/dist-server/service/income-statement/index.d.ts +2 -2
  236. package/dist-server/service/income-statement/index.js +2 -1
  237. package/dist-server/service/income-statement/index.js.map +1 -1
  238. package/dist-server/service/index.d.ts +4 -2
  239. package/dist-server/service/index.js +10 -0
  240. package/dist-server/service/index.js.map +1 -1
  241. package/dist-server/service/payment/event-subscriber.d.ts +7 -0
  242. package/dist-server/service/payment/event-subscriber.js +21 -0
  243. package/dist-server/service/payment/event-subscriber.js.map +1 -0
  244. package/dist-server/service/payment/index.d.ts +7 -0
  245. package/dist-server/service/payment/index.js +12 -0
  246. package/dist-server/service/payment/index.js.map +1 -0
  247. package/dist-server/service/payment/payment-history.d.ts +37 -0
  248. package/dist-server/service/payment/payment-history.js +174 -0
  249. package/dist-server/service/payment/payment-history.js.map +1 -0
  250. package/dist-server/service/payment/payment-mutation.d.ts +10 -0
  251. package/dist-server/service/payment/payment-mutation.js +134 -0
  252. package/dist-server/service/payment/payment-mutation.js.map +1 -0
  253. package/dist-server/service/payment/payment-query.d.ts +11 -0
  254. package/dist-server/service/payment/payment-query.js +81 -0
  255. package/dist-server/service/payment/payment-query.js.map +1 -0
  256. package/dist-server/service/payment/payment-type.d.ts +30 -0
  257. package/dist-server/service/payment/payment-type.js +114 -0
  258. package/dist-server/service/payment/payment-type.js.map +1 -0
  259. package/dist-server/service/payment/payment.d.ts +42 -0
  260. package/dist-server/service/payment/payment.js +181 -0
  261. package/dist-server/service/payment/payment.js.map +1 -0
  262. package/dist-server/service/transaction/index.d.ts +2 -1
  263. package/dist-server/service/transaction/transaction-history.d.ts +6 -2
  264. package/dist-server/service/transaction/transaction-history.js +28 -9
  265. package/dist-server/service/transaction/transaction-history.js.map +1 -1
  266. package/dist-server/service/transaction/transaction-mutation.js +13 -9
  267. package/dist-server/service/transaction/transaction-mutation.js.map +1 -1
  268. package/dist-server/service/transaction/transaction-query.js +2 -0
  269. package/dist-server/service/transaction/transaction-query.js.map +1 -1
  270. package/dist-server/service/transaction/transaction.d.ts +28 -6
  271. package/dist-server/service/transaction/transaction.js +119 -31
  272. package/dist-server/service/transaction/transaction.js.map +1 -1
  273. package/dist-server/tsconfig.tsbuildinfo +1 -1
  274. package/helps/accounting/accounting-document.md +160 -0
  275. package/helps/accounting/bank-account.md +160 -0
  276. package/helps/accounting/bank.md +160 -0
  277. package/helps/accounting/contract.md +160 -0
  278. package/helps/accounting/financial-institution.md +160 -0
  279. package/helps/accounting/payment.md +160 -0
  280. package/package.json +5 -5
  281. package/server/activities/activity-book.ts +31 -19
  282. package/server/controllers/summary-statements.ts +13 -7
  283. package/server/index.ts +1 -0
  284. package/server/migrations/1725200507196-seed-fiscal-entities.ts +3 -3
  285. package/server/migrations/1725201467183-seed-accounts.ts +31 -31
  286. package/server/migrations/1725201567284-seed-country-codes.ts +261 -0
  287. package/server/migrations/1725201667385-seed-financial-institutions.ts +348 -0
  288. package/server/routes.ts +0 -2
  289. package/server/service/account/account-history.ts +14 -6
  290. package/server/service/account/account-mutation.ts +13 -10
  291. package/server/service/account/account-query.ts +2 -0
  292. package/server/service/account/account.ts +15 -4
  293. package/server/service/accounting-category/accounting-category-history.ts +123 -0
  294. package/server/service/accounting-category/accounting-category-mutation.ts +12 -9
  295. package/server/service/accounting-category/accounting-category-query.ts +23 -0
  296. package/server/service/accounting-category/accounting-category.ts +14 -3
  297. package/server/service/accounting-category/event-subscriber.ts +20 -0
  298. package/server/service/accounting-category/index.ts +4 -2
  299. package/server/service/accounting-document/accounting-document-history.ts +117 -0
  300. package/server/service/accounting-document/accounting-document-mutation.ts +137 -0
  301. package/server/service/accounting-document/accounting-document-query.ts +48 -0
  302. package/server/service/accounting-document/accounting-document-type.ts +52 -0
  303. package/server/service/accounting-document/accounting-document.ts +93 -0
  304. package/server/service/accounting-document/event-subscriber.ts +17 -0
  305. package/server/service/accounting-document/index.ts +9 -0
  306. package/server/service/bank-account/bank-account-history.ts +149 -0
  307. package/server/service/bank-account/bank-account-mutation.ts +137 -0
  308. package/server/service/bank-account/bank-account-query.ts +48 -0
  309. package/server/service/bank-account/bank-account-type.ts +112 -0
  310. package/server/service/bank-account/bank-account.ts +142 -0
  311. package/server/service/bank-account/event-subscriber.ts +17 -0
  312. package/server/service/bank-account/index.ts +9 -0
  313. package/server/service/financial-institution/financial-institution-mutation.ts +198 -0
  314. package/server/service/financial-institution/financial-institution-query.ts +62 -0
  315. package/server/service/financial-institution/financial-institution-type.ts +91 -0
  316. package/server/service/financial-institution/financial-institution.ts +122 -0
  317. package/server/service/financial-institution/index.ts +7 -0
  318. package/server/service/financial-statement/financial-statement-history.ts +27 -18
  319. package/server/service/financial-statement/financial-statement-line-item.ts +82 -0
  320. package/server/service/financial-statement/financial-statement-mutation.ts +12 -9
  321. package/server/service/financial-statement/financial-statement-query.ts +2 -0
  322. package/server/service/financial-statement/financial-statement.ts +52 -36
  323. package/server/service/financial-statement/index.ts +2 -1
  324. package/server/service/fiscal-month/fiscal-month-mutation.ts +10 -2
  325. package/server/service/fiscal-month/fiscal-month-query.ts +3 -1
  326. package/server/service/fiscal-month/fiscal-month.ts +1 -1
  327. package/server/service/fiscal-quarter/fiscal-quarter-mutation.ts +14 -3
  328. package/server/service/fiscal-quarter/fiscal-quarter-query.ts +2 -0
  329. package/server/service/fiscal-quarter/fiscal-quarter.ts +1 -1
  330. package/server/service/fiscal-year/fiscal-year-mutation.ts +10 -2
  331. package/server/service/fiscal-year/fiscal-year-query.ts +2 -0
  332. package/server/service/fiscal-year/fiscal-year.ts +1 -1
  333. package/server/service/income-statement/income-statement-history.ts +30 -17
  334. package/server/service/income-statement/income-statement-line-item.ts +84 -0
  335. package/server/service/income-statement/income-statement-mutation.ts +12 -10
  336. package/server/service/income-statement/income-statement-query.ts +2 -0
  337. package/server/service/income-statement/income-statement.ts +54 -39
  338. package/server/service/income-statement/index.ts +2 -1
  339. package/server/service/index.ts +18 -0
  340. package/server/service/payment/event-subscriber.ts +17 -0
  341. package/server/service/payment/index.ts +9 -0
  342. package/server/service/payment/payment-history.ts +149 -0
  343. package/server/service/payment/payment-mutation.ts +139 -0
  344. package/server/service/payment/payment-query.ts +50 -0
  345. package/server/service/payment/payment-type.ts +82 -0
  346. package/server/service/payment/payment.ts +154 -0
  347. package/server/service/transaction/transaction-history.ts +24 -8
  348. package/server/service/transaction/transaction-mutation.ts +13 -10
  349. package/server/service/transaction/transaction-query.ts +2 -0
  350. package/server/service/transaction/transaction.ts +130 -34
  351. package/things-factory.config.js +0 -1
  352. package/translations/en.json +9 -1
  353. package/translations/ja.json +9 -1
  354. package/translations/ko.json +9 -1
  355. package/translations/ms.json +9 -1
  356. package/translations/zh.json +9 -1
  357. package/client/pages/main.ts +0 -24
  358. package/dist-client/pages/ledger/ledger-importer.js.map +0 -1
  359. package/dist-client/pages/ledger/ledger-list-page.js.map +0 -1
  360. package/dist-client/pages/main.d.ts +0 -1
  361. package/dist-client/pages/main.js +0 -27
  362. package/dist-client/pages/main.js.map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IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,iBAAO;;2CAErC;uBAzCU,YAAY;IADxB,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,YAAY,CA0CxB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Payment } from './payment'\nimport { PaymentList } from './payment-type'\n\n@Resolver(Payment)\nexport class PaymentQuery {\n @Directive('@privilege(category: \"accounting\", privilege: \"query\")')\n @Query(returns => Payment!, { nullable: true, description: 'To fetch a Payment' })\n async payment(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Payment> {\n const { domain } = context.state\n\n return await getRepository(Payment).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"accounting\", privilege: \"query\")')\n @Query(returns => PaymentList, { description: 'To fetch multiple Payments' })\n async payments(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<PaymentList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Payment),\n searchables: []\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() payment: Payment): Promise<Domain> {\n return payment.domainId && (await getRepository(Domain).findOneBy({ id: payment.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() payment: Payment): Promise<User> {\n return payment.updaterId && (await getRepository(User).findOneBy({ id: payment.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() payment: Payment): Promise<User> {\n return payment.creatorId && (await getRepository(User).findOneBy({ id: payment.creatorId }))\n }\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import { ObjectRef } from '@things-factory/shell';
2
+ import { Payment, PaymentDirection, PaymentType } from './payment';
3
+ export declare class NewPayment {
4
+ transaction: ObjectRef;
5
+ currency?: string;
6
+ amount: number;
7
+ paidAt: Date;
8
+ direction: PaymentDirection;
9
+ paymentType: PaymentType;
10
+ sourceBankAccount?: ObjectRef;
11
+ destinationBankAccount?: ObjectRef;
12
+ note?: string;
13
+ }
14
+ export declare class PaymentPatch {
15
+ id?: string;
16
+ transaction: ObjectRef;
17
+ currency?: string;
18
+ amount: number;
19
+ paidAt: Date;
20
+ direction: PaymentDirection;
21
+ paymentType: PaymentType;
22
+ sourceBankAccount?: ObjectRef;
23
+ destinationBankAccount?: ObjectRef;
24
+ note?: string;
25
+ cuFlag?: string;
26
+ }
27
+ export declare class PaymentList {
28
+ items: Payment[];
29
+ total: number;
30
+ }
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentList = exports.PaymentPatch = exports.NewPayment = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const payment_1 = require("./payment");
8
+ let NewPayment = class NewPayment {
9
+ };
10
+ exports.NewPayment = NewPayment;
11
+ tslib_1.__decorate([
12
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef),
13
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
14
+ ], NewPayment.prototype, "transaction", void 0);
15
+ tslib_1.__decorate([
16
+ (0, type_graphql_1.Field)({ nullable: true }),
17
+ tslib_1.__metadata("design:type", String)
18
+ ], NewPayment.prototype, "currency", void 0);
19
+ tslib_1.__decorate([
20
+ (0, type_graphql_1.Field)({ nullable: false }),
21
+ tslib_1.__metadata("design:type", Number)
22
+ ], NewPayment.prototype, "amount", void 0);
23
+ tslib_1.__decorate([
24
+ (0, type_graphql_1.Field)({ nullable: false }),
25
+ tslib_1.__metadata("design:type", Date)
26
+ ], NewPayment.prototype, "paidAt", void 0);
27
+ tslib_1.__decorate([
28
+ (0, type_graphql_1.Field)(type => payment_1.PaymentDirection),
29
+ tslib_1.__metadata("design:type", String)
30
+ ], NewPayment.prototype, "direction", void 0);
31
+ tslib_1.__decorate([
32
+ (0, type_graphql_1.Field)(type => payment_1.PaymentType, { description: 'Type of the payment' }),
33
+ tslib_1.__metadata("design:type", String)
34
+ ], NewPayment.prototype, "paymentType", void 0);
35
+ tslib_1.__decorate([
36
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'Source bank account for the payment' }),
37
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
38
+ ], NewPayment.prototype, "sourceBankAccount", void 0);
39
+ tslib_1.__decorate([
40
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'Destination bank account for the payment' }),
41
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
42
+ ], NewPayment.prototype, "destinationBankAccount", void 0);
43
+ tslib_1.__decorate([
44
+ (0, type_graphql_1.Field)({ nullable: true }),
45
+ tslib_1.__metadata("design:type", String)
46
+ ], NewPayment.prototype, "note", void 0);
47
+ exports.NewPayment = NewPayment = tslib_1.__decorate([
48
+ (0, type_graphql_1.InputType)()
49
+ ], NewPayment);
50
+ let PaymentPatch = class PaymentPatch {
51
+ };
52
+ exports.PaymentPatch = PaymentPatch;
53
+ tslib_1.__decorate([
54
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
55
+ tslib_1.__metadata("design:type", String)
56
+ ], PaymentPatch.prototype, "id", void 0);
57
+ tslib_1.__decorate([
58
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef),
59
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
60
+ ], PaymentPatch.prototype, "transaction", void 0);
61
+ tslib_1.__decorate([
62
+ (0, type_graphql_1.Field)({ nullable: true }),
63
+ tslib_1.__metadata("design:type", String)
64
+ ], PaymentPatch.prototype, "currency", void 0);
65
+ tslib_1.__decorate([
66
+ (0, type_graphql_1.Field)({ nullable: false }),
67
+ tslib_1.__metadata("design:type", Number)
68
+ ], PaymentPatch.prototype, "amount", void 0);
69
+ tslib_1.__decorate([
70
+ (0, type_graphql_1.Field)({ nullable: false }),
71
+ tslib_1.__metadata("design:type", Date)
72
+ ], PaymentPatch.prototype, "paidAt", void 0);
73
+ tslib_1.__decorate([
74
+ (0, type_graphql_1.Field)(type => payment_1.PaymentDirection),
75
+ tslib_1.__metadata("design:type", String)
76
+ ], PaymentPatch.prototype, "direction", void 0);
77
+ tslib_1.__decorate([
78
+ (0, type_graphql_1.Field)(type => payment_1.PaymentType, { description: 'Type of the payment' }),
79
+ tslib_1.__metadata("design:type", String)
80
+ ], PaymentPatch.prototype, "paymentType", void 0);
81
+ tslib_1.__decorate([
82
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'Source bank account for the payment' }),
83
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
84
+ ], PaymentPatch.prototype, "sourceBankAccount", void 0);
85
+ tslib_1.__decorate([
86
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'Destination bank account for the payment' }),
87
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
88
+ ], PaymentPatch.prototype, "destinationBankAccount", void 0);
89
+ tslib_1.__decorate([
90
+ (0, type_graphql_1.Field)({ nullable: true }),
91
+ tslib_1.__metadata("design:type", String)
92
+ ], PaymentPatch.prototype, "note", void 0);
93
+ tslib_1.__decorate([
94
+ (0, type_graphql_1.Field)({ nullable: true }),
95
+ tslib_1.__metadata("design:type", String)
96
+ ], PaymentPatch.prototype, "cuFlag", void 0);
97
+ exports.PaymentPatch = PaymentPatch = tslib_1.__decorate([
98
+ (0, type_graphql_1.InputType)()
99
+ ], PaymentPatch);
100
+ let PaymentList = class PaymentList {
101
+ };
102
+ exports.PaymentList = PaymentList;
103
+ tslib_1.__decorate([
104
+ (0, type_graphql_1.Field)(type => [payment_1.Payment]),
105
+ tslib_1.__metadata("design:type", Array)
106
+ ], PaymentList.prototype, "items", void 0);
107
+ tslib_1.__decorate([
108
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
109
+ tslib_1.__metadata("design:type", Number)
110
+ ], PaymentList.prototype, "total", void 0);
111
+ exports.PaymentList = PaymentList = tslib_1.__decorate([
112
+ (0, type_graphql_1.ObjectType)()
113
+ ], PaymentList);
114
+ //# sourceMappingURL=payment-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-type.js","sourceRoot":"","sources":["../../../server/service/payment/payment-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAEtF,iDAA+D;AAE/D,uCAAkE;AAG3D,IAAM,UAAU,GAAhB,MAAM,UAAU;CA2BtB,CAAA;AA3BY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC;sCACZ,iBAAS;+CAAA;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CACb;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;sCACnB,IAAI;0CAAA;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAgB,CAAC;;6CACL;AAG3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,qBAAW,EAAE,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;+CAC3C;AAGxB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;sCAC7E,iBAAS;qDAAA;AAG7B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,I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,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACX;uBAhCJ,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAiCxB;AAGM,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AANY,kCAAW;AAEtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iBAAO,CAAC,CAAC;;0CACT;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;0CACN;sBALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Payment, PaymentDirection, PaymentType } from './payment'\n\n@InputType()\nexport class NewPayment {\n @Field(type => ObjectRef)\n transaction: ObjectRef\n\n @Field({ nullable: true })\n currency?: string\n\n @Field({ nullable: false })\n amount: number\n\n @Field({ nullable: false })\n paidAt: Date\n\n @Field(type => PaymentDirection)\n direction: PaymentDirection\n\n @Field(type => PaymentType, { description: 'Type of the payment' })\n paymentType: PaymentType // 결제 유형\n\n @Field(type => ObjectRef, { nullable: true, description: 'Source bank account for the payment' })\n sourceBankAccount?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true, description: 'Destination bank account for the payment' })\n destinationBankAccount?: ObjectRef\n\n @Field({ nullable: true })\n note?: string\n}\n\n@InputType()\nexport class PaymentPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field(type => ObjectRef)\n transaction: ObjectRef\n\n @Field({ nullable: true })\n currency?: string\n\n @Field({ nullable: false })\n amount: number\n\n @Field({ nullable: false })\n paidAt: Date\n\n @Field(type => PaymentDirection)\n direction: PaymentDirection\n\n @Field(type => PaymentType, { description: 'Type of the payment' })\n paymentType: PaymentType // 결제 유형\n\n @Field(type => ObjectRef, { nullable: true, description: 'Source bank account for the payment' })\n sourceBankAccount?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true, description: 'Destination bank account for the payment' })\n destinationBankAccount?: ObjectRef\n\n @Field({ nullable: true })\n note?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class PaymentList {\n @Field(type => [Payment])\n items: Payment[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,42 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { Transaction } from '../transaction/transaction';
4
+ import { BankAccount } from 'service/bank-account/bank-account';
5
+ export declare enum PaymentDirection {
6
+ Incoming = "Incoming",// 수금
7
+ Outgoing = "Outgoing"
8
+ }
9
+ export declare enum PaymentType {
10
+ Transfer = "Transfer",// 계좌 이체
11
+ Cash = "Cash",// 현금
12
+ CreditCard = "CreditCard",// 신용카드
13
+ DebitCard = "DebitCard"
14
+ }
15
+ export declare class Payment {
16
+ readonly id: string;
17
+ version?: number;
18
+ domain?: Domain;
19
+ domainId?: string;
20
+ transaction: Transaction;
21
+ transactionId: string;
22
+ currency?: string;
23
+ amount: number;
24
+ paymentType: PaymentType;
25
+ sourceBankAccount?: BankAccount;
26
+ sourceBankAccountId?: string;
27
+ destinationBankAccount?: BankAccount;
28
+ destinationBankAccountId?: string;
29
+ year?: number;
30
+ quarter?: number;
31
+ month?: number;
32
+ paidAt: Date;
33
+ direction: PaymentDirection;
34
+ note?: string;
35
+ createdAt?: Date;
36
+ updatedAt?: Date;
37
+ deletedAt?: Date;
38
+ creator?: User;
39
+ creatorId?: string;
40
+ updater?: User;
41
+ updaterId?: string;
42
+ }
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Payment = exports.PaymentType = exports.PaymentDirection = 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
+ const transaction_1 = require("../transaction/transaction");
10
+ const bank_account_1 = require("service/bank-account/bank-account");
11
+ var PaymentDirection;
12
+ (function (PaymentDirection) {
13
+ PaymentDirection["Incoming"] = "Incoming";
14
+ PaymentDirection["Outgoing"] = "Outgoing"; // 지출
15
+ })(PaymentDirection || (exports.PaymentDirection = PaymentDirection = {}));
16
+ (0, type_graphql_1.registerEnumType)(PaymentDirection, {
17
+ name: 'PaymentDirection',
18
+ description: 'Indicates whether the payment is incoming (received) or outgoing (paid)' // 결제 방향을 나타냅니다 (수금 또는 지출)
19
+ });
20
+ var PaymentType;
21
+ (function (PaymentType) {
22
+ PaymentType["Transfer"] = "Transfer";
23
+ PaymentType["Cash"] = "Cash";
24
+ PaymentType["CreditCard"] = "CreditCard";
25
+ PaymentType["DebitCard"] = "DebitCard"; // 직불카드
26
+ })(PaymentType || (exports.PaymentType = PaymentType = {}));
27
+ (0, type_graphql_1.registerEnumType)(PaymentType, {
28
+ name: 'PaymentType',
29
+ description: 'Type of the payment (e.g., Transfer, Cash, CreditCard, DebitCard)' // 결제 유형을 나타냅니다
30
+ });
31
+ let Payment = class Payment {
32
+ constructor() {
33
+ this.version = 1; // 낙관적 잠금을 위한 버전 관리 필드
34
+ }
35
+ };
36
+ exports.Payment = Payment;
37
+ tslib_1.__decorate([
38
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
39
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for the payment record' }),
40
+ tslib_1.__metadata("design:type", String)
41
+ ], Payment.prototype, "id", void 0);
42
+ tslib_1.__decorate([
43
+ (0, typeorm_1.VersionColumn)(),
44
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Version number used for optimistic locking' }),
45
+ tslib_1.__metadata("design:type", Number)
46
+ ], Payment.prototype, "version", void 0);
47
+ tslib_1.__decorate([
48
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
49
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The domain to which this payment belongs' }),
50
+ tslib_1.__metadata("design:type", shell_1.Domain // 결제가 속한 도메인
51
+ )
52
+ ], Payment.prototype, "domain", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.RelationId)((payment) => payment.domain),
55
+ tslib_1.__metadata("design:type", String)
56
+ ], Payment.prototype, "domainId", void 0);
57
+ tslib_1.__decorate([
58
+ (0, typeorm_1.ManyToOne)(type => transaction_1.Transaction, transaction => transaction.payments),
59
+ (0, type_graphql_1.Field)(type => transaction_1.Transaction, { description: 'The transaction associated with this payment' }),
60
+ tslib_1.__metadata("design:type", transaction_1.Transaction // 결제와 연결된 트랜잭션
61
+ )
62
+ ], Payment.prototype, "transaction", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.RelationId)((payment) => payment.transaction),
65
+ tslib_1.__metadata("design:type", String)
66
+ ], Payment.prototype, "transactionId", void 0);
67
+ tslib_1.__decorate([
68
+ (0, typeorm_1.Column)({ nullable: true }),
69
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The currency used in the payment' }),
70
+ tslib_1.__metadata("design:type", String)
71
+ ], Payment.prototype, "currency", void 0);
72
+ tslib_1.__decorate([
73
+ (0, typeorm_1.Column)({ nullable: false }),
74
+ (0, type_graphql_1.Field)({ nullable: false, description: 'The amount of money involved in the payment' }),
75
+ tslib_1.__metadata("design:type", Number)
76
+ ], Payment.prototype, "amount", void 0);
77
+ tslib_1.__decorate([
78
+ (0, typeorm_1.Column)({ type: 'enum', enum: PaymentType, nullable: false }),
79
+ (0, type_graphql_1.Field)(type => PaymentType, { description: 'Type of the payment' }),
80
+ tslib_1.__metadata("design:type", String)
81
+ ], Payment.prototype, "paymentType", void 0);
82
+ tslib_1.__decorate([
83
+ (0, typeorm_1.ManyToOne)(type => bank_account_1.BankAccount, { nullable: true }),
84
+ (0, type_graphql_1.Field)(type => bank_account_1.BankAccount, { nullable: true, description: 'Source bank account for the payment' }),
85
+ tslib_1.__metadata("design:type", bank_account_1.BankAccount)
86
+ ], Payment.prototype, "sourceBankAccount", void 0);
87
+ tslib_1.__decorate([
88
+ (0, typeorm_1.RelationId)((payment) => payment.sourceBankAccount),
89
+ tslib_1.__metadata("design:type", String)
90
+ ], Payment.prototype, "sourceBankAccountId", void 0);
91
+ tslib_1.__decorate([
92
+ (0, typeorm_1.ManyToOne)(type => bank_account_1.BankAccount, { nullable: true }),
93
+ (0, type_graphql_1.Field)(type => bank_account_1.BankAccount, { nullable: true, description: 'Destination bank account for the payment' }),
94
+ tslib_1.__metadata("design:type", bank_account_1.BankAccount)
95
+ ], Payment.prototype, "destinationBankAccount", void 0);
96
+ tslib_1.__decorate([
97
+ (0, typeorm_1.RelationId)((payment) => payment.destinationBankAccount),
98
+ tslib_1.__metadata("design:type", String)
99
+ ], Payment.prototype, "destinationBankAccountId", void 0);
100
+ tslib_1.__decorate([
101
+ (0, typeorm_1.Column)({ nullable: true }),
102
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal year in which the payment was made' }),
103
+ tslib_1.__metadata("design:type", Number)
104
+ ], Payment.prototype, "year", void 0);
105
+ tslib_1.__decorate([
106
+ (0, typeorm_1.Column)({ nullable: true }),
107
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal quarter in which the payment was made' }),
108
+ tslib_1.__metadata("design:type", Number)
109
+ ], Payment.prototype, "quarter", void 0);
110
+ tslib_1.__decorate([
111
+ (0, typeorm_1.Column)({ nullable: true }),
112
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal month in which the payment was made' }),
113
+ tslib_1.__metadata("design:type", Number)
114
+ ], Payment.prototype, "month", void 0);
115
+ tslib_1.__decorate([
116
+ (0, typeorm_1.Column)({ nullable: false }),
117
+ (0, type_graphql_1.Field)({ nullable: false, description: 'The date and time when the payment was made' }),
118
+ tslib_1.__metadata("design:type", Date // 결제가 이루어진 날짜 및 시간
119
+ )
120
+ ], Payment.prototype, "paidAt", void 0);
121
+ tslib_1.__decorate([
122
+ (0, typeorm_1.Column)({ nullable: false }),
123
+ (0, type_graphql_1.Field)(type => PaymentDirection, { description: 'Direction of the payment (Incoming or Outgoing)' }),
124
+ tslib_1.__metadata("design:type", String)
125
+ ], Payment.prototype, "direction", void 0);
126
+ tslib_1.__decorate([
127
+ (0, typeorm_1.Column)({ nullable: true }),
128
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Additional notes or comments about the payment' }),
129
+ tslib_1.__metadata("design:type", String)
130
+ ], Payment.prototype, "note", void 0);
131
+ tslib_1.__decorate([
132
+ (0, typeorm_1.CreateDateColumn)(),
133
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the payment record was created' }),
134
+ tslib_1.__metadata("design:type", Date // 결제 레코드가 생성된 날짜 및 시간
135
+ )
136
+ ], Payment.prototype, "createdAt", void 0);
137
+ tslib_1.__decorate([
138
+ (0, typeorm_1.UpdateDateColumn)(),
139
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the payment record was last updated' }),
140
+ tslib_1.__metadata("design:type", Date // 결제 레코드가 마지막으로 업데이트된 날짜 및 시간
141
+ )
142
+ ], Payment.prototype, "updatedAt", void 0);
143
+ tslib_1.__decorate([
144
+ (0, typeorm_1.DeleteDateColumn)(),
145
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the payment record was deleted' }),
146
+ tslib_1.__metadata("design:type", Date // 결제 레코드가 삭제된 날짜 및 시간
147
+ )
148
+ ], Payment.prototype, "deletedAt", void 0);
149
+ tslib_1.__decorate([
150
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
151
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created the payment record' }),
152
+ tslib_1.__metadata("design:type", auth_base_1.User // 결제 레코드를 생성한 사용자
153
+ )
154
+ ], Payment.prototype, "creator", void 0);
155
+ tslib_1.__decorate([
156
+ (0, typeorm_1.RelationId)((payment) => payment.creator),
157
+ tslib_1.__metadata("design:type", String)
158
+ ], Payment.prototype, "creatorId", void 0);
159
+ tslib_1.__decorate([
160
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
161
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who last updated the payment record' }),
162
+ tslib_1.__metadata("design:type", auth_base_1.User // 결제 레코드를 마지막으로 업데이트한 사용자
163
+ )
164
+ ], Payment.prototype, "updater", void 0);
165
+ tslib_1.__decorate([
166
+ (0, typeorm_1.RelationId)((payment) => payment.updater),
167
+ tslib_1.__metadata("design:type", String)
168
+ ], Payment.prototype, "updaterId", void 0);
169
+ exports.Payment = Payment = tslib_1.__decorate([
170
+ (0, typeorm_1.Entity)(),
171
+ (0, typeorm_1.Index)('ix_payment_0', (payment) => [payment.domain, payment.transaction, payment.paidAt], {
172
+ where: '"deleted_at" IS NULL',
173
+ unique: true
174
+ }),
175
+ (0, typeorm_1.Index)('ix_payment_1', (payment) => [payment.domain, payment.year, payment.quarter, payment.month, payment.paidAt], {
176
+ unique: true,
177
+ where: '"deleted_at" IS NULL'
178
+ }),
179
+ (0, type_graphql_1.ObjectType)({ description: 'Entity representing a Payment record in the system' }) // 시스템 내에서 결제 기록을 나타내는 엔티티
180
+ ], Payment);
181
+ //# sourceMappingURL=payment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../server/service/payment/payment.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAAsE;AAEtE,iDAA8C;AAC9C,yDAAgD;AAChD,4DAAwD;AACxD,oEAA+D;AAE/D,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,yCAAqB,CAAA,CAAC,KAAK;AAC7B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,CAAC,0BAA0B;;wCAA3B;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;kBAjGP,OAAO;IAdnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE;QAClG,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,eAAK,EACJ,cAAc,EACd,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,EACpG;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CACF;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC,CAAC,0BAA0B;GAChG,OAAO,CAkGnB","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, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Transaction } from '../transaction/transaction'\nimport { BankAccount } from 'service/bank-account/bank-account'\n\nexport enum PaymentDirection {\n Incoming = 'Incoming', // 수금\n Outgoing = 'Outgoing' // 지출\n}\n\nregisterEnumType(PaymentDirection, {\n name: 'PaymentDirection',\n description: 'Indicates whether the payment is incoming (received) or outgoing (paid)' // 결제 방향을 나타냅니다 (수금 또는 지출)\n})\n\nexport enum PaymentType {\n Transfer = 'Transfer', // 계좌 이체\n Cash = 'Cash', // 현금\n CreditCard = 'CreditCard', // 신용카드\n DebitCard = 'DebitCard' // 직불카드\n}\n\nregisterEnumType(PaymentType, {\n name: 'PaymentType',\n description: 'Type of the payment (e.g., Transfer, Cash, CreditCard, DebitCard)' // 결제 유형을 나타냅니다\n})\n\n@Entity()\n@Index('ix_payment_0', (payment: Payment) => [payment.domain, payment.transaction, payment.paidAt], {\n where: '\"deleted_at\" IS NULL',\n unique: true\n})\n@Index(\n 'ix_payment_1',\n (payment: Payment) => [payment.domain, payment.year, payment.quarter, payment.month, payment.paidAt],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n }\n)\n@ObjectType({ description: 'Entity representing a Payment record in the system' }) // 시스템 내에서 결제 기록을 나타내는 엔티티\nexport class Payment {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the payment record' })\n readonly id: string // 고유 식별자 (UUID)\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number used for optimistic locking' })\n version?: number = 1 // 낙관적 잠금을 위한 버전 관리 필드\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'The domain to which this payment belongs' })\n domain?: Domain // 결제가 속한 도메인\n\n @RelationId((payment: Payment) => payment.domain)\n domainId?: string // 도메인의 ID\n\n @ManyToOne(type => Transaction, transaction => transaction.payments)\n @Field(type => Transaction, { description: 'The transaction associated with this payment' })\n transaction: Transaction // 결제와 연결된 트랜잭션\n\n @RelationId((payment: Payment) => payment.transaction)\n transactionId: string // 연결된 트랜잭션의 ID\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The currency used in the payment' })\n currency?: string // 결제에 사용된 통화\n\n @Column({ nullable: false })\n @Field({ nullable: false, description: 'The amount of money involved in the payment' })\n amount: number // 결제된 금액\n\n @Column({ type: 'enum', enum: PaymentType, nullable: false })\n @Field(type => PaymentType, { description: 'Type of the payment' })\n paymentType: PaymentType // 결제 유형\n\n @ManyToOne(type => BankAccount, { nullable: true })\n @Field(type => BankAccount, { nullable: true, description: 'Source bank account for the payment' })\n sourceBankAccount?: BankAccount\n\n @RelationId((payment: Payment) => payment.sourceBankAccount)\n sourceBankAccountId?: string\n\n @ManyToOne(type => BankAccount, { nullable: true })\n @Field(type => BankAccount, { nullable: true, description: 'Destination bank account for the payment' })\n destinationBankAccount?: BankAccount\n\n @RelationId((payment: Payment) => payment.destinationBankAccount)\n destinationBankAccountId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal year in which the payment was made' })\n year?: number // 결제가 발생한 회계 연도\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal quarter in which the payment was made' })\n quarter?: number // 결제가 발생한 회계 분기\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal month in which the payment was made' })\n month?: number // 결제가 발생한 회계 월\n\n @Column({ nullable: false })\n @Field({ nullable: false, description: 'The date and time when the payment was made' })\n paidAt: Date // 결제가 이루어진 날짜 및 시간\n\n @Column({ nullable: false })\n @Field(type => PaymentDirection, { description: 'Direction of the payment (Incoming or Outgoing)' })\n direction: PaymentDirection // 결제 방향 (수금 또는 지출)\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Additional notes or comments about the payment' })\n note?: string // 결제에 대한 추가 설명 또는 메모\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the payment record was created' })\n createdAt?: Date // 결제 레코드가 생성된 날짜 및 시간\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the payment record was last updated' })\n updatedAt?: Date // 결제 레코드가 마지막으로 업데이트된 날짜 및 시간\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'The date and time when the payment record was deleted' })\n deletedAt?: Date // 결제 레코드가 삭제된 날짜 및 시간\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created the payment record' })\n creator?: User // 결제 레코드를 생성한 사용자\n\n @RelationId((payment: Payment) => payment.creator)\n creatorId?: string // 결제 레코드를 생성한 사용자의 ID\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated the payment record' })\n updater?: User // 결제 레코드를 마지막으로 업데이트한 사용자\n\n @RelationId((payment: Payment) => payment.updater)\n updaterId?: string // 결제 레코드를 업데이트한 사용자의 ID\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  import { Transaction } from './transaction';
2
+ import { TransactionHistory } from './transaction-history';
2
3
  import { TransactionQuery } from './transaction-query';
3
4
  import { TransactionMutation } from './transaction-mutation';
4
5
  import { TransactionHistoryEntitySubscriber } from './event-subscriber';
5
- export declare const entities: (typeof Transaction)[];
6
+ export declare const entities: (typeof Transaction | typeof TransactionHistory)[];
6
7
  export declare const resolvers: (typeof TransactionQuery | typeof TransactionMutation)[];
7
8
  export declare const subscribers: (typeof TransactionHistoryEntitySubscriber)[];
@@ -1,7 +1,7 @@
1
1
  import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-history';
2
2
  import { User } from '@things-factory/auth-base';
3
3
  import { Domain } from '@things-factory/shell';
4
- import { Transaction, TransactionType } from './transaction';
4
+ import { Transaction, TransactionCategory, TransactionStatus, TransactionType } from './transaction';
5
5
  import { Account } from '../account/account';
6
6
  export declare class TransactionHistory implements HistoryEntityInterface<Transaction> {
7
7
  readonly id: string;
@@ -14,12 +14,16 @@ export declare class TransactionHistory implements HistoryEntityInterface<Transa
14
14
  amount?: number;
15
15
  active?: boolean;
16
16
  type?: TransactionType;
17
+ category: TransactionCategory;
18
+ status: TransactionStatus;
19
+ probability?: number;
20
+ forecastNotes?: string;
17
21
  account?: Account;
18
22
  accountId?: string;
19
23
  year?: number;
20
24
  quarter?: number;
21
25
  month?: number;
22
- occurredAt: Date;
26
+ transactionDate: string;
23
27
  createdAt?: Date;
24
28
  updatedAt?: Date;
25
29
  deletedAt?: Date;
@@ -35,7 +35,7 @@ tslib_1.__decorate([
35
35
  tslib_1.__metadata("design:type", shell_1.Domain)
36
36
  ], TransactionHistory.prototype, "domain", void 0);
37
37
  tslib_1.__decorate([
38
- (0, typeorm_1.RelationId)((transaction) => transaction.domain),
38
+ (0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.domain),
39
39
  tslib_1.__metadata("design:type", String)
40
40
  ], TransactionHistory.prototype, "domainId", void 0);
41
41
  tslib_1.__decorate([
@@ -68,13 +68,33 @@ tslib_1.__decorate([
68
68
  (0, type_graphql_1.Field)({ nullable: true }),
69
69
  tslib_1.__metadata("design:type", Number)
70
70
  ], TransactionHistory.prototype, "type", void 0);
71
+ tslib_1.__decorate([
72
+ (0, typeorm_1.Column)({ nullable: false }),
73
+ (0, type_graphql_1.Field)(type => transaction_1.TransactionCategory, { nullable: false }),
74
+ tslib_1.__metadata("design:type", String)
75
+ ], TransactionHistory.prototype, "category", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.Column)({ nullable: false }),
78
+ (0, type_graphql_1.Field)(type => transaction_1.TransactionStatus, { nullable: false }),
79
+ tslib_1.__metadata("design:type", String)
80
+ ], TransactionHistory.prototype, "status", void 0);
81
+ tslib_1.__decorate([
82
+ (0, typeorm_1.Column)({ nullable: true }),
83
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The probability of the forecast being realized (0 to 100)' }),
84
+ tslib_1.__metadata("design:type", Number)
85
+ ], TransactionHistory.prototype, "probability", void 0);
86
+ tslib_1.__decorate([
87
+ (0, typeorm_1.Column)({ nullable: true }),
88
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Additional notes or comments about the forecast' }),
89
+ tslib_1.__metadata("design:type", String)
90
+ ], TransactionHistory.prototype, "forecastNotes", void 0);
71
91
  tslib_1.__decorate([
72
92
  (0, typeorm_1.ManyToOne)(type => account_1.Account),
73
93
  (0, type_graphql_1.Field)({ nullable: true }),
74
94
  tslib_1.__metadata("design:type", account_1.Account)
75
95
  ], TransactionHistory.prototype, "account", void 0);
76
96
  tslib_1.__decorate([
77
- (0, typeorm_1.RelationId)((transaction) => transaction.account),
97
+ (0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.account),
78
98
  tslib_1.__metadata("design:type", String)
79
99
  ], TransactionHistory.prototype, "accountId", void 0);
80
100
  tslib_1.__decorate([
@@ -93,11 +113,10 @@ tslib_1.__decorate([
93
113
  tslib_1.__metadata("design:type", Number)
94
114
  ], TransactionHistory.prototype, "month", void 0);
95
115
  tslib_1.__decorate([
96
- (0, typeorm_1.Column)({ type: 'timestamp', nullable: false }),
97
- (0, type_graphql_1.Field)({ nullable: false, description: 'The exact date and time the transaction occurred' }),
98
- tslib_1.__metadata("design:type", Date // 트랜잭션이 발생한 실제 시점(날짜와 시간)
99
- )
100
- ], TransactionHistory.prototype, "occurredAt", void 0);
116
+ (0, typeorm_1.Column)({ nullable: false }),
117
+ (0, type_graphql_1.Field)({ nullable: false, description: 'The date the transaction occurs or is scheduled (in string format)' }),
118
+ tslib_1.__metadata("design:type", String)
119
+ ], TransactionHistory.prototype, "transactionDate", void 0);
101
120
  tslib_1.__decorate([
102
121
  (0, typeorm_1.Column)(),
103
122
  (0, type_graphql_1.Field)({ nullable: true }),
@@ -119,7 +138,7 @@ tslib_1.__decorate([
119
138
  tslib_1.__metadata("design:type", auth_base_1.User)
120
139
  ], TransactionHistory.prototype, "creator", void 0);
121
140
  tslib_1.__decorate([
122
- (0, typeorm_1.RelationId)((transaction) => transaction.creator),
141
+ (0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.creator),
123
142
  tslib_1.__metadata("design:type", String)
124
143
  ], TransactionHistory.prototype, "creatorId", void 0);
125
144
  tslib_1.__decorate([
@@ -128,7 +147,7 @@ tslib_1.__decorate([
128
147
  tslib_1.__metadata("design:type", auth_base_1.User)
129
148
  ], TransactionHistory.prototype, "updater", void 0);
130
149
  tslib_1.__decorate([
131
- (0, typeorm_1.RelationId)((transaction) => transaction.updater),
150
+ (0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.updater),
132
151
  tslib_1.__metadata("design:type", String)
133
152
  ], TransactionHistory.prototype, "updaterId", void 0);
134
153
  tslib_1.__decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-history.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,+CAA4D;AAC5D,gDAA4C;AAE5C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAkB7B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAAxB;QAOL,YAAO,GAAY,CAAC,CAAA;QAuBpB,WAAM,GAAY,CAAC,CAAA;IAyErB,CAAC;CAAA,CAAA;AAvGY,gDAAkB;AAGpB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;8CACC;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,cAAM;kDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC;;oDAC5C;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACb;AAIb;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBA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9B,gBAAI;mDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;qDAC5C;AAGX;IADN,IAAA,yCAAuB,GAAE;;sDACA;AAYnB;IAVN,IAAA,qCAAmB,EAAC;QACnB,QAAQ,EAAE,KAAK;QACf,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,QAAQ;gBACzB,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU;QAClB,IAAI,EAAE,mCAAiB;KACxB,CAAC;;kDAC+B;6BAtGtB,kBAAkB;IAhB9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE,kBAAkB,CAAC,OAAO,CAAC,EACvG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC;QAC1C,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,UAAU;QAC7B,kBAAkB,CAAC,OAAO;KAC3B,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CAuG9B","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { Transaction, TransactionType } from './transaction'\nimport { Account } from '../account/account'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_transaction_history_0',\n (transactionHistory: TransactionHistory) => [transactionHistory.originalId, transactionHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_transaction_history_1',\n (transactionHistory: TransactionHistory) => [\n transactionHistory.domain,\n transactionHistory.originalId,\n transactionHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of Transaction' })\nexport class TransactionHistory implements HistoryEntityInterface<Transaction> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((transaction: Transaction) => transaction.domain)\n domainId?: string\n\n @Column()\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 })\n currency?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n amount?: number = 0\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: TransactionType\n\n @ManyToOne(type => Account)\n @Field({ nullable: true })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal year' })\n year?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal quarter' })\n quarter?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal month' })\n month?: number\n\n @Column({ type: 'timestamp', nullable: false })\n @Field({ nullable: false, description: 'The exact date and time the transaction occurred' })\n occurredAt: Date // 트랜잭션이 발생한 실제 시점(날짜와 시간)\n\n @Column()\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column()\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((transaction: Transaction) => transaction.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.updater)\n updaterId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: HistoryActionType\n })\n public action!: HistoryActionType\n}\n"]}
1
+ {"version":3,"file":"transaction-history.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,+CAAoG;AACpG,gDAA4C;AAE5C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAkB7B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAAxB;QAOL,YAAO,GAAY,CAAC,CAAA;QAuBpB,WAAM,GAAY,CAAC,CAAA;IAyFrB,CAAC;CAAA,CAAA;AAvHY,gDAAkB;AAGpB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;8CACC;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,I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IADN,IAAA,yCAAuB,GAAE;;sDACA;AAYnB;IAVN,IAAA,qCAAmB,EAAC;QACnB,QAAQ,EAAE,KAAK;QACf,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,QAAQ;gBACzB,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU;QAClB,IAAI,EAAE,mCAAiB;KACxB,CAAC;;kDAC+B;6BAtHtB,kBAAkB;IAhB9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE,kBAAkB,CAAC,OAAO,CAAC,EACvG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC;QAC1C,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,UAAU;QAC7B,kBAAkB,CAAC,OAAO;KAC3B,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CAuH9B","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { Transaction, TransactionCategory, TransactionStatus, TransactionType } from './transaction'\nimport { Account } from '../account/account'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_transaction_history_0',\n (transactionHistory: TransactionHistory) => [transactionHistory.originalId, transactionHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_transaction_history_1',\n (transactionHistory: TransactionHistory) => [\n transactionHistory.domain,\n transactionHistory.originalId,\n transactionHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of Transaction' })\nexport class TransactionHistory implements HistoryEntityInterface<Transaction> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.domain)\n domainId?: string\n\n @Column()\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 })\n currency?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n amount?: number = 0\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: TransactionType\n\n @Column({ nullable: false })\n @Field(type => TransactionCategory, { nullable: false })\n category: TransactionCategory // 트랜잭션의 카테고리 (확정, 전망)\n\n @Column({ nullable: false })\n @Field(type => TransactionStatus, { nullable: false })\n status: TransactionStatus // 트랜잭션의 상태 (예: Paid, Delayed 등)\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The probability of the forecast being realized (0 to 100)' })\n probability?: number // 예측이 실현될 확률 (0 ~ 100)\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Additional notes or comments about the forecast' })\n forecastNotes?: string // 전망에 대한 추가 설명이나 메모\n\n @ManyToOne(type => Account)\n @Field({ nullable: true })\n account?: Account\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.account)\n accountId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal year' })\n year?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal quarter' })\n quarter?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal month' })\n month?: number\n\n @Column({ nullable: false })\n @Field({ nullable: false, description: 'The date the transaction occurs or is scheduled (in string format)' })\n transactionDate: string // 트랜잭션이 발생하거나 발생할 날짜\n\n @Column()\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column()\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((transactionHistory: TransactionHistory) => transactionHistory.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.updater)\n updaterId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: HistoryActionType\n })\n public action!: HistoryActionType\n}\n"]}