@things-factory/accounting 7.0.2 → 7.1.2

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 (390) hide show
  1. package/client/activities/activity-book-edit.ts +1 -1
  2. package/client/activities/activity-book-view.ts +1 -1
  3. package/client/activities/activity-expense-edit.ts +1 -1
  4. package/client/activities/activity-expense-view.ts +1 -1
  5. package/client/bootstrap.ts +10 -1
  6. package/client/components/accounting-category-selector.ts +136 -0
  7. package/client/components/accounting-category-view.ts +75 -0
  8. package/client/grist-editors/grist-editor-accounting-category-object.ts +83 -0
  9. package/client/grist-editors/grist-renderer-accounting-category-object.ts +13 -0
  10. package/client/pages/account/account-importer.ts +19 -8
  11. package/client/pages/account/account-list-page.ts +38 -8
  12. package/client/pages/accounting-category/accounting-category-importer.ts +19 -8
  13. package/client/pages/accounting-category/accounting-category-list-page.ts +36 -6
  14. package/client/pages/accounting-category/accounting-category-tree-page.ts +338 -0
  15. package/client/pages/accounting-document/accounting-document-importer.ts +90 -0
  16. package/client/pages/accounting-document/accounting-document-list-page.ts +398 -0
  17. package/client/pages/financial-statement/financial-statement-importer.ts +19 -8
  18. package/client/pages/financial-statement/financial-statement-list-page.ts +5 -6
  19. package/client/pages/fiscal-month/fiscal-month-importer.ts +90 -0
  20. package/client/pages/fiscal-month/fiscal-month-list-page.ts +398 -0
  21. package/client/pages/fiscal-quarter/fiscal-quarter-importer.ts +90 -0
  22. package/client/pages/fiscal-quarter/fiscal-quarter-list-page.ts +398 -0
  23. package/client/pages/fiscal-year/fiscal-year-importer.ts +90 -0
  24. package/client/pages/fiscal-year/fiscal-year-list-page.ts +398 -0
  25. package/client/pages/income-statement/income-statement-importer.ts +19 -8
  26. package/client/pages/income-statement/income-statement-list-page.ts +5 -6
  27. package/client/pages/{ledger/ledger-importer.ts → payment/payment-importer.ts} +13 -9
  28. package/client/pages/{ledger/ledger-list-page.ts → payment/payment-list-page.ts} +118 -58
  29. package/client/pages/transaction/transaction-importer.ts +19 -8
  30. package/client/pages/transaction/transaction-list-page.ts +5 -6
  31. package/client/route.ts +16 -8
  32. package/client/types/accounting-category.ts +23 -0
  33. package/client/types/index.ts +1 -0
  34. package/dist-client/activities/activity-book-edit.js +1 -1
  35. package/dist-client/activities/activity-book-edit.js.map +1 -1
  36. package/dist-client/activities/activity-book-view.js +1 -1
  37. package/dist-client/activities/activity-book-view.js.map +1 -1
  38. package/dist-client/activities/activity-expense-edit.js +1 -1
  39. package/dist-client/activities/activity-expense-edit.js.map +1 -1
  40. package/dist-client/activities/activity-expense-view.js +1 -1
  41. package/dist-client/activities/activity-expense-view.js.map +1 -1
  42. package/dist-client/bootstrap.js +7 -1
  43. package/dist-client/bootstrap.js.map +1 -1
  44. package/dist-client/components/accounting-category-selector.d.ts +16 -0
  45. package/dist-client/components/accounting-category-selector.js +134 -0
  46. package/dist-client/components/accounting-category-selector.js.map +1 -0
  47. package/dist-client/components/accounting-category-view.d.ts +14 -0
  48. package/dist-client/components/accounting-category-view.js +81 -0
  49. package/dist-client/components/accounting-category-view.js.map +1 -0
  50. package/dist-client/grist-editors/grist-editor-accounting-category-object.d.ts +11 -0
  51. package/dist-client/grist-editors/grist-editor-accounting-category-object.js +71 -0
  52. package/dist-client/grist-editors/grist-editor-accounting-category-object.js.map +1 -0
  53. package/dist-client/grist-editors/grist-renderer-accounting-category-object.d.ts +2 -0
  54. package/dist-client/grist-editors/grist-renderer-accounting-category-object.js +9 -0
  55. package/dist-client/grist-editors/grist-renderer-accounting-category-object.js.map +1 -0
  56. package/dist-client/pages/account/account-importer.d.ts +0 -1
  57. package/dist-client/pages/account/account-importer.js +12 -5
  58. package/dist-client/pages/account/account-importer.js.map +1 -1
  59. package/dist-client/pages/account/account-list-page.js +38 -8
  60. package/dist-client/pages/account/account-list-page.js.map +1 -1
  61. package/dist-client/pages/accounting-category/accounting-category-importer.d.ts +0 -1
  62. package/dist-client/pages/accounting-category/accounting-category-importer.js +12 -5
  63. package/dist-client/pages/accounting-category/accounting-category-importer.js.map +1 -1
  64. package/dist-client/pages/accounting-category/accounting-category-list-page.js +36 -6
  65. package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -1
  66. package/dist-client/pages/accounting-category/accounting-category-tree-page.d.ts +46 -0
  67. package/dist-client/pages/accounting-category/accounting-category-tree-page.js +329 -0
  68. package/dist-client/pages/accounting-category/accounting-category-tree-page.js.map +1 -0
  69. package/dist-client/pages/accounting-document/accounting-document-importer.d.ts +23 -0
  70. package/dist-client/pages/accounting-document/accounting-document-importer.js +93 -0
  71. package/dist-client/pages/accounting-document/accounting-document-importer.js.map +1 -0
  72. package/dist-client/pages/accounting-document/accounting-document-list-page.d.ts +66 -0
  73. package/dist-client/pages/accounting-document/accounting-document-list-page.js +370 -0
  74. package/dist-client/pages/accounting-document/accounting-document-list-page.js.map +1 -0
  75. package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +0 -1
  76. package/dist-client/pages/financial-statement/financial-statement-importer.js +12 -5
  77. package/dist-client/pages/financial-statement/financial-statement-importer.js.map +1 -1
  78. package/dist-client/pages/financial-statement/financial-statement-list-page.js +5 -6
  79. package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +1 -1
  80. package/dist-client/pages/fiscal-month/fiscal-month-importer.d.ts +23 -0
  81. package/dist-client/pages/fiscal-month/fiscal-month-importer.js +93 -0
  82. package/dist-client/pages/fiscal-month/fiscal-month-importer.js.map +1 -0
  83. package/dist-client/pages/fiscal-month/fiscal-month-list-page.d.ts +66 -0
  84. package/dist-client/pages/fiscal-month/fiscal-month-list-page.js +370 -0
  85. package/dist-client/pages/fiscal-month/fiscal-month-list-page.js.map +1 -0
  86. package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.d.ts +23 -0
  87. package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js +93 -0
  88. package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js.map +1 -0
  89. package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.d.ts +66 -0
  90. package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js +370 -0
  91. package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js.map +1 -0
  92. package/dist-client/pages/fiscal-year/fiscal-year-importer.d.ts +23 -0
  93. package/dist-client/pages/fiscal-year/fiscal-year-importer.js +93 -0
  94. package/dist-client/pages/fiscal-year/fiscal-year-importer.js.map +1 -0
  95. package/dist-client/pages/fiscal-year/fiscal-year-list-page.d.ts +66 -0
  96. package/dist-client/pages/fiscal-year/fiscal-year-list-page.js +370 -0
  97. package/dist-client/pages/fiscal-year/fiscal-year-list-page.js.map +1 -0
  98. package/dist-client/pages/income-statement/income-statement-importer.d.ts +0 -1
  99. package/dist-client/pages/income-statement/income-statement-importer.js +12 -5
  100. package/dist-client/pages/income-statement/income-statement-importer.js.map +1 -1
  101. package/dist-client/pages/income-statement/income-statement-list-page.js +5 -6
  102. package/dist-client/pages/income-statement/income-statement-list-page.js.map +1 -1
  103. package/dist-client/pages/{ledger/ledger-importer.d.ts → payment/payment-importer.d.ts} +2 -2
  104. package/dist-client/pages/{ledger/ledger-importer.js → payment/payment-importer.js} +11 -11
  105. package/dist-client/pages/payment/payment-importer.js.map +1 -0
  106. package/dist-client/pages/{ledger/ledger-list-page.d.ts → payment/payment-list-page.d.ts} +12 -8
  107. package/dist-client/pages/{ledger/ledger-list-page.js → payment/payment-list-page.js} +114 -68
  108. package/dist-client/pages/payment/payment-list-page.js.map +1 -0
  109. package/dist-client/pages/transaction/transaction-importer.d.ts +0 -1
  110. package/dist-client/pages/transaction/transaction-importer.js +12 -5
  111. package/dist-client/pages/transaction/transaction-importer.js.map +1 -1
  112. package/dist-client/pages/transaction/transaction-list-page.js +5 -6
  113. package/dist-client/pages/transaction/transaction-list-page.js.map +1 -1
  114. package/dist-client/route.d.ts +1 -1
  115. package/dist-client/route.js +9 -3
  116. package/dist-client/route.js.map +1 -1
  117. package/dist-client/tsconfig.tsbuildinfo +1 -1
  118. package/dist-client/types/accounting-category.d.ts +16 -0
  119. package/dist-client/types/accounting-category.js +3 -0
  120. package/dist-client/types/accounting-category.js.map +1 -0
  121. package/dist-client/types/index.d.ts +1 -0
  122. package/dist-client/types/index.js +2 -0
  123. package/dist-client/types/index.js.map +1 -0
  124. package/dist-server/activities/activity-book.js +31 -19
  125. package/dist-server/activities/activity-book.js.map +1 -1
  126. package/dist-server/controllers/index.d.ts +1 -0
  127. package/dist-server/controllers/index.js +4 -0
  128. package/dist-server/controllers/index.js.map +1 -1
  129. package/dist-server/controllers/summary-statements.d.ts +4 -0
  130. package/dist-server/controllers/summary-statements.js +149 -0
  131. package/dist-server/controllers/summary-statements.js.map +1 -0
  132. package/dist-server/index.d.ts +2 -0
  133. package/dist-server/index.js +2 -0
  134. package/dist-server/index.js.map +1 -1
  135. package/dist-server/migrations/1725200507196-seed-fiscal-entities.d.ts +5 -0
  136. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js +95 -0
  137. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js.map +1 -0
  138. package/dist-server/migrations/1725201467183-seed-accounts.d.ts +5 -0
  139. package/dist-server/migrations/1725201467183-seed-accounts.js +318 -0
  140. package/dist-server/migrations/1725201467183-seed-accounts.js.map +1 -0
  141. package/dist-server/service/account/account-history.d.ts +4 -1
  142. package/dist-server/service/account/account-history.js +17 -7
  143. package/dist-server/service/account/account-history.js.map +1 -1
  144. package/dist-server/service/account/account-mutation.js +13 -9
  145. package/dist-server/service/account/account-mutation.js.map +1 -1
  146. package/dist-server/service/account/account-query.js +3 -1
  147. package/dist-server/service/account/account-query.js.map +1 -1
  148. package/dist-server/service/account/account.d.ts +1 -1
  149. package/dist-server/service/account/account.js +16 -5
  150. package/dist-server/service/account/account.js.map +1 -1
  151. package/dist-server/service/account/index.d.ts +1 -2
  152. package/dist-server/service/accounting-category/accounting-category-history.d.ts +26 -0
  153. package/dist-server/service/accounting-category/accounting-category-history.js +136 -0
  154. package/dist-server/service/accounting-category/accounting-category-history.js.map +1 -0
  155. package/dist-server/service/accounting-category/accounting-category-mutation.js +12 -8
  156. package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -1
  157. package/dist-server/service/accounting-category/accounting-category-query.d.ts +1 -0
  158. package/dist-server/service/accounting-category/accounting-category-query.js +24 -1
  159. package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
  160. package/dist-server/service/accounting-category/accounting-category-type.d.ts +2 -0
  161. package/dist-server/service/accounting-category/accounting-category-type.js +8 -0
  162. package/dist-server/service/accounting-category/accounting-category-type.js.map +1 -1
  163. package/dist-server/service/accounting-category/accounting-category.d.ts +2 -0
  164. package/dist-server/service/accounting-category/accounting-category.js +20 -3
  165. package/dist-server/service/accounting-category/accounting-category.js.map +1 -1
  166. package/dist-server/service/accounting-category/event-subscriber.d.ts +7 -0
  167. package/dist-server/service/accounting-category/event-subscriber.js +21 -0
  168. package/dist-server/service/accounting-category/event-subscriber.js.map +1 -0
  169. package/dist-server/service/accounting-category/index.d.ts +2 -1
  170. package/dist-server/service/accounting-category/index.js +4 -2
  171. package/dist-server/service/accounting-category/index.js.map +1 -1
  172. package/dist-server/service/accounting-document/accounting-document-history.d.ts +26 -0
  173. package/dist-server/service/accounting-document/accounting-document-history.js +129 -0
  174. package/dist-server/service/accounting-document/accounting-document-history.js.map +1 -0
  175. package/dist-server/service/accounting-document/accounting-document-mutation.d.ts +10 -0
  176. package/dist-server/service/accounting-document/accounting-document-mutation.js +128 -0
  177. package/dist-server/service/accounting-document/accounting-document-mutation.js.map +1 -0
  178. package/dist-server/service/accounting-document/accounting-document-query.d.ts +11 -0
  179. package/dist-server/service/accounting-document/accounting-document-query.js +79 -0
  180. package/dist-server/service/accounting-document/accounting-document-query.js.map +1 -0
  181. package/dist-server/service/accounting-document/accounting-document-type.d.ts +20 -0
  182. package/dist-server/service/accounting-document/accounting-document-type.js +74 -0
  183. package/dist-server/service/accounting-document/accounting-document-type.js.map +1 -0
  184. package/dist-server/service/accounting-document/accounting-document.d.ts +21 -0
  185. package/dist-server/service/accounting-document/accounting-document.js +104 -0
  186. package/dist-server/service/accounting-document/accounting-document.js.map +1 -0
  187. package/dist-server/service/accounting-document/event-subscriber.d.ts +7 -0
  188. package/dist-server/service/accounting-document/event-subscriber.js +21 -0
  189. package/dist-server/service/accounting-document/event-subscriber.js.map +1 -0
  190. package/dist-server/service/accounting-document/index.d.ts +7 -0
  191. package/dist-server/service/accounting-document/index.js +12 -0
  192. package/dist-server/service/accounting-document/index.js.map +1 -0
  193. package/dist-server/service/common-type.d.ts +5 -0
  194. package/dist-server/service/common-type.js +15 -0
  195. package/dist-server/service/common-type.js.map +1 -0
  196. package/dist-server/service/financial-statement/financial-statement-history.d.ts +9 -6
  197. package/dist-server/service/financial-statement/financial-statement-history.js +33 -23
  198. package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
  199. package/dist-server/service/financial-statement/financial-statement-line-item.d.ts +19 -0
  200. package/dist-server/service/financial-statement/financial-statement-line-item.js +94 -0
  201. package/dist-server/service/financial-statement/financial-statement-line-item.js.map +1 -0
  202. package/dist-server/service/financial-statement/financial-statement-mutation.js +12 -8
  203. package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -1
  204. package/dist-server/service/financial-statement/financial-statement-query.js +3 -1
  205. package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
  206. package/dist-server/service/financial-statement/financial-statement.d.ts +2 -0
  207. package/dist-server/service/financial-statement/financial-statement.js +45 -24
  208. package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
  209. package/dist-server/service/financial-statement/index.d.ts +2 -2
  210. package/dist-server/service/financial-statement/index.js +2 -1
  211. package/dist-server/service/financial-statement/index.js.map +1 -1
  212. package/dist-server/service/fiscal-month/fiscal-month-mutation.d.ts +10 -0
  213. package/dist-server/service/fiscal-month/fiscal-month-mutation.js +134 -0
  214. package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -0
  215. package/dist-server/service/fiscal-month/fiscal-month-query.d.ts +11 -0
  216. package/dist-server/service/fiscal-month/fiscal-month-query.js +83 -0
  217. package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -0
  218. package/dist-server/service/fiscal-month/fiscal-month-type.d.ts +26 -0
  219. package/dist-server/service/fiscal-month/fiscal-month-type.js +98 -0
  220. package/dist-server/service/fiscal-month/fiscal-month-type.js.map +1 -0
  221. package/dist-server/service/fiscal-month/fiscal-month.d.ts +22 -0
  222. package/dist-server/service/fiscal-month/fiscal-month.js +99 -0
  223. package/dist-server/service/fiscal-month/fiscal-month.js.map +1 -0
  224. package/dist-server/service/fiscal-month/index.d.ts +6 -0
  225. package/dist-server/service/fiscal-month/index.js +10 -0
  226. package/dist-server/service/fiscal-month/index.js.map +1 -0
  227. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.d.ts +10 -0
  228. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +134 -0
  229. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -0
  230. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.d.ts +11 -0
  231. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +85 -0
  232. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -0
  233. package/dist-server/service/fiscal-quarter/fiscal-quarter-type.d.ts +24 -0
  234. package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js +90 -0
  235. package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js.map +1 -0
  236. package/dist-server/service/fiscal-quarter/fiscal-quarter.d.ts +21 -0
  237. package/dist-server/service/fiscal-quarter/fiscal-quarter.js +94 -0
  238. package/dist-server/service/fiscal-quarter/fiscal-quarter.js.map +1 -0
  239. package/dist-server/service/fiscal-quarter/index.d.ts +6 -0
  240. package/dist-server/service/fiscal-quarter/index.js +10 -0
  241. package/dist-server/service/fiscal-quarter/index.js.map +1 -0
  242. package/dist-server/service/fiscal-year/fiscal-year-mutation.d.ts +10 -0
  243. package/dist-server/service/fiscal-year/fiscal-year-mutation.js +134 -0
  244. package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -0
  245. package/dist-server/service/fiscal-year/fiscal-year-query.d.ts +11 -0
  246. package/dist-server/service/fiscal-year/fiscal-year-query.js +81 -0
  247. package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -0
  248. package/dist-server/service/fiscal-year/fiscal-year-type.d.ts +22 -0
  249. package/dist-server/service/fiscal-year/fiscal-year-type.js +82 -0
  250. package/dist-server/service/fiscal-year/fiscal-year-type.js.map +1 -0
  251. package/dist-server/service/fiscal-year/fiscal-year.d.ts +20 -0
  252. package/dist-server/service/fiscal-year/fiscal-year.js +89 -0
  253. package/dist-server/service/fiscal-year/fiscal-year.js.map +1 -0
  254. package/dist-server/service/fiscal-year/index.d.ts +6 -0
  255. package/dist-server/service/fiscal-year/index.js +10 -0
  256. package/dist-server/service/fiscal-year/index.js.map +1 -0
  257. package/dist-server/service/income-statement/income-statement-history.d.ts +9 -5
  258. package/dist-server/service/income-statement/income-statement-history.js +38 -23
  259. package/dist-server/service/income-statement/income-statement-history.js.map +1 -1
  260. package/dist-server/service/income-statement/income-statement-line-item.d.ts +19 -0
  261. package/dist-server/service/income-statement/income-statement-line-item.js +96 -0
  262. package/dist-server/service/income-statement/income-statement-line-item.js.map +1 -0
  263. package/dist-server/service/income-statement/income-statement-mutation.js +12 -8
  264. package/dist-server/service/income-statement/income-statement-mutation.js.map +1 -1
  265. package/dist-server/service/income-statement/income-statement-query.js +3 -1
  266. package/dist-server/service/income-statement/income-statement-query.js.map +1 -1
  267. package/dist-server/service/income-statement/income-statement.d.ts +2 -0
  268. package/dist-server/service/income-statement/income-statement.js +46 -26
  269. package/dist-server/service/income-statement/income-statement.js.map +1 -1
  270. package/dist-server/service/income-statement/index.d.ts +2 -2
  271. package/dist-server/service/income-statement/index.js +2 -1
  272. package/dist-server/service/income-statement/index.js.map +1 -1
  273. package/dist-server/service/index.d.ts +7 -2
  274. package/dist-server/service/index.js +29 -3
  275. package/dist-server/service/index.js.map +1 -1
  276. package/dist-server/service/payment/event-subscriber.d.ts +7 -0
  277. package/dist-server/service/payment/event-subscriber.js +21 -0
  278. package/dist-server/service/payment/event-subscriber.js.map +1 -0
  279. package/dist-server/service/payment/index.d.ts +8 -0
  280. package/dist-server/service/payment/index.js +12 -0
  281. package/dist-server/service/payment/index.js.map +1 -0
  282. package/dist-server/service/payment/payment-history.d.ts +30 -0
  283. package/dist-server/service/payment/payment-history.js +143 -0
  284. package/dist-server/service/payment/payment-history.js.map +1 -0
  285. package/dist-server/service/payment/payment-mutation.d.ts +10 -0
  286. package/dist-server/service/payment/payment-mutation.js +134 -0
  287. package/dist-server/service/payment/payment-mutation.js.map +1 -0
  288. package/dist-server/service/payment/payment-query.d.ts +11 -0
  289. package/dist-server/service/payment/payment-query.js +81 -0
  290. package/dist-server/service/payment/payment-query.js.map +1 -0
  291. package/dist-server/service/payment/payment-type.d.ts +24 -0
  292. package/dist-server/service/payment/payment-type.js +90 -0
  293. package/dist-server/service/payment/payment-type.js.map +1 -0
  294. package/dist-server/service/payment/payment.d.ts +30 -0
  295. package/dist-server/service/payment/payment.js +146 -0
  296. package/dist-server/service/payment/payment.js.map +1 -0
  297. package/dist-server/service/transaction/transaction-history.d.ts +15 -3
  298. package/dist-server/service/transaction/transaction-history.js +64 -8
  299. package/dist-server/service/transaction/transaction-history.js.map +1 -1
  300. package/dist-server/service/transaction/transaction-mutation.js +13 -9
  301. package/dist-server/service/transaction/transaction-mutation.js.map +1 -1
  302. package/dist-server/service/transaction/transaction-query.js +3 -1
  303. package/dist-server/service/transaction/transaction-query.js.map +1 -1
  304. package/dist-server/service/transaction/transaction.d.ts +31 -6
  305. package/dist-server/service/transaction/transaction.js +138 -27
  306. package/dist-server/service/transaction/transaction.js.map +1 -1
  307. package/dist-server/tsconfig.tsbuildinfo +1 -1
  308. package/helps/accounting/accounting-document.md +160 -0
  309. package/helps/accounting/contract.md +160 -0
  310. package/helps/accounting/fiscal-month.md +160 -0
  311. package/helps/accounting/fiscal-quarter.md +160 -0
  312. package/helps/accounting/fiscal-year.md +160 -0
  313. package/helps/accounting/payment.md +160 -0
  314. package/package.json +9 -8
  315. package/server/activities/activity-book.ts +31 -19
  316. package/server/controllers/index.ts +1 -0
  317. package/server/controllers/summary-statements.ts +166 -0
  318. package/server/index.ts +2 -0
  319. package/server/migrations/1725200507196-seed-fiscal-entities.ts +106 -0
  320. package/server/migrations/1725201467183-seed-accounts.ts +339 -0
  321. package/server/service/account/account-history.ts +15 -7
  322. package/server/service/account/account-mutation.ts +13 -10
  323. package/server/service/account/account-query.ts +3 -1
  324. package/server/service/account/account.ts +16 -5
  325. package/server/service/accounting-category/accounting-category-history.ts +123 -0
  326. package/server/service/accounting-category/accounting-category-mutation.ts +12 -9
  327. package/server/service/accounting-category/accounting-category-query.ts +24 -1
  328. package/server/service/accounting-category/accounting-category-type.ts +6 -0
  329. package/server/service/accounting-category/accounting-category.ts +23 -3
  330. package/server/service/accounting-category/event-subscriber.ts +20 -0
  331. package/server/service/accounting-category/index.ts +4 -2
  332. package/server/service/accounting-document/accounting-document-history.ts +117 -0
  333. package/server/service/accounting-document/accounting-document-mutation.ts +137 -0
  334. package/server/service/accounting-document/accounting-document-query.ts +48 -0
  335. package/server/service/accounting-document/accounting-document-type.ts +52 -0
  336. package/server/service/accounting-document/accounting-document.ts +93 -0
  337. package/server/service/accounting-document/event-subscriber.ts +17 -0
  338. package/server/service/accounting-document/index.ts +9 -0
  339. package/server/service/common-type.ts +12 -0
  340. package/server/service/financial-statement/financial-statement-history.ts +28 -19
  341. package/server/service/financial-statement/financial-statement-line-item.ts +82 -0
  342. package/server/service/financial-statement/financial-statement-mutation.ts +12 -9
  343. package/server/service/financial-statement/financial-statement-query.ts +3 -1
  344. package/server/service/financial-statement/financial-statement.ts +52 -36
  345. package/server/service/financial-statement/index.ts +2 -1
  346. package/server/service/fiscal-month/fiscal-month-mutation.ts +145 -0
  347. package/server/service/fiscal-month/fiscal-month-query.ts +58 -0
  348. package/server/service/fiscal-month/fiscal-month-type.ts +66 -0
  349. package/server/service/fiscal-month/fiscal-month.ts +84 -0
  350. package/server/service/fiscal-month/index.ts +7 -0
  351. package/server/service/fiscal-quarter/fiscal-quarter-mutation.ts +148 -0
  352. package/server/service/fiscal-quarter/fiscal-quarter-query.ts +60 -0
  353. package/server/service/fiscal-quarter/fiscal-quarter-type.ts +60 -0
  354. package/server/service/fiscal-quarter/fiscal-quarter.ts +80 -0
  355. package/server/service/fiscal-quarter/index.ts +7 -0
  356. package/server/service/fiscal-year/fiscal-year-mutation.ts +145 -0
  357. package/server/service/fiscal-year/fiscal-year-query.ts +53 -0
  358. package/server/service/fiscal-year/fiscal-year-type.ts +54 -0
  359. package/server/service/fiscal-year/fiscal-year.ts +76 -0
  360. package/server/service/fiscal-year/index.ts +7 -0
  361. package/server/service/income-statement/income-statement-history.ts +31 -18
  362. package/server/service/income-statement/income-statement-line-item.ts +84 -0
  363. package/server/service/income-statement/income-statement-mutation.ts +12 -10
  364. package/server/service/income-statement/income-statement-query.ts +3 -4
  365. package/server/service/income-statement/income-statement.ts +54 -39
  366. package/server/service/income-statement/index.ts +2 -1
  367. package/server/service/index.ts +49 -3
  368. package/server/service/payment/event-subscriber.ts +17 -0
  369. package/server/service/payment/index.ts +9 -0
  370. package/server/service/payment/payment-history.ts +126 -0
  371. package/server/service/payment/payment-mutation.ts +139 -0
  372. package/server/service/payment/payment-query.ts +50 -0
  373. package/server/service/payment/payment-type.ts +64 -0
  374. package/server/service/payment/payment.ts +123 -0
  375. package/server/service/transaction/transaction-history.ts +54 -10
  376. package/server/service/transaction/transaction-mutation.ts +13 -10
  377. package/server/service/transaction/transaction-query.ts +3 -4
  378. package/server/service/transaction/transaction.ts +144 -29
  379. package/things-factory.config.js +3 -2
  380. package/translations/en.json +9 -1
  381. package/translations/ja.json +9 -1
  382. package/translations/ko.json +9 -1
  383. package/translations/ms.json +9 -1
  384. package/translations/zh.json +9 -1
  385. package/client/pages/main.ts +0 -24
  386. package/dist-client/pages/ledger/ledger-importer.js.map +0 -1
  387. package/dist-client/pages/ledger/ledger-list-page.js.map +0 -1
  388. package/dist-client/pages/main.d.ts +0 -1
  389. package/dist-client/pages/main.js +0 -27
  390. package/dist-client/pages/main.js.map +0 -1
@@ -1,12 +1,28 @@
1
1
  import { Domain } from '@things-factory/shell';
2
2
  import { User } from '@things-factory/auth-base';
3
3
  import { Account } from '../account/account';
4
+ import { Payment } from '../payment/payment';
5
+ import { AccountingDocument } from '../accounting-document/accounting-document';
4
6
  export declare enum TransactionType {
5
- Income = 0,// 회사가 받은 돈을 나타냅니다. 예를 들어, 제품 판매 수익 등이 해당됩니다.
6
- Expense = 1,// 회사가 지불한 돈을 나타냅니다. 예를 들어, 임금, 재고 구매 비용, 건물 임대료 등이 해당됩니다.
7
- Asset = 2,// 회사가 소유한 자산을 나타냅니다. 예를 들어, 토지, 건물, 차량 등이 해당됩니다.
8
- Liability = 3,// 회사가 지불해야 하는 부채를 나타냅니다. 예를 들어, 대출, 미지급금 등이 해당됩니다.
9
- Equity = 4
7
+ SalesIncome = 0,// 매출
8
+ PurchaseExpense = 1,// 매입
9
+ Asset = 2,// 자산
10
+ Liability = 3,// 부채
11
+ Equity = 4,// 자본
12
+ OtherIncome = 5,// 기타 수익
13
+ OtherExpense = 6
14
+ }
15
+ export declare enum TransactionCategory {
16
+ Confirmed = "Confirmed",// 확정된 건
17
+ Forecast = "Forecast"
18
+ }
19
+ export declare enum TransactionStatus {
20
+ Pending = "Pending",// 처리 대기 중
21
+ Paid = "Paid",// 전액 결제됨
22
+ PartiallyPaid = "PartiallyPaid",// 일부만 결제됨
23
+ Cancelled = "Cancelled",// 취소됨
24
+ Delayed = "Delayed",// 지연됨
25
+ ForecastFailed = "ForecastFailed"
10
26
  }
11
27
  export declare class Transaction {
12
28
  readonly id: string;
@@ -15,13 +31,22 @@ export declare class Transaction {
15
31
  domainId?: string;
16
32
  name?: string;
17
33
  description?: string;
18
- date?: Date;
19
34
  currency?: string;
20
35
  amount?: number;
21
36
  active?: boolean;
22
37
  type?: TransactionType;
38
+ category: TransactionCategory;
39
+ status: TransactionStatus;
40
+ probability?: number;
41
+ forecastNotes?: string;
23
42
  account?: Account;
24
43
  accountId?: string;
44
+ year?: number;
45
+ quarter?: number;
46
+ month?: number;
47
+ transactionDate: string;
48
+ payments?: Payment[];
49
+ documents?: AccountingDocument[];
25
50
  createdAt?: Date;
26
51
  updatedAt?: Date;
27
52
  deletedAt?: Date;
@@ -1,23 +1,49 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Transaction = exports.TransactionType = void 0;
3
+ exports.Transaction = exports.TransactionStatus = exports.TransactionCategory = exports.TransactionType = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const typeorm_1 = require("typeorm");
6
6
  const type_graphql_1 = require("type-graphql");
7
7
  const shell_1 = require("@things-factory/shell");
8
8
  const auth_base_1 = require("@things-factory/auth-base");
9
9
  const account_1 = require("../account/account");
10
+ const payment_1 = require("../payment/payment");
11
+ const accounting_document_1 = require("../accounting-document/accounting-document");
10
12
  var TransactionType;
11
13
  (function (TransactionType) {
12
- TransactionType[TransactionType["Income"] = 0] = "Income";
13
- TransactionType[TransactionType["Expense"] = 1] = "Expense";
14
+ TransactionType[TransactionType["SalesIncome"] = 0] = "SalesIncome";
15
+ TransactionType[TransactionType["PurchaseExpense"] = 1] = "PurchaseExpense";
14
16
  TransactionType[TransactionType["Asset"] = 2] = "Asset";
15
17
  TransactionType[TransactionType["Liability"] = 3] = "Liability";
16
- TransactionType[TransactionType["Equity"] = 4] = "Equity"; // 회사의 자본을 나타냅니다. 예를 들어, 자본금, 이익 잉여금 등이 해당됩니다.
18
+ TransactionType[TransactionType["Equity"] = 4] = "Equity";
19
+ TransactionType[TransactionType["OtherIncome"] = 5] = "OtherIncome";
20
+ TransactionType[TransactionType["OtherExpense"] = 6] = "OtherExpense"; // 기타 비용
17
21
  })(TransactionType || (exports.TransactionType = TransactionType = {}));
18
22
  (0, type_graphql_1.registerEnumType)(TransactionType, {
19
23
  name: 'TransactionType',
20
- description: 'type enumeration of a transaction'
24
+ description: 'Type enumeration of a transaction, indicating the nature of the transaction (e.g., Sales, Purchase, etc.)'
25
+ });
26
+ var TransactionCategory;
27
+ (function (TransactionCategory) {
28
+ TransactionCategory["Confirmed"] = "Confirmed";
29
+ TransactionCategory["Forecast"] = "Forecast"; // 예상 전망 건
30
+ })(TransactionCategory || (exports.TransactionCategory = TransactionCategory = {}));
31
+ (0, type_graphql_1.registerEnumType)(TransactionCategory, {
32
+ name: 'TransactionCategory',
33
+ description: 'Category of a transaction, indicating whether it is confirmed or a forecast'
34
+ });
35
+ var TransactionStatus;
36
+ (function (TransactionStatus) {
37
+ TransactionStatus["Pending"] = "Pending";
38
+ TransactionStatus["Paid"] = "Paid";
39
+ TransactionStatus["PartiallyPaid"] = "PartiallyPaid";
40
+ TransactionStatus["Cancelled"] = "Cancelled";
41
+ TransactionStatus["Delayed"] = "Delayed";
42
+ TransactionStatus["ForecastFailed"] = "ForecastFailed"; // 전망이 틀린 경우
43
+ })(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
44
+ (0, type_graphql_1.registerEnumType)(TransactionStatus, {
45
+ name: 'TransactionStatus',
46
+ description: 'Status of a transaction, indicating its processing state (e.g., Paid, Delayed, etc.)'
21
47
  });
22
48
  let Transaction = class Transaction {
23
49
  constructor() {
@@ -28,17 +54,17 @@ let Transaction = class Transaction {
28
54
  exports.Transaction = Transaction;
29
55
  tslib_1.__decorate([
30
56
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
31
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
57
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for the transaction' }),
32
58
  tslib_1.__metadata("design:type", String)
33
59
  ], Transaction.prototype, "id", void 0);
34
60
  tslib_1.__decorate([
35
61
  (0, typeorm_1.VersionColumn)(),
36
- (0, type_graphql_1.Field)({ nullable: true }),
62
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Version number for optimistic locking' }),
37
63
  tslib_1.__metadata("design:type", Number)
38
64
  ], Transaction.prototype, "version", void 0);
39
65
  tslib_1.__decorate([
40
66
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
41
- (0, type_graphql_1.Field)(type => shell_1.Domain),
67
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The domain in which this transaction belongs' }),
42
68
  tslib_1.__metadata("design:type", shell_1.Domain)
43
69
  ], Transaction.prototype, "domain", void 0);
44
70
  tslib_1.__decorate([
@@ -47,66 +73,120 @@ tslib_1.__decorate([
47
73
  ], Transaction.prototype, "domainId", void 0);
48
74
  tslib_1.__decorate([
49
75
  (0, typeorm_1.Column)(),
50
- (0, type_graphql_1.Field)({ nullable: true }),
76
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Name or title of the transaction' }),
51
77
  tslib_1.__metadata("design:type", String)
52
78
  ], Transaction.prototype, "name", void 0);
53
79
  tslib_1.__decorate([
54
80
  (0, typeorm_1.Column)({ nullable: true }),
55
- (0, type_graphql_1.Field)({ nullable: true }),
81
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Detailed description of the transaction' }),
56
82
  tslib_1.__metadata("design:type", String)
57
83
  ], Transaction.prototype, "description", void 0);
58
84
  tslib_1.__decorate([
59
85
  (0, typeorm_1.Column)({ nullable: true }),
60
- (0, type_graphql_1.Field)({ nullable: true }),
61
- tslib_1.__metadata("design:type", Date)
62
- ], Transaction.prototype, "date", void 0);
63
- tslib_1.__decorate([
64
- (0, typeorm_1.Column)({ nullable: true }),
65
- (0, type_graphql_1.Field)({ nullable: true }),
86
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Currency in which the transaction is denominated' }),
66
87
  tslib_1.__metadata("design:type", String)
67
88
  ], Transaction.prototype, "currency", void 0);
68
89
  tslib_1.__decorate([
69
90
  (0, typeorm_1.Column)({ nullable: true }),
70
- (0, type_graphql_1.Field)({ nullable: true }),
91
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Amount involved in the transaction' }),
71
92
  tslib_1.__metadata("design:type", Number)
72
93
  ], Transaction.prototype, "amount", void 0);
73
94
  tslib_1.__decorate([
74
95
  (0, typeorm_1.Column)({ nullable: true }),
75
- (0, type_graphql_1.Field)({ nullable: true }),
96
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates whether the transaction is currently active or not' }),
76
97
  tslib_1.__metadata("design:type", Boolean)
77
98
  ], Transaction.prototype, "active", void 0);
78
99
  tslib_1.__decorate([
79
100
  (0, typeorm_1.Column)({ nullable: true }),
80
- (0, type_graphql_1.Field)({ nullable: true }),
101
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Type of the transaction (e.g., SalesIncome, PurchaseExpense)' }),
81
102
  tslib_1.__metadata("design:type", Number)
82
103
  ], Transaction.prototype, "type", void 0);
104
+ tslib_1.__decorate([
105
+ (0, typeorm_1.Column)({ nullable: false }),
106
+ (0, type_graphql_1.Field)(type => TransactionCategory, {
107
+ nullable: false,
108
+ description: 'Category of the transaction (Confirmed or Forecast)'
109
+ }),
110
+ tslib_1.__metadata("design:type", String)
111
+ ], Transaction.prototype, "category", void 0);
112
+ tslib_1.__decorate([
113
+ (0, typeorm_1.Column)({ nullable: false }),
114
+ (0, type_graphql_1.Field)(type => TransactionStatus, {
115
+ nullable: false,
116
+ description: 'Current status of the transaction (e.g., Paid, Delayed)'
117
+ }),
118
+ tslib_1.__metadata("design:type", String)
119
+ ], Transaction.prototype, "status", void 0);
120
+ tslib_1.__decorate([
121
+ (0, typeorm_1.Column)({ nullable: true }),
122
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The probability of the forecast being realized (0 to 100)' }),
123
+ tslib_1.__metadata("design:type", Number)
124
+ ], Transaction.prototype, "probability", void 0);
125
+ tslib_1.__decorate([
126
+ (0, typeorm_1.Column)({ nullable: true }),
127
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Additional notes or comments about the forecast' }),
128
+ tslib_1.__metadata("design:type", String)
129
+ ], Transaction.prototype, "forecastNotes", void 0);
83
130
  tslib_1.__decorate([
84
131
  (0, typeorm_1.ManyToOne)(type => account_1.Account),
85
- (0, type_graphql_1.Field)({ nullable: true }),
132
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Associated account for this transaction' }),
86
133
  tslib_1.__metadata("design:type", account_1.Account)
87
134
  ], Transaction.prototype, "account", void 0);
88
135
  tslib_1.__decorate([
89
136
  (0, typeorm_1.RelationId)((transaction) => transaction.account),
90
137
  tslib_1.__metadata("design:type", String)
91
138
  ], Transaction.prototype, "accountId", void 0);
139
+ tslib_1.__decorate([
140
+ (0, typeorm_1.Column)({ nullable: true }),
141
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal year in which the transaction occurs' }),
142
+ tslib_1.__metadata("design:type", Number)
143
+ ], Transaction.prototype, "year", void 0);
144
+ tslib_1.__decorate([
145
+ (0, typeorm_1.Column)({ nullable: true }),
146
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal quarter in which the transaction occurs' }),
147
+ tslib_1.__metadata("design:type", Number)
148
+ ], Transaction.prototype, "quarter", void 0);
149
+ tslib_1.__decorate([
150
+ (0, typeorm_1.Column)({ nullable: true }),
151
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal month in which the transaction occurs' }),
152
+ tslib_1.__metadata("design:type", Number)
153
+ ], Transaction.prototype, "month", void 0);
154
+ tslib_1.__decorate([
155
+ (0, typeorm_1.Column)({ nullable: false }),
156
+ (0, type_graphql_1.Field)({ nullable: false, description: 'The date the transaction occurs or is scheduled (in string format)' }),
157
+ tslib_1.__metadata("design:type", String)
158
+ ], Transaction.prototype, "transactionDate", void 0);
159
+ tslib_1.__decorate([
160
+ (0, typeorm_1.OneToMany)(type => payment_1.Payment, payment => payment.transaction),
161
+ (0, type_graphql_1.Field)(type => [payment_1.Payment], { nullable: true, description: 'List of payments associated with this transaction' }),
162
+ tslib_1.__metadata("design:type", Array)
163
+ ], Transaction.prototype, "payments", void 0);
164
+ tslib_1.__decorate([
165
+ (0, typeorm_1.OneToMany)(type => accounting_document_1.AccountingDocument, document => document.transaction),
166
+ (0, type_graphql_1.Field)(type => [accounting_document_1.AccountingDocument], {
167
+ nullable: true,
168
+ description: 'List of accounting documents linked to this transaction'
169
+ }),
170
+ tslib_1.__metadata("design:type", Array)
171
+ ], Transaction.prototype, "documents", void 0);
92
172
  tslib_1.__decorate([
93
173
  (0, typeorm_1.CreateDateColumn)(),
94
- (0, type_graphql_1.Field)({ nullable: true }),
174
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when the transaction record was created' }),
95
175
  tslib_1.__metadata("design:type", Date)
96
176
  ], Transaction.prototype, "createdAt", void 0);
97
177
  tslib_1.__decorate([
98
178
  (0, typeorm_1.UpdateDateColumn)(),
99
- (0, type_graphql_1.Field)({ nullable: true }),
179
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when the transaction record was last updated' }),
100
180
  tslib_1.__metadata("design:type", Date)
101
181
  ], Transaction.prototype, "updatedAt", void 0);
102
182
  tslib_1.__decorate([
103
183
  (0, typeorm_1.DeleteDateColumn)(),
104
- (0, type_graphql_1.Field)({ nullable: true }),
184
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when the transaction record was deleted (soft delete)' }),
105
185
  tslib_1.__metadata("design:type", Date)
106
186
  ], Transaction.prototype, "deletedAt", void 0);
107
187
  tslib_1.__decorate([
108
188
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
109
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
189
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who created the transaction record' }),
110
190
  tslib_1.__metadata("design:type", auth_base_1.User)
111
191
  ], Transaction.prototype, "creator", void 0);
112
192
  tslib_1.__decorate([
@@ -115,7 +195,7 @@ tslib_1.__decorate([
115
195
  ], Transaction.prototype, "creatorId", void 0);
116
196
  tslib_1.__decorate([
117
197
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
118
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
198
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who last updated the transaction record' }),
119
199
  tslib_1.__metadata("design:type", auth_base_1.User)
120
200
  ], Transaction.prototype, "updater", void 0);
121
201
  tslib_1.__decorate([
@@ -123,8 +203,39 @@ tslib_1.__decorate([
123
203
  tslib_1.__metadata("design:type", String)
124
204
  ], Transaction.prototype, "updaterId", void 0);
125
205
  exports.Transaction = Transaction = tslib_1.__decorate([
206
+ (0, type_graphql_1.ObjectType)({
207
+ description: 'Entity representing a financial transaction, which could be sales, purchase, or other types of financial operations.'
208
+ }),
126
209
  (0, typeorm_1.Entity)(),
127
- (0, typeorm_1.Index)('ix_transaction_0', (transaction) => [transaction.domain, transaction.name, transaction.deletedAt], { unique: true }),
128
- (0, type_graphql_1.ObjectType)({ description: 'Entity for Transaction' })
210
+ (0, typeorm_1.Index)('ix_transaction_0', (transaction) => [
211
+ transaction.domain,
212
+ transaction.transactionDate,
213
+ transaction.type,
214
+ transaction.account
215
+ ], {
216
+ unique: false,
217
+ where: '"deleted_at" IS NULL'
218
+ }),
219
+ (0, typeorm_1.Index)('ix_transaction_1', (transaction) => [
220
+ transaction.domain,
221
+ transaction.type,
222
+ transaction.account,
223
+ transaction.transactionDate
224
+ ], {
225
+ unique: false,
226
+ where: '"deleted_at" IS NULL'
227
+ }),
228
+ (0, typeorm_1.Index)('ix_transaction_2', (transaction) => [
229
+ transaction.domain,
230
+ transaction.year,
231
+ transaction.quarter,
232
+ transaction.month,
233
+ transaction.transactionDate,
234
+ transaction.type,
235
+ transaction.account
236
+ ], {
237
+ unique: true,
238
+ where: '"deleted_at" IS NULL'
239
+ })
129
240
  ], Transaction);
130
241
  //# sourceMappingURL=transaction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[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IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;8CAAA;AAIhB;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;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;sBA3EP,WAAW;IAPvB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,kBAAkB,EAClB,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,EAC3F,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;GACzC,WAAW,CA4EvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\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'\nimport { Account } from '../account/account'\n\nexport enum TransactionType {\n Income, // 회사가 받은 돈을 나타냅니다. 예를 들어, 제품 판매 수익 등이 해당됩니다.\n Expense, // 회사가 지불한 돈을 나타냅니다. 예를 들어, 임금, 재고 구매 비용, 건물 임대료 등이 해당됩니다.\n Asset, // 회사가 소유한 자산을 나타냅니다. 예를 들어, 토지, 건물, 차량 등이 해당됩니다.\n Liability, // 회사가 지불해야 하는 부채를 나타냅니다. 예를 들어, 대출, 미지급금 등이 해당됩니다.\n Equity // 회사의 자본을 나타냅니다. 예를 들어, 자본금, 이익 잉여금 등이 해당됩니다.\n}\n\nregisterEnumType(TransactionType, {\n name: 'TransactionType',\n description: 'type enumeration of a transaction'\n})\n\n@Entity()\n@Index(\n 'ix_transaction_0',\n (transaction: Transaction) => [transaction.domain, transaction.name, transaction.deletedAt],\n { unique: true }\n)\n@ObjectType({ description: 'Entity for Transaction' })\nexport class Transaction {\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(type => Domain)\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 date?: Date\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 @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((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"]}
1
+ {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAsE;AAEtE,iDAA8C;AAC9C,yDAAgD;AAChD,gDAA4C;AAC5C,gDAA4C;AAC5C,oFAA+E;AAE/E,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,mEAAW,CAAA;IACX,2EAAe,CAAA;IACf,uDAAK,CAAA;IACL,+DAAS,CAAA;IACT,yDAAM,CAAA;IACN,mEAAW,CAAA;IACX,qEAAY,CAAA,CAAC,QAAQ;AACvB,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAED,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,2GAA2G;CAC9G,CAAC,CAAA;AAEF,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,4CAAqB,CAAA,CAAC,UAAU;AAClC,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;AAED,IAAA,+BAAgB,EAAC,mBAAmB,EAAE;IACpC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,6EAA6E;CAC3F,CAAC,CAAA;AAEF,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,oDAA+B,CAAA;IAC/B,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,sDAAiC,CAAA,CAAC,YAAY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eleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn,\n VersionColumn\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 { Account } from '../account/account'\nimport { Payment } from '../payment/payment'\nimport { AccountingDocument } from '../accounting-document/accounting-document'\n\nexport enum TransactionType {\n SalesIncome, // 매출\n PurchaseExpense, // 매입\n Asset, // 자산\n Liability, // 부채\n Equity, // 자본\n OtherIncome, // 기타 수익\n OtherExpense // 기타 비용\n}\n\nregisterEnumType(TransactionType, {\n name: 'TransactionType',\n description:\n 'Type enumeration of a transaction, indicating the nature of the transaction (e.g., Sales, Purchase, etc.)'\n})\n\nexport enum TransactionCategory {\n Confirmed = 'Confirmed', // 확정된 건\n Forecast = 'Forecast' // 예상 전망 건\n}\n\nregisterEnumType(TransactionCategory, {\n name: 'TransactionCategory',\n description: 'Category of a transaction, indicating whether it is confirmed or a forecast'\n})\n\nexport enum TransactionStatus {\n Pending = 'Pending', // 처리 대기 중\n Paid = 'Paid', // 전액 결제됨\n PartiallyPaid = 'PartiallyPaid', // 일부만 결제됨\n Cancelled = 'Cancelled', // 취소됨\n Delayed = 'Delayed', // 지연됨\n ForecastFailed = 'ForecastFailed' // 전망이 틀린 경우\n}\n\nregisterEnumType(TransactionStatus, {\n name: 'TransactionStatus',\n description: 'Status of a transaction, indicating its processing state (e.g., Paid, Delayed, etc.)'\n})\n\n@ObjectType({\n description:\n 'Entity representing a financial transaction, which could be sales, purchase, or other types of financial operations.'\n})\n@Entity()\n@Index(\n 'ix_transaction_0',\n (transaction: Transaction) => [\n transaction.domain,\n transaction.transactionDate,\n transaction.type,\n transaction.account\n ],\n {\n unique: false,\n where: '\"deleted_at\" IS NULL'\n }\n)\n@Index(\n 'ix_transaction_1',\n (transaction: Transaction) => [\n transaction.domain,\n transaction.type,\n transaction.account,\n transaction.transactionDate\n ],\n {\n unique: false,\n where: '\"deleted_at\" IS NULL'\n }\n)\n@Index(\n 'ix_transaction_2',\n (transaction: Transaction) => [\n transaction.domain,\n transaction.year,\n transaction.quarter,\n transaction.month,\n transaction.transactionDate,\n transaction.type,\n transaction.account\n ],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n }\n)\nexport class Transaction {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the transaction' })\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number for optimistic locking' })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'The domain in which this transaction belongs' })\n domain?: Domain\n\n @RelationId((transaction: Transaction) => transaction.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true, description: 'Name or title of the transaction' })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Detailed description of the transaction' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Currency in which the transaction is denominated' })\n currency?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Amount involved in the transaction' })\n amount?: number = 0\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Indicates whether the transaction is currently active or not' })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Type of the transaction (e.g., SalesIncome, PurchaseExpense)' })\n type?: TransactionType\n\n @Column({ nullable: false })\n @Field(type => TransactionCategory, {\n nullable: false,\n description: 'Category of the transaction (Confirmed or Forecast)'\n })\n category: TransactionCategory // 트랜잭션의 카테고리 (확정, 전망)\n\n @Column({ nullable: false })\n @Field(type => TransactionStatus, {\n nullable: false,\n description: 'Current status of the transaction (e.g., Paid, Delayed)'\n })\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, description: 'Associated account for this transaction' })\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 in which the transaction occurs' })\n year?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal quarter in which the transaction occurs' })\n quarter?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal month in which the transaction occurs' })\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 @OneToMany(type => Payment, payment => payment.transaction)\n @Field(type => [Payment], { nullable: true, description: 'List of payments associated with this transaction' })\n payments?: Payment[]\n\n @OneToMany(type => AccountingDocument, document => document.transaction)\n @Field(type => [AccountingDocument], {\n nullable: true,\n description: 'List of accounting documents linked to this transaction'\n })\n documents?: AccountingDocument[] // 트랜잭션과 연결된 회계 문서\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was created' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was last updated' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was deleted (soft delete)' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created the transaction record' })\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, description: 'User who last updated the transaction record' })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.updater)\n updaterId?: string\n}\n"]}