@things-factory/accounting 10.1.206 → 10.1.209

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 (76) hide show
  1. package/dist-server/activities/activity-expenditure.js +5 -2
  2. package/dist-server/activities/activity-expenditure.js.map +1 -1
  3. package/dist-server/service/account/account-match.d.ts +4 -5
  4. package/dist-server/service/account/account-match.js +7 -8
  5. package/dist-server/service/account/account-match.js.map +1 -1
  6. package/dist-server/service/account/account-mutation.js +5 -7
  7. package/dist-server/service/account/account-mutation.js.map +1 -1
  8. package/dist-server/service/account/account-service.d.ts +5 -0
  9. package/dist-server/service/account/account-service.js +17 -0
  10. package/dist-server/service/account/account-service.js.map +1 -0
  11. package/dist-server/service/bank-account/bank-account-service.d.ts +4 -1
  12. package/dist-server/service/bank-account/bank-account-service.js +5 -1
  13. package/dist-server/service/bank-account/bank-account-service.js.map +1 -1
  14. package/dist-server/service/expenditure-request/expenditure-request-item.d.ts +4 -3
  15. package/dist-server/service/expenditure-request/expenditure-request-item.js +6 -5
  16. package/dist-server/service/expenditure-request/expenditure-request-item.js.map +1 -1
  17. package/dist-server/service/expenditure-request/expenditure-request-mutation.d.ts +2 -2
  18. package/dist-server/service/expenditure-request/expenditure-request-mutation.js +13 -11
  19. package/dist-server/service/expenditure-request/expenditure-request-mutation.js.map +1 -1
  20. package/dist-server/service/expenditure-request/expenditure-request-query.d.ts +9 -2
  21. package/dist-server/service/expenditure-request/expenditure-request-query.js +28 -6
  22. package/dist-server/service/expenditure-request/expenditure-request-query.js.map +1 -1
  23. package/dist-server/service/expenditure-request/expenditure-request-service.d.ts +14 -4
  24. package/dist-server/service/expenditure-request/expenditure-request-service.js +47 -9
  25. package/dist-server/service/expenditure-request/expenditure-request-service.js.map +1 -1
  26. package/dist-server/service/expenditure-request/expenditure-request-type.d.ts +1 -1
  27. package/dist-server/service/expenditure-request/expenditure-request-type.js +3 -3
  28. package/dist-server/service/expenditure-request/expenditure-request-type.js.map +1 -1
  29. package/dist-server/service/expenditure-request/receipt-reader.d.ts +18 -9
  30. package/dist-server/service/expenditure-request/receipt-reader.js +19 -10
  31. package/dist-server/service/expenditure-request/receipt-reader.js.map +1 -1
  32. package/dist-server/service/index.d.ts +1 -0
  33. package/dist-server/service/index.js +1 -0
  34. package/dist-server/service/index.js.map +1 -1
  35. package/dist-server/service/payment/index.js +3 -0
  36. package/dist-server/service/payment/index.js.map +1 -1
  37. package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.d.ts +0 -1
  38. package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js +0 -17
  39. package/dist-server/service/recurring-cash-item/recurring-cash-item-mutation.js.map +1 -1
  40. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.d.ts +4 -8
  41. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js +5 -38
  42. package/dist-server/service/recurring-cash-item/recurring-cash-item-service.js.map +1 -1
  43. package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js +1 -1
  44. package/dist-server/service/recurring-cash-item/recurring-cash-item-type.js.map +1 -1
  45. package/dist-server/service/recurring-cash-item/recurring-cash-item.d.ts +2 -2
  46. package/dist-server/service/recurring-cash-item/recurring-cash-item.js +5 -5
  47. package/dist-server/service/recurring-cash-item/recurring-cash-item.js.map +1 -1
  48. package/dist-server/service/recurring-cash-item/recurring-schedule.d.ts +6 -18
  49. package/dist-server/service/recurring-cash-item/recurring-schedule.js +13 -26
  50. package/dist-server/service/recurring-cash-item/recurring-schedule.js.map +1 -1
  51. package/dist-server/service/transaction/transaction-history.d.ts +1 -7
  52. package/dist-server/service/transaction/transaction-history.js +0 -25
  53. package/dist-server/service/transaction/transaction-history.js.map +1 -1
  54. package/dist-server/service/transaction/transaction-period.d.ts +0 -8
  55. package/dist-server/service/transaction/transaction-period.js +0 -30
  56. package/dist-server/service/transaction/transaction-period.js.map +1 -1
  57. package/dist-server/service/transaction/transaction-query.d.ts +0 -2
  58. package/dist-server/service/transaction/transaction-query.js +2 -16
  59. package/dist-server/service/transaction/transaction-query.js.map +1 -1
  60. package/dist-server/service/transaction/transaction-service.d.ts +4 -6
  61. package/dist-server/service/transaction/transaction-service.js +10 -35
  62. package/dist-server/service/transaction/transaction-service.js.map +1 -1
  63. package/dist-server/service/transaction/transaction-type.d.ts +1 -15
  64. package/dist-server/service/transaction/transaction-type.js +2 -58
  65. package/dist-server/service/transaction/transaction-type.js.map +1 -1
  66. package/dist-server/service/transaction/transaction.d.ts +6 -15
  67. package/dist-server/service/transaction/transaction.js +13 -52
  68. package/dist-server/service/transaction/transaction.js.map +1 -1
  69. package/dist-server/tsconfig.tsbuildinfo +1 -1
  70. package/package.json +10 -10
  71. package/translations/en.json +12 -6
  72. package/translations/es.json +12 -6
  73. package/translations/ja.json +11 -1
  74. package/translations/ko.json +13 -7
  75. package/translations/ms.json +11 -1
  76. package/translations/zh.json +11 -1
@@ -9,10 +9,6 @@ const transaction_1 = require("./transaction");
9
9
  let NewTransaction = class NewTransaction {
10
10
  };
11
11
  exports.NewTransaction = NewTransaction;
12
- tslib_1.__decorate([
13
- (0, type_graphql_1.Field)(type => transaction_1.TransactionCategory, { nullable: true, description: 'Confirmed when not given' }),
14
- tslib_1.__metadata("design:type", String)
15
- ], NewTransaction.prototype, "category", void 0);
16
12
  tslib_1.__decorate([
17
13
  (0, type_graphql_1.Field)(type => cash_flow_type_1.CashFlowType, { description: 'Money in or money out' }),
18
14
  tslib_1.__metadata("design:type", String)
@@ -22,17 +18,9 @@ tslib_1.__decorate([
22
18
  tslib_1.__metadata("design:type", shell_1.ObjectRef)
23
19
  ], NewTransaction.prototype, "bankAccount", void 0);
24
20
  tslib_1.__decorate([
25
- (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD - required for a confirmed transaction' }),
21
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD - required' }),
26
22
  tslib_1.__metadata("design:type", String)
27
23
  ], NewTransaction.prototype, "transactionDate", void 0);
28
- tslib_1.__decorate([
29
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The year a forecast is planned in' }),
30
- tslib_1.__metadata("design:type", Number)
31
- ], NewTransaction.prototype, "year", void 0);
32
- tslib_1.__decorate([
33
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The month a forecast is planned in' }),
34
- tslib_1.__metadata("design:type", Number)
35
- ], NewTransaction.prototype, "month", void 0);
36
24
  tslib_1.__decorate([
37
25
  (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Amount - zero when not given' }),
38
26
  tslib_1.__metadata("design:type", Number)
@@ -65,28 +53,12 @@ tslib_1.__decorate([
65
53
  (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'The registered counterparty' }),
66
54
  tslib_1.__metadata("design:type", shell_1.ObjectRef)
67
55
  ], NewTransaction.prototype, "counterparty", void 0);
68
- tslib_1.__decorate([
69
- (0, type_graphql_1.Field)({ nullable: true, description: 'When in the month a forecast falls' }),
70
- tslib_1.__metadata("design:type", String)
71
- ], NewTransaction.prototype, "timing", void 0);
72
- tslib_1.__decorate([
73
- (0, type_graphql_1.Field)(type => transaction_1.ForecastStatus, { nullable: true, description: 'State of a forecast' }),
74
- tslib_1.__metadata("design:type", String)
75
- ], NewTransaction.prototype, "status", void 0);
76
- tslib_1.__decorate([
77
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The probability of a forecast being realized (0 to 100)' }),
78
- tslib_1.__metadata("design:type", Number)
79
- ], NewTransaction.prototype, "probability", void 0);
80
56
  tslib_1.__decorate([
81
57
  (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
82
58
  tslib_1.__metadata("design:type", String)
83
59
  ], NewTransaction.prototype, "notes", void 0);
84
- tslib_1.__decorate([
85
- (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'The recurring item a forecast was made from' }),
86
- tslib_1.__metadata("design:type", shell_1.ObjectRef)
87
- ], NewTransaction.prototype, "recurringItem", void 0);
88
60
  exports.NewTransaction = NewTransaction = tslib_1.__decorate([
89
- (0, type_graphql_1.InputType)({ description: 'A transaction someone writes - a bank line by hand, or a forecast' })
61
+ (0, type_graphql_1.InputType)({ description: 'A bank line someone writes by hand' })
90
62
  ], NewTransaction);
91
63
  let TransactionPatch = class TransactionPatch {
92
64
  };
@@ -95,10 +67,6 @@ tslib_1.__decorate([
95
67
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'The transaction to change or delete' }),
96
68
  tslib_1.__metadata("design:type", String)
97
69
  ], TransactionPatch.prototype, "id", void 0);
98
- tslib_1.__decorate([
99
- (0, type_graphql_1.Field)(type => transaction_1.TransactionCategory, { nullable: true, description: 'Confirmed or forecast' }),
100
- tslib_1.__metadata("design:type", String)
101
- ], TransactionPatch.prototype, "category", void 0);
102
70
  tslib_1.__decorate([
103
71
  (0, type_graphql_1.Field)(type => cash_flow_type_1.CashFlowType, { nullable: true, description: 'Money in or money out' }),
104
72
  tslib_1.__metadata("design:type", String)
@@ -111,14 +79,6 @@ tslib_1.__decorate([
111
79
  (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD' }),
112
80
  tslib_1.__metadata("design:type", String)
113
81
  ], TransactionPatch.prototype, "transactionDate", void 0);
114
- tslib_1.__decorate([
115
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The year a forecast is planned in' }),
116
- tslib_1.__metadata("design:type", Number)
117
- ], TransactionPatch.prototype, "year", void 0);
118
- tslib_1.__decorate([
119
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The month a forecast is planned in' }),
120
- tslib_1.__metadata("design:type", Number)
121
- ], TransactionPatch.prototype, "month", void 0);
122
82
  tslib_1.__decorate([
123
83
  (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Amount' }),
124
84
  tslib_1.__metadata("design:type", Number)
@@ -151,26 +111,10 @@ tslib_1.__decorate([
151
111
  (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'The registered counterparty' }),
152
112
  tslib_1.__metadata("design:type", shell_1.ObjectRef)
153
113
  ], TransactionPatch.prototype, "counterparty", void 0);
154
- tslib_1.__decorate([
155
- (0, type_graphql_1.Field)({ nullable: true, description: 'When in the month a forecast falls' }),
156
- tslib_1.__metadata("design:type", String)
157
- ], TransactionPatch.prototype, "timing", void 0);
158
- tslib_1.__decorate([
159
- (0, type_graphql_1.Field)(type => transaction_1.ForecastStatus, { nullable: true, description: 'State of a forecast' }),
160
- tslib_1.__metadata("design:type", String)
161
- ], TransactionPatch.prototype, "status", void 0);
162
- tslib_1.__decorate([
163
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The probability of a forecast being realized (0 to 100)' }),
164
- tslib_1.__metadata("design:type", Number)
165
- ], TransactionPatch.prototype, "probability", void 0);
166
114
  tslib_1.__decorate([
167
115
  (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
168
116
  tslib_1.__metadata("design:type", String)
169
117
  ], TransactionPatch.prototype, "notes", void 0);
170
- tslib_1.__decorate([
171
- (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'The recurring item a forecast was made from' }),
172
- tslib_1.__metadata("design:type", shell_1.ObjectRef)
173
- ], TransactionPatch.prototype, "recurringItem", void 0);
174
118
  tslib_1.__decorate([
175
119
  (0, type_graphql_1.Field)({ nullable: true, description: '+ adds, M changes, - deletes' }),
176
120
  tslib_1.__metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-type.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAE3E,iDAAiD;AAEjD,sDAAgD;AAChD,+CAAgF;AAGzE,IAAM,cAAc,GAApB,MAAM,cAAc;CAyD1B,CAAA;AAzDY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CA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AGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;;+CAClC;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;sCACzF,iBAAS;uDAAA;AAGzB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;;gDACxD;2BA9DJ,gBAAgB;IAD5B,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,+EAA+E,EAAE,CAAC;GAC/F,gBAAgB,CA+D5B;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AANY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,yBAAW,CAAC,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;;8CAC3D;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;8CACpD;0BALF,eAAe;IAD3B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;GACzC,eAAe,CAM3B","sourcesContent":["import { ObjectType, Field, Float, InputType, Int, ID } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { CashFlowType } from '../cash-flow-type'\nimport { ForecastStatus, Transaction, TransactionCategory } from './transaction'\n\n@InputType({ description: 'A transaction someone writes - a bank line by hand, or a forecast' })\nexport class NewTransaction {\n @Field(type => TransactionCategory, { nullable: true, description: 'Confirmed when not given' })\n category?: TransactionCategory\n\n @Field(type => CashFlowType, { description: 'Money in or money out' })\n type: CashFlowType\n\n @Field(type => ObjectRef, { nullable: true, description: 'The account the money moved in or out of' })\n bankAccount?: ObjectRef\n\n @Field({ nullable: true, description: 'YYYY-MM-DD - required for a confirmed transaction' })\n transactionDate?: string\n\n @Field(type => Int, { nullable: true, description: 'The year a forecast is planned in' })\n year?: number\n\n @Field(type => Int, { nullable: true, description: 'The month a forecast is planned in' })\n month?: number\n\n @Field(type => Float, { nullable: true, description: 'Amount - zero when not given' })\n amount?: number\n\n @Field({ nullable: true, description: \"ISO 4217 code - the bank account's when not given\" })\n currency?: string\n\n @Field(type => Float, { nullable: true, description: 'Account balance after it' })\n balance?: number\n\n @Field(type => ObjectRef, { nullable: true, description: 'The account subject it is booked to' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'What a person wrote about it' })\n description?: string\n\n @Field({ nullable: true, description: 'The classifying word of the ledger it was kept in' })\n ledgerCategory?: string\n\n @Field({ nullable: true, description: 'The counterparty name as a person wrote it' })\n counterpartyName?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'The registered counterparty' })\n counterparty?: ObjectRef\n\n @Field({ nullable: true, description: 'When in the month a forecast falls' })\n timing?: string\n\n @Field(type => ForecastStatus, { nullable: true, description: 'State of a forecast' })\n status?: ForecastStatus\n\n @Field(type => Int, { nullable: true, description: 'The probability of a forecast being realized (0 to 100)' })\n probability?: number\n\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'The recurring item a forecast was made from' })\n recurringItem?: ObjectRef\n}\n\n@InputType({ description: 'A change to a transaction, or a grid row: cuFlag + adds, M changes, - deletes' })\nexport class TransactionPatch {\n @Field(type => ID, { nullable: true, description: 'The transaction to change or delete' })\n id?: string\n\n @Field(type => TransactionCategory, { nullable: true, description: 'Confirmed or forecast' })\n category?: TransactionCategory\n\n @Field(type => CashFlowType, { nullable: true, description: 'Money in or money out' })\n type?: CashFlowType\n\n @Field(type => ObjectRef, { nullable: true, description: 'The account the money moved in or out of' })\n bankAccount?: ObjectRef\n\n @Field({ nullable: true, description: 'YYYY-MM-DD' })\n transactionDate?: string\n\n @Field(type => Int, { nullable: true, description: 'The year a forecast is planned in' })\n year?: number\n\n @Field(type => Int, { nullable: true, description: 'The month a forecast is planned in' })\n month?: number\n\n @Field(type => Float, { nullable: true, description: 'Amount' })\n amount?: number\n\n @Field({ nullable: true, description: 'ISO 4217 code' })\n currency?: string\n\n @Field(type => Float, { nullable: true, description: 'Account balance after it' })\n balance?: number\n\n @Field(type => ObjectRef, { nullable: true, description: 'The account subject it is booked to' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'What a person wrote about it' })\n description?: string\n\n @Field({ nullable: true, description: 'The classifying word of the ledger it was kept in' })\n ledgerCategory?: string\n\n @Field({ nullable: true, description: 'The counterparty name as a person wrote it' })\n counterpartyName?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'The registered counterparty' })\n counterparty?: ObjectRef\n\n @Field({ nullable: true, description: 'When in the month a forecast falls' })\n timing?: string\n\n @Field(type => ForecastStatus, { nullable: true, description: 'State of a forecast' })\n status?: ForecastStatus\n\n @Field(type => Int, { nullable: true, description: 'The probability of a forecast being realized (0 to 100)' })\n probability?: number\n\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'The recurring item a forecast was made from' })\n recurringItem?: ObjectRef\n\n @Field({ nullable: true, description: '+ adds, M changes, - deletes' })\n cuFlag?: string\n}\n\n@ObjectType({ description: 'A page of transactions' })\nexport class TransactionList {\n @Field(type => [Transaction], { description: 'The transactions on this page' })\n items: Transaction[]\n\n @Field(type => Int, { description: 'How many there are in all' })\n total: number\n}\n"]}
1
+ {"version":3,"file":"transaction-type.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAE3E,iDAAiD;AAEjD,sDAAgD;AAChD,+CAA2C;AAGpC,IAAM,cAAc,GAApB,MAAM,cAAc;CAoC1B,CAAA;AApCY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EA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AAC,kBAAG,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;8CACpD;0BALF,eAAe;IAD3B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;GACzC,eAAe,CAM3B","sourcesContent":["import { ObjectType, Field, Float, InputType, Int, ID } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { CashFlowType } from '../cash-flow-type'\nimport { Transaction } from './transaction'\n\n@InputType({ description: 'A bank line someone writes by hand' })\nexport class NewTransaction {\n @Field(type => CashFlowType, { description: 'Money in or money out' })\n type: CashFlowType\n\n @Field(type => ObjectRef, { nullable: true, description: 'The account the money moved in or out of' })\n bankAccount?: ObjectRef\n\n @Field({ nullable: true, description: 'YYYY-MM-DD - required' })\n transactionDate?: string\n\n @Field(type => Float, { nullable: true, description: 'Amount - zero when not given' })\n amount?: number\n\n @Field({ nullable: true, description: \"ISO 4217 code - the bank account's when not given\" })\n currency?: string\n\n @Field(type => Float, { nullable: true, description: 'Account balance after it' })\n balance?: number\n\n @Field(type => ObjectRef, { nullable: true, description: 'The account subject it is booked to' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'What a person wrote about it' })\n description?: string\n\n @Field({ nullable: true, description: 'The classifying word of the ledger it was kept in' })\n ledgerCategory?: string\n\n @Field({ nullable: true, description: 'The counterparty name as a person wrote it' })\n counterpartyName?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'The registered counterparty' })\n counterparty?: ObjectRef\n\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n}\n\n@InputType({ description: 'A change to a transaction, or a grid row: cuFlag + adds, M changes, - deletes' })\nexport class TransactionPatch {\n @Field(type => ID, { nullable: true, description: 'The transaction to change or delete' })\n id?: string\n\n @Field(type => CashFlowType, { nullable: true, description: 'Money in or money out' })\n type?: CashFlowType\n\n @Field(type => ObjectRef, { nullable: true, description: 'The account the money moved in or out of' })\n bankAccount?: ObjectRef\n\n @Field({ nullable: true, description: 'YYYY-MM-DD' })\n transactionDate?: string\n\n @Field(type => Float, { nullable: true, description: 'Amount' })\n amount?: number\n\n @Field({ nullable: true, description: 'ISO 4217 code' })\n currency?: string\n\n @Field(type => Float, { nullable: true, description: 'Account balance after it' })\n balance?: number\n\n @Field(type => ObjectRef, { nullable: true, description: 'The account subject it is booked to' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'What a person wrote about it' })\n description?: string\n\n @Field({ nullable: true, description: 'The classifying word of the ledger it was kept in' })\n ledgerCategory?: string\n\n @Field({ nullable: true, description: 'The counterparty name as a person wrote it' })\n counterpartyName?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'The registered counterparty' })\n counterparty?: ObjectRef\n\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @Field({ nullable: true, description: '+ adds, M changes, - deletes' })\n cuFlag?: string\n}\n\n@ObjectType({ description: 'A page of transactions' })\nexport class TransactionList {\n @Field(type => [Transaction], { description: 'The transactions on this page' })\n items: Transaction[]\n\n @Field(type => Int, { description: 'How many there are in all' })\n total: number\n}\n"]}
@@ -7,24 +7,20 @@ import { BankStatement } from '../bank-statement/bank-statement';
7
7
  import { CashFlowType } from '../cash-flow-type';
8
8
  import { Payment } from '../payment/payment';
9
9
  import { AccountingDocument } from '../accounting-document/accounting-document';
10
- import { RecurringCashItem } from '../recurring-cash-item/recurring-cash-item';
10
+ /**
11
+ * What a transaction is: a line that happened on the bank account. Money still to come is read from the records that
12
+ * owe it, never written as a transaction (ADR-0157) - the category is the one kind left.
13
+ */
11
14
  export declare enum TransactionCategory {
12
- CONFIRMED = "CONFIRMED",
13
- FORECAST = "FORECAST"
15
+ CONFIRMED = "CONFIRMED"
14
16
  }
15
17
  export declare enum TransactionSource {
16
18
  BANK_STATEMENT = "BANK_STATEMENT",
17
19
  LEGACY = "LEGACY",
18
20
  MANUAL = "MANUAL"
19
21
  }
20
- export declare enum ForecastStatus {
21
- PLANNED = "PLANNED",
22
- DONE = "DONE",
23
- CANCELLED = "CANCELLED"
24
- }
25
22
  /**
26
- * Money that moves in or out of the business: a line on a bank account (confirmed), or a plan someone made of money
27
- * still to come or go (forecast).
23
+ * Money that moved in or out of the business: a line on a bank account.
28
24
  *
29
25
  * What a transaction paid - a contract round, a tax invoice, a VAT period - is its payments (§`Payment`). The facts
30
26
  * of a bank line are kept as the bank gave them, beside what a person wrote about it.
@@ -66,12 +62,7 @@ export declare class Transaction {
66
62
  bankCounterpartyAccount?: string;
67
63
  bankCounterpartyBank?: string;
68
64
  bankMemo?: string;
69
- timing?: string;
70
- status?: ForecastStatus;
71
- probability?: number;
72
65
  notes?: string;
73
- recurringItem?: RecurringCashItem;
74
- recurringItemId?: string;
75
66
  payments?: Payment[];
76
67
  documents?: AccountingDocument[];
77
68
  createdAt?: Date;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Transaction = exports.ForecastStatus = exports.TransactionSource = exports.TransactionCategory = void 0;
3
+ exports.Transaction = exports.TransactionSource = exports.TransactionCategory = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const typeorm_1 = require("typeorm");
6
6
  const type_graphql_1 = require("type-graphql");
@@ -13,15 +13,17 @@ const bank_statement_1 = require("../bank-statement/bank-statement");
13
13
  const cash_flow_type_1 = require("../cash-flow-type");
14
14
  const payment_1 = require("../payment/payment");
15
15
  const accounting_document_1 = require("../accounting-document/accounting-document");
16
- const recurring_cash_item_1 = require("../recurring-cash-item/recurring-cash-item");
16
+ /**
17
+ * What a transaction is: a line that happened on the bank account. Money still to come is read from the records that
18
+ * owe it, never written as a transaction (ADR-0157) - the category is the one kind left.
19
+ */
17
20
  var TransactionCategory;
18
21
  (function (TransactionCategory) {
19
22
  TransactionCategory["CONFIRMED"] = "CONFIRMED";
20
- TransactionCategory["FORECAST"] = "FORECAST";
21
23
  })(TransactionCategory || (exports.TransactionCategory = TransactionCategory = {}));
22
24
  (0, type_graphql_1.registerEnumType)(TransactionCategory, {
23
25
  name: 'TransactionCategory',
24
- description: 'Whether a transaction happened on the bank account (confirmed) or is a plan someone made (forecast)'
26
+ description: 'That a transaction happened on the bank account (confirmed)'
25
27
  });
26
28
  var TransactionSource;
27
29
  (function (TransactionSource) {
@@ -33,19 +35,8 @@ var TransactionSource;
33
35
  name: 'TransactionSource',
34
36
  description: 'Where the facts of a confirmed transaction come from - a bank statement file, an old ledger, or a person'
35
37
  });
36
- var ForecastStatus;
37
- (function (ForecastStatus) {
38
- ForecastStatus["PLANNED"] = "PLANNED";
39
- ForecastStatus["DONE"] = "DONE";
40
- ForecastStatus["CANCELLED"] = "CANCELLED";
41
- })(ForecastStatus || (exports.ForecastStatus = ForecastStatus = {}));
42
- (0, type_graphql_1.registerEnumType)(ForecastStatus, {
43
- name: 'ForecastStatus',
44
- description: 'State of a forecast - still expected, happened, dropped'
45
- });
46
38
  /**
47
- * Money that moves in or out of the business: a line on a bank account (confirmed), or a plan someone made of money
48
- * still to come or go (forecast).
39
+ * Money that moved in or out of the business: a line on a bank account.
49
40
  *
50
41
  * What a transaction paid - a contract round, a tax invoice, a VAT period - is its payments (§`Payment`). The facts
51
42
  * of a bank line are kept as the bank gave them, beside what a person wrote about it.
@@ -77,7 +68,7 @@ tslib_1.__decorate([
77
68
  ], Transaction.prototype, "domainId", void 0);
78
69
  tslib_1.__decorate([
79
70
  (0, typeorm_1.Column)({ default: TransactionCategory.CONFIRMED }),
80
- (0, type_graphql_1.Field)(type => TransactionCategory, { description: 'Confirmed (on the bank account) or forecast (a plan)' }),
71
+ (0, type_graphql_1.Field)(type => TransactionCategory, { description: 'Confirmed - on the bank account' }),
81
72
  tslib_1.__metadata("design:type", String)
82
73
  ], Transaction.prototype, "category", void 0);
83
74
  tslib_1.__decorate([
@@ -98,7 +89,7 @@ tslib_1.__decorate([
98
89
  (0, typeorm_1.Column)({ nullable: true }),
99
90
  (0, type_graphql_1.Field)({
100
91
  nullable: true,
101
- description: "YYYY-MM-DD - the day in the account's time zone; for a forecast, the day its timing names, empty when it names none"
92
+ description: "YYYY-MM-DD - the day in the account's time zone"
102
93
  }),
103
94
  tslib_1.__metadata("design:type", String)
104
95
  ], Transaction.prototype, "transactionDate", void 0);
@@ -109,12 +100,12 @@ tslib_1.__decorate([
109
100
  ], Transaction.prototype, "transactionAt", void 0);
110
101
  tslib_1.__decorate([
111
102
  (0, typeorm_1.Column)({ type: 'int' }),
112
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Year of the transaction date - for a forecast, the year it is planned in' }),
103
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Year of the transaction date' }),
113
104
  tslib_1.__metadata("design:type", Number)
114
105
  ], Transaction.prototype, "year", void 0);
115
106
  tslib_1.__decorate([
116
107
  (0, typeorm_1.Column)({ type: 'int' }),
117
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Month of the transaction date - for a forecast, the month it is planned in' }),
108
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Month of the transaction date' }),
118
109
  tslib_1.__metadata("design:type", Number)
119
110
  ], Transaction.prototype, "month", void 0);
120
111
  tslib_1.__decorate([
@@ -146,7 +137,7 @@ tslib_1.__decorate([
146
137
  ], Transaction.prototype, "accountId", void 0);
147
138
  tslib_1.__decorate([
148
139
  (0, typeorm_1.Column)({ type: 'text', nullable: true }),
149
- (0, type_graphql_1.Field)({ nullable: true, description: 'What a person wrote about it - for a forecast, what is planned' }),
140
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What a person wrote about it' }),
150
141
  tslib_1.__metadata("design:type", String)
151
142
  ], Transaction.prototype, "description", void 0);
152
143
  tslib_1.__decorate([
@@ -242,41 +233,11 @@ tslib_1.__decorate([
242
233
  (0, type_graphql_1.Field)({ nullable: true, description: 'Memo as the bank wrote it' }),
243
234
  tslib_1.__metadata("design:type", String)
244
235
  ], Transaction.prototype, "bankMemo", void 0);
245
- tslib_1.__decorate([
246
- (0, typeorm_1.Column)({ nullable: true }),
247
- (0, type_graphql_1.Field)({
248
- nullable: true,
249
- description: 'When in the month a forecast falls, as a person wrote it - 15th, end of month'
250
- }),
251
- tslib_1.__metadata("design:type", String)
252
- ], Transaction.prototype, "timing", void 0);
253
- tslib_1.__decorate([
254
- (0, typeorm_1.Column)({ nullable: true }),
255
- (0, type_graphql_1.Field)(type => ForecastStatus, {
256
- nullable: true,
257
- description: 'State of a forecast; empty on a confirmed transaction'
258
- }),
259
- tslib_1.__metadata("design:type", String)
260
- ], Transaction.prototype, "status", void 0);
261
- tslib_1.__decorate([
262
- (0, typeorm_1.Column)({ type: 'int', nullable: true }),
263
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The probability of a forecast being realized (0 to 100)' }),
264
- tslib_1.__metadata("design:type", Number)
265
- ], Transaction.prototype, "probability", void 0);
266
236
  tslib_1.__decorate([
267
237
  (0, typeorm_1.Column)({ type: 'text', nullable: true }),
268
238
  (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
269
239
  tslib_1.__metadata("design:type", String)
270
240
  ], Transaction.prototype, "notes", void 0);
271
- tslib_1.__decorate([
272
- (0, typeorm_1.ManyToOne)(type => recurring_cash_item_1.RecurringCashItem, { nullable: true, onDelete: 'SET NULL' }),
273
- (0, type_graphql_1.Field)(type => recurring_cash_item_1.RecurringCashItem, { nullable: true, description: 'The recurring item a forecast was made from' }),
274
- tslib_1.__metadata("design:type", recurring_cash_item_1.RecurringCashItem)
275
- ], Transaction.prototype, "recurringItem", void 0);
276
- tslib_1.__decorate([
277
- (0, typeorm_1.RelationId)((transaction) => transaction.recurringItem),
278
- tslib_1.__metadata("design:type", String)
279
- ], Transaction.prototype, "recurringItemId", void 0);
280
241
  tslib_1.__decorate([
281
242
  (0, typeorm_1.OneToMany)(type => payment_1.Payment, payment => payment.transaction),
282
243
  (0, type_graphql_1.Field)(type => [payment_1.Payment], { nullable: true, description: 'What this transaction paid' }),
@@ -321,7 +282,7 @@ tslib_1.__decorate([
321
282
  tslib_1.__metadata("design:type", String)
322
283
  ], Transaction.prototype, "updaterId", void 0);
323
284
  exports.Transaction = Transaction = tslib_1.__decorate([
324
- (0, type_graphql_1.ObjectType)({ description: 'Money moving in or out - a bank line (confirmed) or a plan (forecast)' }),
285
+ (0, type_graphql_1.ObjectType)({ description: 'Money that moved in or out - a bank line' }),
325
286
  (0, typeorm_1.Entity)(),
326
287
  (0, typeorm_1.Index)('ix_transaction_0', (transaction) => [transaction.domain, transaction.bankFingerprint], {
327
288
  unique: true,
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAkF;AAElF,iDAA2D;AAC3D,yDAAgD;AAChD,uDAAuD;AAEvD,gDAA4C;AAC5C,+DAA0D;AAC1D,qEAAgE;AAChE,sDAAgD;AAChD,gDAA4C;AAC5C,oFAA+E;AAC/E,oFAA8E;AAE9E,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,4CAAqB,CAAA;AACvB,CAAC,EAHW,mBAAmB,mCAAnB,mBAAmB,QAG9B;AAED,IAAA,+BAAgB,EAAC,mBAAmB,EAAE;IACpC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qGAAqG;CACnH,CAAC,CAAA;AAEF,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sDAAiC,CAAA;IACjC,sCAAiB,CAAA;IACjB,sCAAiB,CAAA;AACnB,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AAED,IAAA,+BAAgB,EAAC,iBAAiB,EAAE;IAClC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACT,0GAA0G;CAC7G,CAAC,CAAA;AAEF,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,yCAAuB,CAAA;AACzB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED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C;IACD,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC;QACvD,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,QAAQ;QACpB,WAAW,CAAC,IAAI;QAChB,WAAW,CAAC,KAAK;KAClB,CAAC;IACD,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;GAC9F,WAAW,CAsNvB","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, Float, ID, Int, registerEnumType } from 'type-graphql'\n\nimport { Domain, moneyColumn } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Counterparty } from '@things-factory/biz-base'\n\nimport { Account } from '../account/account'\nimport { BankAccount } from '../bank-account/bank-account'\nimport { BankStatement } from '../bank-statement/bank-statement'\nimport { CashFlowType } from '../cash-flow-type'\nimport { Payment } from '../payment/payment'\nimport { AccountingDocument } from '../accounting-document/accounting-document'\nimport { RecurringCashItem } from '../recurring-cash-item/recurring-cash-item'\n\nexport enum TransactionCategory {\n CONFIRMED = 'CONFIRMED',\n FORECAST = 'FORECAST'\n}\n\nregisterEnumType(TransactionCategory, {\n name: 'TransactionCategory',\n description: 'Whether a transaction happened on the bank account (confirmed) or is a plan someone made (forecast)'\n})\n\nexport enum TransactionSource {\n BANK_STATEMENT = 'BANK_STATEMENT',\n LEGACY = 'LEGACY',\n MANUAL = 'MANUAL'\n}\n\nregisterEnumType(TransactionSource, {\n name: 'TransactionSource',\n description:\n 'Where the facts of a confirmed transaction come from - a bank statement file, an old ledger, or a person'\n})\n\nexport enum ForecastStatus {\n PLANNED = 'PLANNED',\n DONE = 'DONE',\n CANCELLED = 'CANCELLED'\n}\n\nregisterEnumType(ForecastStatus, {\n name: 'ForecastStatus',\n description: 'State of a forecast - still expected, happened, dropped'\n})\n\n/**\n * Money that moves in or out of the business: a line on a bank account (confirmed), or a plan someone made of money\n * still to come or go (forecast).\n *\n * What a transaction paid - a contract round, a tax invoice, a VAT period - is its payments (§`Payment`). The facts\n * of a bank line are kept as the bank gave them, beside what a person wrote about it.\n */\n@ObjectType({ description: 'Money moving in or out - a bank line (confirmed) or a plan (forecast)' })\n@Entity()\n@Index('ix_transaction_0', (transaction: Transaction) => [transaction.domain, transaction.bankFingerprint], {\n unique: true,\n where: '\"deleted_at\" IS NULL AND \"bank_fingerprint\" IS NOT NULL'\n})\n@Index('ix_transaction_1', (transaction: Transaction) => [\n transaction.domain,\n transaction.bankAccount,\n transaction.transactionDate\n])\n@Index('ix_transaction_2', (transaction: Transaction) => [\n transaction.domain,\n transaction.category,\n transaction.year,\n transaction.month\n])\n@Index('ix_transaction_3', (transaction: Transaction) => [transaction.domain, transaction.transactionDate])\nexport class Transaction {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the transaction' })\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number for optimistic locking' })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain in which this transaction belongs' })\n domain?: Domain\n\n @RelationId((transaction: Transaction) => transaction.domain)\n domainId?: string\n\n @Column({ default: TransactionCategory.CONFIRMED })\n @Field(type => TransactionCategory, { description: 'Confirmed (on the bank account) or forecast (a plan)' })\n category: TransactionCategory\n\n @Column({ default: CashFlowType.INCOME })\n @Field(type => CashFlowType, { description: 'Money in or money out' })\n type: CashFlowType\n\n @ManyToOne(type => BankAccount, { nullable: true })\n @Field(type => BankAccount, { nullable: true, description: 'The account the money moved in or out of' })\n bankAccount?: BankAccount\n\n @RelationId((transaction: Transaction) => transaction.bankAccount)\n bankAccountId?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description:\n \"YYYY-MM-DD - the day in the account's time zone; for a forecast, the day its timing names, empty when it names none\"\n })\n transactionDate?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Bank timestamp with UTC offset; empty when only a date is known' })\n transactionAt?: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Year of the transaction date - for a forecast, the year it is planned in' })\n year: number\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Month of the transaction date - for a forecast, the month it is planned in' })\n month: number\n\n @Column(moneyColumn())\n @Field(type => Float, { description: 'Amount, in the currency' })\n amount: number\n\n @Column({ default: 'KRW' })\n @Field({ description: 'ISO 4217 code - the currency of the account' })\n currency: string\n\n @Column(moneyColumn({ nullable: true, default: null }))\n @Field(type => Float, {\n nullable: true,\n description: 'Account balance after this transaction, as the bank statement says'\n })\n balance?: number\n\n @ManyToOne(type => Account, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Account, { nullable: true, description: 'The account subject it is booked to' })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What a person wrote about it - for a forecast, what is planned' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The classifying word of the ledger it was kept in' })\n ledgerCategory?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The counterparty name as a person wrote it' })\n counterpartyName?: string\n\n @ManyToOne(type => Counterparty, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Counterparty, {\n nullable: true,\n description: 'The registered counterparty, when the name is one the domain knows'\n })\n counterparty?: Counterparty\n\n @RelationId((transaction: Transaction) => transaction.counterparty)\n counterpartyId?: string\n\n @Column({ default: TransactionSource.MANUAL })\n @Field(type => TransactionSource, { description: 'Where the facts of the line come from' })\n source: TransactionSource\n\n @ManyToOne(type => BankStatement, { nullable: true, onDelete: 'RESTRICT' })\n @Field(type => BankStatement, { nullable: true, description: 'The bank statement file the line was read from' })\n bankStatement?: BankStatement\n\n @RelationId((transaction: Transaction) => transaction.bankStatement)\n bankStatementId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The file the line was read from, for lines from before statements were kept' })\n sourceFile?: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The row of the source file' })\n sourceRow?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'Chronological order within the source statement' })\n bankSequence?: number\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'What makes the bank line itself unique in the domain - the same line read twice is refused'\n })\n bankFingerprint?: string\n\n @Column({ type: 'simple-json', nullable: true })\n bankReconciliationBefore?: Record<string, any>\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Description as the bank wrote it' })\n bankDescription?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Kind of the line as the bank wrote it' })\n bankKind?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Counterparty name as the bank wrote it' })\n bankCounterpartyName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's account number as the bank wrote it\" })\n bankCounterpartyAccount?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's bank as the bank wrote it\" })\n bankCounterpartyBank?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Memo as the bank wrote it' })\n bankMemo?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'When in the month a forecast falls, as a person wrote it - 15th, end of month'\n })\n timing?: string\n\n @Column({ nullable: true })\n @Field(type => ForecastStatus, {\n nullable: true,\n description: 'State of a forecast; empty on a confirmed transaction'\n })\n status?: ForecastStatus\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The probability of a forecast being realized (0 to 100)' })\n probability?: number\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @ManyToOne(type => RecurringCashItem, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => RecurringCashItem, { nullable: true, description: 'The recurring item a forecast was made from' })\n recurringItem?: RecurringCashItem\n\n @RelationId((transaction: Transaction) => transaction.recurringItem)\n recurringItemId?: string\n\n @OneToMany(type => Payment, payment => payment.transaction)\n @Field(type => [Payment], { nullable: true, description: 'What this transaction paid' })\n payments?: Payment[]\n\n @OneToMany(type => AccountingDocument, document => document.transaction)\n @Field(type => [AccountingDocument], { nullable: true, description: 'Documents linked to this transaction' })\n documents?: AccountingDocument[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was created' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was last updated' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When it was deleted - financial rows are kept, not erased' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created the transaction record' })\n creator?: User\n\n @RelationId((transaction: Transaction) => transaction.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated the transaction record' })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAkF;AAElF,iDAA2D;AAC3D,yDAAgD;AAChD,uDAAuD;AAEvD,gDAA4C;AAC5C,+DAA0D;AAC1D,qEAAgE;AAChE,sDAAgD;AAChD,gDAA4C;AAC5C,oFAA+E;AAE/E;;;GAGG;AACH,IAAY,mBAEX;AAFD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;AACzB,CAAC,EAFW,mBAAmB,mCAAnB,mBAAmB,QAE9B;AAED,IAAA,+BAAgB,EAAC,mBAAmB,EAAE;IACpC,IAAI,EAAE,qBAAqB;IAC3B,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;sBA5LP,WAAW;IAlBvB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;IACvE,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,EAAE;QAC1G,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,yDAAyD;KACjE,CAAC;IACD,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC;QACvD,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,WAAW;QACvB,WAAW,CAAC,eAAe;KAC5B,CAAC;IACD,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC;QACvD,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,QAAQ;QACpB,WAAW,CAAC,IAAI;QAChB,WAAW,CAAC,KAAK;KAClB,CAAC;IACD,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;GAC9F,WAAW,CA6LvB","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, Float, ID, Int, registerEnumType } from 'type-graphql'\n\nimport { Domain, moneyColumn } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Counterparty } from '@things-factory/biz-base'\n\nimport { Account } from '../account/account'\nimport { BankAccount } from '../bank-account/bank-account'\nimport { BankStatement } from '../bank-statement/bank-statement'\nimport { CashFlowType } from '../cash-flow-type'\nimport { Payment } from '../payment/payment'\nimport { AccountingDocument } from '../accounting-document/accounting-document'\n\n/**\n * What a transaction is: a line that happened on the bank account. Money still to come is read from the records that\n * owe it, never written as a transaction (ADR-0157) - the category is the one kind left.\n */\nexport enum TransactionCategory {\n CONFIRMED = 'CONFIRMED'\n}\n\nregisterEnumType(TransactionCategory, {\n name: 'TransactionCategory',\n description: 'That a transaction happened on the bank account (confirmed)'\n})\n\nexport enum TransactionSource {\n BANK_STATEMENT = 'BANK_STATEMENT',\n LEGACY = 'LEGACY',\n MANUAL = 'MANUAL'\n}\n\nregisterEnumType(TransactionSource, {\n name: 'TransactionSource',\n description:\n 'Where the facts of a confirmed transaction come from - a bank statement file, an old ledger, or a person'\n})\n\n/**\n * Money that moved in or out of the business: a line on a bank account.\n *\n * What a transaction paid - a contract round, a tax invoice, a VAT period - is its payments (§`Payment`). The facts\n * of a bank line are kept as the bank gave them, beside what a person wrote about it.\n */\n@ObjectType({ description: 'Money that moved in or out - a bank line' })\n@Entity()\n@Index('ix_transaction_0', (transaction: Transaction) => [transaction.domain, transaction.bankFingerprint], {\n unique: true,\n where: '\"deleted_at\" IS NULL AND \"bank_fingerprint\" IS NOT NULL'\n})\n@Index('ix_transaction_1', (transaction: Transaction) => [\n transaction.domain,\n transaction.bankAccount,\n transaction.transactionDate\n])\n@Index('ix_transaction_2', (transaction: Transaction) => [\n transaction.domain,\n transaction.category,\n transaction.year,\n transaction.month\n])\n@Index('ix_transaction_3', (transaction: Transaction) => [transaction.domain, transaction.transactionDate])\nexport class Transaction {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the transaction' })\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number for optimistic locking' })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain in which this transaction belongs' })\n domain?: Domain\n\n @RelationId((transaction: Transaction) => transaction.domain)\n domainId?: string\n\n @Column({ default: TransactionCategory.CONFIRMED })\n @Field(type => TransactionCategory, { description: 'Confirmed - on the bank account' })\n category: TransactionCategory\n\n @Column({ default: CashFlowType.INCOME })\n @Field(type => CashFlowType, { description: 'Money in or money out' })\n type: CashFlowType\n\n @ManyToOne(type => BankAccount, { nullable: true })\n @Field(type => BankAccount, { nullable: true, description: 'The account the money moved in or out of' })\n bankAccount?: BankAccount\n\n @RelationId((transaction: Transaction) => transaction.bankAccount)\n bankAccountId?: string\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description:\n \"YYYY-MM-DD - the day in the account's time zone\"\n })\n transactionDate?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Bank timestamp with UTC offset; empty when only a date is known' })\n transactionAt?: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Year of the transaction date' })\n year: number\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Month of the transaction date' })\n month: number\n\n @Column(moneyColumn())\n @Field(type => Float, { description: 'Amount, in the currency' })\n amount: number\n\n @Column({ default: 'KRW' })\n @Field({ description: 'ISO 4217 code - the currency of the account' })\n currency: string\n\n @Column(moneyColumn({ nullable: true, default: null }))\n @Field(type => Float, {\n nullable: true,\n description: 'Account balance after this transaction, as the bank statement says'\n })\n balance?: number\n\n @ManyToOne(type => Account, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Account, { nullable: true, description: 'The account subject it is booked to' })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What a person wrote about it' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The classifying word of the ledger it was kept in' })\n ledgerCategory?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The counterparty name as a person wrote it' })\n counterpartyName?: string\n\n @ManyToOne(type => Counterparty, { nullable: true, onDelete: 'SET NULL' })\n @Field(type => Counterparty, {\n nullable: true,\n description: 'The registered counterparty, when the name is one the domain knows'\n })\n counterparty?: Counterparty\n\n @RelationId((transaction: Transaction) => transaction.counterparty)\n counterpartyId?: string\n\n @Column({ default: TransactionSource.MANUAL })\n @Field(type => TransactionSource, { description: 'Where the facts of the line come from' })\n source: TransactionSource\n\n @ManyToOne(type => BankStatement, { nullable: true, onDelete: 'RESTRICT' })\n @Field(type => BankStatement, { nullable: true, description: 'The bank statement file the line was read from' })\n bankStatement?: BankStatement\n\n @RelationId((transaction: Transaction) => transaction.bankStatement)\n bankStatementId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The file the line was read from, for lines from before statements were kept' })\n sourceFile?: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The row of the source file' })\n sourceRow?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'Chronological order within the source statement' })\n bankSequence?: number\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description: 'What makes the bank line itself unique in the domain - the same line read twice is refused'\n })\n bankFingerprint?: string\n\n @Column({ type: 'simple-json', nullable: true })\n bankReconciliationBefore?: Record<string, any>\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Description as the bank wrote it' })\n bankDescription?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Kind of the line as the bank wrote it' })\n bankKind?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Counterparty name as the bank wrote it' })\n bankCounterpartyName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's account number as the bank wrote it\" })\n bankCounterpartyAccount?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: \"Counterparty's bank as the bank wrote it\" })\n bankCounterpartyBank?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Memo as the bank wrote it' })\n bankMemo?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n\n @OneToMany(type => Payment, payment => payment.transaction)\n @Field(type => [Payment], { nullable: true, description: 'What this transaction paid' })\n payments?: Payment[]\n\n @OneToMany(type => AccountingDocument, document => document.transaction)\n @Field(type => [AccountingDocument], { nullable: true, description: 'Documents linked to this transaction' })\n documents?: AccountingDocument[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was created' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when the transaction record was last updated' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When it was deleted - financial rows are kept, not erased' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created the transaction record' })\n creator?: User\n\n @RelationId((transaction: Transaction) => transaction.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated the transaction record' })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.updater)\n updaterId?: string\n}\n"]}