@things-factory/accounting 10.1.124 → 10.1.135

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 (257) 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 +8 -8
  12. package/dist-server/service/account/account-mutation.js.map +1 -1
  13. package/dist-server/service/account/account-query.js +2 -2
  14. package/dist-server/service/account/account-query.js.map +1 -1
  15. package/dist-server/service/account/account-type.d.ts +16 -0
  16. package/dist-server/service/account/account-type.js +71 -13
  17. package/dist-server/service/account/account-type.js.map +1 -1
  18. package/dist-server/service/account/account.d.ts +9 -3
  19. package/dist-server/service/account/account.js +34 -8
  20. package/dist-server/service/account/account.js.map +1 -1
  21. package/dist-server/service/account/index.d.ts +1 -1
  22. package/dist-server/service/accounting-category/accounting-category-mutation.js +8 -8
  23. package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -1
  24. package/dist-server/service/accounting-category/accounting-category-query.js +2 -2
  25. package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
  26. package/dist-server/service/accounting-category/index.d.ts +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/accounting-document/index.d.ts +1 -1
  32. package/dist-server/service/bank-account/bank-account-history.d.ts +11 -14
  33. package/dist-server/service/bank-account/bank-account-history.js +46 -59
  34. package/dist-server/service/bank-account/bank-account-history.js.map +1 -1
  35. package/dist-server/service/bank-account/bank-account-mutation.d.ts +1 -2
  36. package/dist-server/service/bank-account/bank-account-mutation.js +25 -69
  37. package/dist-server/service/bank-account/bank-account-mutation.js.map +1 -1
  38. package/dist-server/service/bank-account/bank-account-query.js +2 -0
  39. package/dist-server/service/bank-account/bank-account-query.js.map +1 -1
  40. package/dist-server/service/bank-account/bank-account-service.d.ts +5 -0
  41. package/dist-server/service/bank-account/bank-account-service.js +21 -0
  42. package/dist-server/service/bank-account/bank-account-service.js.map +1 -0
  43. package/dist-server/service/bank-account/bank-account-type.d.ts +13 -19
  44. package/dist-server/service/bank-account/bank-account-type.js +45 -69
  45. package/dist-server/service/bank-account/bank-account-type.js.map +1 -1
  46. package/dist-server/service/bank-account/bank-account.d.ts +14 -17
  47. package/dist-server/service/bank-account/bank-account.js +45 -57
  48. package/dist-server/service/bank-account/bank-account.js.map +1 -1
  49. package/dist-server/service/bank-account/index.d.ts +1 -1
  50. package/dist-server/service/bank-statement/bank-statement-query.d.ts +14 -0
  51. package/dist-server/service/bank-statement/bank-statement-query.js +92 -0
  52. package/dist-server/service/bank-statement/bank-statement-query.js.map +1 -0
  53. package/dist-server/service/bank-statement/bank-statement.d.ts +26 -0
  54. package/dist-server/service/bank-statement/bank-statement.js +109 -0
  55. package/dist-server/service/bank-statement/bank-statement.js.map +1 -0
  56. package/dist-server/service/bank-statement/index.d.ts +5 -0
  57. package/dist-server/service/bank-statement/index.js +9 -0
  58. package/dist-server/service/bank-statement/index.js.map +1 -0
  59. package/dist-server/service/cash-flow-type.d.ts +5 -0
  60. package/dist-server/service/cash-flow-type.js +15 -0
  61. package/dist-server/service/cash-flow-type.js.map +1 -0
  62. package/dist-server/service/financial-institution/financial-institution-mutation.js +10 -1
  63. package/dist-server/service/financial-institution/financial-institution-mutation.js.map +1 -1
  64. package/dist-server/service/financial-institution/financial-institution-query.js +14 -6
  65. package/dist-server/service/financial-institution/financial-institution-query.js.map +1 -1
  66. package/dist-server/service/financial-statement/financial-statement-history.d.ts +11 -9
  67. package/dist-server/service/financial-statement/financial-statement-history.js +44 -33
  68. package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
  69. package/dist-server/service/financial-statement/financial-statement-line.d.ts +24 -0
  70. package/dist-server/service/financial-statement/financial-statement-line.js +108 -0
  71. package/dist-server/service/financial-statement/financial-statement-line.js.map +1 -0
  72. package/dist-server/service/financial-statement/financial-statement-mutation.d.ts +1 -8
  73. package/dist-server/service/financial-statement/financial-statement-mutation.js +11 -136
  74. package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -1
  75. package/dist-server/service/financial-statement/financial-statement-query.d.ts +8 -7
  76. package/dist-server/service/financial-statement/financial-statement-query.js +42 -32
  77. package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
  78. package/dist-server/service/financial-statement/financial-statement-service.d.ts +33 -0
  79. package/dist-server/service/financial-statement/financial-statement-service.js +44 -0
  80. package/dist-server/service/financial-statement/financial-statement-service.js.map +1 -0
  81. package/dist-server/service/financial-statement/financial-statement.d.ts +19 -11
  82. package/dist-server/service/financial-statement/financial-statement.js +70 -62
  83. package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
  84. package/dist-server/service/financial-statement/index.d.ts +4 -3
  85. package/dist-server/service/financial-statement/index.js +2 -2
  86. package/dist-server/service/financial-statement/index.js.map +1 -1
  87. package/dist-server/service/fiscal-month/fiscal-month-mutation.js +6 -6
  88. package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -1
  89. package/dist-server/service/fiscal-month/fiscal-month-query.js +2 -2
  90. package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -1
  91. package/dist-server/service/fiscal-month/index.d.ts +1 -1
  92. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +6 -6
  93. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -1
  94. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +2 -2
  95. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -1
  96. package/dist-server/service/fiscal-quarter/index.d.ts +1 -1
  97. package/dist-server/service/fiscal-year/fiscal-year-mutation.js +6 -6
  98. package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -1
  99. package/dist-server/service/fiscal-year/fiscal-year-query.js +2 -2
  100. package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -1
  101. package/dist-server/service/fiscal-year/index.d.ts +1 -1
  102. package/dist-server/service/index.d.ts +15 -3
  103. package/dist-server/service/index.js +30 -13
  104. package/dist-server/service/index.js.map +1 -1
  105. package/dist-server/service/payment/index.d.ts +2 -1
  106. package/dist-server/service/payment/index.js +1 -0
  107. package/dist-server/service/payment/index.js.map +1 -1
  108. package/dist-server/service/payment/payment-history.d.ts +9 -16
  109. package/dist-server/service/payment/payment-history.js +36 -70
  110. package/dist-server/service/payment/payment-history.js.map +1 -1
  111. package/dist-server/service/payment/payment-mutation.d.ts +0 -1
  112. package/dist-server/service/payment/payment-mutation.js +19 -84
  113. package/dist-server/service/payment/payment-mutation.js.map +1 -1
  114. package/dist-server/service/payment/payment-query.d.ts +3 -0
  115. package/dist-server/service/payment/payment-query.js +32 -3
  116. package/dist-server/service/payment/payment-query.js.map +1 -1
  117. package/dist-server/service/payment/payment-service.d.ts +16 -0
  118. package/dist-server/service/payment/payment-service.js +140 -0
  119. package/dist-server/service/payment/payment-service.js.map +1 -0
  120. package/dist-server/service/payment/payment-targets.d.ts +31 -0
  121. package/dist-server/service/payment/payment-targets.js +19 -0
  122. package/dist-server/service/payment/payment-targets.js.map +1 -0
  123. package/dist-server/service/payment/payment-type.d.ts +13 -17
  124. package/dist-server/service/payment/payment-type.js +35 -51
  125. package/dist-server/service/payment/payment-type.js.map +1 -1
  126. package/dist-server/service/payment/payment.d.ts +23 -22
  127. package/dist-server/service/payment/payment.js +65 -95
  128. package/dist-server/service/payment/payment.js.map +1 -1
  129. package/dist-server/service/payment/transfer-target.d.ts +1 -0
  130. package/dist-server/service/payment/transfer-target.js +43 -0
  131. package/dist-server/service/payment/transfer-target.js.map +1 -0
  132. package/dist-server/service/recurring-cash-item/index.d.ts +6 -0
  133. package/dist-server/service/recurring-cash-item/index.js +10 -0
  134. package/dist-server/service/recurring-cash-item/index.js.map +1 -0
  135. package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.d.ts +7 -0
  136. package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js +63 -0
  137. package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js.map +1 -0
  138. package/dist-server/service/recurring-cash-item/recurring-cash-item-query.d.ts +15 -0
  139. package/dist-server/service/recurring-cash-item/recurring-cash-item-query.js +101 -0
  140. package/dist-server/service/recurring-cash-item/recurring-cash-item-query.js.map +1 -0
  141. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.d.ts +23 -0
  142. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js +91 -0
  143. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js.map +1 -0
  144. package/dist-server/service/recurring-cash-item/recurring-cash-item-type.d.ts +23 -0
  145. package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js +85 -0
  146. package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js.map +1 -0
  147. package/dist-server/service/recurring-cash-item/recurring-cash-item.d.ts +35 -0
  148. package/dist-server/service/recurring-cash-item/recurring-cash-item.js +142 -0
  149. package/dist-server/service/recurring-cash-item/recurring-cash-item.js.map +1 -0
  150. package/dist-server/service/recurring-cash-item/recurring-schedule.d.ts +36 -0
  151. package/dist-server/service/recurring-cash-item/recurring-schedule.js +41 -0
  152. package/dist-server/service/recurring-cash-item/recurring-schedule.js.map +1 -0
  153. package/dist-server/service/transaction/index.d.ts +2 -2
  154. package/dist-server/service/transaction/transaction-history.d.ts +42 -15
  155. package/dist-server/service/transaction/transaction-history.js +160 -54
  156. package/dist-server/service/transaction/transaction-history.js.map +1 -1
  157. package/dist-server/service/transaction/transaction-mutation.d.ts +0 -1
  158. package/dist-server/service/transaction/transaction-mutation.js +18 -83
  159. package/dist-server/service/transaction/transaction-mutation.js.map +1 -1
  160. package/dist-server/service/transaction/transaction-period.d.ts +16 -0
  161. package/dist-server/service/transaction/transaction-period.js +49 -0
  162. package/dist-server/service/transaction/transaction-period.js.map +1 -0
  163. package/dist-server/service/transaction/transaction-query.d.ts +12 -0
  164. package/dist-server/service/transaction/transaction-query.js +86 -4
  165. package/dist-server/service/transaction/transaction-query.js.map +1 -1
  166. package/dist-server/service/transaction/transaction-service.d.ts +30 -0
  167. package/dist-server/service/transaction/transaction-service.js +130 -0
  168. package/dist-server/service/transaction/transaction-service.js.map +1 -0
  169. package/dist-server/service/transaction/transaction-type.d.ts +39 -7
  170. package/dist-server/service/transaction/transaction-type.js +145 -23
  171. package/dist-server/service/transaction/transaction-type.js.map +1 -1
  172. package/dist-server/service/transaction/transaction.d.ts +58 -31
  173. package/dist-server/service/transaction/transaction.js +213 -111
  174. package/dist-server/service/transaction/transaction.js.map +1 -1
  175. package/dist-server/tsconfig.tsbuildinfo +1 -1
  176. package/package.json +8 -4
  177. package/things-factory.config.js +0 -4
  178. package/translations/en.json +34 -2
  179. package/translations/ja.json +0 -1
  180. package/translations/ko.json +34 -2
  181. package/translations/ms.json +0 -1
  182. package/translations/zh.json +0 -1
  183. package/dist-client/pages/account/account-importer.d.ts +0 -22
  184. package/dist-client/pages/account/account-importer.js +0 -99
  185. package/dist-client/pages/account/account-importer.js.map +0 -1
  186. package/dist-client/pages/account/account-list-page.d.ts +0 -57
  187. package/dist-client/pages/account/account-list-page.js +0 -306
  188. package/dist-client/pages/account/account-list-page.js.map +0 -1
  189. package/dist-client/pages/bank-account/bank-account-importer.d.ts +0 -23
  190. package/dist-client/pages/bank-account/bank-account-importer.js +0 -92
  191. package/dist-client/pages/bank-account/bank-account-importer.js.map +0 -1
  192. package/dist-client/pages/bank-account/bank-account-list-page.d.ts +0 -60
  193. package/dist-client/pages/bank-account/bank-account-list-page.js +0 -317
  194. package/dist-client/pages/bank-account/bank-account-list-page.js.map +0 -1
  195. package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +0 -22
  196. package/dist-client/pages/financial-statement/financial-statement-importer.js +0 -99
  197. package/dist-client/pages/financial-statement/financial-statement-importer.js.map +0 -1
  198. package/dist-client/pages/financial-statement/financial-statement-list-page.d.ts +0 -57
  199. package/dist-client/pages/financial-statement/financial-statement-list-page.js +0 -280
  200. package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +0 -1
  201. package/dist-client/pages/income-statement/income-statement-importer.d.ts +0 -22
  202. package/dist-client/pages/income-statement/income-statement-importer.js +0 -99
  203. package/dist-client/pages/income-statement/income-statement-importer.js.map +0 -1
  204. package/dist-client/pages/income-statement/income-statement-list-page.d.ts +0 -57
  205. package/dist-client/pages/income-statement/income-statement-list-page.js +0 -280
  206. package/dist-client/pages/income-statement/income-statement-list-page.js.map +0 -1
  207. package/dist-client/pages/payment/payment-importer.d.ts +0 -23
  208. package/dist-client/pages/payment/payment-importer.js +0 -92
  209. package/dist-client/pages/payment/payment-importer.js.map +0 -1
  210. package/dist-client/pages/payment/payment-list-page.d.ts +0 -60
  211. package/dist-client/pages/payment/payment-list-page.js +0 -317
  212. package/dist-client/pages/payment/payment-list-page.js.map +0 -1
  213. package/dist-client/pages/transaction/transaction-importer.d.ts +0 -22
  214. package/dist-client/pages/transaction/transaction-importer.js +0 -99
  215. package/dist-client/pages/transaction/transaction-importer.js.map +0 -1
  216. package/dist-client/pages/transaction/transaction-list-page.d.ts +0 -57
  217. package/dist-client/pages/transaction/transaction-list-page.js +0 -280
  218. package/dist-client/pages/transaction/transaction-list-page.js.map +0 -1
  219. package/dist-server/controllers/index.d.ts +0 -1
  220. package/dist-server/controllers/index.js +0 -5
  221. package/dist-server/controllers/index.js.map +0 -1
  222. package/dist-server/controllers/summary-statements.d.ts +0 -4
  223. package/dist-server/controllers/summary-statements.js +0 -149
  224. package/dist-server/controllers/summary-statements.js.map +0 -1
  225. package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +0 -5
  226. package/dist-server/migrations/1725201567284-seed-country-codes.js +0 -255
  227. package/dist-server/migrations/1725201567284-seed-country-codes.js.map +0 -1
  228. package/dist-server/service/financial-statement/financial-statement-line-item.d.ts +0 -19
  229. package/dist-server/service/financial-statement/financial-statement-line-item.js +0 -94
  230. package/dist-server/service/financial-statement/financial-statement-line-item.js.map +0 -1
  231. package/dist-server/service/financial-statement/financial-statement-type.d.ts +0 -20
  232. package/dist-server/service/financial-statement/financial-statement-type.js +0 -77
  233. package/dist-server/service/financial-statement/financial-statement-type.js.map +0 -1
  234. package/dist-server/service/income-statement/event-subscriber.d.ts +0 -7
  235. package/dist-server/service/income-statement/event-subscriber.js +0 -21
  236. package/dist-server/service/income-statement/event-subscriber.js.map +0 -1
  237. package/dist-server/service/income-statement/income-statement-history.d.ts +0 -28
  238. package/dist-server/service/income-statement/income-statement-history.js +0 -146
  239. package/dist-server/service/income-statement/income-statement-history.js.map +0 -1
  240. package/dist-server/service/income-statement/income-statement-line-item.d.ts +0 -19
  241. package/dist-server/service/income-statement/income-statement-line-item.js +0 -96
  242. package/dist-server/service/income-statement/income-statement-line-item.js.map +0 -1
  243. package/dist-server/service/income-statement/income-statement-mutation.d.ts +0 -10
  244. package/dist-server/service/income-statement/income-statement-mutation.js +0 -159
  245. package/dist-server/service/income-statement/income-statement-mutation.js.map +0 -1
  246. package/dist-server/service/income-statement/income-statement-query.d.ts +0 -11
  247. package/dist-server/service/income-statement/income-statement-query.js +0 -81
  248. package/dist-server/service/income-statement/income-statement-query.js.map +0 -1
  249. package/dist-server/service/income-statement/income-statement-type.d.ts +0 -20
  250. package/dist-server/service/income-statement/income-statement-type.js +0 -77
  251. package/dist-server/service/income-statement/income-statement-type.js.map +0 -1
  252. package/dist-server/service/income-statement/income-statement.d.ts +0 -28
  253. package/dist-server/service/income-statement/income-statement.js +0 -137
  254. package/dist-server/service/income-statement/income-statement.js.map +0 -1
  255. package/dist-server/service/income-statement/index.d.ts +0 -8
  256. package/dist-server/service/income-statement/index.js +0 -13
  257. package/dist-server/service/income-statement/index.js.map +0 -1
@@ -6,54 +6,64 @@ const type_graphql_1 = require("type-graphql");
6
6
  const shell_1 = require("@things-factory/shell");
7
7
  const auth_base_1 = require("@things-factory/auth-base");
8
8
  const financial_statement_1 = require("./financial-statement");
9
- const financial_statement_type_1 = require("./financial-statement-type");
9
+ const financial_statement_line_1 = require("./financial-statement-line");
10
10
  let FinancialStatementQuery = class FinancialStatementQuery {
11
- async financialStatement(id, context) {
11
+ async financialStatementYears(context) {
12
12
  const { domain } = context.state;
13
- return await (0, shell_1.getRepository)(financial_statement_1.FinancialStatement).findOne({
14
- where: { domain: { id: domain.id }, id }
13
+ const rows = await (0, shell_1.getRepository)(financial_statement_1.FinancialStatement).find({
14
+ where: { domain: { id: domain.id } },
15
+ select: ['fiscalYear']
15
16
  });
17
+ return [...new Set(rows.map(row => row.fiscalYear))].sort((a, b) => b - a);
16
18
  }
17
- async financialStatements(params, context) {
19
+ async financialStatements(fiscalYear, context) {
18
20
  const { domain } = context.state;
19
- const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
20
- domain,
21
- params,
22
- repository: await (0, shell_1.getRepository)(financial_statement_1.FinancialStatement),
23
- searchables: ['name', 'description']
21
+ return await (0, shell_1.getRepository)(financial_statement_1.FinancialStatement).find({
22
+ where: { domain: { id: domain.id }, fiscalYear },
23
+ order: { kind: 'ASC' }
24
24
  });
25
- const [items, total] = await queryBuilder.getManyAndCount();
26
- return { items, total };
27
25
  }
28
- async domain(financialStatement) {
29
- return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: financialStatement.domainId });
26
+ async lines(statement) {
27
+ return await (0, shell_1.getRepository)(financial_statement_line_1.FinancialStatementLine).find({
28
+ where: { statement: { id: statement.id } },
29
+ order: { code: 'ASC' }
30
+ });
31
+ }
32
+ async domain(statement) {
33
+ return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: statement.domainId });
30
34
  }
31
- async updater(financialStatement) {
32
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: financialStatement.updaterId });
35
+ async creator(statement) {
36
+ return statement.creatorId ? await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: statement.creatorId }) : null;
33
37
  }
34
- async creator(financialStatement) {
35
- return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: financialStatement.creatorId });
38
+ async updater(statement) {
39
+ return statement.updaterId ? await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: statement.updaterId }) : null;
36
40
  }
37
41
  };
38
42
  exports.FinancialStatementQuery = FinancialStatementQuery;
39
43
  tslib_1.__decorate([
40
- (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query")'),
41
- (0, type_graphql_1.Query)(returns => financial_statement_1.FinancialStatement, { nullable: true, description: 'To fetch a FinancialStatement' }),
42
- tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
43
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
44
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query", domainOwnerGranted: true)'),
45
+ (0, type_graphql_1.Query)(returns => [type_graphql_1.Int], { description: 'The fiscal years with a filed statement, the latest first' }),
46
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
44
47
  tslib_1.__metadata("design:type", Function),
45
- tslib_1.__metadata("design:paramtypes", [String, Object]),
48
+ tslib_1.__metadata("design:paramtypes", [Object]),
46
49
  tslib_1.__metadata("design:returntype", Promise)
47
- ], FinancialStatementQuery.prototype, "financialStatement", null);
50
+ ], FinancialStatementQuery.prototype, "financialStatementYears", null);
48
51
  tslib_1.__decorate([
49
- (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query")'),
50
- (0, type_graphql_1.Query)(returns => financial_statement_type_1.FinancialStatementList, { description: 'To fetch multiple FinancialStatements' }),
51
- tslib_1.__param(0, (0, type_graphql_1.Args)()),
52
+ (0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query", domainOwnerGranted: true)'),
53
+ (0, type_graphql_1.Query)(returns => [financial_statement_1.FinancialStatement], { description: 'The statements filed for a fiscal year' }),
54
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('fiscalYear', type => type_graphql_1.Int)),
52
55
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
53
56
  tslib_1.__metadata("design:type", Function),
54
- tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
57
+ tslib_1.__metadata("design:paramtypes", [Number, Object]),
55
58
  tslib_1.__metadata("design:returntype", Promise)
56
59
  ], FinancialStatementQuery.prototype, "financialStatements", null);
60
+ tslib_1.__decorate([
61
+ (0, type_graphql_1.FieldResolver)(type => [financial_statement_line_1.FinancialStatementLine]),
62
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
63
+ tslib_1.__metadata("design:type", Function),
64
+ tslib_1.__metadata("design:paramtypes", [financial_statement_1.FinancialStatement]),
65
+ tslib_1.__metadata("design:returntype", Promise)
66
+ ], FinancialStatementQuery.prototype, "lines", null);
57
67
  tslib_1.__decorate([
58
68
  (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
59
69
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
@@ -62,19 +72,19 @@ tslib_1.__decorate([
62
72
  tslib_1.__metadata("design:returntype", Promise)
63
73
  ], FinancialStatementQuery.prototype, "domain", null);
64
74
  tslib_1.__decorate([
65
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
75
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
66
76
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
67
77
  tslib_1.__metadata("design:type", Function),
68
78
  tslib_1.__metadata("design:paramtypes", [financial_statement_1.FinancialStatement]),
69
79
  tslib_1.__metadata("design:returntype", Promise)
70
- ], FinancialStatementQuery.prototype, "updater", null);
80
+ ], FinancialStatementQuery.prototype, "creator", null);
71
81
  tslib_1.__decorate([
72
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
82
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
73
83
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
74
84
  tslib_1.__metadata("design:type", Function),
75
85
  tslib_1.__metadata("design:paramtypes", [financial_statement_1.FinancialStatement]),
76
86
  tslib_1.__metadata("design:returntype", Promise)
77
- ], FinancialStatementQuery.prototype, "creator", null);
87
+ ], FinancialStatementQuery.prototype, "updater", null);
78
88
  exports.FinancialStatementQuery = FinancialStatementQuery = tslib_1.__decorate([
79
89
  (0, type_graphql_1.Resolver)(financial_statement_1.FinancialStatement)
80
90
  ], FinancialStatementQuery);
@@ -1 +1 @@
1
- {"version":3,"file":"financial-statement-query.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,+DAA0D;AAC1D,yEAAmE;AAG5D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAG5B,AAAN,KAAK,CAAC,kBAAkB,CAAY,EAAU,EAAS,OAAwB;QAC7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC,CAAC,OAAO,CAAC;YACrD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,mBAAmB,CACf,MAAiB,EAClB,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC;YACnD,WAAW,EAAE,CA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N,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADU,iBAAS;;kEAe1B;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;qDAE1D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;sDAE3D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;sDAE3D;kCA5CU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,uBAAuB,CA6CnC","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { FinancialStatement } from './financial-statement'\nimport { FinancialStatementList } from './financial-statement-type'\n\n@Resolver(FinancialStatement)\nexport class FinancialStatementQuery {\n @Directive('@privilege(category: \"accounting\", privilege: \"query\")')\n @Query(returns => FinancialStatement!, { nullable: true, description: 'To fetch a FinancialStatement' })\n async financialStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<FinancialStatement> {\n const { domain } = context.state\n\n return await getRepository(FinancialStatement).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"accounting\", privilege: \"query\")')\n @Query(returns => FinancialStatementList, { description: 'To fetch multiple FinancialStatements' })\n async financialStatements(\n @Args() params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatementList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(FinancialStatement),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() financialStatement: FinancialStatement): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: financialStatement.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() financialStatement: FinancialStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: financialStatement.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() financialStatement: FinancialStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: financialStatement.creatorId })\n }\n}\n"]}
1
+ {"version":3,"file":"financial-statement-query.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA6F;AAE7F,iDAA6D;AAC7D,yDAAgD;AAEhD,+DAA0D;AAC1D,yEAAmE;AAG5D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAG5B,AAAN,KAAK,CAAC,uBAAuB,CAAQ,OAAwB;QAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC,CAAC,IAAI,CAAC;YACxD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE;YACpC,MAAM,EAAE,CAAC,YAAY,CAAC;SACvB,CAAC,CAAA;QAEF,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAC5E,CAAC;IAIK,AAAN,KAAK,CAAC,mBAAmB,CACS,UAAkB,EAC3C,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GA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ldResolver, Root, Arg, Ctx, Directive, Int } from 'type-graphql'\n\nimport { Domain, getRepository } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nimport { FinancialStatement } from './financial-statement'\nimport { FinancialStatementLine } from './financial-statement-line'\n\n@Resolver(FinancialStatement)\nexport class FinancialStatementQuery {\n @Directive('@privilege(category: \"accounting\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => [Int], { description: 'The fiscal years with a filed statement, the latest first' })\n async financialStatementYears(@Ctx() context: ResolverContext): Promise<number[]> {\n const { domain } = context.state\n const rows = await getRepository(FinancialStatement).find({\n where: { domain: { id: domain.id } },\n select: ['fiscalYear']\n })\n\n return [...new Set(rows.map(row => row.fiscalYear))].sort((a, b) => b - a)\n }\n\n @Directive('@privilege(category: \"accounting\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => [FinancialStatement], { description: 'The statements filed for a fiscal year' })\n async financialStatements(\n @Arg('fiscalYear', type => Int) fiscalYear: number,\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement[]> {\n const { domain } = context.state\n\n return await getRepository(FinancialStatement).find({\n where: { domain: { id: domain.id }, fiscalYear },\n order: { kind: 'ASC' }\n })\n }\n\n @FieldResolver(type => [FinancialStatementLine])\n async lines(@Root() statement: FinancialStatement): Promise<FinancialStatementLine[]> {\n return await getRepository(FinancialStatementLine).find({\n where: { statement: { id: statement.id } },\n order: { code: 'ASC' }\n })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() statement: FinancialStatement): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: statement.domainId })\n }\n\n @FieldResolver(type => User, { nullable: true })\n async creator(@Root() statement: FinancialStatement): Promise<User | null> {\n return statement.creatorId ? await getRepository(User).findOneBy({ id: statement.creatorId }) : null\n }\n\n @FieldResolver(type => User, { nullable: true })\n async updater(@Root() statement: FinancialStatement): Promise<User | null> {\n return statement.updaterId ? await getRepository(User).findOneBy({ id: statement.updaterId }) : null\n }\n}\n"]}
@@ -0,0 +1,33 @@
1
+ import { EntityManager } from 'typeorm';
2
+ import { FinancialStatement, FinancialStatementKind } from './financial-statement';
3
+ export interface FiledStatement {
4
+ fiscalYear: number;
5
+ kind: FinancialStatementKind;
6
+ periodFrom?: string | null;
7
+ periodTo?: string | null;
8
+ filingKind?: string | null;
9
+ filedOn?: string | null;
10
+ issueNo?: string | null;
11
+ source?: string | null;
12
+ notes?: string | null;
13
+ lines: {
14
+ code: string;
15
+ name: string;
16
+ amount: number;
17
+ rank?: number;
18
+ level?: number;
19
+ contra?: boolean;
20
+ }[];
21
+ }
22
+ /**
23
+ * Record a filed statement. The one of the same year and kind it replaces is deleted (softly), lines and all.
24
+ * Returns whether one was replaced.
25
+ */
26
+ export declare function saveFiledStatement(tx: EntityManager, domain: {
27
+ id: string;
28
+ }, user: any, filed: FiledStatement): Promise<{
29
+ statement: FinancialStatement;
30
+ replaced: boolean;
31
+ }>;
32
+ /** Delete statements (softly), lines and all. */
33
+ export declare function deleteStatements(tx: EntityManager, statements: FinancialStatement[]): Promise<void>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.saveFiledStatement = saveFiledStatement;
4
+ exports.deleteStatements = deleteStatements;
5
+ const shell_1 = require("@things-factory/shell");
6
+ const financial_statement_1 = require("./financial-statement");
7
+ const financial_statement_line_1 = require("./financial-statement-line");
8
+ /**
9
+ * Record a filed statement. The one of the same year and kind it replaces is deleted (softly), lines and all.
10
+ * Returns whether one was replaced.
11
+ */
12
+ async function saveFiledStatement(tx, domain, user, filed) {
13
+ if (!Number.isInteger(filed.fiscalYear))
14
+ throw new shell_1.Refusal('statement-year-required', {}, 'fiscalYear: the year it is of');
15
+ if (!Object.values(financial_statement_1.FinancialStatementKind).includes(filed.kind))
16
+ throw new shell_1.Refusal('statement-kind-unknown', { kind: filed.kind ?? '' }, 'kind: which statement');
17
+ const codes = filed.lines.map(line => line.code);
18
+ if (new Set(codes).size !== codes.length)
19
+ throw new shell_1.Refusal('statement-line-code-twice', {}, 'a line code appears twice');
20
+ const statements = tx.getRepository(financial_statement_1.FinancialStatement);
21
+ const lines = tx.getRepository(financial_statement_line_1.FinancialStatementLine);
22
+ const previous = await statements.findOne({
23
+ where: { domain: { id: domain.id }, fiscalYear: filed.fiscalYear, kind: filed.kind }
24
+ });
25
+ if (previous)
26
+ await deleteStatements(tx, [previous]);
27
+ const { lines: filedLines, ...fields } = filed;
28
+ const statement = await statements.save({ ...fields, domain, creator: user, updater: user });
29
+ await lines.save(filedLines.map(line => ({ ...line, domain, statement: { id: statement.id }, creator: user, updater: user })));
30
+ return { statement, replaced: !!previous };
31
+ }
32
+ /** Delete statements (softly), lines and all. */
33
+ async function deleteStatements(tx, statements) {
34
+ if (!statements.length)
35
+ return;
36
+ const lines = tx.getRepository(financial_statement_line_1.FinancialStatementLine);
37
+ for (const statement of statements) {
38
+ const old = await lines.find({ where: { statement: { id: statement.id } }, select: ['id'] });
39
+ if (old.length)
40
+ await lines.softDelete(old.map(line => line.id));
41
+ }
42
+ await tx.getRepository(financial_statement_1.FinancialStatement).softDelete(statements.map(statement => statement.id));
43
+ }
44
+ //# sourceMappingURL=financial-statement-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"financial-statement-service.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-service.ts"],"names":[],"mappings":";;AAwBA,gDA+BC;AAGD,4CAQC;AAhED,iDAA+C;AAE/C,+DAAkF;AAClF,yEAAmE;AAenE;;;GAGG;AACI,KAAK,UAAU,kBAAkB,CACtC,EAAiB,EACjB,MAAsB,EACtB,IAAS,EACT,KAAqB;IAErB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;QACrC,MAAM,IAAI,eAAO,CAAC,yBAAyB,EAAE,EAAE,EAAE,+BAA+B,CAAC,CAAA;IACnF,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,4CAAsB,CAAC,CAAC,QAAQ,CAAC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,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAA2B,CACjH,CACF,CAAA;IAED,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAA;AAC5C,CAAC;AAED,iDAAiD;AAC1C,KAAK,UAAU,gBAAgB,CAAC,EAAiB,EAAE,UAAgC;IACxF,IAAI,CAAC,UAAU,CAAC,MAAM;QAAE,OAAM;IAC9B,MAAM,KAAK,GAAG,EAAE,CAAC,aAAa,CAAC,iDAAsB,CAAC,CAAA;IACtD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC5F,IAAI,GAAG,CAAC,MAAM;YAAE,MAAM,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;IAClE,CAAC;IACD,MAAM,EAAE,CAAC,aAAa,CAAC,wCAAkB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAA;AAClG,CAAC","sourcesContent":["import { EntityManager } from 'typeorm'\n\nimport { Refusal } from '@things-factory/shell'\n\nimport { FinancialStatement, FinancialStatementKind } from './financial-statement'\nimport { FinancialStatementLine } from './financial-statement-line'\n\nexport interface FiledStatement {\n fiscalYear: number\n kind: FinancialStatementKind\n periodFrom?: string | null\n periodTo?: string | null\n filingKind?: string | null\n filedOn?: string | null\n issueNo?: string | null\n source?: string | null\n notes?: string | null\n lines: { code: string; name: string; amount: number; rank?: number; level?: number; contra?: boolean }[]\n}\n\n/**\n * Record a filed statement. The one of the same year and kind it replaces is deleted (softly), lines and all.\n * Returns whether one was replaced.\n */\nexport async function saveFiledStatement(\n tx: EntityManager,\n domain: { id: string },\n user: any,\n filed: FiledStatement\n): Promise<{ statement: FinancialStatement; replaced: boolean }> {\n if (!Number.isInteger(filed.fiscalYear))\n throw new Refusal('statement-year-required', {}, 'fiscalYear: the year it is of')\n if (!Object.values(FinancialStatementKind).includes(filed.kind))\n throw new Refusal('statement-kind-unknown', { kind: filed.kind ?? '' }, 'kind: which statement')\n const codes = filed.lines.map(line => line.code)\n if (new Set(codes).size !== codes.length)\n throw new Refusal('statement-line-code-twice', {}, 'a line code appears twice')\n\n const statements = tx.getRepository(FinancialStatement)\n const lines = tx.getRepository(FinancialStatementLine)\n const previous = await statements.findOne({\n where: { domain: { id: domain.id }, fiscalYear: filed.fiscalYear, kind: filed.kind }\n })\n if (previous) await deleteStatements(tx, [previous])\n\n const { lines: filedLines, ...fields } = filed\n const statement = await statements.save({ ...fields, domain, creator: user, updater: user } as FinancialStatement)\n await lines.save(\n filedLines.map(\n line =>\n ({ ...line, domain, statement: { id: statement.id }, creator: user, updater: user }) as FinancialStatementLine\n )\n )\n\n return { statement, replaced: !!previous }\n}\n\n/** Delete statements (softly), lines and all. */\nexport async function deleteStatements(tx: EntityManager, statements: FinancialStatement[]): Promise<void> {\n if (!statements.length) return\n const lines = tx.getRepository(FinancialStatementLine)\n for (const statement of statements) {\n const old = await lines.find({ where: { statement: { id: statement.id } }, select: ['id'] })\n if (old.length) await lines.softDelete(old.map(line => line.id))\n }\n await tx.getRepository(FinancialStatement).softDelete(statements.map(statement => statement.id))\n}\n"]}
@@ -1,22 +1,30 @@
1
1
  import { Domain } from '@things-factory/shell';
2
2
  import { User } from '@things-factory/auth-base';
3
- import { FinancialStatementLineItem } from './financial-statement-line-item';
4
- export declare enum FinancialStatementStatus {
5
- STATUS_A = "STATUS_A",
6
- STATUS_B = "STATUS_B"
3
+ import { FinancialStatementLine } from './financial-statement-line';
4
+ export declare enum FinancialStatementKind {
5
+ BALANCE_SHEET = "BALANCE_SHEET",
6
+ INCOME_STATEMENT = "INCOME_STATEMENT",
7
+ COST_OF_GOODS = "COST_OF_GOODS"
7
8
  }
9
+ /**
10
+ * A financial statement of a fiscal year, line by line, as it was filed. Filing it again replaces it; what the books
11
+ * moved on the same lines is read beside it, not kept.
12
+ */
8
13
  export declare class FinancialStatement {
9
14
  readonly id: string;
10
15
  version?: number;
11
16
  domain?: Domain;
12
17
  domainId?: string;
13
- year?: number;
14
- quarter?: number;
15
- month?: number;
16
- asset?: number;
17
- liability?: number;
18
- equity?: number;
19
- lineItems?: FinancialStatementLineItem[];
18
+ fiscalYear: number;
19
+ kind: FinancialStatementKind;
20
+ periodFrom?: string;
21
+ periodTo?: string;
22
+ filingKind?: string;
23
+ filedOn?: string;
24
+ issueNo?: string;
25
+ source?: string;
26
+ notes?: string;
27
+ lines?: FinancialStatementLine[];
20
28
  createdAt?: Date;
21
29
  updatedAt?: Date;
22
30
  deletedAt?: Date;
@@ -1,25 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FinancialStatement = exports.FinancialStatementStatus = void 0;
3
+ exports.FinancialStatement = exports.FinancialStatementKind = 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 financial_statement_line_item_1 = require("./financial-statement-line-item");
10
- var FinancialStatementStatus;
11
- (function (FinancialStatementStatus) {
12
- FinancialStatementStatus["STATUS_A"] = "STATUS_A";
13
- FinancialStatementStatus["STATUS_B"] = "STATUS_B";
14
- })(FinancialStatementStatus || (exports.FinancialStatementStatus = FinancialStatementStatus = {}));
15
- (0, type_graphql_1.registerEnumType)(FinancialStatementStatus, {
16
- name: 'FinancialStatementStatus',
17
- description: 'State enumeration of a financial statement' // 재무제표 상태 열거형
9
+ const financial_statement_line_1 = require("./financial-statement-line");
10
+ var FinancialStatementKind;
11
+ (function (FinancialStatementKind) {
12
+ FinancialStatementKind["BALANCE_SHEET"] = "BALANCE_SHEET";
13
+ FinancialStatementKind["INCOME_STATEMENT"] = "INCOME_STATEMENT";
14
+ FinancialStatementKind["COST_OF_GOODS"] = "COST_OF_GOODS";
15
+ })(FinancialStatementKind || (exports.FinancialStatementKind = FinancialStatementKind = {}));
16
+ (0, type_graphql_1.registerEnumType)(FinancialStatementKind, {
17
+ name: 'FinancialStatementKind',
18
+ description: 'Which statement - balance sheet, income statement, statement of cost of goods manufactured'
18
19
  });
19
- // 재무제표 (Financial Statement)
20
+ /**
21
+ * A financial statement of a fiscal year, line by line, as it was filed. Filing it again replaces it; what the books
22
+ * moved on the same lines is read beside it, not kept.
23
+ */
20
24
  let FinancialStatement = class FinancialStatement {
21
25
  constructor() {
22
- this.version = 1; // 낙관적 잠금을 위한 버전 관리 필드
26
+ this.version = 1;
23
27
  }
24
28
  };
25
29
  exports.FinancialStatement = FinancialStatement;
@@ -35,98 +39,102 @@ tslib_1.__decorate([
35
39
  ], FinancialStatement.prototype, "version", void 0);
36
40
  tslib_1.__decorate([
37
41
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
38
- (0, type_graphql_1.Field)({ nullable: true, description: 'The domain to which this financial statement belongs' }),
39
- tslib_1.__metadata("design:type", shell_1.Domain // 이 재무제표가 속한 도메인
40
- )
42
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain to which this financial statement belongs' }),
43
+ tslib_1.__metadata("design:type", shell_1.Domain)
41
44
  ], FinancialStatement.prototype, "domain", void 0);
42
45
  tslib_1.__decorate([
43
- (0, typeorm_1.RelationId)((financialStatement) => financialStatement.domain),
46
+ (0, typeorm_1.RelationId)((statement) => statement.domain),
44
47
  tslib_1.__metadata("design:type", String)
45
48
  ], FinancialStatement.prototype, "domainId", void 0);
46
49
  tslib_1.__decorate([
47
- (0, typeorm_1.Column)({ nullable: true }),
48
- (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal year of the financial statement' }),
50
+ (0, typeorm_1.Column)({ type: 'int' }),
51
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Fiscal year' }),
49
52
  tslib_1.__metadata("design:type", Number)
50
- ], FinancialStatement.prototype, "year", void 0);
53
+ ], FinancialStatement.prototype, "fiscalYear", void 0);
54
+ tslib_1.__decorate([
55
+ (0, typeorm_1.Column)(),
56
+ (0, type_graphql_1.Field)(type => FinancialStatementKind, { description: 'Which statement' }),
57
+ tslib_1.__metadata("design:type", String)
58
+ ], FinancialStatement.prototype, "kind", void 0);
51
59
  tslib_1.__decorate([
52
60
  (0, typeorm_1.Column)({ nullable: true }),
53
- (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal quarter of the financial statement' }),
54
- tslib_1.__metadata("design:type", Number)
55
- ], FinancialStatement.prototype, "quarter", void 0);
61
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD - the first day of the period' }),
62
+ tslib_1.__metadata("design:type", String)
63
+ ], FinancialStatement.prototype, "periodFrom", void 0);
56
64
  tslib_1.__decorate([
57
65
  (0, typeorm_1.Column)({ nullable: true }),
58
- (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal month of the financial statement' }),
59
- tslib_1.__metadata("design:type", Number)
60
- ], FinancialStatement.prototype, "month", void 0);
66
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD - the last day of the period' }),
67
+ tslib_1.__metadata("design:type", String)
68
+ ], FinancialStatement.prototype, "periodTo", void 0);
61
69
  tslib_1.__decorate([
62
70
  (0, typeorm_1.Column)({ nullable: true }),
63
- (0, type_graphql_1.Field)({ nullable: true, description: 'Total assets recorded in the financial statement' }),
64
- tslib_1.__metadata("design:type", Number)
65
- ], FinancialStatement.prototype, "asset", void 0);
71
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The kind of filing - regular, amended' }),
72
+ tslib_1.__metadata("design:type", String)
73
+ ], FinancialStatement.prototype, "filingKind", void 0);
66
74
  tslib_1.__decorate([
67
75
  (0, typeorm_1.Column)({ nullable: true }),
68
- (0, type_graphql_1.Field)({ nullable: true, description: 'Total liabilities recorded in the financial statement' }),
69
- tslib_1.__metadata("design:type", Number)
70
- ], FinancialStatement.prototype, "liability", void 0);
76
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD - when it was filed' }),
77
+ tslib_1.__metadata("design:type", String)
78
+ ], FinancialStatement.prototype, "filedOn", void 0);
71
79
  tslib_1.__decorate([
72
80
  (0, typeorm_1.Column)({ nullable: true }),
73
- (0, type_graphql_1.Field)({ nullable: true, description: 'Total equity recorded in the financial statement' }),
74
- tslib_1.__metadata("design:type", Number)
75
- ], FinancialStatement.prototype, "equity", void 0);
81
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The issue number of the certificate it came from' }),
82
+ tslib_1.__metadata("design:type", String)
83
+ ], FinancialStatement.prototype, "issueNo", void 0);
84
+ tslib_1.__decorate([
85
+ (0, typeorm_1.Column)({ nullable: true }),
86
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The document it came from' }),
87
+ tslib_1.__metadata("design:type", String)
88
+ ], FinancialStatement.prototype, "source", void 0);
89
+ tslib_1.__decorate([
90
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
91
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
92
+ tslib_1.__metadata("design:type", String)
93
+ ], FinancialStatement.prototype, "notes", void 0);
76
94
  tslib_1.__decorate([
77
- (0, typeorm_1.OneToMany)(type => financial_statement_line_item_1.FinancialStatementLineItem, lineItem => lineItem.statement),
78
- (0, type_graphql_1.Field)(type => [financial_statement_line_item_1.FinancialStatementLineItem], { nullable: true }),
95
+ (0, typeorm_1.OneToMany)(type => financial_statement_line_1.FinancialStatementLine, line => line.statement),
96
+ (0, type_graphql_1.Field)(type => [financial_statement_line_1.FinancialStatementLine], { nullable: true, description: 'Its lines, in the order of the statement' }),
79
97
  tslib_1.__metadata("design:type", Array)
80
- ], FinancialStatement.prototype, "lineItems", void 0);
98
+ ], FinancialStatement.prototype, "lines", void 0);
81
99
  tslib_1.__decorate([
82
100
  (0, typeorm_1.CreateDateColumn)(),
83
- (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the financial statement was created' }),
84
- tslib_1.__metadata("design:type", Date // 재무제표가 생성된 날짜 및 시간
85
- )
101
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was recorded' }),
102
+ tslib_1.__metadata("design:type", Date)
86
103
  ], FinancialStatement.prototype, "createdAt", void 0);
87
104
  tslib_1.__decorate([
88
105
  (0, typeorm_1.UpdateDateColumn)(),
89
- (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the financial statement was last updated' }),
90
- tslib_1.__metadata("design:type", Date // 재무제표가 마지막으로 업데이트된 날짜 및 시간
91
- )
106
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it last changed' }),
107
+ tslib_1.__metadata("design:type", Date)
92
108
  ], FinancialStatement.prototype, "updatedAt", void 0);
93
109
  tslib_1.__decorate([
94
110
  (0, typeorm_1.DeleteDateColumn)(),
95
- (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the financial statement was deleted' }),
96
- tslib_1.__metadata("design:type", Date // 재무제표가 삭제된 날짜 및 시간
97
- )
111
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was replaced or deleted' }),
112
+ tslib_1.__metadata("design:type", Date)
98
113
  ], FinancialStatement.prototype, "deletedAt", void 0);
99
114
  tslib_1.__decorate([
100
115
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
101
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created the financial statement' }),
102
- tslib_1.__metadata("design:type", auth_base_1.User // 재무제표를 생성한 사용자
103
- )
116
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who recorded it' }),
117
+ tslib_1.__metadata("design:type", auth_base_1.User)
104
118
  ], FinancialStatement.prototype, "creator", void 0);
105
119
  tslib_1.__decorate([
106
- (0, typeorm_1.RelationId)((financialStatement) => financialStatement.creator),
120
+ (0, typeorm_1.RelationId)((statement) => statement.creator),
107
121
  tslib_1.__metadata("design:type", String)
108
122
  ], FinancialStatement.prototype, "creatorId", void 0);
109
123
  tslib_1.__decorate([
110
124
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
111
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who last updated the financial statement' }),
112
- tslib_1.__metadata("design:type", auth_base_1.User // 재무제표를 마지막으로 업데이트한 사용자
113
- )
125
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it' }),
126
+ tslib_1.__metadata("design:type", auth_base_1.User)
114
127
  ], FinancialStatement.prototype, "updater", void 0);
115
128
  tslib_1.__decorate([
116
- (0, typeorm_1.RelationId)((financialStatement) => financialStatement.updater),
129
+ (0, typeorm_1.RelationId)((statement) => statement.updater),
117
130
  tslib_1.__metadata("design:type", String)
118
131
  ], FinancialStatement.prototype, "updaterId", void 0);
119
132
  exports.FinancialStatement = FinancialStatement = tslib_1.__decorate([
120
133
  (0, typeorm_1.Entity)(),
121
- (0, typeorm_1.Index)('ix_financial_statement_0', (financialStatement) => [
122
- financialStatement.domain,
123
- financialStatement.year,
124
- financialStatement.quarter,
125
- financialStatement.month
126
- ], {
134
+ (0, typeorm_1.Index)('ix_financial_statement_0', (statement) => [statement.domain, statement.fiscalYear, statement.kind], {
127
135
  unique: true,
128
- where: '"deleted_at" IS NULL' // 삭제되지 않은 경우에만 유니크
136
+ where: '"deleted_at" IS NULL'
129
137
  }),
130
- (0, type_graphql_1.ObjectType)({ description: 'Entity for FinancialStatement, representing the financial position of an entity' }) // 엔티티 설명 추가
138
+ (0, type_graphql_1.ObjectType)({ description: 'A financial statement of a fiscal year, as it was filed' })
131
139
  ], FinancialStatement);
132
140
  //# sourceMappingURL=financial-statement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"financial-statement.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAsE;AAEtE,iDAA8C;AAC9C,yDAAgD;AAEhD,mFAA4E;AAE5E,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,iDAAqB,CAAA;AACvB,CAAC,EAHW,wBAAwB,wCAAxB,wBAAwB,QAGnC;AAED,IAAA,+BAAgB,EAAC,wBAAwB,EAAE;IACzC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,4CAA4C,CAAC,cAAc;CACzE,CAAC,CAAA;AAEF,6BAA6B;AAgBtB,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAAxB;QAOL,YAAO,GAAY,CAAC,CAAA,CAAC,sBAAsB;IA8D7C,CAAC;CAAA,CAAA;AArEY,gDAAkB;AAGpB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;;8CACjE;AAInB;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;;mDAC5D;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC;sCACtF,cAAM,CAAC,iBAAiB;;kDAAlB;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAA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AAO,CAAC;;qDACjE;6BApEP,kBAAkB;IAf9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC;QAC1C,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,IAAI;QACvB,kBAAkB,CAAC,OAAO;QAC1B,kBAAkB,CAAC,KAAK;KACzB,EACD;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB,CAAC,mBAAmB;KAClD,CACF;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iFAAiF,EAAE,CAAC,CAAC,YAAY;GAC/G,kBAAkB,CAqE9B","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'\n\nimport { FinancialStatementLineItem } from './financial-statement-line-item'\n\nexport enum FinancialStatementStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(FinancialStatementStatus, {\n name: 'FinancialStatementStatus',\n description: 'State enumeration of a financial statement' // 재무제표 상태 열거형\n})\n\n// 재무제표 (Financial Statement)\n@Entity()\n@Index(\n 'ix_financial_statement_0',\n (financialStatement: FinancialStatement) => [\n financialStatement.domain,\n financialStatement.year,\n financialStatement.quarter,\n financialStatement.month\n ],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL' // 삭제되지 않은 경우에만 유니크\n }\n)\n@ObjectType({ description: 'Entity for FinancialStatement, representing the financial position of an entity' }) // 엔티티 설명 추가\nexport class FinancialStatement {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the financial statement' })\n readonly id: string // 고유 식별자 (UUID)\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number for optimistic locking' })\n version?: number = 1 // 낙관적 잠금을 위한 버전 관리 필드\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'The domain to which this financial statement belongs' })\n domain?: Domain // 이 재무제표가 속한 도메인\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.domain)\n domainId?: string // 도메인의 ID\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal year of the financial statement' })\n year?: number // 회계 연도\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal quarter of the financial statement' })\n quarter?: number // 회계 분기\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal month of the financial statement' })\n month?: number // 회계 월\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Total assets recorded in the financial statement' })\n asset?: number // 재무제표에 기록된 총자산\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Total liabilities recorded in the financial statement' })\n liability?: number // 재무제표에 기록된 총부채\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Total equity recorded in the financial statement' })\n equity?: number // 재무제표에 기록된 총자본\n\n @OneToMany(type => FinancialStatementLineItem, lineItem => lineItem.statement)\n @Field(type => [FinancialStatementLineItem], { nullable: true })\n lineItems?: FinancialStatementLineItem[] // 계정별 브레이크다운\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the financial statement was created' })\n createdAt?: Date // 재무제표가 생성된 날짜 및 시간\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the financial statement was last updated' })\n updatedAt?: Date // 재무제표가 마지막으로 업데이트된 날짜 및 시간\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'The date and time when the financial statement was deleted' })\n deletedAt?: Date // 재무제표가 삭제된 날짜 및 시간\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created the financial statement' })\n creator?: User // 재무제표를 생성한 사용자\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.creator)\n creatorId?: string // 재무제표를 생성한 사용자의 ID\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated the financial statement' })\n updater?: User // 재무제표를 마지막으로 업데이트한 사용자\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.updater)\n updaterId?: string // 재무제표를 업데이트한 사용자의 ID\n}\n"]}
1
+ {"version":3,"file":"financial-statement.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,yEAAmE;AAEnE,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAChC,yDAA+B,CAAA;IAC/B,+DAAqC,CAAA;IACrC,yDAA+B,CAAA;AACjC,CAAC,EAJW,sBAAsB,sCAAtB,sBAAsB,QAIjC;AAED,IAAA,+BAAgB,EAAC,sBAAsB,EAAE;IACvC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,4FAA4F;CAC1G,CAAC,CAAA;AAEF;;;GAGG;AAWI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAAxB;QAOL,YAAO,GAAY,CAAC,CAAA;IA0EtB,CAAC;CAAA,CAAA;AAjFY,gDAAkB;AAGpB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;;8CACjE;AAInB;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;;mDAC5D;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,E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E,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;sCAC9D,gBAAI;mDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,SAA6B,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;qDAC/C;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,WAAW,EAAE,qBAAqB,EAAE,CAAC;sCAClE,gBAAI;mDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,SAA6B,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;qDAC/C;6BAhFP,kBAAkB;IAV9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,SAA6B,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,EAC3F;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CACF;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;GAC1E,kBAAkB,CAiF9B","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, Int, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nimport { FinancialStatementLine } from './financial-statement-line'\n\nexport enum FinancialStatementKind {\n BALANCE_SHEET = 'BALANCE_SHEET',\n INCOME_STATEMENT = 'INCOME_STATEMENT',\n COST_OF_GOODS = 'COST_OF_GOODS'\n}\n\nregisterEnumType(FinancialStatementKind, {\n name: 'FinancialStatementKind',\n description: 'Which statement - balance sheet, income statement, statement of cost of goods manufactured'\n})\n\n/**\n * A financial statement of a fiscal year, line by line, as it was filed. Filing it again replaces it; what the books\n * moved on the same lines is read beside it, not kept.\n */\n@Entity()\n@Index(\n 'ix_financial_statement_0',\n (statement: FinancialStatement) => [statement.domain, statement.fiscalYear, statement.kind],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n }\n)\n@ObjectType({ description: 'A financial statement of a fiscal year, as it was filed' })\nexport class FinancialStatement {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the financial statement' })\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 to which this financial statement belongs' })\n domain?: Domain\n\n @RelationId((statement: FinancialStatement) => statement.domain)\n domainId?: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Fiscal year' })\n fiscalYear: number\n\n @Column()\n @Field(type => FinancialStatementKind, { description: 'Which statement' })\n kind: FinancialStatementKind\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'YYYY-MM-DD - the first day of the period' })\n periodFrom?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'YYYY-MM-DD - the last day of the period' })\n periodTo?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The kind of filing - regular, amended' })\n filingKind?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'YYYY-MM-DD - when it was filed' })\n filedOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The issue number of the certificate it came from' })\n issueNo?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The document it came from' })\n source?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @OneToMany(type => FinancialStatementLine, line => line.statement)\n @Field(type => [FinancialStatementLine], { nullable: true, description: 'Its lines, in the order of the statement' })\n lines?: FinancialStatementLine[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When it was recorded' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When it last changed' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When it was replaced or deleted' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who recorded it' })\n creator?: User\n\n @RelationId((statement: FinancialStatement) => statement.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who last changed it' })\n updater?: User\n\n @RelationId((statement: FinancialStatement) => statement.updater)\n updaterId?: string\n}\n"]}
@@ -1,8 +1,9 @@
1
1
  import { FinancialStatement } from './financial-statement';
2
- import { FinancialStatementLineItem } from './financial-statement-line-item';
2
+ import { FinancialStatementLine } from './financial-statement-line';
3
+ import { FinancialStatementHistory } from './financial-statement-history';
3
4
  import { FinancialStatementQuery } from './financial-statement-query';
4
5
  import { FinancialStatementMutation } from './financial-statement-mutation';
5
6
  import { FinancialStatementHistoryEntitySubscriber } from './event-subscriber';
6
- export declare const entities: (typeof FinancialStatement | typeof FinancialStatementLineItem)[];
7
- export declare const resolvers: (typeof FinancialStatementMutation | typeof FinancialStatementQuery)[];
7
+ export declare const entities: (typeof FinancialStatementLine | typeof FinancialStatement | typeof FinancialStatementHistory)[];
8
+ export declare const resolvers: (typeof FinancialStatementQuery | typeof FinancialStatementMutation)[];
8
9
  export declare const subscribers: (typeof FinancialStatementHistoryEntitySubscriber)[];
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.subscribers = exports.resolvers = exports.entities = void 0;
4
4
  const financial_statement_1 = require("./financial-statement");
5
- const financial_statement_line_item_1 = require("./financial-statement-line-item");
5
+ const financial_statement_line_1 = require("./financial-statement-line");
6
6
  const financial_statement_history_1 = require("./financial-statement-history");
7
7
  const financial_statement_query_1 = require("./financial-statement-query");
8
8
  const financial_statement_mutation_1 = require("./financial-statement-mutation");
9
9
  const event_subscriber_1 = require("./event-subscriber");
10
- exports.entities = [financial_statement_1.FinancialStatement, financial_statement_line_item_1.FinancialStatementLineItem, financial_statement_history_1.FinancialStatementHistory];
10
+ exports.entities = [financial_statement_1.FinancialStatement, financial_statement_line_1.FinancialStatementLine, financial_statement_history_1.FinancialStatementHistory];
11
11
  exports.resolvers = [financial_statement_query_1.FinancialStatementQuery, financial_statement_mutation_1.FinancialStatementMutation];
12
12
  exports.subscribers = [event_subscriber_1.FinancialStatementHistoryEntitySubscriber];
13
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/financial-statement/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAC1D,mFAA4E;AAC5E,+EAAyE;AACzE,2EAAqE;AACrE,iFAA2E;AAC3E,yDAA8E;AAEjE,QAAA,QAAQ,GAAG,CAAC,wCAAkB,EAAE,0DAA0B,EAAE,uDAAyB,CAAC,CAAA;AACtF,QAAA,SAAS,GAAG,CAAC,mDAAuB,EAAE,yDAA0B,CAAC,CAAA;AACjE,QAAA,WAAW,GAAG,CAAC,4DAAyC,CAAC,CAAA","sourcesContent":["import { FinancialStatement } from './financial-statement'\nimport { FinancialStatementLineItem } from './financial-statement-line-item'\nimport { FinancialStatementHistory } from './financial-statement-history'\nimport { FinancialStatementQuery } from './financial-statement-query'\nimport { FinancialStatementMutation } from './financial-statement-mutation'\nimport { FinancialStatementHistoryEntitySubscriber } from './event-subscriber'\n\nexport const entities = [FinancialStatement, FinancialStatementLineItem, FinancialStatementHistory]\nexport const resolvers = [FinancialStatementQuery, FinancialStatementMutation]\nexport const subscribers = [FinancialStatementHistoryEntitySubscriber]\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/financial-statement/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAC1D,yEAAmE;AACnE,+EAAyE;AACzE,2EAAqE;AACrE,iFAA2E;AAC3E,yDAA8E;AAEjE,QAAA,QAAQ,GAAG,CAAC,wCAAkB,EAAE,iDAAsB,EAAE,uDAAyB,CAAC,CAAA;AAClF,QAAA,SAAS,GAAG,CAAC,mDAAuB,EAAE,yDAA0B,CAAC,CAAA;AACjE,QAAA,WAAW,GAAG,CAAC,4DAAyC,CAAC,CAAA","sourcesContent":["import { FinancialStatement } from './financial-statement'\nimport { FinancialStatementLine } from './financial-statement-line'\nimport { FinancialStatementHistory } from './financial-statement-history'\nimport { FinancialStatementQuery } from './financial-statement-query'\nimport { FinancialStatementMutation } from './financial-statement-mutation'\nimport { FinancialStatementHistoryEntitySubscriber } from './event-subscriber'\n\nexport const entities = [FinancialStatement, FinancialStatementLine, FinancialStatementHistory]\nexport const resolvers = [FinancialStatementQuery, FinancialStatementMutation]\nexport const subscribers = [FinancialStatementHistoryEntitySubscriber]\n"]}