@things-factory/accounting 10.1.134 → 10.1.136

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 (240) hide show
  1. package/dist-client/route.d.ts +1 -1
  2. package/dist-client/route.js +0 -12
  3. package/dist-client/route.js.map +1 -1
  4. package/dist-client/tsconfig.tsbuildinfo +1 -1
  5. package/dist-server/index.d.ts +0 -1
  6. package/dist-server/index.js +0 -1
  7. package/dist-server/index.js.map +1 -1
  8. package/dist-server/service/account/account-history.d.ts +13 -6
  9. package/dist-server/service/account/account-history.js +44 -17
  10. package/dist-server/service/account/account-history.js.map +1 -1
  11. package/dist-server/service/account/account-mutation.js +2 -2
  12. package/dist-server/service/account/account-mutation.js.map +1 -1
  13. package/dist-server/service/account/account-query.d.ts +2 -0
  14. package/dist-server/service/account/account-query.js +12 -1
  15. package/dist-server/service/account/account-query.js.map +1 -1
  16. package/dist-server/service/account/account-type.d.ts +16 -0
  17. package/dist-server/service/account/account-type.js +71 -13
  18. package/dist-server/service/account/account-type.js.map +1 -1
  19. package/dist-server/service/account/account.d.ts +9 -3
  20. package/dist-server/service/account/account.js +34 -8
  21. package/dist-server/service/account/account.js.map +1 -1
  22. package/dist-server/service/accounting-category/accounting-category-mutation.js +2 -2
  23. package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -1
  24. package/dist-server/service/accounting-category/accounting-category-query.d.ts +1 -0
  25. package/dist-server/service/accounting-category/accounting-category-query.js +10 -0
  26. package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
  27. package/dist-server/service/accounting-document/accounting-document-mutation.js +12 -3
  28. package/dist-server/service/accounting-document/accounting-document-mutation.js.map +1 -1
  29. package/dist-server/service/accounting-document/accounting-document-query.js +2 -0
  30. package/dist-server/service/accounting-document/accounting-document-query.js.map +1 -1
  31. package/dist-server/service/bank-account/bank-account-history.d.ts +11 -14
  32. package/dist-server/service/bank-account/bank-account-history.js +46 -59
  33. package/dist-server/service/bank-account/bank-account-history.js.map +1 -1
  34. package/dist-server/service/bank-account/bank-account-mutation.d.ts +1 -2
  35. package/dist-server/service/bank-account/bank-account-mutation.js +25 -69
  36. package/dist-server/service/bank-account/bank-account-mutation.js.map +1 -1
  37. package/dist-server/service/bank-account/bank-account-query.js +3 -1
  38. package/dist-server/service/bank-account/bank-account-query.js.map +1 -1
  39. package/dist-server/service/bank-account/bank-account-service.d.ts +5 -0
  40. package/dist-server/service/bank-account/bank-account-service.js +21 -0
  41. package/dist-server/service/bank-account/bank-account-service.js.map +1 -0
  42. package/dist-server/service/bank-account/bank-account-type.d.ts +13 -19
  43. package/dist-server/service/bank-account/bank-account-type.js +45 -69
  44. package/dist-server/service/bank-account/bank-account-type.js.map +1 -1
  45. package/dist-server/service/bank-account/bank-account.d.ts +14 -17
  46. package/dist-server/service/bank-account/bank-account.js +45 -57
  47. package/dist-server/service/bank-account/bank-account.js.map +1 -1
  48. package/dist-server/service/bank-statement/bank-statement-query.d.ts +14 -0
  49. package/dist-server/service/bank-statement/bank-statement-query.js +92 -0
  50. package/dist-server/service/bank-statement/bank-statement-query.js.map +1 -0
  51. package/dist-server/service/bank-statement/bank-statement.d.ts +26 -0
  52. package/dist-server/service/bank-statement/bank-statement.js +109 -0
  53. package/dist-server/service/bank-statement/bank-statement.js.map +1 -0
  54. package/dist-server/service/bank-statement/index.d.ts +5 -0
  55. package/dist-server/service/bank-statement/index.js +9 -0
  56. package/dist-server/service/bank-statement/index.js.map +1 -0
  57. package/dist-server/service/cash-flow-type.d.ts +5 -0
  58. package/dist-server/service/cash-flow-type.js +15 -0
  59. package/dist-server/service/cash-flow-type.js.map +1 -0
  60. package/dist-server/service/financial-institution/financial-institution-mutation.js +10 -1
  61. package/dist-server/service/financial-institution/financial-institution-mutation.js.map +1 -1
  62. package/dist-server/service/financial-institution/financial-institution-query.js +14 -6
  63. package/dist-server/service/financial-institution/financial-institution-query.js.map +1 -1
  64. package/dist-server/service/financial-institution/index.d.ts +1 -1
  65. package/dist-server/service/financial-statement/financial-statement-history.d.ts +11 -9
  66. package/dist-server/service/financial-statement/financial-statement-history.js +47 -36
  67. package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
  68. package/dist-server/service/financial-statement/financial-statement-line.d.ts +24 -0
  69. package/dist-server/service/financial-statement/financial-statement-line.js +108 -0
  70. package/dist-server/service/financial-statement/financial-statement-line.js.map +1 -0
  71. package/dist-server/service/financial-statement/financial-statement-mutation.d.ts +1 -8
  72. package/dist-server/service/financial-statement/financial-statement-mutation.js +10 -135
  73. package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -1
  74. package/dist-server/service/financial-statement/financial-statement-query.d.ts +14 -7
  75. package/dist-server/service/financial-statement/financial-statement-query.js +87 -31
  76. package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
  77. package/dist-server/service/financial-statement/financial-statement-service.d.ts +33 -0
  78. package/dist-server/service/financial-statement/financial-statement-service.js +44 -0
  79. package/dist-server/service/financial-statement/financial-statement-service.js.map +1 -0
  80. package/dist-server/service/financial-statement/financial-statement.d.ts +19 -11
  81. package/dist-server/service/financial-statement/financial-statement.js +73 -65
  82. package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
  83. package/dist-server/service/financial-statement/index.d.ts +5 -4
  84. package/dist-server/service/financial-statement/index.js +3 -3
  85. package/dist-server/service/financial-statement/index.js.map +1 -1
  86. package/dist-server/service/index.d.ts +15 -3
  87. package/dist-server/service/index.js +30 -13
  88. package/dist-server/service/index.js.map +1 -1
  89. package/dist-server/service/payment/index.d.ts +1 -0
  90. package/dist-server/service/payment/index.js +1 -0
  91. package/dist-server/service/payment/index.js.map +1 -1
  92. package/dist-server/service/payment/payment-history.d.ts +9 -16
  93. package/dist-server/service/payment/payment-history.js +36 -70
  94. package/dist-server/service/payment/payment-history.js.map +1 -1
  95. package/dist-server/service/payment/payment-mutation.d.ts +0 -1
  96. package/dist-server/service/payment/payment-mutation.js +14 -79
  97. package/dist-server/service/payment/payment-mutation.js.map +1 -1
  98. package/dist-server/service/payment/payment-query.d.ts +3 -0
  99. package/dist-server/service/payment/payment-query.js +30 -1
  100. package/dist-server/service/payment/payment-query.js.map +1 -1
  101. package/dist-server/service/payment/payment-service.d.ts +16 -0
  102. package/dist-server/service/payment/payment-service.js +140 -0
  103. package/dist-server/service/payment/payment-service.js.map +1 -0
  104. package/dist-server/service/payment/payment-targets.d.ts +31 -0
  105. package/dist-server/service/payment/payment-targets.js +19 -0
  106. package/dist-server/service/payment/payment-targets.js.map +1 -0
  107. package/dist-server/service/payment/payment-type.d.ts +13 -17
  108. package/dist-server/service/payment/payment-type.js +35 -51
  109. package/dist-server/service/payment/payment-type.js.map +1 -1
  110. package/dist-server/service/payment/payment.d.ts +23 -22
  111. package/dist-server/service/payment/payment.js +66 -94
  112. package/dist-server/service/payment/payment.js.map +1 -1
  113. package/dist-server/service/payment/transfer-target.d.ts +1 -0
  114. package/dist-server/service/payment/transfer-target.js +43 -0
  115. package/dist-server/service/payment/transfer-target.js.map +1 -0
  116. package/dist-server/service/recurring-cash-item/index.d.ts +6 -0
  117. package/dist-server/service/recurring-cash-item/index.js +10 -0
  118. package/dist-server/service/recurring-cash-item/index.js.map +1 -0
  119. package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.d.ts +7 -0
  120. package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js +63 -0
  121. package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js.map +1 -0
  122. package/dist-server/service/recurring-cash-item/recurring-cash-item-query.d.ts +15 -0
  123. package/dist-server/service/recurring-cash-item/recurring-cash-item-query.js +101 -0
  124. package/dist-server/service/recurring-cash-item/recurring-cash-item-query.js.map +1 -0
  125. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.d.ts +23 -0
  126. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js +91 -0
  127. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js.map +1 -0
  128. package/dist-server/service/recurring-cash-item/recurring-cash-item-type.d.ts +23 -0
  129. package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js +85 -0
  130. package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js.map +1 -0
  131. package/dist-server/service/recurring-cash-item/recurring-cash-item.d.ts +35 -0
  132. package/dist-server/service/recurring-cash-item/recurring-cash-item.js +142 -0
  133. package/dist-server/service/recurring-cash-item/recurring-cash-item.js.map +1 -0
  134. package/dist-server/service/recurring-cash-item/recurring-schedule.d.ts +36 -0
  135. package/dist-server/service/recurring-cash-item/recurring-schedule.js +41 -0
  136. package/dist-server/service/recurring-cash-item/recurring-schedule.js.map +1 -0
  137. package/dist-server/service/transaction/transaction-history.d.ts +42 -15
  138. package/dist-server/service/transaction/transaction-history.js +160 -54
  139. package/dist-server/service/transaction/transaction-history.js.map +1 -1
  140. package/dist-server/service/transaction/transaction-mutation.d.ts +0 -1
  141. package/dist-server/service/transaction/transaction-mutation.js +13 -78
  142. package/dist-server/service/transaction/transaction-mutation.js.map +1 -1
  143. package/dist-server/service/transaction/transaction-period.d.ts +16 -0
  144. package/dist-server/service/transaction/transaction-period.js +49 -0
  145. package/dist-server/service/transaction/transaction-period.js.map +1 -0
  146. package/dist-server/service/transaction/transaction-query.d.ts +12 -0
  147. package/dist-server/service/transaction/transaction-query.js +84 -2
  148. package/dist-server/service/transaction/transaction-query.js.map +1 -1
  149. package/dist-server/service/transaction/transaction-service.d.ts +30 -0
  150. package/dist-server/service/transaction/transaction-service.js +130 -0
  151. package/dist-server/service/transaction/transaction-service.js.map +1 -0
  152. package/dist-server/service/transaction/transaction-type.d.ts +39 -7
  153. package/dist-server/service/transaction/transaction-type.js +145 -23
  154. package/dist-server/service/transaction/transaction-type.js.map +1 -1
  155. package/dist-server/service/transaction/transaction.d.ts +58 -31
  156. package/dist-server/service/transaction/transaction.js +216 -102
  157. package/dist-server/service/transaction/transaction.js.map +1 -1
  158. package/dist-server/tsconfig.tsbuildinfo +1 -1
  159. package/package.json +5 -3
  160. package/things-factory.config.js +0 -4
  161. package/translations/en.json +34 -2
  162. package/translations/ja.json +0 -1
  163. package/translations/ko.json +34 -2
  164. package/translations/ms.json +0 -1
  165. package/translations/zh.json +0 -1
  166. package/dist-client/pages/account/account-importer.d.ts +0 -22
  167. package/dist-client/pages/account/account-importer.js +0 -99
  168. package/dist-client/pages/account/account-importer.js.map +0 -1
  169. package/dist-client/pages/account/account-list-page.d.ts +0 -57
  170. package/dist-client/pages/account/account-list-page.js +0 -306
  171. package/dist-client/pages/account/account-list-page.js.map +0 -1
  172. package/dist-client/pages/bank-account/bank-account-importer.d.ts +0 -23
  173. package/dist-client/pages/bank-account/bank-account-importer.js +0 -92
  174. package/dist-client/pages/bank-account/bank-account-importer.js.map +0 -1
  175. package/dist-client/pages/bank-account/bank-account-list-page.d.ts +0 -60
  176. package/dist-client/pages/bank-account/bank-account-list-page.js +0 -317
  177. package/dist-client/pages/bank-account/bank-account-list-page.js.map +0 -1
  178. package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +0 -22
  179. package/dist-client/pages/financial-statement/financial-statement-importer.js +0 -99
  180. package/dist-client/pages/financial-statement/financial-statement-importer.js.map +0 -1
  181. package/dist-client/pages/financial-statement/financial-statement-list-page.d.ts +0 -57
  182. package/dist-client/pages/financial-statement/financial-statement-list-page.js +0 -280
  183. package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +0 -1
  184. package/dist-client/pages/income-statement/income-statement-importer.d.ts +0 -22
  185. package/dist-client/pages/income-statement/income-statement-importer.js +0 -99
  186. package/dist-client/pages/income-statement/income-statement-importer.js.map +0 -1
  187. package/dist-client/pages/income-statement/income-statement-list-page.d.ts +0 -57
  188. package/dist-client/pages/income-statement/income-statement-list-page.js +0 -280
  189. package/dist-client/pages/income-statement/income-statement-list-page.js.map +0 -1
  190. package/dist-client/pages/payment/payment-importer.d.ts +0 -23
  191. package/dist-client/pages/payment/payment-importer.js +0 -92
  192. package/dist-client/pages/payment/payment-importer.js.map +0 -1
  193. package/dist-client/pages/payment/payment-list-page.d.ts +0 -60
  194. package/dist-client/pages/payment/payment-list-page.js +0 -317
  195. package/dist-client/pages/payment/payment-list-page.js.map +0 -1
  196. package/dist-client/pages/transaction/transaction-importer.d.ts +0 -22
  197. package/dist-client/pages/transaction/transaction-importer.js +0 -99
  198. package/dist-client/pages/transaction/transaction-importer.js.map +0 -1
  199. package/dist-client/pages/transaction/transaction-list-page.d.ts +0 -57
  200. package/dist-client/pages/transaction/transaction-list-page.js +0 -280
  201. package/dist-client/pages/transaction/transaction-list-page.js.map +0 -1
  202. package/dist-server/controllers/index.d.ts +0 -1
  203. package/dist-server/controllers/index.js +0 -5
  204. package/dist-server/controllers/index.js.map +0 -1
  205. package/dist-server/controllers/summary-statements.d.ts +0 -4
  206. package/dist-server/controllers/summary-statements.js +0 -149
  207. package/dist-server/controllers/summary-statements.js.map +0 -1
  208. package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +0 -5
  209. package/dist-server/migrations/1725201567284-seed-country-codes.js +0 -255
  210. package/dist-server/migrations/1725201567284-seed-country-codes.js.map +0 -1
  211. package/dist-server/service/financial-statement/financial-statement-line-item.d.ts +0 -19
  212. package/dist-server/service/financial-statement/financial-statement-line-item.js +0 -95
  213. package/dist-server/service/financial-statement/financial-statement-line-item.js.map +0 -1
  214. package/dist-server/service/financial-statement/financial-statement-type.d.ts +0 -20
  215. package/dist-server/service/financial-statement/financial-statement-type.js +0 -77
  216. package/dist-server/service/financial-statement/financial-statement-type.js.map +0 -1
  217. package/dist-server/service/income-statement/event-subscriber.d.ts +0 -7
  218. package/dist-server/service/income-statement/event-subscriber.js +0 -21
  219. package/dist-server/service/income-statement/event-subscriber.js.map +0 -1
  220. package/dist-server/service/income-statement/income-statement-history.d.ts +0 -28
  221. package/dist-server/service/income-statement/income-statement-history.js +0 -146
  222. package/dist-server/service/income-statement/income-statement-history.js.map +0 -1
  223. package/dist-server/service/income-statement/income-statement-line-item.d.ts +0 -19
  224. package/dist-server/service/income-statement/income-statement-line-item.js +0 -97
  225. package/dist-server/service/income-statement/income-statement-line-item.js.map +0 -1
  226. package/dist-server/service/income-statement/income-statement-mutation.d.ts +0 -10
  227. package/dist-server/service/income-statement/income-statement-mutation.js +0 -159
  228. package/dist-server/service/income-statement/income-statement-mutation.js.map +0 -1
  229. package/dist-server/service/income-statement/income-statement-query.d.ts +0 -11
  230. package/dist-server/service/income-statement/income-statement-query.js +0 -81
  231. package/dist-server/service/income-statement/income-statement-query.js.map +0 -1
  232. package/dist-server/service/income-statement/income-statement-type.d.ts +0 -20
  233. package/dist-server/service/income-statement/income-statement-type.js +0 -77
  234. package/dist-server/service/income-statement/income-statement-type.js.map +0 -1
  235. package/dist-server/service/income-statement/income-statement.d.ts +0 -28
  236. package/dist-server/service/income-statement/income-statement.js +0 -137
  237. package/dist-server/service/income-statement/income-statement.js.map +0 -1
  238. package/dist-server/service/income-statement/index.d.ts +0 -8
  239. package/dist-server/service/income-statement/index.js +0 -13
  240. package/dist-server/service/income-statement/index.js.map +0 -1
@@ -1,54 +1,58 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Transaction = exports.TransactionStatus = exports.TransactionCategory = exports.TransactionType = void 0;
3
+ exports.Transaction = exports.ForecastStatus = exports.TransactionSource = exports.TransactionCategory = 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
+ const biz_base_1 = require("@things-factory/biz-base");
9
10
  const account_1 = require("../account/account");
11
+ const bank_account_1 = require("../bank-account/bank-account");
12
+ const bank_statement_1 = require("../bank-statement/bank-statement");
13
+ const cash_flow_type_1 = require("../cash-flow-type");
10
14
  const payment_1 = require("../payment/payment");
11
15
  const accounting_document_1 = require("../accounting-document/accounting-document");
12
- var TransactionType;
13
- (function (TransactionType) {
14
- TransactionType[TransactionType["SalesIncome"] = 0] = "SalesIncome";
15
- TransactionType[TransactionType["PurchaseExpense"] = 1] = "PurchaseExpense";
16
- TransactionType[TransactionType["Asset"] = 2] = "Asset";
17
- TransactionType[TransactionType["Liability"] = 3] = "Liability";
18
- TransactionType[TransactionType["Equity"] = 4] = "Equity";
19
- TransactionType[TransactionType["OtherIncome"] = 5] = "OtherIncome";
20
- TransactionType[TransactionType["OtherExpense"] = 6] = "OtherExpense"; // 기타 비용
21
- })(TransactionType || (exports.TransactionType = TransactionType = {}));
22
- (0, type_graphql_1.registerEnumType)(TransactionType, {
23
- name: 'TransactionType',
24
- description: 'Type enumeration of a transaction, indicating the nature of the transaction (e.g., Sales, Purchase, etc.)'
25
- });
16
+ const recurring_cash_item_1 = require("../recurring-cash-item/recurring-cash-item");
26
17
  var TransactionCategory;
27
18
  (function (TransactionCategory) {
28
- TransactionCategory["Confirmed"] = "Confirmed";
29
- TransactionCategory["Forecast"] = "Forecast"; // 예상 전망 건
19
+ TransactionCategory["CONFIRMED"] = "CONFIRMED";
20
+ TransactionCategory["FORECAST"] = "FORECAST";
30
21
  })(TransactionCategory || (exports.TransactionCategory = TransactionCategory = {}));
31
22
  (0, type_graphql_1.registerEnumType)(TransactionCategory, {
32
23
  name: 'TransactionCategory',
33
- description: 'Category of a transaction, indicating whether it is confirmed or a forecast'
24
+ description: 'Whether a transaction happened on the bank account (confirmed) or is a plan someone made (forecast)'
25
+ });
26
+ var TransactionSource;
27
+ (function (TransactionSource) {
28
+ TransactionSource["BANK_STATEMENT"] = "BANK_STATEMENT";
29
+ TransactionSource["LEGACY"] = "LEGACY";
30
+ TransactionSource["MANUAL"] = "MANUAL";
31
+ })(TransactionSource || (exports.TransactionSource = TransactionSource = {}));
32
+ (0, type_graphql_1.registerEnumType)(TransactionSource, {
33
+ name: 'TransactionSource',
34
+ description: 'Where the facts of a confirmed transaction come from - a bank statement file, an old ledger, or a person'
34
35
  });
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.)'
36
+ var ForecastStatus;
37
+ (function (ForecastStatus) {
38
+ ForecastStatus["PLANNED"] = "PLANNED";
39
+ ForecastStatus["DONE"] = "DONE";
40
+ ForecastStatus["CANCELLED"] = "CANCELLED";
41
+ })(ForecastStatus || (exports.ForecastStatus = ForecastStatus = {}));
42
+ (0, type_graphql_1.registerEnumType)(ForecastStatus, {
43
+ name: 'ForecastStatus',
44
+ description: 'State of a forecast - still expected, happened, dropped'
47
45
  });
46
+ /**
47
+ * Money that moves in or out of the business: a line on a bank account (confirmed), or a plan someone made of money
48
+ * still to come or go (forecast).
49
+ *
50
+ * What a transaction paid - a contract round, a tax invoice, a VAT period - is its payments (§`Payment`). The facts
51
+ * of a bank line are kept as the bank gave them, beside what a person wrote about it.
52
+ */
48
53
  let Transaction = class Transaction {
49
54
  constructor() {
50
55
  this.version = 1;
51
- this.amount = 0;
52
56
  }
53
57
  };
54
58
  exports.Transaction = Transaction;
@@ -64,7 +68,7 @@ tslib_1.__decorate([
64
68
  ], Transaction.prototype, "version", void 0);
65
69
  tslib_1.__decorate([
66
70
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
67
- (0, type_graphql_1.Field)({ nullable: true, description: 'The domain in which this transaction belongs' }),
71
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain in which this transaction belongs' }),
68
72
  tslib_1.__metadata("design:type", shell_1.Domain)
69
73
  ], Transaction.prototype, "domain", void 0);
70
74
  tslib_1.__decorate([
@@ -72,101 +76,215 @@ tslib_1.__decorate([
72
76
  tslib_1.__metadata("design:type", String)
73
77
  ], Transaction.prototype, "domainId", void 0);
74
78
  tslib_1.__decorate([
75
- (0, typeorm_1.Column)(),
76
- (0, type_graphql_1.Field)({ nullable: true, description: 'Name or title of the transaction' }),
79
+ (0, typeorm_1.Column)({ default: TransactionCategory.CONFIRMED }),
80
+ (0, type_graphql_1.Field)(type => TransactionCategory, { description: 'Confirmed (on the bank account) or forecast (a plan)' }),
81
+ tslib_1.__metadata("design:type", String)
82
+ ], Transaction.prototype, "category", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.Column)({ default: cash_flow_type_1.CashFlowType.INCOME }),
85
+ (0, type_graphql_1.Field)(type => cash_flow_type_1.CashFlowType, { description: 'Money in or money out' }),
86
+ tslib_1.__metadata("design:type", String)
87
+ ], Transaction.prototype, "type", void 0);
88
+ tslib_1.__decorate([
89
+ (0, typeorm_1.ManyToOne)(type => bank_account_1.BankAccount, { nullable: true }),
90
+ (0, type_graphql_1.Field)(type => bank_account_1.BankAccount, { nullable: true, description: 'The account the money moved in or out of' }),
91
+ tslib_1.__metadata("design:type", bank_account_1.BankAccount)
92
+ ], Transaction.prototype, "bankAccount", void 0);
93
+ tslib_1.__decorate([
94
+ (0, typeorm_1.RelationId)((transaction) => transaction.bankAccount),
77
95
  tslib_1.__metadata("design:type", String)
78
- ], Transaction.prototype, "name", void 0);
96
+ ], Transaction.prototype, "bankAccountId", void 0);
79
97
  tslib_1.__decorate([
80
98
  (0, typeorm_1.Column)({ nullable: true }),
81
- (0, type_graphql_1.Field)({ nullable: true, description: 'Detailed description of the transaction' }),
99
+ (0, type_graphql_1.Field)({
100
+ nullable: true,
101
+ description: "YYYY-MM-DD - the day in the account's time zone; for a forecast, the day its timing names, empty when it names none"
102
+ }),
82
103
  tslib_1.__metadata("design:type", String)
83
- ], Transaction.prototype, "description", void 0);
104
+ ], Transaction.prototype, "transactionDate", void 0);
84
105
  tslib_1.__decorate([
85
106
  (0, typeorm_1.Column)({ nullable: true }),
86
- (0, type_graphql_1.Field)({ nullable: true, description: 'Currency in which the transaction is denominated' }),
107
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Bank timestamp with UTC offset; empty when only a date is known' }),
87
108
  tslib_1.__metadata("design:type", String)
88
- ], Transaction.prototype, "currency", void 0);
109
+ ], Transaction.prototype, "transactionAt", void 0);
110
+ tslib_1.__decorate([
111
+ (0, typeorm_1.Column)({ type: 'int' }),
112
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Year of the transaction date - for a forecast, the year it is planned in' }),
113
+ tslib_1.__metadata("design:type", Number)
114
+ ], Transaction.prototype, "year", void 0);
115
+ tslib_1.__decorate([
116
+ (0, typeorm_1.Column)({ type: 'int' }),
117
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Month of the transaction date - for a forecast, the month it is planned in' }),
118
+ tslib_1.__metadata("design:type", Number)
119
+ ], Transaction.prototype, "month", void 0);
89
120
  tslib_1.__decorate([
90
- (0, typeorm_1.Column)((0, shell_1.moneyColumn)({ nullable: true })),
91
- (0, type_graphql_1.Field)({ nullable: true, description: 'Amount involved in the transaction' }),
121
+ (0, typeorm_1.Column)((0, shell_1.moneyColumn)()),
122
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'Amount, in the currency' }),
92
123
  tslib_1.__metadata("design:type", Number)
93
124
  ], Transaction.prototype, "amount", void 0);
125
+ tslib_1.__decorate([
126
+ (0, typeorm_1.Column)({ default: 'KRW' }),
127
+ (0, type_graphql_1.Field)({ description: 'ISO 4217 code - the currency of the account' }),
128
+ tslib_1.__metadata("design:type", String)
129
+ ], Transaction.prototype, "currency", void 0);
130
+ tslib_1.__decorate([
131
+ (0, typeorm_1.Column)((0, shell_1.moneyColumn)({ nullable: true, default: null })),
132
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, {
133
+ nullable: true,
134
+ description: 'Account balance after this transaction, as the bank statement says'
135
+ }),
136
+ tslib_1.__metadata("design:type", Number)
137
+ ], Transaction.prototype, "balance", void 0);
138
+ tslib_1.__decorate([
139
+ (0, typeorm_1.ManyToOne)(type => account_1.Account, { nullable: true, onDelete: 'SET NULL' }),
140
+ (0, type_graphql_1.Field)(type => account_1.Account, { nullable: true, description: 'The account subject it is booked to' }),
141
+ tslib_1.__metadata("design:type", account_1.Account)
142
+ ], Transaction.prototype, "account", void 0);
143
+ tslib_1.__decorate([
144
+ (0, typeorm_1.RelationId)((transaction) => transaction.account),
145
+ tslib_1.__metadata("design:type", String)
146
+ ], Transaction.prototype, "accountId", void 0);
147
+ tslib_1.__decorate([
148
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
149
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What a person wrote about it - for a forecast, what is planned' }),
150
+ tslib_1.__metadata("design:type", String)
151
+ ], Transaction.prototype, "description", void 0);
94
152
  tslib_1.__decorate([
95
153
  (0, typeorm_1.Column)({ nullable: true }),
96
- (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates whether the transaction is currently active or not' }),
97
- tslib_1.__metadata("design:type", Boolean)
98
- ], Transaction.prototype, "active", void 0);
154
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The classifying word of the ledger it was kept in' }),
155
+ tslib_1.__metadata("design:type", String)
156
+ ], Transaction.prototype, "ledgerCategory", void 0);
99
157
  tslib_1.__decorate([
100
158
  (0, typeorm_1.Column)({ nullable: true }),
101
- (0, type_graphql_1.Field)({ nullable: true, description: 'Type of the transaction (e.g., SalesIncome, PurchaseExpense)' }),
102
- tslib_1.__metadata("design:type", Number)
103
- ], Transaction.prototype, "type", void 0);
159
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The counterparty name as a person wrote it' }),
160
+ tslib_1.__metadata("design:type", String)
161
+ ], Transaction.prototype, "counterpartyName", void 0);
104
162
  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)'
163
+ (0, typeorm_1.ManyToOne)(type => biz_base_1.Counterparty, { nullable: true, onDelete: 'SET NULL' }),
164
+ (0, type_graphql_1.Field)(type => biz_base_1.Counterparty, {
165
+ nullable: true,
166
+ description: 'The registered counterparty, when the name is one the domain knows'
109
167
  }),
168
+ tslib_1.__metadata("design:type", biz_base_1.Counterparty)
169
+ ], Transaction.prototype, "counterparty", void 0);
170
+ tslib_1.__decorate([
171
+ (0, typeorm_1.RelationId)((transaction) => transaction.counterparty),
110
172
  tslib_1.__metadata("design:type", String)
111
- ], Transaction.prototype, "category", void 0);
173
+ ], Transaction.prototype, "counterpartyId", void 0);
112
174
  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
- }),
175
+ (0, typeorm_1.Column)({ default: TransactionSource.MANUAL }),
176
+ (0, type_graphql_1.Field)(type => TransactionSource, { description: 'Where the facts of the line come from' }),
118
177
  tslib_1.__metadata("design:type", String)
119
- ], Transaction.prototype, "status", void 0);
178
+ ], Transaction.prototype, "source", void 0);
179
+ tslib_1.__decorate([
180
+ (0, typeorm_1.ManyToOne)(type => bank_statement_1.BankStatement, { nullable: true, onDelete: 'RESTRICT' }),
181
+ (0, type_graphql_1.Field)(type => bank_statement_1.BankStatement, { nullable: true, description: 'The bank statement file the line was read from' }),
182
+ tslib_1.__metadata("design:type", bank_statement_1.BankStatement)
183
+ ], Transaction.prototype, "bankStatement", void 0);
184
+ tslib_1.__decorate([
185
+ (0, typeorm_1.RelationId)((transaction) => transaction.bankStatement),
186
+ tslib_1.__metadata("design:type", String)
187
+ ], Transaction.prototype, "bankStatementId", void 0);
120
188
  tslib_1.__decorate([
121
189
  (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)' }),
190
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The file the line was read from, for lines from before statements were kept' }),
191
+ tslib_1.__metadata("design:type", String)
192
+ ], Transaction.prototype, "sourceFile", void 0);
193
+ tslib_1.__decorate([
194
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
195
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The row of the source file' }),
123
196
  tslib_1.__metadata("design:type", Number)
124
- ], Transaction.prototype, "probability", void 0);
197
+ ], Transaction.prototype, "sourceRow", void 0);
198
+ tslib_1.__decorate([
199
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
200
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Chronological order within the source statement' }),
201
+ tslib_1.__metadata("design:type", Number)
202
+ ], Transaction.prototype, "bankSequence", void 0);
125
203
  tslib_1.__decorate([
126
204
  (0, typeorm_1.Column)({ nullable: true }),
127
- (0, type_graphql_1.Field)({ nullable: true, description: 'Additional notes or comments about the forecast' }),
205
+ (0, type_graphql_1.Field)({
206
+ nullable: true,
207
+ description: 'What makes the bank line itself unique in the domain - the same line read twice is refused'
208
+ }),
128
209
  tslib_1.__metadata("design:type", String)
129
- ], Transaction.prototype, "forecastNotes", void 0);
210
+ ], Transaction.prototype, "bankFingerprint", void 0);
130
211
  tslib_1.__decorate([
131
- (0, typeorm_1.ManyToOne)(type => account_1.Account),
132
- (0, type_graphql_1.Field)({ nullable: true, description: 'Associated account for this transaction' }),
133
- tslib_1.__metadata("design:type", account_1.Account)
134
- ], Transaction.prototype, "account", void 0);
212
+ (0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
213
+ tslib_1.__metadata("design:type", Object)
214
+ ], Transaction.prototype, "bankReconciliationBefore", void 0);
135
215
  tslib_1.__decorate([
136
- (0, typeorm_1.RelationId)((transaction) => transaction.account),
216
+ (0, typeorm_1.Column)({ nullable: true }),
217
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Description as the bank wrote it' }),
137
218
  tslib_1.__metadata("design:type", String)
138
- ], Transaction.prototype, "accountId", void 0);
219
+ ], Transaction.prototype, "bankDescription", void 0);
139
220
  tslib_1.__decorate([
140
221
  (0, typeorm_1.Column)({ nullable: true }),
141
- (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal year in which the transaction occurs' }),
142
- tslib_1.__metadata("design:type", Number)
143
- ], Transaction.prototype, "year", void 0);
222
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Kind of the line as the bank wrote it' }),
223
+ tslib_1.__metadata("design:type", String)
224
+ ], Transaction.prototype, "bankKind", void 0);
144
225
  tslib_1.__decorate([
145
226
  (0, typeorm_1.Column)({ nullable: true }),
146
- (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal quarter in which the transaction occurs' }),
147
- tslib_1.__metadata("design:type", Number)
148
- ], Transaction.prototype, "quarter", void 0);
227
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Counterparty name as the bank wrote it' }),
228
+ tslib_1.__metadata("design:type", String)
229
+ ], Transaction.prototype, "bankCounterpartyName", void 0);
230
+ tslib_1.__decorate([
231
+ (0, typeorm_1.Column)({ nullable: true }),
232
+ (0, type_graphql_1.Field)({ nullable: true, description: "Counterparty's account number as the bank wrote it" }),
233
+ tslib_1.__metadata("design:type", String)
234
+ ], Transaction.prototype, "bankCounterpartyAccount", void 0);
235
+ tslib_1.__decorate([
236
+ (0, typeorm_1.Column)({ nullable: true }),
237
+ (0, type_graphql_1.Field)({ nullable: true, description: "Counterparty's bank as the bank wrote it" }),
238
+ tslib_1.__metadata("design:type", String)
239
+ ], Transaction.prototype, "bankCounterpartyBank", void 0);
149
240
  tslib_1.__decorate([
150
241
  (0, typeorm_1.Column)({ nullable: true }),
151
- (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal month in which the transaction occurs' }),
242
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Memo as the bank wrote it' }),
243
+ tslib_1.__metadata("design:type", String)
244
+ ], Transaction.prototype, "bankMemo", void 0);
245
+ tslib_1.__decorate([
246
+ (0, typeorm_1.Column)({ nullable: true }),
247
+ (0, type_graphql_1.Field)({
248
+ nullable: true,
249
+ description: 'When in the month a forecast falls, as a person wrote it - 15th, end of month'
250
+ }),
251
+ tslib_1.__metadata("design:type", String)
252
+ ], Transaction.prototype, "timing", void 0);
253
+ tslib_1.__decorate([
254
+ (0, typeorm_1.Column)({ nullable: true }),
255
+ (0, type_graphql_1.Field)(type => ForecastStatus, {
256
+ nullable: true,
257
+ description: 'State of a forecast; empty on a confirmed transaction'
258
+ }),
259
+ tslib_1.__metadata("design:type", String)
260
+ ], Transaction.prototype, "status", void 0);
261
+ tslib_1.__decorate([
262
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
263
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The probability of a forecast being realized (0 to 100)' }),
152
264
  tslib_1.__metadata("design:type", Number)
153
- ], Transaction.prototype, "month", void 0);
265
+ ], Transaction.prototype, "probability", void 0);
154
266
  tslib_1.__decorate([
155
- (0, typeorm_1.Column)({ nullable: false }),
156
- (0, type_graphql_1.Field)({ nullable: false, description: 'The date the transaction occurs or is scheduled (in string format)' }),
267
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
268
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
157
269
  tslib_1.__metadata("design:type", String)
158
- ], Transaction.prototype, "transactionDate", void 0);
270
+ ], Transaction.prototype, "notes", void 0);
271
+ tslib_1.__decorate([
272
+ (0, typeorm_1.ManyToOne)(type => recurring_cash_item_1.RecurringCashItem, { nullable: true, onDelete: 'SET NULL' }),
273
+ (0, type_graphql_1.Field)(type => recurring_cash_item_1.RecurringCashItem, { nullable: true, description: 'The recurring item a forecast was made from' }),
274
+ tslib_1.__metadata("design:type", recurring_cash_item_1.RecurringCashItem)
275
+ ], Transaction.prototype, "recurringItem", void 0);
276
+ tslib_1.__decorate([
277
+ (0, typeorm_1.RelationId)((transaction) => transaction.recurringItem),
278
+ tslib_1.__metadata("design:type", String)
279
+ ], Transaction.prototype, "recurringItemId", void 0);
159
280
  tslib_1.__decorate([
160
281
  (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' }),
282
+ (0, type_graphql_1.Field)(type => [payment_1.Payment], { nullable: true, description: 'What this transaction paid' }),
162
283
  tslib_1.__metadata("design:type", Array)
163
284
  ], Transaction.prototype, "payments", void 0);
164
285
  tslib_1.__decorate([
165
286
  (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
- }),
287
+ (0, type_graphql_1.Field)(type => [accounting_document_1.AccountingDocument], { nullable: true, description: 'Documents linked to this transaction' }),
170
288
  tslib_1.__metadata("design:type", Array)
171
289
  ], Transaction.prototype, "documents", void 0);
172
290
  tslib_1.__decorate([
@@ -181,7 +299,7 @@ tslib_1.__decorate([
181
299
  ], Transaction.prototype, "updatedAt", void 0);
182
300
  tslib_1.__decorate([
183
301
  (0, typeorm_1.DeleteDateColumn)(),
184
- (0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when the transaction record was deleted (soft delete)' }),
302
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was deleted - financial rows are kept, not erased' }),
185
303
  tslib_1.__metadata("design:type", Date)
186
304
  ], Transaction.prototype, "deletedAt", void 0);
187
305
  tslib_1.__decorate([
@@ -203,27 +321,23 @@ tslib_1.__decorate([
203
321
  tslib_1.__metadata("design:type", String)
204
322
  ], Transaction.prototype, "updaterId", void 0);
205
323
  exports.Transaction = Transaction = tslib_1.__decorate([
206
- (0, type_graphql_1.ObjectType)({
207
- description: 'Entity representing a financial transaction, which could be sales, purchase, or other types of financial operations.'
208
- }),
324
+ (0, type_graphql_1.ObjectType)({ description: 'Money moving in or out - a bank line (confirmed) or a plan (forecast)' }),
209
325
  (0, typeorm_1.Entity)(),
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'
326
+ (0, typeorm_1.Index)('ix_transaction_0', (transaction) => [transaction.domain, transaction.bankFingerprint], {
327
+ unique: true,
328
+ where: '"deleted_at" IS NULL AND "bank_fingerprint" IS NOT NULL'
218
329
  }),
219
330
  (0, typeorm_1.Index)('ix_transaction_1', (transaction) => [
220
331
  transaction.domain,
221
- transaction.type,
222
- transaction.account,
332
+ transaction.bankAccount,
223
333
  transaction.transactionDate
224
- ], {
225
- unique: false,
226
- where: '"deleted_at" IS NULL'
227
- })
334
+ ]),
335
+ (0, typeorm_1.Index)('ix_transaction_2', (transaction) => [
336
+ transaction.domain,
337
+ transaction.category,
338
+ transaction.year,
339
+ transaction.month
340
+ ]),
341
+ (0, typeorm_1.Index)('ix_transaction_3', (transaction) => [transaction.domain, transaction.transactionDate])
228
342
  ], Transaction);
229
343
  //# sourceMappingURL=transaction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAsE;AAEtE,iDAA2D;AAC3D,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,2G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AC,OAAO;QACnB,WAAW,CAAC,eAAe;KAC5B,EACD;QACE,MAAM,EAAE,KAAK;QACb,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, moneyColumn } 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)\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(moneyColumn({ 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"]}
1
+ {"version":3,"file":"transaction.js","s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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, Float, ID, Int, registerEnumType } from 'type-graphql'\n\nimport { Domain, moneyColumn } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Counterparty } from '@things-factory/biz-base'\n\nimport { Account } from '../account/account'\nimport { BankAccount } from '../bank-account/bank-account'\nimport { BankStatement } from '../bank-statement/bank-statement'\nimport { CashFlowType } from '../cash-flow-type'\nimport { Payment } from '../payment/payment'\nimport { AccountingDocument } from '../accounting-document/accounting-document'\nimport { RecurringCashItem } from '../recurring-cash-item/recurring-cash-item'\n\nexport enum TransactionCategory {\n CONFIRMED = 'CONFIRMED',\n FORECAST = 'FORECAST'\n}\n\nregisterEnumType(TransactionCategory, {\n name: 'TransactionCategory',\n description: 'Whether a transaction happened on the bank account (confirmed) or is a plan someone made (forecast)'\n})\n\nexport enum TransactionSource {\n BANK_STATEMENT = 'BANK_STATEMENT',\n LEGACY = 'LEGACY',\n MANUAL = 'MANUAL'\n}\n\nregisterEnumType(TransactionSource, {\n name: 'TransactionSource',\n description:\n 'Where the facts of a confirmed transaction come from - a bank statement file, an old ledger, or a person'\n})\n\nexport enum ForecastStatus {\n PLANNED = 'PLANNED',\n DONE = 'DONE',\n CANCELLED = 'CANCELLED'\n}\n\nregisterEnumType(ForecastStatus, {\n name: 'ForecastStatus',\n description: 'State of a forecast - still expected, happened, dropped'\n})\n\n/**\n * Money that moves in or out of the business: a line on a bank account (confirmed), or a plan someone made of money\n * still to come or go (forecast).\n *\n * What a transaction paid - a contract round, a tax invoice, a VAT period - is its payments (§`Payment`). The facts\n * of a bank line are kept as the bank gave them, beside what a person wrote about it.\n */\n@ObjectType({ description: 'Money moving in or out - a bank line (confirmed) or a plan (forecast)' })\n@Entity()\n@Index('ix_transaction_0', (transaction: Transaction) => [transaction.domain, transaction.bankFingerprint], {\n unique: true,\n where: '\"deleted_at\" IS NULL AND \"bank_fingerprint\" IS NOT NULL'\n})\n@Index('ix_transaction_1', (transaction: Transaction) => [\n transaction.domain,\n transaction.bankAccount,\n transaction.transactionDate\n])\n@Index('ix_transaction_2', (transaction: Transaction) => [\n transaction.domain,\n transaction.category,\n transaction.year,\n transaction.month\n])\n@Index('ix_transaction_3', (transaction: Transaction) => [transaction.domain, transaction.transactionDate])\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(type => Domain, { 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({ default: TransactionCategory.CONFIRMED })\n @Field(type => TransactionCategory, { description: 'Confirmed (on the bank account) or forecast (a plan)' })\n category: TransactionCategory\n\n @Column({ default: CashFlowType.INCOME })\n @Field(type => CashFlowType, { description: 'Money in or money out' })\n type: CashFlowType\n\n @ManyToOne(type => BankAccount, { nullable: true })\n @Field(type => BankAccount, { nullable: true, description: 'The account the money moved in or out of' })\n bankAccount?: BankAccount\n\n @RelationId((transaction: Transaction) => transaction.bankAccount)\n bankAccountId?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description:\n \"YYYY-MM-DD - the day in the account's time zone; for a forecast, the day its timing names, empty when it names none\"\n })\n transactionDate?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Bank timestamp with UTC offset; empty when only a date is known' })\n transactionAt?: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Year of the transaction date - for a forecast, the year it is planned in' })\n year: number\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Month of the transaction date - for a forecast, the month it is planned in' })\n month: number\n\n @Column(moneyColumn())\n @Field(type => Float, { description: 'Amount, in the currency' })\n amount: number\n\n @Column({ default: 'KRW' })\n @Field({ description: 'ISO 4217 code - the currency of the account' })\n currency: string\n\n @Column(moneyColumn({ nullable: true, default: null }))\n @Field(type => Float, {\n nullable: true,\n description: 'Account balance after this transaction, as the bank statement says'\n })\n balance?: number\n\n @ManyToOne(type => Account, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Account, { nullable: true, description: 'The account subject it is booked to' })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What a person wrote about it - for a forecast, what is planned' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The classifying word of the ledger it was kept in' })\n ledgerCategory?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The counterparty name as a person wrote it' })\n counterpartyName?: string\n\n @ManyToOne(type => Counterparty, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Counterparty, {\n nullable: true,\n description: 'The registered counterparty, when the name is one the domain knows'\n })\n counterparty?: Counterparty\n\n @RelationId((transaction: Transaction) => transaction.counterparty)\n counterpartyId?: string\n\n @Column({ default: TransactionSource.MANUAL })\n @Field(type => TransactionSource, { description: 'Where the facts of the line come from' })\n source: TransactionSource\n\n @ManyToOne(type => BankStatement, { nullable: true, onDelete: 'RESTRICT' })\n @Field(type => BankStatement, { nullable: true, description: 'The bank statement file the line was read from' })\n bankStatement?: BankStatement\n\n @RelationId((transaction: Transaction) => transaction.bankStatement)\n bankStatementId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The file the line was read from, for lines from before statements were kept' })\n sourceFile?: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The row of the source file' })\n sourceRow?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'Chronological order within the source statement' })\n bankSequence?: number\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'What makes the bank line itself unique in the domain - the same line read twice is refused'\n })\n bankFingerprint?: string\n\n @Column({ type: 'simple-json', nullable: true })\n bankReconciliationBefore?: Record<string, any>\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Description as the bank wrote it' })\n bankDescription?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Kind of the line as the bank wrote it' })\n bankKind?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Counterparty name as the bank wrote it' })\n bankCounterpartyName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's account number as the bank wrote it\" })\n bankCounterpartyAccount?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's bank as the bank wrote it\" })\n bankCounterpartyBank?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Memo as the bank wrote it' })\n bankMemo?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'When in the month a forecast falls, as a person wrote it - 15th, end of month'\n })\n timing?: string\n\n @Column({ nullable: true })\n @Field(type => ForecastStatus, {\n nullable: true,\n description: 'State of a forecast; empty on a confirmed transaction'\n })\n status?: ForecastStatus\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The probability of a forecast being realized (0 to 100)' })\n probability?: number\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @ManyToOne(type => RecurringCashItem, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => RecurringCashItem, { nullable: true, description: 'The recurring item a forecast was made from' })\n recurringItem?: RecurringCashItem\n\n @RelationId((transaction: Transaction) => transaction.recurringItem)\n recurringItemId?: string\n\n @OneToMany(type => Payment, payment => payment.transaction)\n @Field(type => [Payment], { nullable: true, description: 'What this transaction paid' })\n payments?: Payment[]\n\n @OneToMany(type => AccountingDocument, document => document.transaction)\n @Field(type => [AccountingDocument], { nullable: true, description: 'Documents linked to this transaction' })\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: 'When it was deleted - financial rows are kept, not erased' })\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"]}