@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.
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +0 -12
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +0 -1
- package/dist-server/index.js +0 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/account/account-history.d.ts +13 -6
- package/dist-server/service/account/account-history.js +44 -17
- package/dist-server/service/account/account-history.js.map +1 -1
- package/dist-server/service/account/account-mutation.js +8 -8
- package/dist-server/service/account/account-mutation.js.map +1 -1
- package/dist-server/service/account/account-query.js +2 -2
- package/dist-server/service/account/account-query.js.map +1 -1
- package/dist-server/service/account/account-type.d.ts +16 -0
- package/dist-server/service/account/account-type.js +71 -13
- package/dist-server/service/account/account-type.js.map +1 -1
- package/dist-server/service/account/account.d.ts +9 -3
- package/dist-server/service/account/account.js +34 -8
- package/dist-server/service/account/account.js.map +1 -1
- package/dist-server/service/account/index.d.ts +1 -1
- package/dist-server/service/accounting-category/accounting-category-mutation.js +8 -8
- package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category-query.js +2 -2
- package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
- package/dist-server/service/accounting-category/index.d.ts +1 -1
- package/dist-server/service/accounting-document/accounting-document-mutation.js +12 -3
- package/dist-server/service/accounting-document/accounting-document-mutation.js.map +1 -1
- package/dist-server/service/accounting-document/accounting-document-query.js +2 -0
- package/dist-server/service/accounting-document/accounting-document-query.js.map +1 -1
- package/dist-server/service/accounting-document/index.d.ts +1 -1
- package/dist-server/service/bank-account/bank-account-history.d.ts +11 -14
- package/dist-server/service/bank-account/bank-account-history.js +46 -59
- package/dist-server/service/bank-account/bank-account-history.js.map +1 -1
- package/dist-server/service/bank-account/bank-account-mutation.d.ts +1 -2
- package/dist-server/service/bank-account/bank-account-mutation.js +25 -69
- package/dist-server/service/bank-account/bank-account-mutation.js.map +1 -1
- package/dist-server/service/bank-account/bank-account-query.js +2 -0
- package/dist-server/service/bank-account/bank-account-query.js.map +1 -1
- package/dist-server/service/bank-account/bank-account-service.d.ts +5 -0
- package/dist-server/service/bank-account/bank-account-service.js +21 -0
- package/dist-server/service/bank-account/bank-account-service.js.map +1 -0
- package/dist-server/service/bank-account/bank-account-type.d.ts +13 -19
- package/dist-server/service/bank-account/bank-account-type.js +45 -69
- package/dist-server/service/bank-account/bank-account-type.js.map +1 -1
- package/dist-server/service/bank-account/bank-account.d.ts +14 -17
- package/dist-server/service/bank-account/bank-account.js +45 -57
- package/dist-server/service/bank-account/bank-account.js.map +1 -1
- package/dist-server/service/bank-account/index.d.ts +1 -1
- package/dist-server/service/bank-statement/bank-statement-query.d.ts +14 -0
- package/dist-server/service/bank-statement/bank-statement-query.js +92 -0
- package/dist-server/service/bank-statement/bank-statement-query.js.map +1 -0
- package/dist-server/service/bank-statement/bank-statement.d.ts +26 -0
- package/dist-server/service/bank-statement/bank-statement.js +109 -0
- package/dist-server/service/bank-statement/bank-statement.js.map +1 -0
- package/dist-server/service/bank-statement/index.d.ts +5 -0
- package/dist-server/service/bank-statement/index.js +9 -0
- package/dist-server/service/bank-statement/index.js.map +1 -0
- package/dist-server/service/cash-flow-type.d.ts +5 -0
- package/dist-server/service/cash-flow-type.js +15 -0
- package/dist-server/service/cash-flow-type.js.map +1 -0
- package/dist-server/service/financial-institution/financial-institution-mutation.js +10 -1
- package/dist-server/service/financial-institution/financial-institution-mutation.js.map +1 -1
- package/dist-server/service/financial-institution/financial-institution-query.js +14 -6
- package/dist-server/service/financial-institution/financial-institution-query.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-history.d.ts +11 -9
- package/dist-server/service/financial-statement/financial-statement-history.js +44 -33
- package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-line.d.ts +24 -0
- package/dist-server/service/financial-statement/financial-statement-line.js +108 -0
- package/dist-server/service/financial-statement/financial-statement-line.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement-mutation.d.ts +1 -8
- package/dist-server/service/financial-statement/financial-statement-mutation.js +11 -136
- package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-query.d.ts +8 -7
- package/dist-server/service/financial-statement/financial-statement-query.js +42 -32
- package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-service.d.ts +33 -0
- package/dist-server/service/financial-statement/financial-statement-service.js +44 -0
- package/dist-server/service/financial-statement/financial-statement-service.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement.d.ts +19 -11
- package/dist-server/service/financial-statement/financial-statement.js +70 -62
- package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
- package/dist-server/service/financial-statement/index.d.ts +4 -3
- package/dist-server/service/financial-statement/index.js +2 -2
- package/dist-server/service/financial-statement/index.js.map +1 -1
- package/dist-server/service/fiscal-month/fiscal-month-mutation.js +6 -6
- package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -1
- package/dist-server/service/fiscal-month/fiscal-month-query.js +2 -2
- package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -1
- package/dist-server/service/fiscal-month/index.d.ts +1 -1
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +6 -6
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -1
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +2 -2
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -1
- package/dist-server/service/fiscal-quarter/index.d.ts +1 -1
- package/dist-server/service/fiscal-year/fiscal-year-mutation.js +6 -6
- package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -1
- package/dist-server/service/fiscal-year/fiscal-year-query.js +2 -2
- package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -1
- package/dist-server/service/fiscal-year/index.d.ts +1 -1
- package/dist-server/service/index.d.ts +15 -3
- package/dist-server/service/index.js +30 -13
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/payment/index.d.ts +2 -1
- package/dist-server/service/payment/index.js +1 -0
- package/dist-server/service/payment/index.js.map +1 -1
- package/dist-server/service/payment/payment-history.d.ts +9 -16
- package/dist-server/service/payment/payment-history.js +36 -70
- package/dist-server/service/payment/payment-history.js.map +1 -1
- package/dist-server/service/payment/payment-mutation.d.ts +0 -1
- package/dist-server/service/payment/payment-mutation.js +19 -84
- package/dist-server/service/payment/payment-mutation.js.map +1 -1
- package/dist-server/service/payment/payment-query.d.ts +3 -0
- package/dist-server/service/payment/payment-query.js +32 -3
- package/dist-server/service/payment/payment-query.js.map +1 -1
- package/dist-server/service/payment/payment-service.d.ts +16 -0
- package/dist-server/service/payment/payment-service.js +140 -0
- package/dist-server/service/payment/payment-service.js.map +1 -0
- package/dist-server/service/payment/payment-targets.d.ts +31 -0
- package/dist-server/service/payment/payment-targets.js +19 -0
- package/dist-server/service/payment/payment-targets.js.map +1 -0
- package/dist-server/service/payment/payment-type.d.ts +13 -17
- package/dist-server/service/payment/payment-type.js +35 -51
- package/dist-server/service/payment/payment-type.js.map +1 -1
- package/dist-server/service/payment/payment.d.ts +23 -22
- package/dist-server/service/payment/payment.js +65 -95
- package/dist-server/service/payment/payment.js.map +1 -1
- package/dist-server/service/payment/transfer-target.d.ts +1 -0
- package/dist-server/service/payment/transfer-target.js +43 -0
- package/dist-server/service/payment/transfer-target.js.map +1 -0
- package/dist-server/service/recurring-cash-item/index.d.ts +6 -0
- package/dist-server/service/recurring-cash-item/index.js +10 -0
- package/dist-server/service/recurring-cash-item/index.js.map +1 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.d.ts +7 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js +63 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js.map +1 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-query.d.ts +15 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-query.js +101 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-query.js.map +1 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-service.d.ts +23 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js +91 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js.map +1 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-type.d.ts +23 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js +85 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js.map +1 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item.d.ts +35 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item.js +142 -0
- package/dist-server/service/recurring-cash-item/recurring-cash-item.js.map +1 -0
- package/dist-server/service/recurring-cash-item/recurring-schedule.d.ts +36 -0
- package/dist-server/service/recurring-cash-item/recurring-schedule.js +41 -0
- package/dist-server/service/recurring-cash-item/recurring-schedule.js.map +1 -0
- package/dist-server/service/transaction/index.d.ts +2 -2
- package/dist-server/service/transaction/transaction-history.d.ts +42 -15
- package/dist-server/service/transaction/transaction-history.js +160 -54
- package/dist-server/service/transaction/transaction-history.js.map +1 -1
- package/dist-server/service/transaction/transaction-mutation.d.ts +0 -1
- package/dist-server/service/transaction/transaction-mutation.js +18 -83
- package/dist-server/service/transaction/transaction-mutation.js.map +1 -1
- package/dist-server/service/transaction/transaction-period.d.ts +16 -0
- package/dist-server/service/transaction/transaction-period.js +49 -0
- package/dist-server/service/transaction/transaction-period.js.map +1 -0
- package/dist-server/service/transaction/transaction-query.d.ts +12 -0
- package/dist-server/service/transaction/transaction-query.js +86 -4
- package/dist-server/service/transaction/transaction-query.js.map +1 -1
- package/dist-server/service/transaction/transaction-service.d.ts +30 -0
- package/dist-server/service/transaction/transaction-service.js +130 -0
- package/dist-server/service/transaction/transaction-service.js.map +1 -0
- package/dist-server/service/transaction/transaction-type.d.ts +39 -7
- package/dist-server/service/transaction/transaction-type.js +145 -23
- package/dist-server/service/transaction/transaction-type.js.map +1 -1
- package/dist-server/service/transaction/transaction.d.ts +58 -31
- package/dist-server/service/transaction/transaction.js +213 -111
- package/dist-server/service/transaction/transaction.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -4
- package/things-factory.config.js +0 -4
- package/translations/en.json +34 -2
- package/translations/ja.json +0 -1
- package/translations/ko.json +34 -2
- package/translations/ms.json +0 -1
- package/translations/zh.json +0 -1
- package/dist-client/pages/account/account-importer.d.ts +0 -22
- package/dist-client/pages/account/account-importer.js +0 -99
- package/dist-client/pages/account/account-importer.js.map +0 -1
- package/dist-client/pages/account/account-list-page.d.ts +0 -57
- package/dist-client/pages/account/account-list-page.js +0 -306
- package/dist-client/pages/account/account-list-page.js.map +0 -1
- package/dist-client/pages/bank-account/bank-account-importer.d.ts +0 -23
- package/dist-client/pages/bank-account/bank-account-importer.js +0 -92
- package/dist-client/pages/bank-account/bank-account-importer.js.map +0 -1
- package/dist-client/pages/bank-account/bank-account-list-page.d.ts +0 -60
- package/dist-client/pages/bank-account/bank-account-list-page.js +0 -317
- package/dist-client/pages/bank-account/bank-account-list-page.js.map +0 -1
- package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +0 -22
- package/dist-client/pages/financial-statement/financial-statement-importer.js +0 -99
- package/dist-client/pages/financial-statement/financial-statement-importer.js.map +0 -1
- package/dist-client/pages/financial-statement/financial-statement-list-page.d.ts +0 -57
- package/dist-client/pages/financial-statement/financial-statement-list-page.js +0 -280
- package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +0 -1
- package/dist-client/pages/income-statement/income-statement-importer.d.ts +0 -22
- package/dist-client/pages/income-statement/income-statement-importer.js +0 -99
- package/dist-client/pages/income-statement/income-statement-importer.js.map +0 -1
- package/dist-client/pages/income-statement/income-statement-list-page.d.ts +0 -57
- package/dist-client/pages/income-statement/income-statement-list-page.js +0 -280
- package/dist-client/pages/income-statement/income-statement-list-page.js.map +0 -1
- package/dist-client/pages/payment/payment-importer.d.ts +0 -23
- package/dist-client/pages/payment/payment-importer.js +0 -92
- package/dist-client/pages/payment/payment-importer.js.map +0 -1
- package/dist-client/pages/payment/payment-list-page.d.ts +0 -60
- package/dist-client/pages/payment/payment-list-page.js +0 -317
- package/dist-client/pages/payment/payment-list-page.js.map +0 -1
- package/dist-client/pages/transaction/transaction-importer.d.ts +0 -22
- package/dist-client/pages/transaction/transaction-importer.js +0 -99
- package/dist-client/pages/transaction/transaction-importer.js.map +0 -1
- package/dist-client/pages/transaction/transaction-list-page.d.ts +0 -57
- package/dist-client/pages/transaction/transaction-list-page.js +0 -280
- package/dist-client/pages/transaction/transaction-list-page.js.map +0 -1
- package/dist-server/controllers/index.d.ts +0 -1
- package/dist-server/controllers/index.js +0 -5
- package/dist-server/controllers/index.js.map +0 -1
- package/dist-server/controllers/summary-statements.d.ts +0 -4
- package/dist-server/controllers/summary-statements.js +0 -149
- package/dist-server/controllers/summary-statements.js.map +0 -1
- package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +0 -5
- package/dist-server/migrations/1725201567284-seed-country-codes.js +0 -255
- package/dist-server/migrations/1725201567284-seed-country-codes.js.map +0 -1
- package/dist-server/service/financial-statement/financial-statement-line-item.d.ts +0 -19
- package/dist-server/service/financial-statement/financial-statement-line-item.js +0 -94
- package/dist-server/service/financial-statement/financial-statement-line-item.js.map +0 -1
- package/dist-server/service/financial-statement/financial-statement-type.d.ts +0 -20
- package/dist-server/service/financial-statement/financial-statement-type.js +0 -77
- package/dist-server/service/financial-statement/financial-statement-type.js.map +0 -1
- package/dist-server/service/income-statement/event-subscriber.d.ts +0 -7
- package/dist-server/service/income-statement/event-subscriber.js +0 -21
- package/dist-server/service/income-statement/event-subscriber.js.map +0 -1
- package/dist-server/service/income-statement/income-statement-history.d.ts +0 -28
- package/dist-server/service/income-statement/income-statement-history.js +0 -146
- package/dist-server/service/income-statement/income-statement-history.js.map +0 -1
- package/dist-server/service/income-statement/income-statement-line-item.d.ts +0 -19
- package/dist-server/service/income-statement/income-statement-line-item.js +0 -96
- package/dist-server/service/income-statement/income-statement-line-item.js.map +0 -1
- package/dist-server/service/income-statement/income-statement-mutation.d.ts +0 -10
- package/dist-server/service/income-statement/income-statement-mutation.js +0 -159
- package/dist-server/service/income-statement/income-statement-mutation.js.map +0 -1
- package/dist-server/service/income-statement/income-statement-query.d.ts +0 -11
- package/dist-server/service/income-statement/income-statement-query.js +0 -81
- package/dist-server/service/income-statement/income-statement-query.js.map +0 -1
- package/dist-server/service/income-statement/income-statement-type.d.ts +0 -20
- package/dist-server/service/income-statement/income-statement-type.js +0 -77
- package/dist-server/service/income-statement/income-statement-type.js.map +0 -1
- package/dist-server/service/income-statement/income-statement.d.ts +0 -28
- package/dist-server/service/income-statement/income-statement.js +0 -137
- package/dist-server/service/income-statement/income-statement.js.map +0 -1
- package/dist-server/service/income-statement/index.d.ts +0 -8
- package/dist-server/service/income-statement/index.js +0 -13
- package/dist-server/service/income-statement/index.js.map +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Which recurring items fall in a month, and the forecast line each one makes.
|
|
4
|
+
*
|
|
5
|
+
* An item falls in a month when it is active and the month lies within [startMonth, endMonth].
|
|
6
|
+
* Its timing is written the way the forecast ledger writes it — `21일`, `말일` — so the calendar
|
|
7
|
+
* places the line on that day (§`forecastDay`). An item with neither a day nor 말일 makes a line
|
|
8
|
+
* with no timing: the calendar shows it undated, as it does any line nobody gave a day.
|
|
9
|
+
*
|
|
10
|
+
* Pure.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.fallsIn = fallsIn;
|
|
14
|
+
exports.timingOf = timingOf;
|
|
15
|
+
exports.linesFor = linesFor;
|
|
16
|
+
const monthKey = (year, month) => `${year}-${String(month).padStart(2, '0')}`;
|
|
17
|
+
function fallsIn(item, year, month) {
|
|
18
|
+
const key = monthKey(year, month);
|
|
19
|
+
return item.active !== false && item.startMonth <= key && (!item.endMonth || key <= item.endMonth);
|
|
20
|
+
}
|
|
21
|
+
function timingOf(item) {
|
|
22
|
+
if (item.lastDayOfMonth)
|
|
23
|
+
return '말일';
|
|
24
|
+
return item.dayOfMonth ? `${item.dayOfMonth}일` : null;
|
|
25
|
+
}
|
|
26
|
+
/** The lines to add for a month — leaving out items that already made one (`already`). */
|
|
27
|
+
function linesFor(items, year, month, already) {
|
|
28
|
+
return items
|
|
29
|
+
.filter(item => fallsIn(item, year, month) && !already.has(item.id))
|
|
30
|
+
.map(item => ({
|
|
31
|
+
recurringItemId: item.id,
|
|
32
|
+
year,
|
|
33
|
+
month,
|
|
34
|
+
type: item.type,
|
|
35
|
+
name: item.name,
|
|
36
|
+
amount: item.amount,
|
|
37
|
+
currency: item.currency || 'KRW',
|
|
38
|
+
timing: timingOf(item)
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=recurring-schedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurring-schedule.js","sourceRoot":"","sources":["../../../server/service/recurring-cash-item/recurring-schedule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AA4BH,0BAGC;AAED,4BAGC;AAGD,4BAkBC;AA/BD,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAA;AAE7F,SAAgB,OAAO,CAAC,IAAmB,EAAE,IAAY,EAAE,KAAa;IACtE,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACjC,OAAO,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC,UAAU,IAAI,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAA;AACpG,CAAC;AAED,SAAgB,QAAQ,CAAC,IAAmB;IAC1C,IAAI,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAA;IACpC,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;AACvD,CAAC;AAED,0FAA0F;AAC1F,SAAgB,QAAQ,CACtB,KAA+B,EAC/B,IAAY,EACZ,KAAa,EACb,OAA4B;IAE5B,OAAO,KAAK;SACT,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACnE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACZ,eAAe,EAAE,IAAI,CAAC,EAAE;QACxB,IAAI;QACJ,KAAK;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,KAAK;QAChC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC;KACvB,CAAC,CAAC,CAAA;AACP,CAAC","sourcesContent":["/**\n * Which recurring items fall in a month, and the forecast line each one makes.\n *\n * An item falls in a month when it is active and the month lies within [startMonth, endMonth].\n * Its timing is written the way the forecast ledger writes it — `21일`, `말일` — so the calendar\n * places the line on that day (§`forecastDay`). An item with neither a day nor 말일 makes a line\n * with no timing: the calendar shows it undated, as it does any line nobody gave a day.\n *\n * Pure.\n */\n\nexport interface RecurringItem {\n id: string\n name: string\n type: string\n amount: number\n currency?: string | null\n dayOfMonth?: number | null\n lastDayOfMonth?: boolean | null\n startMonth: string\n endMonth?: string | null\n active?: boolean | null\n}\n\nexport interface GeneratedLine {\n recurringItemId: string\n year: number\n month: number\n type: string\n name: string\n amount: number\n currency: string\n timing: string | null\n}\n\nconst monthKey = (year: number, month: number) => `${year}-${String(month).padStart(2, '0')}`\n\nexport function fallsIn(item: RecurringItem, year: number, month: number): boolean {\n const key = monthKey(year, month)\n return item.active !== false && item.startMonth <= key && (!item.endMonth || key <= item.endMonth)\n}\n\nexport function timingOf(item: RecurringItem): string | null {\n if (item.lastDayOfMonth) return '말일'\n return item.dayOfMonth ? `${item.dayOfMonth}일` : null\n}\n\n/** The lines to add for a month — leaving out items that already made one (`already`). */\nexport function linesFor(\n items: readonly RecurringItem[],\n year: number,\n month: number,\n already: ReadonlySet<string>\n): GeneratedLine[] {\n return items\n .filter(item => fallsIn(item, year, month) && !already.has(item.id))\n .map(item => ({\n recurringItemId: item.id,\n year,\n month,\n type: item.type,\n name: item.name,\n amount: item.amount,\n currency: item.currency || 'KRW',\n timing: timingOf(item)\n }))\n}\n"]}
|
|
@@ -3,6 +3,6 @@ import { TransactionHistory } from './transaction-history';
|
|
|
3
3
|
import { TransactionQuery } from './transaction-query';
|
|
4
4
|
import { TransactionMutation } from './transaction-mutation';
|
|
5
5
|
import { TransactionHistoryEntitySubscriber } from './event-subscriber';
|
|
6
|
-
export declare const entities: (typeof
|
|
7
|
-
export declare const resolvers: (typeof
|
|
6
|
+
export declare const entities: (typeof Transaction | typeof TransactionHistory)[];
|
|
7
|
+
export declare const resolvers: (typeof TransactionQuery | typeof TransactionMutation)[];
|
|
8
8
|
export declare const subscribers: (typeof TransactionHistoryEntitySubscriber)[];
|
|
@@ -1,29 +1,56 @@
|
|
|
1
1
|
import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-history';
|
|
2
2
|
import { User } from '@things-factory/auth-base';
|
|
3
3
|
import { Domain } from '@things-factory/shell';
|
|
4
|
-
import {
|
|
4
|
+
import { Counterparty } from '@things-factory/biz-base';
|
|
5
5
|
import { Account } from '../account/account';
|
|
6
|
+
import { BankAccount } from '../bank-account/bank-account';
|
|
7
|
+
import { BankStatement } from '../bank-statement/bank-statement';
|
|
8
|
+
import { CashFlowType } from '../cash-flow-type';
|
|
9
|
+
import { RecurringCashItem } from '../recurring-cash-item/recurring-cash-item';
|
|
10
|
+
import { ForecastStatus, Transaction, TransactionCategory, TransactionSource } from './transaction';
|
|
11
|
+
/** Each version of a transaction, written when it changes. */
|
|
6
12
|
export declare class TransactionHistory implements HistoryEntityInterface<Transaction> {
|
|
7
13
|
readonly id: string;
|
|
8
14
|
version?: number;
|
|
9
15
|
domain?: Domain;
|
|
10
16
|
domainId?: string;
|
|
11
|
-
name?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
currency?: string;
|
|
14
|
-
amount?: number;
|
|
15
|
-
active?: boolean;
|
|
16
|
-
type?: TransactionType;
|
|
17
17
|
category: TransactionCategory;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
account?: Account;
|
|
22
|
-
accountId?: string;
|
|
23
|
-
year?: number;
|
|
24
|
-
quarter?: number;
|
|
25
|
-
month?: number;
|
|
18
|
+
type: CashFlowType;
|
|
19
|
+
bankAccount: BankAccount;
|
|
20
|
+
bankAccountId?: string;
|
|
26
21
|
transactionDate: string;
|
|
22
|
+
transactionAt: string;
|
|
23
|
+
year: number;
|
|
24
|
+
month: number;
|
|
25
|
+
amount: number;
|
|
26
|
+
currency: string;
|
|
27
|
+
balance: number;
|
|
28
|
+
account: Account;
|
|
29
|
+
accountId?: string;
|
|
30
|
+
description: string;
|
|
31
|
+
ledgerCategory: string;
|
|
32
|
+
counterpartyName: string;
|
|
33
|
+
counterparty: Counterparty;
|
|
34
|
+
counterpartyId?: string;
|
|
35
|
+
source: TransactionSource;
|
|
36
|
+
bankStatement: BankStatement;
|
|
37
|
+
bankStatementId?: string;
|
|
38
|
+
sourceFile: string;
|
|
39
|
+
sourceRow: number;
|
|
40
|
+
bankSequence: number;
|
|
41
|
+
bankFingerprint: string;
|
|
42
|
+
bankDescription: string;
|
|
43
|
+
bankKind: string;
|
|
44
|
+
bankCounterpartyName: string;
|
|
45
|
+
bankCounterpartyAccount: string;
|
|
46
|
+
bankCounterpartyBank: string;
|
|
47
|
+
bankMemo: string;
|
|
48
|
+
timing: string;
|
|
49
|
+
status: ForecastStatus;
|
|
50
|
+
probability: number;
|
|
51
|
+
notes: string;
|
|
52
|
+
recurringItem: RecurringCashItem;
|
|
53
|
+
recurringItemId?: string;
|
|
27
54
|
createdAt?: Date;
|
|
28
55
|
updatedAt?: Date;
|
|
29
56
|
deletedAt?: Date;
|
|
@@ -8,30 +8,35 @@ const typeorm_history_1 = require("@operato/typeorm-history");
|
|
|
8
8
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
9
|
const env_1 = require("@things-factory/env");
|
|
10
10
|
const shell_1 = require("@things-factory/shell");
|
|
11
|
-
const
|
|
11
|
+
const biz_base_1 = require("@things-factory/biz-base");
|
|
12
12
|
const account_1 = require("../account/account");
|
|
13
|
+
const bank_account_1 = require("../bank-account/bank-account");
|
|
14
|
+
const bank_statement_1 = require("../bank-statement/bank-statement");
|
|
15
|
+
const cash_flow_type_1 = require("../cash-flow-type");
|
|
16
|
+
const recurring_cash_item_1 = require("../recurring-cash-item/recurring-cash-item");
|
|
17
|
+
const transaction_1 = require("./transaction");
|
|
13
18
|
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
14
19
|
const DATABASE_TYPE = ORMCONFIG.type;
|
|
20
|
+
/** Each version of a transaction, written when it changes. */
|
|
15
21
|
let TransactionHistory = class TransactionHistory {
|
|
16
22
|
constructor() {
|
|
17
23
|
this.version = 1;
|
|
18
|
-
this.amount = 0;
|
|
19
24
|
}
|
|
20
25
|
};
|
|
21
26
|
exports.TransactionHistory = TransactionHistory;
|
|
22
27
|
tslib_1.__decorate([
|
|
23
28
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
24
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
29
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier of the version' }),
|
|
25
30
|
tslib_1.__metadata("design:type", String)
|
|
26
31
|
], TransactionHistory.prototype, "id", void 0);
|
|
27
32
|
tslib_1.__decorate([
|
|
28
33
|
(0, typeorm_1.Column)({ nullable: true, default: 1 }),
|
|
29
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
34
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Version number' }),
|
|
30
35
|
tslib_1.__metadata("design:type", Number)
|
|
31
36
|
], TransactionHistory.prototype, "version", void 0);
|
|
32
37
|
tslib_1.__decorate([
|
|
33
38
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
34
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
39
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain' }),
|
|
35
40
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
36
41
|
], TransactionHistory.prototype, "domain", void 0);
|
|
37
42
|
tslib_1.__decorate([
|
|
@@ -39,102 +44,203 @@ tslib_1.__decorate([
|
|
|
39
44
|
tslib_1.__metadata("design:type", String)
|
|
40
45
|
], TransactionHistory.prototype, "domainId", void 0);
|
|
41
46
|
tslib_1.__decorate([
|
|
42
|
-
(0, typeorm_1.Column)(),
|
|
43
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
47
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
48
|
+
(0, type_graphql_1.Field)(type => transaction_1.TransactionCategory, { nullable: true, description: 'category at this version' }),
|
|
44
49
|
tslib_1.__metadata("design:type", String)
|
|
45
|
-
], TransactionHistory.prototype, "
|
|
50
|
+
], TransactionHistory.prototype, "category", void 0);
|
|
46
51
|
tslib_1.__decorate([
|
|
47
52
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
48
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
53
|
+
(0, type_graphql_1.Field)(type => cash_flow_type_1.CashFlowType, { nullable: true, description: 'type at this version' }),
|
|
49
54
|
tslib_1.__metadata("design:type", String)
|
|
50
|
-
], TransactionHistory.prototype, "
|
|
55
|
+
], TransactionHistory.prototype, "type", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.ManyToOne)(type => bank_account_1.BankAccount, { nullable: true, createForeignKeyConstraints: false }),
|
|
58
|
+
(0, type_graphql_1.Field)(type => bank_account_1.BankAccount, { nullable: true, description: 'bankAccount at this version' }),
|
|
59
|
+
tslib_1.__metadata("design:type", bank_account_1.BankAccount)
|
|
60
|
+
], TransactionHistory.prototype, "bankAccount", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.bankAccount),
|
|
63
|
+
tslib_1.__metadata("design:type", String)
|
|
64
|
+
], TransactionHistory.prototype, "bankAccountId", void 0);
|
|
51
65
|
tslib_1.__decorate([
|
|
52
66
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
53
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
67
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'transactionDate at this version' }),
|
|
54
68
|
tslib_1.__metadata("design:type", String)
|
|
55
|
-
], TransactionHistory.prototype, "
|
|
69
|
+
], TransactionHistory.prototype, "transactionDate", void 0);
|
|
56
70
|
tslib_1.__decorate([
|
|
57
71
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
58
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
72
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'transactionAt at this version' }),
|
|
73
|
+
tslib_1.__metadata("design:type", String)
|
|
74
|
+
], TransactionHistory.prototype, "transactionAt", void 0);
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
77
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'year at this version' }),
|
|
78
|
+
tslib_1.__metadata("design:type", Number)
|
|
79
|
+
], TransactionHistory.prototype, "year", void 0);
|
|
80
|
+
tslib_1.__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
82
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'month at this version' }),
|
|
83
|
+
tslib_1.__metadata("design:type", Number)
|
|
84
|
+
], TransactionHistory.prototype, "month", void 0);
|
|
85
|
+
tslib_1.__decorate([
|
|
86
|
+
(0, typeorm_1.Column)((0, shell_1.moneyColumn)({ nullable: true })),
|
|
87
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'amount at this version' }),
|
|
59
88
|
tslib_1.__metadata("design:type", Number)
|
|
60
89
|
], TransactionHistory.prototype, "amount", void 0);
|
|
61
90
|
tslib_1.__decorate([
|
|
62
91
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
63
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
64
|
-
tslib_1.__metadata("design:type",
|
|
65
|
-
], TransactionHistory.prototype, "
|
|
92
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'currency at this version' }),
|
|
93
|
+
tslib_1.__metadata("design:type", String)
|
|
94
|
+
], TransactionHistory.prototype, "currency", void 0);
|
|
66
95
|
tslib_1.__decorate([
|
|
67
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
68
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
96
|
+
(0, typeorm_1.Column)((0, shell_1.moneyColumn)({ nullable: true })),
|
|
97
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'balance at this version' }),
|
|
69
98
|
tslib_1.__metadata("design:type", Number)
|
|
70
|
-
], TransactionHistory.prototype, "
|
|
99
|
+
], TransactionHistory.prototype, "balance", void 0);
|
|
100
|
+
tslib_1.__decorate([
|
|
101
|
+
(0, typeorm_1.ManyToOne)(type => account_1.Account, { nullable: true, createForeignKeyConstraints: false }),
|
|
102
|
+
(0, type_graphql_1.Field)(type => account_1.Account, { nullable: true, description: 'account at this version' }),
|
|
103
|
+
tslib_1.__metadata("design:type", account_1.Account)
|
|
104
|
+
], TransactionHistory.prototype, "account", void 0);
|
|
71
105
|
tslib_1.__decorate([
|
|
72
|
-
(0, typeorm_1.
|
|
73
|
-
(0, type_graphql_1.Field)(type => transaction_1.TransactionCategory, { nullable: false }),
|
|
106
|
+
(0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.account),
|
|
74
107
|
tslib_1.__metadata("design:type", String)
|
|
75
|
-
], TransactionHistory.prototype, "
|
|
108
|
+
], TransactionHistory.prototype, "accountId", void 0);
|
|
76
109
|
tslib_1.__decorate([
|
|
77
|
-
(0, typeorm_1.Column)({ nullable:
|
|
78
|
-
(0, type_graphql_1.Field)(
|
|
110
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
111
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'description at this version' }),
|
|
79
112
|
tslib_1.__metadata("design:type", String)
|
|
80
|
-
], TransactionHistory.prototype, "
|
|
113
|
+
], TransactionHistory.prototype, "description", void 0);
|
|
81
114
|
tslib_1.__decorate([
|
|
82
115
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
83
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
84
|
-
tslib_1.__metadata("design:type",
|
|
85
|
-
], TransactionHistory.prototype, "
|
|
116
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'ledgerCategory at this version' }),
|
|
117
|
+
tslib_1.__metadata("design:type", String)
|
|
118
|
+
], TransactionHistory.prototype, "ledgerCategory", void 0);
|
|
86
119
|
tslib_1.__decorate([
|
|
87
120
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
88
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
121
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'counterpartyName at this version' }),
|
|
89
122
|
tslib_1.__metadata("design:type", String)
|
|
90
|
-
], TransactionHistory.prototype, "
|
|
123
|
+
], TransactionHistory.prototype, "counterpartyName", void 0);
|
|
91
124
|
tslib_1.__decorate([
|
|
92
|
-
(0, typeorm_1.ManyToOne)(type =>
|
|
93
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
-
tslib_1.__metadata("design:type",
|
|
95
|
-
], TransactionHistory.prototype, "
|
|
125
|
+
(0, typeorm_1.ManyToOne)(type => biz_base_1.Counterparty, { nullable: true, createForeignKeyConstraints: false }),
|
|
126
|
+
(0, type_graphql_1.Field)(type => biz_base_1.Counterparty, { nullable: true, description: 'counterparty at this version' }),
|
|
127
|
+
tslib_1.__metadata("design:type", biz_base_1.Counterparty)
|
|
128
|
+
], TransactionHistory.prototype, "counterparty", void 0);
|
|
96
129
|
tslib_1.__decorate([
|
|
97
|
-
(0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.
|
|
130
|
+
(0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.counterparty),
|
|
98
131
|
tslib_1.__metadata("design:type", String)
|
|
99
|
-
], TransactionHistory.prototype, "
|
|
132
|
+
], TransactionHistory.prototype, "counterpartyId", void 0);
|
|
100
133
|
tslib_1.__decorate([
|
|
101
134
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
102
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
103
|
-
tslib_1.__metadata("design:type",
|
|
104
|
-
], TransactionHistory.prototype, "
|
|
135
|
+
(0, type_graphql_1.Field)(type => transaction_1.TransactionSource, { nullable: true, description: 'source at this version' }),
|
|
136
|
+
tslib_1.__metadata("design:type", String)
|
|
137
|
+
], TransactionHistory.prototype, "source", void 0);
|
|
138
|
+
tslib_1.__decorate([
|
|
139
|
+
(0, typeorm_1.ManyToOne)(type => bank_statement_1.BankStatement, { nullable: true, createForeignKeyConstraints: false }),
|
|
140
|
+
(0, type_graphql_1.Field)(type => bank_statement_1.BankStatement, { nullable: true, description: 'bankStatement at this version' }),
|
|
141
|
+
tslib_1.__metadata("design:type", bank_statement_1.BankStatement)
|
|
142
|
+
], TransactionHistory.prototype, "bankStatement", void 0);
|
|
143
|
+
tslib_1.__decorate([
|
|
144
|
+
(0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.bankStatement),
|
|
145
|
+
tslib_1.__metadata("design:type", String)
|
|
146
|
+
], TransactionHistory.prototype, "bankStatementId", void 0);
|
|
105
147
|
tslib_1.__decorate([
|
|
106
148
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
107
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
149
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'sourceFile at this version' }),
|
|
150
|
+
tslib_1.__metadata("design:type", String)
|
|
151
|
+
], TransactionHistory.prototype, "sourceFile", void 0);
|
|
152
|
+
tslib_1.__decorate([
|
|
153
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
154
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'sourceRow at this version' }),
|
|
155
|
+
tslib_1.__metadata("design:type", Number)
|
|
156
|
+
], TransactionHistory.prototype, "sourceRow", void 0);
|
|
157
|
+
tslib_1.__decorate([
|
|
158
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
159
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'bankSequence at this version' }),
|
|
108
160
|
tslib_1.__metadata("design:type", Number)
|
|
109
|
-
], TransactionHistory.prototype, "
|
|
161
|
+
], TransactionHistory.prototype, "bankSequence", void 0);
|
|
162
|
+
tslib_1.__decorate([
|
|
163
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
164
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'bankFingerprint at this version' }),
|
|
165
|
+
tslib_1.__metadata("design:type", String)
|
|
166
|
+
], TransactionHistory.prototype, "bankFingerprint", void 0);
|
|
167
|
+
tslib_1.__decorate([
|
|
168
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
169
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'bankDescription at this version' }),
|
|
170
|
+
tslib_1.__metadata("design:type", String)
|
|
171
|
+
], TransactionHistory.prototype, "bankDescription", void 0);
|
|
172
|
+
tslib_1.__decorate([
|
|
173
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
174
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'bankKind at this version' }),
|
|
175
|
+
tslib_1.__metadata("design:type", String)
|
|
176
|
+
], TransactionHistory.prototype, "bankKind", void 0);
|
|
177
|
+
tslib_1.__decorate([
|
|
178
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
179
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'bankCounterpartyName at this version' }),
|
|
180
|
+
tslib_1.__metadata("design:type", String)
|
|
181
|
+
], TransactionHistory.prototype, "bankCounterpartyName", void 0);
|
|
182
|
+
tslib_1.__decorate([
|
|
183
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
184
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'bankCounterpartyAccount at this version' }),
|
|
185
|
+
tslib_1.__metadata("design:type", String)
|
|
186
|
+
], TransactionHistory.prototype, "bankCounterpartyAccount", void 0);
|
|
110
187
|
tslib_1.__decorate([
|
|
111
188
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
112
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
189
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'bankCounterpartyBank at this version' }),
|
|
190
|
+
tslib_1.__metadata("design:type", String)
|
|
191
|
+
], TransactionHistory.prototype, "bankCounterpartyBank", void 0);
|
|
192
|
+
tslib_1.__decorate([
|
|
193
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
194
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'bankMemo at this version' }),
|
|
195
|
+
tslib_1.__metadata("design:type", String)
|
|
196
|
+
], TransactionHistory.prototype, "bankMemo", void 0);
|
|
197
|
+
tslib_1.__decorate([
|
|
198
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
199
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'timing at this version' }),
|
|
200
|
+
tslib_1.__metadata("design:type", String)
|
|
201
|
+
], TransactionHistory.prototype, "timing", void 0);
|
|
202
|
+
tslib_1.__decorate([
|
|
203
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
204
|
+
(0, type_graphql_1.Field)(type => transaction_1.ForecastStatus, { nullable: true, description: 'status at this version' }),
|
|
205
|
+
tslib_1.__metadata("design:type", String)
|
|
206
|
+
], TransactionHistory.prototype, "status", void 0);
|
|
207
|
+
tslib_1.__decorate([
|
|
208
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
209
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'probability at this version' }),
|
|
113
210
|
tslib_1.__metadata("design:type", Number)
|
|
114
|
-
], TransactionHistory.prototype, "
|
|
211
|
+
], TransactionHistory.prototype, "probability", void 0);
|
|
115
212
|
tslib_1.__decorate([
|
|
116
|
-
(0, typeorm_1.Column)({ nullable:
|
|
117
|
-
(0, type_graphql_1.Field)({ nullable:
|
|
213
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
214
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'notes at this version' }),
|
|
118
215
|
tslib_1.__metadata("design:type", String)
|
|
119
|
-
], TransactionHistory.prototype, "
|
|
216
|
+
], TransactionHistory.prototype, "notes", void 0);
|
|
217
|
+
tslib_1.__decorate([
|
|
218
|
+
(0, typeorm_1.ManyToOne)(type => recurring_cash_item_1.RecurringCashItem, { nullable: true, createForeignKeyConstraints: false }),
|
|
219
|
+
(0, type_graphql_1.Field)(type => recurring_cash_item_1.RecurringCashItem, { nullable: true, description: 'recurringItem at this version' }),
|
|
220
|
+
tslib_1.__metadata("design:type", recurring_cash_item_1.RecurringCashItem)
|
|
221
|
+
], TransactionHistory.prototype, "recurringItem", void 0);
|
|
120
222
|
tslib_1.__decorate([
|
|
121
|
-
(0, typeorm_1.
|
|
122
|
-
|
|
223
|
+
(0, typeorm_1.RelationId)((transactionHistory) => transactionHistory.recurringItem),
|
|
224
|
+
tslib_1.__metadata("design:type", String)
|
|
225
|
+
], TransactionHistory.prototype, "recurringItemId", void 0);
|
|
226
|
+
tslib_1.__decorate([
|
|
227
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
228
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was created' }),
|
|
123
229
|
tslib_1.__metadata("design:type", Date)
|
|
124
230
|
], TransactionHistory.prototype, "createdAt", void 0);
|
|
125
231
|
tslib_1.__decorate([
|
|
126
|
-
(0, typeorm_1.Column)(),
|
|
127
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
232
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
233
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When this version was written' }),
|
|
128
234
|
tslib_1.__metadata("design:type", Date)
|
|
129
235
|
], TransactionHistory.prototype, "updatedAt", void 0);
|
|
130
236
|
tslib_1.__decorate([
|
|
131
|
-
(0, typeorm_1.Column)(),
|
|
132
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
237
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
238
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was deleted' }),
|
|
133
239
|
tslib_1.__metadata("design:type", Date)
|
|
134
240
|
], TransactionHistory.prototype, "deletedAt", void 0);
|
|
135
241
|
tslib_1.__decorate([
|
|
136
242
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
137
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
243
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who created it' }),
|
|
138
244
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
139
245
|
], TransactionHistory.prototype, "creator", void 0);
|
|
140
246
|
tslib_1.__decorate([
|
|
@@ -143,7 +249,7 @@ tslib_1.__decorate([
|
|
|
143
249
|
], TransactionHistory.prototype, "creatorId", void 0);
|
|
144
250
|
tslib_1.__decorate([
|
|
145
251
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
146
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
252
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who wrote this version' }),
|
|
147
253
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
148
254
|
], TransactionHistory.prototype, "updater", void 0);
|
|
149
255
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-history.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,+CAAoG;AACpG,gDAA4C;AAE5C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAkB7B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAAxB;QAOL,YAAO,GAAY,CAAC,CAAA;QAuBpB,WAAM,GAAY,CAAC,CAAA;IA+FrB,CAAC;CAAA,CAAA;AA7HY,gDAAkB;AAGpB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;8CACC;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAIpB;IAFC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BnB;IAhBN,IAAA,qCAAmB,EAAC;QACnB,QAAQ,EAAE,KAAK;QACf,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,QAAQ;gBACzB,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,aAAa,IAAI,OAAO;oBACxB,CAAC,CAAC,UAAU;oBACZ,CAAC,CAAC,SAAS;QACnB,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,mCAAiB;YACnB,CAAC,CAAC,SAAS;QACf,MAAM,EAAE,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;KAC/G,CAAC;;kDAC+B;6BA5HtB,kBAAkB;IAhB9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE,kBAAkB,CAAC,OAAO,CAAC,EACvG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC;QAC1C,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,UAAU;QAC7B,kBAAkB,CAAC,OAAO;KAC3B,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CA6H9B","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { Transaction, TransactionCategory, TransactionStatus, TransactionType } from './transaction'\nimport { Account } from '../account/account'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_transaction_history_0',\n (transactionHistory: TransactionHistory) => [transactionHistory.originalId, transactionHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_transaction_history_1',\n (transactionHistory: TransactionHistory) => [\n transactionHistory.domain,\n transactionHistory.originalId,\n transactionHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of Transaction' })\nexport class TransactionHistory implements HistoryEntityInterface<Transaction> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n currency?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n amount?: number = 0\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: TransactionType\n\n @Column({ nullable: false })\n @Field(type => TransactionCategory, { nullable: false })\n category: TransactionCategory // 트랜잭션의 카테고리 (확정, 전망)\n\n @Column({ nullable: false })\n @Field(type => TransactionStatus, { nullable: false })\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 })\n account?: Account\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.account)\n accountId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal year' })\n year?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal quarter' })\n quarter?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal month' })\n month?: number\n\n @Column({ nullable: false })\n @Field({ nullable: false, description: 'The date the transaction occurs or is scheduled (in string format)' })\n transactionDate: string // 트랜잭션이 발생하거나 발생할 날짜\n\n @Column()\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.updater)\n updaterId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n enum:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? HistoryActionType\n : undefined,\n length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 10\n })\n public action!: HistoryActionType\n}\n"]}
|
|
1
|
+
{"version":3,"file":"transaction-history.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAgD;AAChD,6CAA4C;AAC5C,iDAA2D;AAC3D,uDAAuD;AAEvD,gDAA4C;AAC5C,+DAA0D;AAC1D,qEAAgE;AAChE,sDAAgD;AAChD,oFAA8E;AAC9E,+CAAmG;AAEnG,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,8DAA8D;AAiBvD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAAxB;QAOL,YAAO,GAAY,CAAC,CAAA;IAsMtB,CAAC;CAAA,CAAA;AA7MY,gDAAkB;AAGpB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;8CACpD;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;;mDACrC;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;sCAC5D,cAAM;kDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC;;o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;oBACxB,CAAC,CAAC,UAAU;oBACZ,CAAC,CAAC,SAAS;QACnB,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,mCAAiB;YACnB,CAAC,CAAC,SAAS;QACf,MAAM,EAAE,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;KAC/G,CAAC;;kDAC+B;6BA5MtB,kBAAkB;IAhB9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE,kBAAkB,CAAC,OAAO,CAAC,EACvG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC;QAC1C,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,UAAU;QAC7B,kBAAkB,CAAC,OAAO;KAC3B,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CA6M9B","sourcesContent":["import { Field, Float, ID, Int, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain, moneyColumn } from '@things-factory/shell'\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 { RecurringCashItem } from '../recurring-cash-item/recurring-cash-item'\nimport { ForecastStatus, Transaction, TransactionCategory, TransactionSource } from './transaction'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n/** Each version of a transaction, written when it changes. */\n@Entity()\n@Index(\n 'ix_transaction_history_0',\n (transactionHistory: TransactionHistory) => [transactionHistory.originalId, transactionHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_transaction_history_1',\n (transactionHistory: TransactionHistory) => [\n transactionHistory.domain,\n transactionHistory.originalId,\n transactionHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of Transaction' })\nexport class TransactionHistory implements HistoryEntityInterface<Transaction> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier of the version' })\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true, description: 'Version number' })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain' })\n domain?: Domain\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.domain)\n domainId?: string\n\n @Column({ nullable: true })\n @Field(type => TransactionCategory, { nullable: true, description: 'category at this version' })\n category: TransactionCategory\n\n @Column({ nullable: true })\n @Field(type => CashFlowType, { nullable: true, description: 'type at this version' })\n type: CashFlowType\n\n @ManyToOne(type => BankAccount, { nullable: true, createForeignKeyConstraints: false })\n @Field(type => BankAccount, { nullable: true, description: 'bankAccount at this version' })\n bankAccount: BankAccount\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.bankAccount)\n bankAccountId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'transactionDate at this version' })\n transactionDate: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'transactionAt at this version' })\n transactionAt: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'year at this version' })\n year: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'month at this version' })\n month: number\n\n @Column(moneyColumn({ nullable: true }))\n @Field(type => Float, { nullable: true, description: 'amount at this version' })\n amount: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'currency at this version' })\n currency: string\n\n @Column(moneyColumn({ nullable: true }))\n @Field(type => Float, { nullable: true, description: 'balance at this version' })\n balance: number\n\n @ManyToOne(type => Account, { nullable: true, createForeignKeyConstraints: false })\n @Field(type => Account, { nullable: true, description: 'account at this version' })\n account: Account\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.account)\n accountId?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'description at this version' })\n description: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'ledgerCategory at this version' })\n ledgerCategory: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'counterpartyName at this version' })\n counterpartyName: string\n\n @ManyToOne(type => Counterparty, { nullable: true, createForeignKeyConstraints: false })\n @Field(type => Counterparty, { nullable: true, description: 'counterparty at this version' })\n counterparty: Counterparty\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.counterparty)\n counterpartyId?: string\n\n @Column({ nullable: true })\n @Field(type => TransactionSource, { nullable: true, description: 'source at this version' })\n source: TransactionSource\n\n @ManyToOne(type => BankStatement, { nullable: true, createForeignKeyConstraints: false })\n @Field(type => BankStatement, { nullable: true, description: 'bankStatement at this version' })\n bankStatement: BankStatement\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.bankStatement)\n bankStatementId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'sourceFile at this version' })\n sourceFile: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'sourceRow at this version' })\n sourceRow: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'bankSequence at this version' })\n bankSequence: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'bankFingerprint at this version' })\n bankFingerprint: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'bankDescription at this version' })\n bankDescription: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'bankKind at this version' })\n bankKind: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'bankCounterpartyName at this version' })\n bankCounterpartyName: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'bankCounterpartyAccount at this version' })\n bankCounterpartyAccount: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'bankCounterpartyBank at this version' })\n bankCounterpartyBank: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'bankMemo at this version' })\n bankMemo: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'timing at this version' })\n timing: string\n\n @Column({ nullable: true })\n @Field(type => ForecastStatus, { nullable: true, description: 'status at this version' })\n status: ForecastStatus\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'probability at this version' })\n probability: number\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'notes at this version' })\n notes: string\n\n @ManyToOne(type => RecurringCashItem, { nullable: true, createForeignKeyConstraints: false })\n @Field(type => RecurringCashItem, { nullable: true, description: 'recurringItem at this version' })\n recurringItem: RecurringCashItem\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.recurringItem)\n recurringItemId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When it was created' })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When this version was written' })\n updatedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When it was deleted' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who created it' })\n creator?: User\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who wrote this version' })\n updater?: User\n\n @RelationId((transactionHistory: TransactionHistory) => transactionHistory.updater)\n updaterId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n enum:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? HistoryActionType\n : undefined,\n length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 10\n })\n public action!: HistoryActionType\n}\n"]}
|
|
@@ -6,5 +6,4 @@ export declare class TransactionMutation {
|
|
|
6
6
|
updateMultipleTransaction(patches: TransactionPatch[], context: ResolverContext): Promise<Transaction[]>;
|
|
7
7
|
deleteTransaction(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
8
|
deleteTransactions(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
-
importTransactions(transactions: TransactionPatch[], context: ResolverContext): Promise<boolean>;
|
|
10
9
|
}
|