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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. package/client/bootstrap.ts +10 -1
  2. package/client/components/accounting-category-selector.ts +136 -0
  3. package/client/components/accounting-category-view.ts +75 -0
  4. package/client/grist-editors/grist-editor-accounting-category-object.ts +83 -0
  5. package/client/grist-editors/grist-renderer-accounting-category-object.ts +13 -0
  6. package/client/pages/account/account-list-page.ts +33 -2
  7. package/client/pages/accounting-category/accounting-category-list-page.ts +31 -1
  8. package/client/pages/accounting-category/accounting-category-tree-page.ts +338 -0
  9. package/client/pages/accounting-document/accounting-document-importer.ts +90 -0
  10. package/client/pages/accounting-document/accounting-document-list-page.ts +398 -0
  11. package/client/pages/{ledger/ledger-importer.ts → payment/payment-importer.ts} +10 -17
  12. package/client/pages/{ledger/ledger-list-page.ts → payment/payment-list-page.ts} +118 -57
  13. package/client/route.ts +0 -4
  14. package/client/types/accounting-category.ts +23 -0
  15. package/client/types/index.ts +1 -0
  16. package/dist-client/bootstrap.js +7 -1
  17. package/dist-client/bootstrap.js.map +1 -1
  18. package/dist-client/components/accounting-category-selector.d.ts +16 -0
  19. package/dist-client/components/accounting-category-selector.js +134 -0
  20. package/dist-client/components/accounting-category-selector.js.map +1 -0
  21. package/dist-client/components/accounting-category-view.d.ts +14 -0
  22. package/dist-client/components/accounting-category-view.js +81 -0
  23. package/dist-client/components/accounting-category-view.js.map +1 -0
  24. package/dist-client/grist-editors/grist-editor-accounting-category-object.d.ts +11 -0
  25. package/dist-client/grist-editors/grist-editor-accounting-category-object.js +71 -0
  26. package/dist-client/grist-editors/grist-editor-accounting-category-object.js.map +1 -0
  27. package/dist-client/grist-editors/grist-renderer-accounting-category-object.d.ts +2 -0
  28. package/dist-client/grist-editors/grist-renderer-accounting-category-object.js +9 -0
  29. package/dist-client/grist-editors/grist-renderer-accounting-category-object.js.map +1 -0
  30. package/dist-client/pages/account/account-list-page.js +33 -2
  31. package/dist-client/pages/account/account-list-page.js.map +1 -1
  32. package/dist-client/pages/accounting-category/accounting-category-list-page.js +31 -1
  33. package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -1
  34. package/dist-client/pages/accounting-category/accounting-category-tree-page.d.ts +46 -0
  35. package/dist-client/pages/accounting-category/accounting-category-tree-page.js +329 -0
  36. package/dist-client/pages/accounting-category/accounting-category-tree-page.js.map +1 -0
  37. package/dist-client/pages/accounting-document/accounting-document-importer.d.ts +23 -0
  38. package/dist-client/pages/accounting-document/accounting-document-importer.js +93 -0
  39. package/dist-client/pages/accounting-document/accounting-document-importer.js.map +1 -0
  40. package/dist-client/pages/accounting-document/accounting-document-list-page.d.ts +66 -0
  41. package/dist-client/pages/accounting-document/accounting-document-list-page.js +370 -0
  42. package/dist-client/pages/accounting-document/accounting-document-list-page.js.map +1 -0
  43. package/dist-client/pages/{ledger/ledger-importer.d.ts → payment/payment-importer.d.ts} +3 -2
  44. package/dist-client/pages/{ledger/ledger-importer.js → payment/payment-importer.js} +14 -21
  45. package/dist-client/pages/payment/payment-importer.js.map +1 -0
  46. package/dist-client/pages/{ledger/ledger-list-page.d.ts → payment/payment-list-page.d.ts} +12 -8
  47. package/dist-client/pages/{ledger/ledger-list-page.js → payment/payment-list-page.js} +114 -67
  48. package/dist-client/pages/payment/payment-list-page.js.map +1 -0
  49. package/dist-client/route.d.ts +1 -1
  50. package/dist-client/route.js +0 -3
  51. package/dist-client/route.js.map +1 -1
  52. package/dist-client/tsconfig.tsbuildinfo +1 -1
  53. package/dist-client/types/accounting-category.d.ts +16 -0
  54. package/dist-client/types/accounting-category.js +3 -0
  55. package/dist-client/types/accounting-category.js.map +1 -0
  56. package/dist-client/types/index.d.ts +1 -0
  57. package/dist-client/types/index.js +2 -0
  58. package/dist-client/types/index.js.map +1 -0
  59. package/dist-server/activities/activity-book.js +31 -19
  60. package/dist-server/activities/activity-book.js.map +1 -1
  61. package/dist-server/controllers/summary-statements.js +13 -7
  62. package/dist-server/controllers/summary-statements.js.map +1 -1
  63. package/dist-server/index.d.ts +1 -0
  64. package/dist-server/index.js +1 -0
  65. package/dist-server/index.js.map +1 -1
  66. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js +3 -3
  67. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js.map +1 -1
  68. package/dist-server/migrations/1725201467183-seed-accounts.js +31 -31
  69. package/dist-server/migrations/1725201467183-seed-accounts.js.map +1 -1
  70. package/dist-server/routes.d.ts +0 -1
  71. package/dist-server/routes.js +0 -1
  72. package/dist-server/routes.js.map +1 -1
  73. package/dist-server/service/account/account-history.d.ts +4 -1
  74. package/dist-server/service/account/account-history.js +14 -4
  75. package/dist-server/service/account/account-history.js.map +1 -1
  76. package/dist-server/service/account/account-mutation.js +13 -9
  77. package/dist-server/service/account/account-mutation.js.map +1 -1
  78. package/dist-server/service/account/account-query.js +2 -0
  79. package/dist-server/service/account/account-query.js.map +1 -1
  80. package/dist-server/service/account/account.d.ts +1 -1
  81. package/dist-server/service/account/account.js +15 -4
  82. package/dist-server/service/account/account.js.map +1 -1
  83. package/dist-server/service/account/index.d.ts +1 -2
  84. package/dist-server/service/accounting-category/accounting-category-history.d.ts +26 -0
  85. package/dist-server/service/accounting-category/accounting-category-history.js +136 -0
  86. package/dist-server/service/accounting-category/accounting-category-history.js.map +1 -0
  87. package/dist-server/service/accounting-category/accounting-category-mutation.js +12 -8
  88. package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -1
  89. package/dist-server/service/accounting-category/accounting-category-query.d.ts +1 -0
  90. package/dist-server/service/accounting-category/accounting-category-query.js +23 -0
  91. package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
  92. package/dist-server/service/accounting-category/accounting-category.d.ts +1 -0
  93. package/dist-server/service/accounting-category/accounting-category.js +14 -3
  94. package/dist-server/service/accounting-category/accounting-category.js.map +1 -1
  95. package/dist-server/service/accounting-category/event-subscriber.d.ts +7 -0
  96. package/dist-server/service/accounting-category/event-subscriber.js +21 -0
  97. package/dist-server/service/accounting-category/event-subscriber.js.map +1 -0
  98. package/dist-server/service/accounting-category/index.d.ts +2 -1
  99. package/dist-server/service/accounting-category/index.js +4 -2
  100. package/dist-server/service/accounting-category/index.js.map +1 -1
  101. package/dist-server/service/accounting-document/accounting-document-history.d.ts +26 -0
  102. package/dist-server/service/accounting-document/accounting-document-history.js +129 -0
  103. package/dist-server/service/accounting-document/accounting-document-history.js.map +1 -0
  104. package/dist-server/service/accounting-document/accounting-document-mutation.d.ts +10 -0
  105. package/dist-server/service/accounting-document/accounting-document-mutation.js +128 -0
  106. package/dist-server/service/accounting-document/accounting-document-mutation.js.map +1 -0
  107. package/dist-server/service/accounting-document/accounting-document-query.d.ts +11 -0
  108. package/dist-server/service/accounting-document/accounting-document-query.js +79 -0
  109. package/dist-server/service/accounting-document/accounting-document-query.js.map +1 -0
  110. package/dist-server/service/accounting-document/accounting-document-type.d.ts +20 -0
  111. package/dist-server/service/accounting-document/accounting-document-type.js +74 -0
  112. package/dist-server/service/accounting-document/accounting-document-type.js.map +1 -0
  113. package/dist-server/service/accounting-document/accounting-document.d.ts +21 -0
  114. package/dist-server/service/accounting-document/accounting-document.js +104 -0
  115. package/dist-server/service/accounting-document/accounting-document.js.map +1 -0
  116. package/dist-server/service/accounting-document/event-subscriber.d.ts +7 -0
  117. package/dist-server/service/accounting-document/event-subscriber.js +21 -0
  118. package/dist-server/service/accounting-document/event-subscriber.js.map +1 -0
  119. package/dist-server/service/accounting-document/index.d.ts +7 -0
  120. package/dist-server/service/accounting-document/index.js +12 -0
  121. package/dist-server/service/accounting-document/index.js.map +1 -0
  122. package/dist-server/service/financial-statement/financial-statement-history.d.ts +9 -6
  123. package/dist-server/service/financial-statement/financial-statement-history.js +30 -20
  124. package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
  125. package/dist-server/service/financial-statement/financial-statement-line-item.d.ts +19 -0
  126. package/dist-server/service/financial-statement/financial-statement-line-item.js +94 -0
  127. package/dist-server/service/financial-statement/financial-statement-line-item.js.map +1 -0
  128. package/dist-server/service/financial-statement/financial-statement-mutation.js +12 -8
  129. package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -1
  130. package/dist-server/service/financial-statement/financial-statement-query.js +2 -0
  131. package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
  132. package/dist-server/service/financial-statement/financial-statement.d.ts +2 -0
  133. package/dist-server/service/financial-statement/financial-statement.js +45 -24
  134. package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
  135. package/dist-server/service/financial-statement/index.d.ts +2 -2
  136. package/dist-server/service/financial-statement/index.js +2 -1
  137. package/dist-server/service/financial-statement/index.js.map +1 -1
  138. package/dist-server/service/fiscal-month/fiscal-month-mutation.js +6 -0
  139. package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -1
  140. package/dist-server/service/fiscal-month/fiscal-month-query.js +2 -0
  141. package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -1
  142. package/dist-server/service/fiscal-month/fiscal-month.js +1 -1
  143. package/dist-server/service/fiscal-month/fiscal-month.js.map +1 -1
  144. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +6 -0
  145. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -1
  146. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +2 -0
  147. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -1
  148. package/dist-server/service/fiscal-quarter/fiscal-quarter.js +1 -1
  149. package/dist-server/service/fiscal-quarter/fiscal-quarter.js.map +1 -1
  150. package/dist-server/service/fiscal-year/fiscal-year-mutation.js +6 -0
  151. package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -1
  152. package/dist-server/service/fiscal-year/fiscal-year-query.js +2 -0
  153. package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -1
  154. package/dist-server/service/fiscal-year/fiscal-year.js +1 -1
  155. package/dist-server/service/fiscal-year/fiscal-year.js.map +1 -1
  156. package/dist-server/service/income-statement/income-statement-history.d.ts +9 -5
  157. package/dist-server/service/income-statement/income-statement-history.js +35 -20
  158. package/dist-server/service/income-statement/income-statement-history.js.map +1 -1
  159. package/dist-server/service/income-statement/income-statement-line-item.d.ts +19 -0
  160. package/dist-server/service/income-statement/income-statement-line-item.js +96 -0
  161. package/dist-server/service/income-statement/income-statement-line-item.js.map +1 -0
  162. package/dist-server/service/income-statement/income-statement-mutation.js +12 -8
  163. package/dist-server/service/income-statement/income-statement-mutation.js.map +1 -1
  164. package/dist-server/service/income-statement/income-statement-query.js +2 -0
  165. package/dist-server/service/income-statement/income-statement-query.js.map +1 -1
  166. package/dist-server/service/income-statement/income-statement.d.ts +2 -0
  167. package/dist-server/service/income-statement/income-statement.js +46 -26
  168. package/dist-server/service/income-statement/income-statement.js.map +1 -1
  169. package/dist-server/service/income-statement/index.d.ts +2 -2
  170. package/dist-server/service/income-statement/index.js +2 -1
  171. package/dist-server/service/income-statement/index.js.map +1 -1
  172. package/dist-server/service/index.d.ts +4 -2
  173. package/dist-server/service/index.js +10 -0
  174. package/dist-server/service/index.js.map +1 -1
  175. package/dist-server/service/payment/event-subscriber.d.ts +7 -0
  176. package/dist-server/service/payment/event-subscriber.js +21 -0
  177. package/dist-server/service/payment/event-subscriber.js.map +1 -0
  178. package/dist-server/service/payment/index.d.ts +8 -0
  179. package/dist-server/service/payment/index.js +12 -0
  180. package/dist-server/service/payment/index.js.map +1 -0
  181. package/dist-server/service/payment/payment-history.d.ts +30 -0
  182. package/dist-server/service/payment/payment-history.js +143 -0
  183. package/dist-server/service/payment/payment-history.js.map +1 -0
  184. package/dist-server/service/payment/payment-mutation.d.ts +10 -0
  185. package/dist-server/service/payment/payment-mutation.js +134 -0
  186. package/dist-server/service/payment/payment-mutation.js.map +1 -0
  187. package/dist-server/service/payment/payment-query.d.ts +11 -0
  188. package/dist-server/service/payment/payment-query.js +81 -0
  189. package/dist-server/service/payment/payment-query.js.map +1 -0
  190. package/dist-server/service/payment/payment-type.d.ts +24 -0
  191. package/dist-server/service/payment/payment-type.js +90 -0
  192. package/dist-server/service/payment/payment-type.js.map +1 -0
  193. package/dist-server/service/payment/payment.d.ts +30 -0
  194. package/dist-server/service/payment/payment.js +146 -0
  195. package/dist-server/service/payment/payment.js.map +1 -0
  196. package/dist-server/service/transaction/index.d.ts +2 -1
  197. package/dist-server/service/transaction/transaction-history.d.ts +6 -2
  198. package/dist-server/service/transaction/transaction-history.js +28 -9
  199. package/dist-server/service/transaction/transaction-history.js.map +1 -1
  200. package/dist-server/service/transaction/transaction-mutation.js +13 -9
  201. package/dist-server/service/transaction/transaction-mutation.js.map +1 -1
  202. package/dist-server/service/transaction/transaction-query.js +2 -0
  203. package/dist-server/service/transaction/transaction-query.js.map +1 -1
  204. package/dist-server/service/transaction/transaction.d.ts +28 -6
  205. package/dist-server/service/transaction/transaction.js +119 -31
  206. package/dist-server/service/transaction/transaction.js.map +1 -1
  207. package/dist-server/tsconfig.tsbuildinfo +1 -1
  208. package/helps/accounting/accounting-document.md +160 -0
  209. package/helps/accounting/contract.md +160 -0
  210. package/helps/accounting/payment.md +160 -0
  211. package/package.json +5 -5
  212. package/server/activities/activity-book.ts +31 -19
  213. package/server/controllers/summary-statements.ts +13 -7
  214. package/server/index.ts +1 -0
  215. package/server/migrations/1725200507196-seed-fiscal-entities.ts +3 -3
  216. package/server/migrations/1725201467183-seed-accounts.ts +31 -31
  217. package/server/routes.ts +0 -2
  218. package/server/service/account/account-history.ts +14 -6
  219. package/server/service/account/account-mutation.ts +13 -10
  220. package/server/service/account/account-query.ts +2 -0
  221. package/server/service/account/account.ts +15 -4
  222. package/server/service/accounting-category/accounting-category-history.ts +123 -0
  223. package/server/service/accounting-category/accounting-category-mutation.ts +12 -9
  224. package/server/service/accounting-category/accounting-category-query.ts +23 -0
  225. package/server/service/accounting-category/accounting-category.ts +14 -3
  226. package/server/service/accounting-category/event-subscriber.ts +20 -0
  227. package/server/service/accounting-category/index.ts +4 -2
  228. package/server/service/accounting-document/accounting-document-history.ts +117 -0
  229. package/server/service/accounting-document/accounting-document-mutation.ts +137 -0
  230. package/server/service/accounting-document/accounting-document-query.ts +48 -0
  231. package/server/service/accounting-document/accounting-document-type.ts +52 -0
  232. package/server/service/accounting-document/accounting-document.ts +93 -0
  233. package/server/service/accounting-document/event-subscriber.ts +17 -0
  234. package/server/service/accounting-document/index.ts +9 -0
  235. package/server/service/financial-statement/financial-statement-history.ts +27 -18
  236. package/server/service/financial-statement/financial-statement-line-item.ts +82 -0
  237. package/server/service/financial-statement/financial-statement-mutation.ts +12 -9
  238. package/server/service/financial-statement/financial-statement-query.ts +2 -0
  239. package/server/service/financial-statement/financial-statement.ts +52 -36
  240. package/server/service/financial-statement/index.ts +2 -1
  241. package/server/service/fiscal-month/fiscal-month-mutation.ts +10 -2
  242. package/server/service/fiscal-month/fiscal-month-query.ts +3 -1
  243. package/server/service/fiscal-month/fiscal-month.ts +1 -1
  244. package/server/service/fiscal-quarter/fiscal-quarter-mutation.ts +14 -3
  245. package/server/service/fiscal-quarter/fiscal-quarter-query.ts +2 -0
  246. package/server/service/fiscal-quarter/fiscal-quarter.ts +1 -1
  247. package/server/service/fiscal-year/fiscal-year-mutation.ts +10 -2
  248. package/server/service/fiscal-year/fiscal-year-query.ts +2 -0
  249. package/server/service/fiscal-year/fiscal-year.ts +1 -1
  250. package/server/service/income-statement/income-statement-history.ts +30 -17
  251. package/server/service/income-statement/income-statement-line-item.ts +84 -0
  252. package/server/service/income-statement/income-statement-mutation.ts +12 -10
  253. package/server/service/income-statement/income-statement-query.ts +2 -0
  254. package/server/service/income-statement/income-statement.ts +54 -39
  255. package/server/service/income-statement/index.ts +2 -1
  256. package/server/service/index.ts +18 -0
  257. package/server/service/payment/event-subscriber.ts +17 -0
  258. package/server/service/payment/index.ts +9 -0
  259. package/server/service/payment/payment-history.ts +126 -0
  260. package/server/service/payment/payment-mutation.ts +139 -0
  261. package/server/service/payment/payment-query.ts +50 -0
  262. package/server/service/payment/payment-type.ts +64 -0
  263. package/server/service/payment/payment.ts +123 -0
  264. package/server/service/transaction/transaction-history.ts +24 -8
  265. package/server/service/transaction/transaction-mutation.ts +13 -10
  266. package/server/service/transaction/transaction-query.ts +2 -0
  267. package/server/service/transaction/transaction.ts +130 -34
  268. package/things-factory.config.js +0 -1
  269. package/translations/en.json +9 -1
  270. package/translations/ja.json +9 -1
  271. package/translations/ko.json +9 -1
  272. package/translations/ms.json +9 -1
  273. package/translations/zh.json +9 -1
  274. package/client/pages/main.ts +0 -24
  275. package/dist-client/pages/ledger/ledger-importer.js.map +0 -1
  276. package/dist-client/pages/ledger/ledger-list-page.js.map +0 -1
  277. package/dist-client/pages/main.d.ts +0 -1
  278. package/dist-client/pages/main.js +0 -27
  279. package/dist-client/pages/main.js.map +0 -1
@@ -1,23 +1,49 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Transaction = exports.TransactionType = void 0;
3
+ exports.Transaction = exports.TransactionStatus = exports.TransactionCategory = exports.TransactionType = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const typeorm_1 = require("typeorm");
6
6
  const type_graphql_1 = require("type-graphql");
7
7
  const shell_1 = require("@things-factory/shell");
8
8
  const auth_base_1 = require("@things-factory/auth-base");
9
9
  const account_1 = require("../account/account");
10
+ const payment_1 = require("../payment/payment");
11
+ const accounting_document_1 = require("../accounting-document/accounting-document");
10
12
  var TransactionType;
11
13
  (function (TransactionType) {
12
- TransactionType[TransactionType["Income"] = 0] = "Income";
13
- TransactionType[TransactionType["Expense"] = 1] = "Expense";
14
+ TransactionType[TransactionType["SalesIncome"] = 0] = "SalesIncome";
15
+ TransactionType[TransactionType["PurchaseExpense"] = 1] = "PurchaseExpense";
14
16
  TransactionType[TransactionType["Asset"] = 2] = "Asset";
15
17
  TransactionType[TransactionType["Liability"] = 3] = "Liability";
16
18
  TransactionType[TransactionType["Equity"] = 4] = "Equity";
19
+ TransactionType[TransactionType["OtherIncome"] = 5] = "OtherIncome";
20
+ TransactionType[TransactionType["OtherExpense"] = 6] = "OtherExpense"; // 기타 비용
17
21
  })(TransactionType || (exports.TransactionType = TransactionType = {}));
18
22
  (0, type_graphql_1.registerEnumType)(TransactionType, {
19
23
  name: 'TransactionType',
20
- description: 'Type enumeration of a transaction'
24
+ description: 'Type enumeration of a transaction, indicating the nature of the transaction (e.g., Sales, Purchase, etc.)'
25
+ });
26
+ var TransactionCategory;
27
+ (function (TransactionCategory) {
28
+ TransactionCategory["Confirmed"] = "Confirmed";
29
+ TransactionCategory["Forecast"] = "Forecast"; // 예상 전망 건
30
+ })(TransactionCategory || (exports.TransactionCategory = TransactionCategory = {}));
31
+ (0, type_graphql_1.registerEnumType)(TransactionCategory, {
32
+ name: 'TransactionCategory',
33
+ description: 'Category of a transaction, indicating whether it is confirmed or a forecast'
34
+ });
35
+ var TransactionStatus;
36
+ (function (TransactionStatus) {
37
+ TransactionStatus["Pending"] = "Pending";
38
+ TransactionStatus["Paid"] = "Paid";
39
+ TransactionStatus["PartiallyPaid"] = "PartiallyPaid";
40
+ TransactionStatus["Cancelled"] = "Cancelled";
41
+ TransactionStatus["Delayed"] = "Delayed";
42
+ TransactionStatus["ForecastFailed"] = "ForecastFailed"; // 전망이 틀린 경우
43
+ })(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
44
+ (0, type_graphql_1.registerEnumType)(TransactionStatus, {
45
+ name: 'TransactionStatus',
46
+ description: 'Status of a transaction, indicating its processing state (e.g., Paid, Delayed, etc.)'
21
47
  });
22
48
  let Transaction = class Transaction {
23
49
  constructor() {
@@ -28,17 +54,17 @@ let Transaction = class Transaction {
28
54
  exports.Transaction = Transaction;
29
55
  tslib_1.__decorate([
30
56
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
31
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
57
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for the transaction' }),
32
58
  tslib_1.__metadata("design:type", String)
33
59
  ], Transaction.prototype, "id", void 0);
34
60
  tslib_1.__decorate([
35
61
  (0, typeorm_1.VersionColumn)(),
36
- (0, type_graphql_1.Field)({ nullable: true }),
62
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Version number for optimistic locking' }),
37
63
  tslib_1.__metadata("design:type", Number)
38
64
  ], Transaction.prototype, "version", void 0);
39
65
  tslib_1.__decorate([
40
66
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
41
- (0, type_graphql_1.Field)({ nullable: true }),
67
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The domain in which this transaction belongs' }),
42
68
  tslib_1.__metadata("design:type", shell_1.Domain)
43
69
  ], Transaction.prototype, "domain", void 0);
44
70
  tslib_1.__decorate([
@@ -47,37 +73,63 @@ tslib_1.__decorate([
47
73
  ], Transaction.prototype, "domainId", void 0);
48
74
  tslib_1.__decorate([
49
75
  (0, typeorm_1.Column)(),
50
- (0, type_graphql_1.Field)({ nullable: true }),
76
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Name or title of the transaction' }),
51
77
  tslib_1.__metadata("design:type", String)
52
78
  ], Transaction.prototype, "name", void 0);
53
79
  tslib_1.__decorate([
54
80
  (0, typeorm_1.Column)({ nullable: true }),
55
- (0, type_graphql_1.Field)({ nullable: true }),
81
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Detailed description of the transaction' }),
56
82
  tslib_1.__metadata("design:type", String)
57
83
  ], Transaction.prototype, "description", void 0);
58
84
  tslib_1.__decorate([
59
85
  (0, typeorm_1.Column)({ nullable: true }),
60
- (0, type_graphql_1.Field)({ nullable: true }),
86
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Currency in which the transaction is denominated' }),
61
87
  tslib_1.__metadata("design:type", String)
62
88
  ], Transaction.prototype, "currency", void 0);
63
89
  tslib_1.__decorate([
64
90
  (0, typeorm_1.Column)({ nullable: true }),
65
- (0, type_graphql_1.Field)({ nullable: true }),
91
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Amount involved in the transaction' }),
66
92
  tslib_1.__metadata("design:type", Number)
67
93
  ], Transaction.prototype, "amount", void 0);
68
94
  tslib_1.__decorate([
69
95
  (0, typeorm_1.Column)({ nullable: true }),
70
- (0, type_graphql_1.Field)({ nullable: true }),
96
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates whether the transaction is currently active or not' }),
71
97
  tslib_1.__metadata("design:type", Boolean)
72
98
  ], Transaction.prototype, "active", void 0);
73
99
  tslib_1.__decorate([
74
100
  (0, typeorm_1.Column)({ nullable: true }),
75
- (0, type_graphql_1.Field)({ nullable: true }),
101
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Type of the transaction (e.g., SalesIncome, PurchaseExpense)' }),
76
102
  tslib_1.__metadata("design:type", Number)
77
103
  ], Transaction.prototype, "type", void 0);
104
+ tslib_1.__decorate([
105
+ (0, typeorm_1.Column)({ nullable: false }),
106
+ (0, type_graphql_1.Field)(type => TransactionCategory, {
107
+ nullable: false,
108
+ description: 'Category of the transaction (Confirmed or Forecast)'
109
+ }),
110
+ tslib_1.__metadata("design:type", String)
111
+ ], Transaction.prototype, "category", void 0);
112
+ tslib_1.__decorate([
113
+ (0, typeorm_1.Column)({ nullable: false }),
114
+ (0, type_graphql_1.Field)(type => TransactionStatus, {
115
+ nullable: false,
116
+ description: 'Current status of the transaction (e.g., Paid, Delayed)'
117
+ }),
118
+ tslib_1.__metadata("design:type", String)
119
+ ], Transaction.prototype, "status", void 0);
120
+ tslib_1.__decorate([
121
+ (0, typeorm_1.Column)({ nullable: true }),
122
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The probability of the forecast being realized (0 to 100)' }),
123
+ tslib_1.__metadata("design:type", Number)
124
+ ], Transaction.prototype, "probability", void 0);
125
+ tslib_1.__decorate([
126
+ (0, typeorm_1.Column)({ nullable: true }),
127
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Additional notes or comments about the forecast' }),
128
+ tslib_1.__metadata("design:type", String)
129
+ ], Transaction.prototype, "forecastNotes", void 0);
78
130
  tslib_1.__decorate([
79
131
  (0, typeorm_1.ManyToOne)(type => account_1.Account),
80
- (0, type_graphql_1.Field)({ nullable: true }),
132
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Associated account for this transaction' }),
81
133
  tslib_1.__metadata("design:type", account_1.Account)
82
134
  ], Transaction.prototype, "account", void 0);
83
135
  tslib_1.__decorate([
@@ -86,43 +138,55 @@ tslib_1.__decorate([
86
138
  ], Transaction.prototype, "accountId", void 0);
87
139
  tslib_1.__decorate([
88
140
  (0, typeorm_1.Column)({ nullable: true }),
89
- (0, type_graphql_1.Field)({ nullable: true, description: 'fiscal year' }),
141
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal year in which the transaction occurs' }),
90
142
  tslib_1.__metadata("design:type", Number)
91
143
  ], Transaction.prototype, "year", void 0);
92
144
  tslib_1.__decorate([
93
145
  (0, typeorm_1.Column)({ nullable: true }),
94
- (0, type_graphql_1.Field)({ nullable: true, description: 'fiscal quarter' }),
146
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal quarter in which the transaction occurs' }),
95
147
  tslib_1.__metadata("design:type", Number)
96
148
  ], Transaction.prototype, "quarter", void 0);
97
149
  tslib_1.__decorate([
98
150
  (0, typeorm_1.Column)({ nullable: true }),
99
- (0, type_graphql_1.Field)({ nullable: true, description: 'fiscal month' }),
151
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal month in which the transaction occurs' }),
100
152
  tslib_1.__metadata("design:type", Number)
101
153
  ], Transaction.prototype, "month", void 0);
102
154
  tslib_1.__decorate([
103
- (0, typeorm_1.Column)({ type: 'timestamp', nullable: false }),
104
- (0, type_graphql_1.Field)({ nullable: false, description: 'The exact date and time the transaction occurred' }),
105
- tslib_1.__metadata("design:type", Date // 트랜잭션이 발생한 실제 시점(날짜와 시간)
106
- )
107
- ], Transaction.prototype, "occurredAt", void 0);
155
+ (0, typeorm_1.Column)({ nullable: false }),
156
+ (0, type_graphql_1.Field)({ nullable: false, description: 'The date the transaction occurs or is scheduled (in string format)' }),
157
+ tslib_1.__metadata("design:type", String)
158
+ ], Transaction.prototype, "transactionDate", void 0);
159
+ tslib_1.__decorate([
160
+ (0, typeorm_1.OneToMany)(type => payment_1.Payment, payment => payment.transaction),
161
+ (0, type_graphql_1.Field)(type => [payment_1.Payment], { nullable: true, description: 'List of payments associated with this transaction' }),
162
+ tslib_1.__metadata("design:type", Array)
163
+ ], Transaction.prototype, "payments", void 0);
164
+ tslib_1.__decorate([
165
+ (0, typeorm_1.OneToMany)(type => accounting_document_1.AccountingDocument, document => document.transaction),
166
+ (0, type_graphql_1.Field)(type => [accounting_document_1.AccountingDocument], {
167
+ nullable: true,
168
+ description: 'List of accounting documents linked to this transaction'
169
+ }),
170
+ tslib_1.__metadata("design:type", Array)
171
+ ], Transaction.prototype, "documents", void 0);
108
172
  tslib_1.__decorate([
109
173
  (0, typeorm_1.CreateDateColumn)(),
110
- (0, type_graphql_1.Field)({ nullable: true }),
174
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when the transaction record was created' }),
111
175
  tslib_1.__metadata("design:type", Date)
112
176
  ], Transaction.prototype, "createdAt", void 0);
113
177
  tslib_1.__decorate([
114
178
  (0, typeorm_1.UpdateDateColumn)(),
115
- (0, type_graphql_1.Field)({ nullable: true }),
179
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when the transaction record was last updated' }),
116
180
  tslib_1.__metadata("design:type", Date)
117
181
  ], Transaction.prototype, "updatedAt", void 0);
118
182
  tslib_1.__decorate([
119
183
  (0, typeorm_1.DeleteDateColumn)(),
120
- (0, type_graphql_1.Field)({ nullable: true }),
184
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when the transaction record was deleted (soft delete)' }),
121
185
  tslib_1.__metadata("design:type", Date)
122
186
  ], Transaction.prototype, "deletedAt", void 0);
123
187
  tslib_1.__decorate([
124
188
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
125
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
189
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who created the transaction record' }),
126
190
  tslib_1.__metadata("design:type", auth_base_1.User)
127
191
  ], Transaction.prototype, "creator", void 0);
128
192
  tslib_1.__decorate([
@@ -131,7 +195,7 @@ tslib_1.__decorate([
131
195
  ], Transaction.prototype, "creatorId", void 0);
132
196
  tslib_1.__decorate([
133
197
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
134
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
198
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who last updated the transaction record' }),
135
199
  tslib_1.__metadata("design:type", auth_base_1.User)
136
200
  ], Transaction.prototype, "updater", void 0);
137
201
  tslib_1.__decorate([
@@ -139,13 +203,37 @@ tslib_1.__decorate([
139
203
  tslib_1.__metadata("design:type", String)
140
204
  ], Transaction.prototype, "updaterId", void 0);
141
205
  exports.Transaction = Transaction = tslib_1.__decorate([
142
- (0, type_graphql_1.ObjectType)({ description: 'Entity for Transaction' }),
206
+ (0, type_graphql_1.ObjectType)({
207
+ description: 'Entity representing a financial transaction, which could be sales, purchase, or other types of financial operations.'
208
+ }),
143
209
  (0, typeorm_1.Entity)(),
144
- (0, typeorm_1.Index)('ix_transaction_0', (transaction) => [transaction.domain, transaction.occurredAt], {
145
- unique: true,
210
+ (0, typeorm_1.Index)('ix_transaction_0', (transaction) => [
211
+ transaction.domain,
212
+ transaction.transactionDate,
213
+ transaction.type,
214
+ transaction.account
215
+ ], {
216
+ unique: false,
217
+ where: '"deleted_at" IS NULL'
218
+ }),
219
+ (0, typeorm_1.Index)('ix_transaction_1', (transaction) => [
220
+ transaction.domain,
221
+ transaction.type,
222
+ transaction.account,
223
+ transaction.transactionDate
224
+ ], {
225
+ unique: false,
146
226
  where: '"deleted_at" IS NULL'
147
227
  }),
148
- (0, typeorm_1.Index)('ix_transaction_1', (transaction) => [transaction.domain, transaction.year, transaction.quarter, transaction.month], {
228
+ (0, typeorm_1.Index)('ix_transaction_2', (transaction) => [
229
+ transaction.domain,
230
+ transaction.year,
231
+ transaction.quarter,
232
+ transaction.month,
233
+ transaction.transactionDate,
234
+ transaction.type,
235
+ transaction.account
236
+ ], {
149
237
  unique: true,
150
238
  where: '"deleted_at" IS NULL'
151
239
  })
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAChD,gDAA4C;AAE5C,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,yDAAM,CAAA;IACN,2DAAO,CAAA;IACP,uDAAK,CAAA;IACL,+DAAS,CAAA;IACT,yDAAM,CAAA;AACR,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,mCAAmC;CACjD,CAAC,CAAA;AAgBK,IAAM,WAAW,GAAjB,MAAM,WAAW;IAAjB;QAOL,YAAO,GAAY,CAAC,CAAA;QAuBpB,WAAM,GAAY,CAAC,CAAA;IA0DrB,CAAC;CAAA,CAAA;AAxFY,kCAAW;AAGb;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;uCACC;AAInB;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACN;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,cAAM;2CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,C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AO,CAAC;;8CAC5C;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC5C;sBAvFP,WAAW;IAdvB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IACrD,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE;QACrG,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,eAAK,EACJ,kBAAkB,EAClB,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,EAC5G;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CACF;GACY,WAAW,CAwFvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Account } from '../account/account'\n\nexport enum TransactionType {\n Income,\n Expense,\n Asset,\n Liability,\n Equity\n}\n\nregisterEnumType(TransactionType, {\n name: 'TransactionType',\n description: 'Type enumeration of a transaction'\n})\n\n@ObjectType({ description: 'Entity for Transaction' })\n@Entity()\n@Index('ix_transaction_0', (transaction: Transaction) => [transaction.domain, transaction.occurredAt], {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n})\n@Index(\n 'ix_transaction_1',\n (transaction: Transaction) => [transaction.domain, transaction.year, transaction.quarter, transaction.month],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n }\n)\nexport class Transaction {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((transaction: Transaction) => transaction.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n currency?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n amount?: number = 0\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: TransactionType\n\n @ManyToOne(type => Account)\n @Field({ nullable: true })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal year' })\n year?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal quarter' })\n quarter?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal month' })\n month?: number\n\n @Column({ type: 'timestamp', nullable: false })\n @Field({ nullable: false, description: 'The exact date and time the transaction occurred' })\n occurredAt: Date // 트랜잭션이 발생한 실제 시점(날짜와 시간)\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((transaction: Transaction) => transaction.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAsE;AAEtE,iDAA8C;AAC9C,yDAAgD;AAChD,gDAA4C;AAC5C,gDAA4C;AAC5C,oFAA+E;AAE/E,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,mEAAW,CAAA;IACX,2EAAe,CAAA;IACf,uDAAK,CAAA;IACL,+DAAS,CAAA;IACT,yDAAM,CAAA;IACN,mEAAW,CAAA;IACX,qEAAY,CAAA,CAAC,QAAQ;AACvB,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAED,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,2GAA2G;CAC9G,CAAC,CAAA;AAEF,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,4CAAqB,CAAA,CAAC,UAAU;AAClC,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;AAED,IAAA,+BAAgB,EAAC,mBAAmB,EAAE;IACpC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,6EAA6E;CAC3F,CAAC,CAAA;AAEF,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,oDAA+B,CAAA;IAC/B,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,sDAAiC,CAAA,CAAC,YAAY;AAChD,CAAC,EAPW,iBAAiB,iCAAjB,iBAAiB,QAO5B;AAED,IAAA,+BAAgB,EAAC,iBAAiB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gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;sCAC3F,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC5C;sBAxHP,WAAW;IA/CvB,IAAA,yBAAU,EAAC;QACV,WAAW,EACT,sHAAsH;KACzH,CAAC;IACD,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,kBAAkB,EAClB,CAAC,WAAwB,EAAE,EAAE,CAAC;QAC5B,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,eAAe;QAC3B,WAAW,CAAC,IAAI;QAChB,WAAW,CAAC,OAAO;KACpB,EACD;QACE,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,sBAAsB;KAC9B,CACF;IACA,IAAA,eAAK,EACJ,kBAAkB,EAClB,CAAC,WAAwB,EAAE,EAAE,CAAC;QAC5B,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,IAAI;QAChB,WAAW,CAAC,OAAO;QACnB,WAAW,CAAC,eAAe;KAC5B,EACD;QACE,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,sBAAsB;KAC9B,CACF;IACA,IAAA,eAAK,EACJ,kBAAkB,EAClB,CAAC,WAAwB,EAAE,EAAE,CAAC;QAC5B,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,IAAI;QAChB,WAAW,CAAC,OAAO;QACnB,WAAW,CAAC,KAAK;QACjB,WAAW,CAAC,eAAe;QAC3B,WAAW,CAAC,IAAI;QAChB,WAAW,CAAC,OAAO;KACpB,EACD;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CACF;GACY,WAAW,CAyHvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Account } from '../account/account'\nimport { Payment } from '../payment/payment'\nimport { AccountingDocument } from '../accounting-document/accounting-document'\n\nexport enum TransactionType {\n SalesIncome, // 매출\n PurchaseExpense, // 매입\n Asset, // 자산\n Liability, // 부채\n Equity, // 자본\n OtherIncome, // 기타 수익\n OtherExpense // 기타 비용\n}\n\nregisterEnumType(TransactionType, {\n name: 'TransactionType',\n description:\n 'Type enumeration of a transaction, indicating the nature of the transaction (e.g., Sales, Purchase, etc.)'\n})\n\nexport enum TransactionCategory {\n Confirmed = 'Confirmed', // 확정된 건\n Forecast = 'Forecast' // 예상 전망 건\n}\n\nregisterEnumType(TransactionCategory, {\n name: 'TransactionCategory',\n description: 'Category of a transaction, indicating whether it is confirmed or a forecast'\n})\n\nexport enum TransactionStatus {\n Pending = 'Pending', // 처리 대기 중\n Paid = 'Paid', // 전액 결제됨\n PartiallyPaid = 'PartiallyPaid', // 일부만 결제됨\n Cancelled = 'Cancelled', // 취소됨\n Delayed = 'Delayed', // 지연됨\n ForecastFailed = 'ForecastFailed' // 전망이 틀린 경우\n}\n\nregisterEnumType(TransactionStatus, {\n name: 'TransactionStatus',\n description: 'Status of a transaction, indicating its processing state (e.g., Paid, Delayed, etc.)'\n})\n\n@ObjectType({\n description:\n 'Entity representing a financial transaction, which could be sales, purchase, or other types of financial operations.'\n})\n@Entity()\n@Index(\n 'ix_transaction_0',\n (transaction: Transaction) => [\n transaction.domain,\n transaction.transactionDate,\n transaction.type,\n transaction.account\n ],\n {\n unique: false,\n where: '\"deleted_at\" IS NULL'\n }\n)\n@Index(\n 'ix_transaction_1',\n (transaction: Transaction) => [\n transaction.domain,\n transaction.type,\n transaction.account,\n transaction.transactionDate\n ],\n {\n unique: false,\n where: '\"deleted_at\" IS NULL'\n }\n)\n@Index(\n 'ix_transaction_2',\n (transaction: Transaction) => [\n transaction.domain,\n transaction.year,\n transaction.quarter,\n transaction.month,\n transaction.transactionDate,\n transaction.type,\n transaction.account\n ],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n }\n)\nexport class Transaction {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the transaction' })\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number for optimistic locking' })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'The domain in which this transaction belongs' })\n domain?: Domain\n\n @RelationId((transaction: Transaction) => transaction.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true, description: 'Name or title of the transaction' })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Detailed description of the transaction' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Currency in which the transaction is denominated' })\n currency?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Amount involved in the transaction' })\n amount?: number = 0\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Indicates whether the transaction is currently active or not' })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Type of the transaction (e.g., SalesIncome, PurchaseExpense)' })\n type?: TransactionType\n\n @Column({ nullable: false })\n @Field(type => TransactionCategory, {\n nullable: false,\n description: 'Category of the transaction (Confirmed or Forecast)'\n })\n category: TransactionCategory // 트랜잭션의 카테고리 (확정, 전망)\n\n @Column({ nullable: false })\n @Field(type => TransactionStatus, {\n nullable: false,\n description: 'Current status of the transaction (e.g., Paid, Delayed)'\n })\n status: TransactionStatus // 트랜잭션의 상태 (예: Paid, Delayed 등)\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The probability of the forecast being realized (0 to 100)' })\n probability?: number // 예측이 실현될 확률 (0 ~ 100)\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Additional notes or comments about the forecast' })\n forecastNotes?: string // 전망에 대한 추가 설명이나 메모\n\n @ManyToOne(type => Account)\n @Field({ nullable: true, description: 'Associated account for this transaction' })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal year in which the transaction occurs' })\n year?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal quarter in which the transaction occurs' })\n quarter?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal month in which the transaction occurs' })\n month?: number\n\n @Column({ nullable: false })\n @Field({ nullable: false, description: 'The date the transaction occurs or is scheduled (in string format)' })\n transactionDate: string // 트랜잭션이 발생하거나 발생할 날짜\n\n @OneToMany(type => Payment, payment => payment.transaction)\n @Field(type => [Payment], { nullable: true, description: 'List of payments associated with this transaction' })\n payments?: Payment[]\n\n @OneToMany(type => AccountingDocument, document => document.transaction)\n @Field(type => [AccountingDocument], {\n nullable: true,\n description: 'List of accounting documents linked to this transaction'\n })\n documents?: AccountingDocument[] // 트랜잭션과 연결된 회계 문서\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was created' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was last updated' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was deleted (soft delete)' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created the transaction record' })\n creator?: User\n\n @RelationId((transaction: Transaction) => transaction.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated the transaction record' })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.updater)\n updaterId?: string\n}\n"]}