@things-factory/accounting 7.0.6 → 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
@@ -4,18 +4,18 @@ exports.IncomeStatementMutation = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const type_graphql_1 = require("type-graphql");
6
6
  const typeorm_1 = require("typeorm");
7
- const attachment_base_1 = require("@things-factory/attachment-base");
7
+ const shell_1 = require("@things-factory/shell");
8
8
  const income_statement_1 = require("./income-statement");
9
9
  const income_statement_type_1 = require("./income-statement-type");
10
10
  let IncomeStatementMutation = class IncomeStatementMutation {
11
11
  async createIncomeStatement(incomeStatement, context) {
12
12
  const { domain, user, tx } = context.state;
13
- const result = await tx.getRepository(income_statement_1.IncomeStatement).save(Object.assign(Object.assign({}, incomeStatement), { domain, creator: user, updater: user }));
13
+ const result = await (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx).save(Object.assign(Object.assign({}, incomeStatement), { domain, creator: user, updater: user }));
14
14
  return result;
15
15
  }
16
16
  async updateIncomeStatement(id, patch, context) {
17
17
  const { domain, user, tx } = context.state;
18
- const repository = tx.getRepository(income_statement_1.IncomeStatement);
18
+ const repository = (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx);
19
19
  const incomeStatement = await repository.findOne({
20
20
  where: { domain: { id: domain.id }, id }
21
21
  });
@@ -27,7 +27,7 @@ let IncomeStatementMutation = class IncomeStatementMutation {
27
27
  let results = [];
28
28
  const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
29
29
  const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
30
- const incomeStatementRepo = tx.getRepository(income_statement_1.IncomeStatement);
30
+ const incomeStatementRepo = (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx);
31
31
  if (_createRecords.length > 0) {
32
32
  for (let i = 0; i < _createRecords.length; i++) {
33
33
  const newRecord = _createRecords[i];
@@ -47,17 +47,15 @@ let IncomeStatementMutation = class IncomeStatementMutation {
47
47
  }
48
48
  async deleteIncomeStatement(id, context) {
49
49
  const { domain, tx } = context.state;
50
- await tx.getRepository(income_statement_1.IncomeStatement).delete({ domain: { id: domain.id }, id });
51
- await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
50
+ await (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx).delete({ domain: { id: domain.id }, id });
52
51
  return true;
53
52
  }
54
53
  async deleteIncomeStatements(ids, context) {
55
54
  const { domain, tx } = context.state;
56
- await tx.getRepository(income_statement_1.IncomeStatement).delete({
55
+ await (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx).delete({
57
56
  domain: { id: domain.id },
58
57
  id: (0, typeorm_1.In)(ids)
59
58
  });
60
- await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: ids }, context);
61
59
  return true;
62
60
  }
63
61
  async importIncomeStatements(incomeStatements, context) {
@@ -73,6 +71,7 @@ let IncomeStatementMutation = class IncomeStatementMutation {
73
71
  exports.IncomeStatementMutation = IncomeStatementMutation;
74
72
  tslib_1.__decorate([
75
73
  (0, type_graphql_1.Directive)('@transaction'),
74
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation")'),
76
75
  (0, type_graphql_1.Mutation)(returns => income_statement_1.IncomeStatement, { description: 'To create new IncomeStatement' }),
77
76
  tslib_1.__param(0, (0, type_graphql_1.Arg)('incomeStatement')),
78
77
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
@@ -82,6 +81,7 @@ tslib_1.__decorate([
82
81
  ], IncomeStatementMutation.prototype, "createIncomeStatement", null);
83
82
  tslib_1.__decorate([
84
83
  (0, type_graphql_1.Directive)('@transaction'),
84
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation")'),
85
85
  (0, type_graphql_1.Mutation)(returns => income_statement_1.IncomeStatement, { description: 'To modify IncomeStatement information' }),
86
86
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
87
87
  tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
@@ -92,6 +92,7 @@ tslib_1.__decorate([
92
92
  ], IncomeStatementMutation.prototype, "updateIncomeStatement", null);
93
93
  tslib_1.__decorate([
94
94
  (0, type_graphql_1.Directive)('@transaction'),
95
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation")'),
95
96
  (0, type_graphql_1.Mutation)(returns => [income_statement_1.IncomeStatement], { description: "To modify multiple IncomeStatements' information" }),
96
97
  tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [income_statement_type_1.IncomeStatementPatch])),
97
98
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
@@ -101,6 +102,7 @@ tslib_1.__decorate([
101
102
  ], IncomeStatementMutation.prototype, "updateMultipleIncomeStatement", null);
102
103
  tslib_1.__decorate([
103
104
  (0, type_graphql_1.Directive)('@transaction'),
105
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation")'),
104
106
  (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete IncomeStatement' }),
105
107
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
106
108
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
@@ -110,6 +112,7 @@ tslib_1.__decorate([
110
112
  ], IncomeStatementMutation.prototype, "deleteIncomeStatement", null);
111
113
  tslib_1.__decorate([
112
114
  (0, type_graphql_1.Directive)('@transaction'),
115
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation")'),
113
116
  (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple IncomeStatements' }),
114
117
  tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
115
118
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
@@ -119,6 +122,7 @@ tslib_1.__decorate([
119
122
  ], IncomeStatementMutation.prototype, "deleteIncomeStatements", null);
120
123
  tslib_1.__decorate([
121
124
  (0, type_graphql_1.Directive)('@transaction'),
125
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation")'),
122
126
  (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple IncomeStatements' }),
123
127
  tslib_1.__param(0, (0, type_graphql_1.Arg)('incomeStatements', type => [income_statement_type_1.IncomeStatementPatch])),
124
128
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
@@ -1 +1 @@
1
- {"version":3,"file":"income-statement-mutation.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,yDAAoD;AACpD,mEAAkF;AAG3E,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAG5B,AAAN,KAAK,CAAC,qBAAqB,CACD,eAAmC,EACpD,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,kCAAe,CAAC,CAAC,IAAI,iCACtD,eAAe,KAClB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,qBAAqB,CACd,EAAU,EACP,KAA2B,EAClC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,kCAAe,CAAC,CAAA;QACpD,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;QAEF,M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kCAAe,CAAC,EAAE,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;IAEzG,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,4CAAoB,CAAC,CAAC,CAAA;IAC9C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4EAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oEAOxD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IAElF,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qEAYP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IAElF,mBAAA,IAAA,kBAAG,EAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,4CAAoB,CAAC,CAAC,CAAA;IACvD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qEAaP;kCAtIU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,kCAAe,CAAC;GACb,uBAAuB,CAuInC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { IncomeStatement } from './income-statement'\nimport { NewIncomeStatement, IncomeStatementPatch } from './income-statement-type'\n\n@Resolver(IncomeStatement)\nexport class IncomeStatementMutation {\n @Directive('@transaction')\n @Mutation(returns => IncomeStatement, { description: 'To create new IncomeStatement' })\n async createIncomeStatement(\n @Arg('incomeStatement') incomeStatement: NewIncomeStatement,\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatement> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(IncomeStatement).save({\n ...incomeStatement,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => IncomeStatement, { description: 'To modify IncomeStatement information' })\n async updateIncomeStatement(\n @Arg('id') id: string,\n @Arg('patch') patch: IncomeStatementPatch,\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatement> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(IncomeStatement)\n const incomeStatement = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...incomeStatement,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [IncomeStatement], { description: \"To modify multiple IncomeStatements' information\" })\n async updateMultipleIncomeStatement(\n @Arg('patches', type => [IncomeStatementPatch]) patches: IncomeStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatement[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const incomeStatementRepo = tx.getRepository(IncomeStatement)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await incomeStatementRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const incomeStatement = await incomeStatementRepo.findOneBy({ id: updateRecord.id })\n\n const result = await incomeStatementRepo.save({\n ...incomeStatement,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete IncomeStatement' })\n async deleteIncomeStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(IncomeStatement).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple IncomeStatements' })\n async deleteIncomeStatements(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(IncomeStatement).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple IncomeStatements' })\n async importIncomeStatements(\n @Arg('incomeStatements', type => [IncomeStatementPatch]) incomeStatements: IncomeStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n incomeStatements.map(async (incomeStatement: IncomeStatementPatch) => {\n const createdIncomeStatement: IncomeStatement = await tx\n .getRepository(IncomeStatement)\n .save({ domain, ...incomeStatement })\n })\n )\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"income-statement-mutation.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,iDAAqD;AAErD,yDAAoD;AACpD,mEAAkF;AAG3E,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAI5B,AA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AS,EAAC,2DAA2D,CAAC;IACtE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IAElF,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qEAUP;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,2DAA2D,CAAC;IACtE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IAElF,mBAAA,IAAA,kBAAG,EAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,4CAAoB,CAAC,CAAC,CAAA;IACvD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qEAaP;kCAzIU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,kCAAe,CAAC;GACb,uBAAuB,CA0InC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { getRepository } from '@things-factory/shell'\n\nimport { IncomeStatement } from './income-statement'\nimport { NewIncomeStatement, IncomeStatementPatch } from './income-statement-type'\n\n@Resolver(IncomeStatement)\nexport class IncomeStatementMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\")')\n @Mutation(returns => IncomeStatement, { description: 'To create new IncomeStatement' })\n async createIncomeStatement(\n @Arg('incomeStatement') incomeStatement: NewIncomeStatement,\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatement> {\n const { domain, user, tx } = context.state\n\n const result = await getRepository(IncomeStatement, tx).save({\n ...incomeStatement,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\")')\n @Mutation(returns => IncomeStatement, { description: 'To modify IncomeStatement information' })\n async updateIncomeStatement(\n @Arg('id') id: string,\n @Arg('patch') patch: IncomeStatementPatch,\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatement> {\n const { domain, user, tx } = context.state\n\n const repository = getRepository(IncomeStatement, tx)\n const incomeStatement = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...incomeStatement,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\")')\n @Mutation(returns => [IncomeStatement], { description: \"To modify multiple IncomeStatements' information\" })\n async updateMultipleIncomeStatement(\n @Arg('patches', type => [IncomeStatementPatch]) patches: IncomeStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatement[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const incomeStatementRepo = getRepository(IncomeStatement, tx)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await incomeStatementRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const incomeStatement = await incomeStatementRepo.findOneBy({ id: updateRecord.id })\n\n const result = await incomeStatementRepo.save({\n ...incomeStatement,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\")')\n @Mutation(returns => Boolean, { description: 'To delete IncomeStatement' })\n async deleteIncomeStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(IncomeStatement, tx).delete({ domain: { id: domain.id }, id })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\")')\n @Mutation(returns => Boolean, { description: 'To delete multiple IncomeStatements' })\n async deleteIncomeStatements(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(IncomeStatement, tx).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\")')\n @Mutation(returns => Boolean, { description: 'To import multiple IncomeStatements' })\n async importIncomeStatements(\n @Arg('incomeStatements', type => [IncomeStatementPatch]) incomeStatements: IncomeStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n incomeStatements.map(async (incomeStatement: IncomeStatementPatch) => {\n const createdIncomeStatement: IncomeStatement = await tx\n .getRepository(IncomeStatement)\n .save({ domain, ...incomeStatement })\n })\n )\n\n return true\n }\n}\n"]}
@@ -37,6 +37,7 @@ let IncomeStatementQuery = class IncomeStatementQuery {
37
37
  };
38
38
  exports.IncomeStatementQuery = IncomeStatementQuery;
39
39
  tslib_1.__decorate([
40
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query")'),
40
41
  (0, type_graphql_1.Query)(returns => income_statement_1.IncomeStatement, { nullable: true, description: 'To fetch a IncomeStatement' }),
41
42
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
42
43
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
@@ -45,8 +46,9 @@ tslib_1.__decorate([
45
46
  tslib_1.__metadata("design:returntype", Promise)
46
47
  ], IncomeStatementQuery.prototype, "incomeStatement", null);
47
48
  tslib_1.__decorate([
49
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query")'),
48
50
  (0, type_graphql_1.Query)(returns => income_statement_type_1.IncomeStatementList, { description: 'To fetch multiple IncomeStatements' }),
49
- tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
51
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
50
52
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
51
53
  tslib_1.__metadata("design:type", Function),
52
54
  tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
@@ -1 +1 @@
1
- {"version":3,"file":"income-statement-query.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,yDAAoD;AACpD,mEAA6D;AAGtD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAEzB,AAAN,KAAK,CAAC,eAAe,CAAY,EAAU,EAAS,OAAwB;QAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,kCAAe,CAAC,CAAC,OAAO,CAAC;YAClD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,gBAAgB,CACK,MAAiB,EACnC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,kCAAe,CAAC;YAChD,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAA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Aa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAkB,kCAAe;;mDAErD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAkB,kCAAe;;mDAErD;+BA1CU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,kCAAe,CAAC;GACb,oBAAoB,CA2ChC","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 { IncomeStatement } from './income-statement'\nimport { IncomeStatementList } from './income-statement-type'\n\n@Resolver(IncomeStatement)\nexport class IncomeStatementQuery {\n @Query(returns => IncomeStatement!, { nullable: true, description: 'To fetch a IncomeStatement' })\n async incomeStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<IncomeStatement> {\n const { domain } = context.state\n\n return await getRepository(IncomeStatement).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => IncomeStatementList, { description: 'To fetch multiple IncomeStatements' })\n async incomeStatements(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatementList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(IncomeStatement),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() incomeStatement: IncomeStatement): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: incomeStatement.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() incomeStatement: IncomeStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: incomeStatement.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() incomeStatement: IncomeStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: incomeStatement.creatorId })\n }\n}\n"]}
1
+ {"version":3,"file":"income-statement-query.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,yDAAoD;AACpD,mEAA6D;AAGtD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAGzB,AAAN,KAAK,CAAC,eAAe,CAAY,EAAU,EAAS,OAAwB;QAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,kCAAe,CAAC,CAAC,OAAO,CAAC;YAClD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CAAS,MAAiB,EAAS,OAAwB;QAC/E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,kCAAe,CAAC;YAChD,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,eAAgC;QACnD,OAAO,MAAM,IAAA,qBAAa,EAAC,cAAM,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAA;I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E,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAkB,kCAAe;;mDAErD;+BAzCU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,kCAAe,CAAC;GACb,oBAAoB,CA0ChC","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 { IncomeStatement } from './income-statement'\nimport { IncomeStatementList } from './income-statement-type'\n\n@Resolver(IncomeStatement)\nexport class IncomeStatementQuery {\n @Directive('@privilege(category: \"accounting\", privilege: \"query\")')\n @Query(returns => IncomeStatement!, { nullable: true, description: 'To fetch a IncomeStatement' })\n async incomeStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<IncomeStatement> {\n const { domain } = context.state\n\n return await getRepository(IncomeStatement).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"accounting\", privilege: \"query\")')\n @Query(returns => IncomeStatementList, { description: 'To fetch multiple IncomeStatements' })\n async incomeStatements(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<IncomeStatementList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(IncomeStatement),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() incomeStatement: IncomeStatement): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: incomeStatement.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() incomeStatement: IncomeStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: incomeStatement.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() incomeStatement: IncomeStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: incomeStatement.creatorId })\n }\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import { Domain } from '@things-factory/shell';
2
2
  import { User } from '@things-factory/auth-base';
3
+ import { IncomeStatementLineItem } from './income-statement-line-item';
3
4
  export declare enum IncomeStatementStatus {
4
5
  STATUS_A = "STATUS_A",
5
6
  STATUS_B = "STATUS_B"
@@ -16,6 +17,7 @@ export declare class IncomeStatement {
16
17
  expense?: number;
17
18
  netIncome?: number;
18
19
  active?: boolean;
20
+ lineItems?: IncomeStatementLineItem[];
19
21
  createdAt?: Date;
20
22
  updatedAt?: Date;
21
23
  deletedAt?: Date;
@@ -6,6 +6,7 @@ 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
+ const income_statement_line_item_1 = require("./income-statement-line-item");
9
10
  var IncomeStatementStatus;
10
11
  (function (IncomeStatementStatus) {
11
12
  IncomeStatementStatus["STATUS_A"] = "STATUS_A";
@@ -13,29 +14,30 @@ var IncomeStatementStatus;
13
14
  })(IncomeStatementStatus || (exports.IncomeStatementStatus = IncomeStatementStatus = {}));
14
15
  (0, type_graphql_1.registerEnumType)(IncomeStatementStatus, {
15
16
  name: 'IncomeStatementStatus',
16
- description: 'state enumeration of a incomeStatement'
17
+ description: 'State enumeration of an income statement' // 손익계산서의 상태 열거형
17
18
  });
18
- // 손익계산서
19
+ // 손익계산서 (Income Statement)
19
20
  let IncomeStatement = class IncomeStatement {
20
21
  constructor() {
21
- this.version = 1;
22
+ this.version = 1; // 낙관적 잠금을 위한 버전 관리 필드
22
23
  }
23
24
  };
24
25
  exports.IncomeStatement = IncomeStatement;
25
26
  tslib_1.__decorate([
26
27
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
27
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
28
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for the income statement' }),
28
29
  tslib_1.__metadata("design:type", String)
29
30
  ], IncomeStatement.prototype, "id", void 0);
30
31
  tslib_1.__decorate([
31
32
  (0, typeorm_1.VersionColumn)(),
32
- (0, type_graphql_1.Field)({ nullable: true }),
33
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Version number for optimistic locking' }),
33
34
  tslib_1.__metadata("design:type", Number)
34
35
  ], IncomeStatement.prototype, "version", void 0);
35
36
  tslib_1.__decorate([
36
37
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
37
- (0, type_graphql_1.Field)(type => shell_1.Domain),
38
- tslib_1.__metadata("design:type", shell_1.Domain)
38
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The domain to which this income statement belongs' }),
39
+ tslib_1.__metadata("design:type", shell_1.Domain // 이 손익계산서가 속한 도메인
40
+ )
39
41
  ], IncomeStatement.prototype, "domain", void 0);
40
42
  tslib_1.__decorate([
41
43
  (0, typeorm_1.RelationId)((incomeStatement) => incomeStatement.domain),
@@ -43,58 +45,67 @@ tslib_1.__decorate([
43
45
  ], IncomeStatement.prototype, "domainId", void 0);
44
46
  tslib_1.__decorate([
45
47
  (0, typeorm_1.Column)({ nullable: true }),
46
- (0, type_graphql_1.Field)({ nullable: true, description: 'fiscal year' }),
48
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal year of the income statement' }),
47
49
  tslib_1.__metadata("design:type", Number)
48
50
  ], IncomeStatement.prototype, "year", void 0);
49
51
  tslib_1.__decorate([
50
52
  (0, typeorm_1.Column)({ nullable: true }),
51
- (0, type_graphql_1.Field)({ nullable: true, description: 'fiscal quarter' }),
53
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal quarter of the income statement' }),
52
54
  tslib_1.__metadata("design:type", Number)
53
55
  ], IncomeStatement.prototype, "quarter", void 0);
54
56
  tslib_1.__decorate([
55
57
  (0, typeorm_1.Column)({ nullable: true }),
56
- (0, type_graphql_1.Field)({ nullable: true }),
58
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal month of the income statement' }),
57
59
  tslib_1.__metadata("design:type", Number)
58
60
  ], IncomeStatement.prototype, "month", void 0);
59
61
  tslib_1.__decorate([
60
62
  (0, typeorm_1.Column)({ nullable: true }),
61
- (0, type_graphql_1.Field)({ nullable: true }),
63
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Total revenue recorded in the income statement' }),
62
64
  tslib_1.__metadata("design:type", Number)
63
65
  ], IncomeStatement.prototype, "revenue", void 0);
64
66
  tslib_1.__decorate([
65
67
  (0, typeorm_1.Column)({ nullable: true }),
66
- (0, type_graphql_1.Field)({ nullable: true }),
68
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Total expenses recorded in the income statement' }),
67
69
  tslib_1.__metadata("design:type", Number)
68
70
  ], IncomeStatement.prototype, "expense", void 0);
69
71
  tslib_1.__decorate([
70
72
  (0, typeorm_1.Column)({ nullable: true }),
71
- (0, type_graphql_1.Field)({ nullable: true }),
73
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Net income calculated as revenue minus expenses' }),
72
74
  tslib_1.__metadata("design:type", Number)
73
75
  ], IncomeStatement.prototype, "netIncome", void 0);
74
76
  tslib_1.__decorate([
75
77
  (0, typeorm_1.Column)({ nullable: true }),
76
- (0, type_graphql_1.Field)({ nullable: true }),
78
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates whether this income statement is active' }),
77
79
  tslib_1.__metadata("design:type", Boolean)
78
80
  ], IncomeStatement.prototype, "active", void 0);
81
+ tslib_1.__decorate([
82
+ (0, typeorm_1.OneToMany)(type => income_statement_line_item_1.IncomeStatementLineItem, lineItem => lineItem.statement),
83
+ (0, type_graphql_1.Field)(type => [income_statement_line_item_1.IncomeStatementLineItem], { nullable: true }),
84
+ tslib_1.__metadata("design:type", Array)
85
+ ], IncomeStatement.prototype, "lineItems", void 0);
79
86
  tslib_1.__decorate([
80
87
  (0, typeorm_1.CreateDateColumn)(),
81
- (0, type_graphql_1.Field)({ nullable: true }),
82
- tslib_1.__metadata("design:type", Date)
88
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the income statement was created' }),
89
+ tslib_1.__metadata("design:type", Date // 손익계산서가 생성된 날짜 및 시간
90
+ )
83
91
  ], IncomeStatement.prototype, "createdAt", void 0);
84
92
  tslib_1.__decorate([
85
93
  (0, typeorm_1.UpdateDateColumn)(),
86
- (0, type_graphql_1.Field)({ nullable: true }),
87
- tslib_1.__metadata("design:type", Date)
94
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the income statement was last updated' }),
95
+ tslib_1.__metadata("design:type", Date // 손익계산서가 마지막으로 업데이트된 날짜 및 시간
96
+ )
88
97
  ], IncomeStatement.prototype, "updatedAt", void 0);
89
98
  tslib_1.__decorate([
90
99
  (0, typeorm_1.DeleteDateColumn)(),
91
- (0, type_graphql_1.Field)({ nullable: true }),
92
- tslib_1.__metadata("design:type", Date)
100
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the income statement was deleted' }),
101
+ tslib_1.__metadata("design:type", Date // 손익계산서가 삭제된 날짜 및 시간
102
+ )
93
103
  ], IncomeStatement.prototype, "deletedAt", void 0);
94
104
  tslib_1.__decorate([
95
105
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
96
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
97
- tslib_1.__metadata("design:type", auth_base_1.User)
106
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created the income statement' }),
107
+ tslib_1.__metadata("design:type", auth_base_1.User // 손익계산서를 생성한 사용자
108
+ )
98
109
  ], IncomeStatement.prototype, "creator", void 0);
99
110
  tslib_1.__decorate([
100
111
  (0, typeorm_1.RelationId)((incomeStatement) => incomeStatement.creator),
@@ -102,8 +113,9 @@ tslib_1.__decorate([
102
113
  ], IncomeStatement.prototype, "creatorId", void 0);
103
114
  tslib_1.__decorate([
104
115
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
105
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
106
- tslib_1.__metadata("design:type", auth_base_1.User)
116
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who last updated the income statement' }),
117
+ tslib_1.__metadata("design:type", auth_base_1.User // 손익계산서를 마지막으로 업데이트한 사용자
118
+ )
107
119
  ], IncomeStatement.prototype, "updater", void 0);
108
120
  tslib_1.__decorate([
109
121
  (0, typeorm_1.RelationId)((incomeStatement) => incomeStatement.updater),
@@ -111,7 +123,15 @@ tslib_1.__decorate([
111
123
  ], IncomeStatement.prototype, "updaterId", void 0);
112
124
  exports.IncomeStatement = IncomeStatement = tslib_1.__decorate([
113
125
  (0, typeorm_1.Entity)(),
114
- (0, typeorm_1.Index)('ix_income_statement_0', (incomeStatement) => [incomeStatement.domain, incomeStatement.deletedAt], { unique: true }),
115
- (0, type_graphql_1.ObjectType)({ description: 'Entity for IncomeStatement' })
126
+ (0, typeorm_1.Index)('ix_income_statement_0', (incomeStatement) => [
127
+ incomeStatement.domain,
128
+ incomeStatement.year,
129
+ incomeStatement.quarter,
130
+ incomeStatement.month
131
+ ], {
132
+ unique: true,
133
+ where: '"deleted_at" IS NULL' // 삭제되지 않은 경우에만 유니크
134
+ }),
135
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for IncomeStatement, representing the profit and loss report' }) // 손익계산서 엔티티
116
136
  ], IncomeStatement);
117
137
  //# sourceMappingURL=income-statement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"income-statement.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;AACvB,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAED,IAAA,+BAAgB,EAAC,qBAAqB,EAAE;IACtC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,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EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;gDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,eAAgC,EAAE,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC;;kDACxD;0BApEP,eAAe;IAP3B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,uBAAuB,EACvB,CAAC,eAAgC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC,EACzF,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;GAC7C,eAAe,CAqE3B","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'\n\nexport enum IncomeStatementStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(IncomeStatementStatus, {\n name: 'IncomeStatementStatus',\n description: 'state enumeration of a incomeStatement'\n})\n\n// 손익계산서\n@Entity()\n@Index(\n 'ix_income_statement_0',\n (incomeStatement: IncomeStatement) => [incomeStatement.domain, incomeStatement.deletedAt],\n { unique: true }\n)\n@ObjectType({ description: 'Entity for IncomeStatement' })\nexport class IncomeStatement {\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((incomeStatement: IncomeStatement) => incomeStatement.domain)\n domainId?: 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 })\n month?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n revenue?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n expense?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n netIncome?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\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((incomeStatement: IncomeStatement) => incomeStatement.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((incomeStatement: IncomeStatement) => incomeStatement.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"income-statement.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAsE;AAEtE,iDAA8C;AAC9C,yDAAgD;AAEhD,6EAAsE;AAEtE,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;AACvB,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAED,IAAA,+BAAgB,EAAC,qBAAqB,EAAE;IACtC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,0CAA0C,CAAC,gBAAgB;CACzE,CAAC,CAAA;AAEF,2BAA2B;AAgBpB,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QAOL,YAAO,GAAY,CAAC,CAAA,CAAC,sBAAsB;IAkE7C,CAAC;CAAA,CAAA;AAzEY,0CAAe;AAGjB;IAFR,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ryGeneratedColumn,\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'\n\nimport { IncomeStatementLineItem } from './income-statement-line-item'\n\nexport enum IncomeStatementStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(IncomeStatementStatus, {\n name: 'IncomeStatementStatus',\n description: 'State enumeration of an income statement' // 손익계산서의 상태 열거형\n})\n\n// 손익계산서 (Income Statement)\n@Entity()\n@Index(\n 'ix_income_statement_0',\n (incomeStatement: IncomeStatement) => [\n incomeStatement.domain,\n incomeStatement.year,\n incomeStatement.quarter,\n incomeStatement.month\n ],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL' // 삭제되지 않은 경우에만 유니크\n }\n)\n@ObjectType({ description: 'Entity for IncomeStatement, representing the profit and loss report' }) // 손익계산서 엔티티\nexport class IncomeStatement {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the income statement' })\n readonly id: string // 고유 식별자 (UUID)\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 to which this income statement belongs' })\n domain?: Domain // 이 손익계산서가 속한 도메인\n\n @RelationId((incomeStatement: IncomeStatement) => incomeStatement.domain)\n domainId?: string // 도메인의 ID\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal year of the income statement' })\n year?: number // 회계 연도\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal quarter of the income statement' })\n quarter?: number // 회계 분기\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal month of the income statement' })\n month?: number // 회계 월\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Total revenue recorded in the income statement' })\n revenue?: number // 손익계산서에 기록된 총수익\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Total expenses recorded in the income statement' })\n expense?: number // 손익계산서에 기록된 총비용\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Net income calculated as revenue minus expenses' })\n netIncome?: number // 총수익에서 총비용을 뺀 순이익\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Indicates whether this income statement is active' })\n active?: boolean // 이 손익계산서가 활성 상태인지 여부\n\n @OneToMany(type => IncomeStatementLineItem, lineItem => lineItem.statement)\n @Field(type => [IncomeStatementLineItem], { nullable: true })\n lineItems?: IncomeStatementLineItem[] // 계정별 브레이크다운\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the income statement was created' })\n createdAt?: Date // 손익계산서가 생성된 날짜 및 시간\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the income statement was last updated' })\n updatedAt?: Date // 손익계산서가 마지막으로 업데이트된 날짜 및 시간\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'The date and time when the income statement was deleted' })\n deletedAt?: Date // 손익계산서가 삭제된 날짜 및 시간\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created the income statement' })\n creator?: User // 손익계산서를 생성한 사용자\n\n @RelationId((incomeStatement: IncomeStatement) => incomeStatement.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 income statement' })\n updater?: User // 손익계산서를 마지막으로 업데이트한 사용자\n\n @RelationId((incomeStatement: IncomeStatement) => incomeStatement.updater)\n updaterId?: string // 손익계산서를 업데이트한 사용자의 ID\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import { IncomeStatement } from './income-statement';
2
- import { IncomeStatementHistory } from './income-statement-history';
2
+ import { IncomeStatementLineItem } from './income-statement-line-item';
3
3
  import { IncomeStatementQuery } from './income-statement-query';
4
4
  import { IncomeStatementMutation } from './income-statement-mutation';
5
5
  import { IncomeStatementHistoryEntitySubscriber } from './event-subscriber';
6
- export declare const entities: (typeof IncomeStatement | typeof IncomeStatementHistory)[];
6
+ export declare const entities: (typeof IncomeStatementLineItem | typeof IncomeStatement)[];
7
7
  export declare const resolvers: (typeof IncomeStatementQuery | typeof IncomeStatementMutation)[];
8
8
  export declare const subscribers: (typeof IncomeStatementHistoryEntitySubscriber)[];
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.subscribers = exports.resolvers = exports.entities = void 0;
4
4
  const income_statement_1 = require("./income-statement");
5
+ const income_statement_line_item_1 = require("./income-statement-line-item");
5
6
  const income_statement_history_1 = require("./income-statement-history");
6
7
  const income_statement_query_1 = require("./income-statement-query");
7
8
  const income_statement_mutation_1 = require("./income-statement-mutation");
8
9
  const event_subscriber_1 = require("./event-subscriber");
9
- exports.entities = [income_statement_1.IncomeStatement, income_statement_history_1.IncomeStatementHistory];
10
+ exports.entities = [income_statement_1.IncomeStatement, income_statement_line_item_1.IncomeStatementLineItem, income_statement_history_1.IncomeStatementHistory];
10
11
  exports.resolvers = [income_statement_query_1.IncomeStatementQuery, income_statement_mutation_1.IncomeStatementMutation];
11
12
  exports.subscribers = [event_subscriber_1.IncomeStatementHistoryEntitySubscriber];
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/income-statement/index.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AACpD,yEAAmE;AACnE,qEAA+D;AAC/D,2EAAqE;AACrE,yDAA2E;AAE9D,QAAA,QAAQ,GAAG,CAAC,kCAAe,EAAE,iDAAsB,CAAC,CAAA;AACpD,QAAA,SAAS,GAAG,CAAC,6CAAoB,EAAE,mDAAuB,CAAC,CAAA;AAC3D,QAAA,WAAW,GAAG,CAAC,yDAAsC,CAAC,CAAA","sourcesContent":["import { IncomeStatement } from './income-statement'\nimport { IncomeStatementHistory } from './income-statement-history'\nimport { IncomeStatementQuery } from './income-statement-query'\nimport { IncomeStatementMutation } from './income-statement-mutation'\nimport { IncomeStatementHistoryEntitySubscriber } from './event-subscriber'\n\nexport const entities = [IncomeStatement, IncomeStatementHistory]\nexport const resolvers = [IncomeStatementQuery, IncomeStatementMutation]\nexport const subscribers = [IncomeStatementHistoryEntitySubscriber]\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/income-statement/index.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AACpD,6EAAsE;AACtE,yEAAmE;AACnE,qEAA+D;AAC/D,2EAAqE;AACrE,yDAA2E;AAE9D,QAAA,QAAQ,GAAG,CAAC,kCAAe,EAAE,oDAAuB,EAAE,iDAAsB,CAAC,CAAA;AAC7E,QAAA,SAAS,GAAG,CAAC,6CAAoB,EAAE,mDAAuB,CAAC,CAAA;AAC3D,QAAA,WAAW,GAAG,CAAC,yDAAsC,CAAC,CAAA","sourcesContent":["import { IncomeStatement } from './income-statement'\nimport { IncomeStatementLineItem } from './income-statement-line-item'\nimport { IncomeStatementHistory } from './income-statement-history'\nimport { IncomeStatementQuery } from './income-statement-query'\nimport { IncomeStatementMutation } from './income-statement-mutation'\nimport { IncomeStatementHistoryEntitySubscriber } from './event-subscriber'\n\nexport const entities = [IncomeStatement, IncomeStatementLineItem, IncomeStatementHistory]\nexport const resolvers = [IncomeStatementQuery, IncomeStatementMutation]\nexport const subscribers = [IncomeStatementHistoryEntitySubscriber]\n"]}
@@ -2,9 +2,14 @@ export * from './income-statement/income-statement';
2
2
  export * from './financial-statement/financial-statement';
3
3
  export * from './accounting-category/accounting-category';
4
4
  export * from './transaction/transaction';
5
+ export * from './payment/payment';
5
6
  export * from './account/account';
6
- export declare const entities: (typeof import("./income-statement/income-statement").IncomeStatement | typeof import("./financial-statement/financial-statement").FinancialStatement | typeof import("./accounting-category/accounting-category").AccountingCategory | typeof import("./account/account").Account | typeof import("./transaction/transaction").Transaction | typeof import("./income-statement/income-statement-history").IncomeStatementHistory | typeof import("./financial-statement/financial-statement-history").FinancialStatementHistory | typeof import("./transaction/transaction-history").TransactionHistory | typeof import("./account/account-history").AccountHistory)[];
7
+ export * from './accounting-document/accounting-document';
8
+ export * from './fiscal-month/fiscal-month';
9
+ export * from './fiscal-quarter/fiscal-quarter';
10
+ export * from './fiscal-year/fiscal-year';
11
+ export declare const entities: (typeof import("./accounting-category/accounting-category").AccountingCategory | typeof import("./account/account").Account | typeof import("./financial-statement/financial-statement-line-item").FinancialStatementLineItem | typeof import("./financial-statement/financial-statement").FinancialStatement | typeof import("./income-statement/income-statement-line-item").IncomeStatementLineItem | typeof import("./income-statement/income-statement").IncomeStatement | typeof import("./payment/payment").Payment | typeof import("./transaction/transaction").Transaction | typeof import("./accounting-document/accounting-document").AccountingDocument | typeof import("./fiscal-year/fiscal-year").FiscalYear | typeof import("./transaction/transaction-history").TransactionHistory | typeof import("./payment/payment-history").PaymentHistory)[];
7
12
  export declare const subscribers: any[];
8
13
  export declare const schema: {
9
- resolverClasses: (typeof import("./income-statement/income-statement-query").IncomeStatementQuery | typeof import("./income-statement/income-statement-mutation").IncomeStatementMutation | typeof import("./financial-statement/financial-statement-query").FinancialStatementQuery | typeof import("./financial-statement/financial-statement-mutation").FinancialStatementMutation | typeof import("./accounting-category/accounting-category-query").AccountingCategoryQuery | typeof import("./accounting-category/accounting-category-mutation").AccountingCategoryMutation | typeof import("./transaction/transaction-query").TransactionQuery | typeof import("./transaction/transaction-mutation").TransactionMutation | typeof import("./account/account-query").AccountQuery | typeof import("./account/account-mutation").AccountMutation)[];
14
+ resolverClasses: (typeof import("./income-statement/income-statement-query").IncomeStatementQuery | typeof import("./income-statement/income-statement-mutation").IncomeStatementMutation | typeof import("./financial-statement/financial-statement-query").FinancialStatementQuery | typeof import("./financial-statement/financial-statement-mutation").FinancialStatementMutation | typeof import("./accounting-category/accounting-category-query").AccountingCategoryQuery | typeof import("./accounting-category/accounting-category-mutation").AccountingCategoryMutation | typeof import("./transaction/transaction-query").TransactionQuery | typeof import("./transaction/transaction-mutation").TransactionMutation | typeof import("./payment/payment-query").PaymentQuery | typeof import("./payment/payment-mutation").PaymentMutation | typeof import("./account/account-query").AccountQuery | typeof import("./account/account-mutation").AccountMutation | typeof import("./accounting-document/accounting-document-query").AccountingDocumentQuery | typeof import("./accounting-document/accounting-document-mutation").AccountingDocumentMutation | typeof import("./fiscal-month/fiscal-month-query").FiscalMonthQuery | typeof import("./fiscal-month/fiscal-month-mutation").FiscalMonthMutation | typeof import("./fiscal-quarter/fiscal-quarter-query").FiscalQuarterQuery | typeof import("./fiscal-quarter/fiscal-quarter-mutation").FiscalQuarterMutation | typeof import("./fiscal-year/fiscal-year-query").FiscalYearQuery | typeof import("./fiscal-year/fiscal-year-mutation").FiscalYearMutation)[];
10
15
  };
@@ -7,20 +7,35 @@ tslib_1.__exportStar(require("./income-statement/income-statement"), exports);
7
7
  tslib_1.__exportStar(require("./financial-statement/financial-statement"), exports);
8
8
  tslib_1.__exportStar(require("./accounting-category/accounting-category"), exports);
9
9
  tslib_1.__exportStar(require("./transaction/transaction"), exports);
10
+ tslib_1.__exportStar(require("./payment/payment"), exports);
10
11
  tslib_1.__exportStar(require("./account/account"), exports);
12
+ tslib_1.__exportStar(require("./accounting-document/accounting-document"), exports);
13
+ tslib_1.__exportStar(require("./fiscal-month/fiscal-month"), exports);
14
+ tslib_1.__exportStar(require("./fiscal-quarter/fiscal-quarter"), exports);
15
+ tslib_1.__exportStar(require("./fiscal-year/fiscal-year"), exports);
11
16
  /* IMPORT ENTITIES AND RESOLVERS */
12
17
  const income_statement_1 = require("./income-statement");
13
18
  const financial_statement_1 = require("./financial-statement");
14
19
  const accounting_category_1 = require("./accounting-category");
15
20
  const transaction_1 = require("./transaction");
21
+ const payment_1 = require("./payment");
16
22
  const account_1 = require("./account");
23
+ const accounting_document_1 = require("./accounting-document");
24
+ const fiscal_month_1 = require("./fiscal-month");
25
+ const fiscal_quarter_1 = require("./fiscal-quarter");
26
+ const fiscal_year_1 = require("./fiscal-year");
17
27
  exports.entities = [
18
28
  /* ENTITIES */
19
29
  ...income_statement_1.entities,
20
30
  ...financial_statement_1.entities,
21
31
  ...accounting_category_1.entities,
22
32
  ...transaction_1.entities,
23
- ...account_1.entities
33
+ ...account_1.entities,
34
+ ...accounting_document_1.entities,
35
+ ...payment_1.entities,
36
+ ...fiscal_month_1.entities,
37
+ ...fiscal_quarter_1.entities,
38
+ ...fiscal_year_1.entities
24
39
  ];
25
40
  exports.subscribers = [
26
41
  /* SUBSCRIBERS */
@@ -28,7 +43,13 @@ exports.subscribers = [
28
43
  ...financial_statement_1.subscribers,
29
44
  ...accounting_category_1.subscribers,
30
45
  ...transaction_1.subscribers,
31
- ...account_1.subscribers
46
+ ...payment_1.subscribers,
47
+ ...account_1.subscribers,
48
+ ...accounting_document_1.subscribers,
49
+ ...fiscal_year_1.subscribers,
50
+ ...fiscal_month_1.subscribers,
51
+ ...fiscal_quarter_1.subscribers,
52
+ ...fiscal_year_1.subscribers
32
53
  ];
33
54
  exports.schema = {
34
55
  resolverClasses: [
@@ -37,7 +58,12 @@ exports.schema = {
37
58
  ...financial_statement_1.resolvers,
38
59
  ...accounting_category_1.resolvers,
39
60
  ...transaction_1.resolvers,
40
- ...account_1.resolvers
61
+ ...payment_1.resolvers,
62
+ ...account_1.resolvers,
63
+ ...accounting_document_1.resolvers,
64
+ ...fiscal_month_1.resolvers,
65
+ ...fiscal_quarter_1.resolvers,
66
+ ...fiscal_year_1.resolvers
41
67
  ]
42
68
  };
43
69
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,8EAAmD;AACnD,oFAAyD;AACzD,oFAAyD;AACzD,oEAAyC;AACzC,4DAAiC;AAEjC,mCAAmC;AACnC,yDAI2B;AAC3B,+DAI8B;AAC9B,+DAI8B;AAC9B,+CAIsB;AACtB,uCAIkB;AAEL,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,2BAAuB;IAC1B,GAAG,8BAA0B;IAC7B,GAAG,8BAA0B;IAC7B,GAAG,sBAAmB;IACtB,GAAG,kBAAe;CACnB,CAAA;AAEY,QAAA,WAAW,GAAG;IACzB,iBAAiB;IACjB,GAAG,8BAA0B;IAC7B,GAAG,iCAA6B;IAChC,GAAG,iCAA6B;IAChC,GAAG,yBAAsB;IACzB,GAAG,qBAAkB;CACtB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,4BAAwB;QAC3B,GAAG,+BAA2B;QAC9B,GAAG,+BAA2B;QAC9B,GAAG,uBAAoB;QACvB,GAAG,mBAAgB;KACpB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './income-statement/income-statement'\nexport * from './financial-statement/financial-statement'\nexport * from './accounting-category/accounting-category'\nexport * from './transaction/transaction'\nexport * from './account/account'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport {\n entities as IncomeStatementEntities,\n resolvers as IncomeStatementResolvers,\n subscribers as IncomeStatementSubscribers\n} from './income-statement'\nimport {\n entities as FinancialStatementEntities,\n resolvers as FinancialStatementResolvers,\n subscribers as FinancialStatementSubscribers\n} from './financial-statement'\nimport {\n entities as AccountingCategoryEntities,\n resolvers as AccountingCategoryResolvers,\n subscribers as AccountingCategorySubscribers\n} from './accounting-category'\nimport {\n entities as TransactionEntities,\n resolvers as TransactionResolvers,\n subscribers as TransactionSubscribers\n} from './transaction'\nimport {\n entities as AccountEntities,\n resolvers as AccountResolvers,\n subscribers as AccountSubscribers\n} from './account'\n\nexport const entities = [\n /* ENTITIES */\n ...IncomeStatementEntities,\n ...FinancialStatementEntities,\n ...AccountingCategoryEntities,\n ...TransactionEntities,\n ...AccountEntities\n]\n\nexport const subscribers = [\n /* SUBSCRIBERS */\n ...IncomeStatementSubscribers,\n ...FinancialStatementSubscribers,\n ...AccountingCategorySubscribers,\n ...TransactionSubscribers,\n ...AccountSubscribers\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...IncomeStatementResolvers,\n ...FinancialStatementResolvers,\n ...AccountingCategoryResolvers,\n ...TransactionResolvers,\n ...AccountResolvers\n ]\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,8EAAmD;AACnD,oFAAyD;AACzD,oFAAyD;AACzD,oEAAyC;AACzC,4DAAiC;AACjC,4DAAiC;AACjC,oFAAyD;AACzD,sEAA2C;AAC3C,0EAA+C;AAC/C,oEAAyC;AAEzC,mCAAmC;AACnC,yDAI2B;AAC3B,+DAI8B;AAC9B,+DAI8B;AAC9B,+CAIsB;AACtB,uCAIkB;AAClB,uCAIkB;AAClB,+DAI8B;AAC9B,iDAIuB;AACvB,qDAIyB;AACzB,+CAIsB;AAET,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,2BAAuB;IAC1B,GAAG,8BAA0B;IAC7B,GAAG,8BAA0B;IAC7B,GAAG,sBAAmB;IACtB,GAAG,kBAAe;IAClB,GAAG,8BAA0B;IAC7B,GAAG,kBAAe;IAClB,GAAG,uBAAmB;IACtB,GAAG,yBAAqB;IACxB,GAAG,sBAAkB;CACtB,CAAA;AAEY,QAAA,WAAW,GAAG;IACzB,iBAAiB;IACjB,GAAG,8BAA0B;IAC7B,GAAG,iCAA6B;IAChC,GAAG,iCAA6B;IAChC,GAAG,yBAAsB;IACzB,GAAG,qBAAkB;IACrB,GAAG,qBAAkB;IACrB,GAAG,iCAA6B;IAChC,GAAG,yBAAqB;IACxB,GAAG,0BAAsB;IACzB,GAAG,4BAAwB;IAC3B,GAAG,yBAAqB;CACzB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,4BAAwB;QAC3B,GAAG,+BAA2B;QAC9B,GAAG,+BAA2B;QAC9B,GAAG,uBAAoB;QACvB,GAAG,mBAAgB;QACnB,GAAG,mBAAgB;QACnB,GAAG,+BAA2B;QAC9B,GAAG,wBAAoB;QACvB,GAAG,0BAAsB;QACzB,GAAG,uBAAmB;KACvB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './income-statement/income-statement'\nexport * from './financial-statement/financial-statement'\nexport * from './accounting-category/accounting-category'\nexport * from './transaction/transaction'\nexport * from './payment/payment'\nexport * from './account/account'\nexport * from './accounting-document/accounting-document'\nexport * from './fiscal-month/fiscal-month'\nexport * from './fiscal-quarter/fiscal-quarter'\nexport * from './fiscal-year/fiscal-year'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport {\n entities as IncomeStatementEntities,\n resolvers as IncomeStatementResolvers,\n subscribers as IncomeStatementSubscribers\n} from './income-statement'\nimport {\n entities as FinancialStatementEntities,\n resolvers as FinancialStatementResolvers,\n subscribers as FinancialStatementSubscribers\n} from './financial-statement'\nimport {\n entities as AccountingCategoryEntities,\n resolvers as AccountingCategoryResolvers,\n subscribers as AccountingCategorySubscribers\n} from './accounting-category'\nimport {\n entities as TransactionEntities,\n resolvers as TransactionResolvers,\n subscribers as TransactionSubscribers\n} from './transaction'\nimport {\n entities as PaymentEntities,\n resolvers as PaymentResolvers,\n subscribers as PaymentSubscribers\n} from './payment'\nimport {\n entities as AccountEntities,\n resolvers as AccountResolvers,\n subscribers as AccountSubscribers\n} from './account'\nimport {\n entities as AccountingDocumentEntities,\n resolvers as AccountingDocumentResolvers,\n subscribers as AccountingDocumentSubscribers\n} from './accounting-document'\nimport {\n entities as FiscalMonthEntities,\n resolvers as FiscalMonthResolvers,\n subscribers as FiscalMonthSubscribers\n} from './fiscal-month'\nimport {\n entities as FiscalQuarterEntities,\n resolvers as FiscalQuarterResolvers,\n subscribers as FiscalQuarterSubscribers\n} from './fiscal-quarter'\nimport {\n entities as FiscalYearEntities,\n resolvers as FiscalYearResolvers,\n subscribers as FiscalYearSubscribers\n} from './fiscal-year'\n\nexport const entities = [\n /* ENTITIES */\n ...IncomeStatementEntities,\n ...FinancialStatementEntities,\n ...AccountingCategoryEntities,\n ...TransactionEntities,\n ...AccountEntities,\n ...AccountingDocumentEntities,\n ...PaymentEntities,\n ...FiscalMonthEntities,\n ...FiscalQuarterEntities,\n ...FiscalYearEntities\n]\n\nexport const subscribers = [\n /* SUBSCRIBERS */\n ...IncomeStatementSubscribers,\n ...FinancialStatementSubscribers,\n ...AccountingCategorySubscribers,\n ...TransactionSubscribers,\n ...PaymentSubscribers,\n ...AccountSubscribers,\n ...AccountingDocumentSubscribers,\n ...FiscalYearSubscribers,\n ...FiscalMonthSubscribers,\n ...FiscalQuarterSubscribers,\n ...FiscalYearSubscribers\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...IncomeStatementResolvers,\n ...FinancialStatementResolvers,\n ...AccountingCategoryResolvers,\n ...TransactionResolvers,\n ...PaymentResolvers,\n ...AccountResolvers,\n ...AccountingDocumentResolvers,\n ...FiscalMonthResolvers,\n ...FiscalQuarterResolvers,\n ...FiscalYearResolvers\n ]\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { HistoryEntitySubscriber } from '@operato/typeorm-history';
2
+ import { Payment } from './payment';
3
+ import { PaymentHistory } from './payment-history';
4
+ export declare class PaymentHistoryEntitySubscriber extends HistoryEntitySubscriber<Payment, PaymentHistory> {
5
+ get entity(): typeof Payment;
6
+ get historyEntity(): typeof PaymentHistory;
7
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentHistoryEntitySubscriber = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const typeorm_history_1 = require("@operato/typeorm-history");
7
+ const payment_1 = require("./payment");
8
+ const payment_history_1 = require("./payment-history");
9
+ let PaymentHistoryEntitySubscriber = class PaymentHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
10
+ get entity() {
11
+ return payment_1.Payment;
12
+ }
13
+ get historyEntity() {
14
+ return payment_history_1.PaymentHistory;
15
+ }
16
+ };
17
+ exports.PaymentHistoryEntitySubscriber = PaymentHistoryEntitySubscriber;
18
+ exports.PaymentHistoryEntitySubscriber = PaymentHistoryEntitySubscriber = tslib_1.__decorate([
19
+ (0, typeorm_1.EventSubscriber)()
20
+ ], PaymentHistoryEntitySubscriber);
21
+ //# sourceMappingURL=event-subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/payment/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,uCAAmC;AACnC,uDAAkD;AAG3C,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,yCAAgD;IAClG,IAAW,MAAM;QACf,OAAO,iBAAO,CAAA;IAChB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,gCAAc,CAAA;IACvB,CAAC;CACF,CAAA;AARY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,yBAAe,GAAE;GACL,8BAA8B,CAQ1C","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { Payment } from './payment'\nimport { PaymentHistory } from './payment-history'\n\n@EventSubscriber()\nexport class PaymentHistoryEntitySubscriber extends HistoryEntitySubscriber<Payment, PaymentHistory> {\n public get entity() {\n return Payment\n }\n\n public get historyEntity() {\n return PaymentHistory\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { Payment } from './payment';
2
+ import { PaymentHistory } from './payment-history';
3
+ import { PaymentHistoryEntitySubscriber } from './event-subscriber';
4
+ import { PaymentQuery } from './payment-query';
5
+ import { PaymentMutation } from './payment-mutation';
6
+ export declare const entities: (typeof Payment | typeof PaymentHistory)[];
7
+ export declare const resolvers: (typeof PaymentQuery | typeof PaymentMutation)[];
8
+ export declare const subscribers: (typeof PaymentHistoryEntitySubscriber)[];