@things-factory/accounting 10.1.134 → 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 +2 -2
- package/dist-server/service/account/account-mutation.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/accounting-category/accounting-category-mutation.js +2 -2
- package/dist-server/service/accounting-category/accounting-category-mutation.js.map +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/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-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-institution/index.d.ts +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 +47 -36
- 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 +10 -135
- 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 +40 -30
- 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 +73 -65
- package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
- package/dist-server/service/financial-statement/index.d.ts +3 -2
- 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/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 +1 -0
- 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 +14 -79
- 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 +30 -1
- 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 +66 -94
- 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/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 +13 -78
- 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 +84 -2
- 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 +216 -102
- package/dist-server/service/transaction/transaction.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- 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 -95
- 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 -97
- 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
|
@@ -3,95 +3,55 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BankAccountMutation = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const typeorm_1 = require("typeorm");
|
|
7
6
|
const shell_1 = require("@things-factory/shell");
|
|
8
7
|
const bank_account_1 = require("./bank-account");
|
|
8
|
+
const bank_account_service_1 = require("./bank-account-service");
|
|
9
9
|
const bank_account_type_1 = require("./bank-account-type");
|
|
10
10
|
let BankAccountMutation = class BankAccountMutation {
|
|
11
11
|
async createBankAccount(bankAccount, context) {
|
|
12
12
|
const { domain, user, tx } = context.state;
|
|
13
|
-
|
|
14
|
-
...bankAccount,
|
|
15
|
-
domain,
|
|
16
|
-
creator: user,
|
|
17
|
-
updater: user
|
|
18
|
-
});
|
|
19
|
-
return result;
|
|
13
|
+
return await (0, shell_1.getRepository)(bank_account_1.BankAccount, tx).save({ ...bankAccount, domain, creator: user, updater: user });
|
|
20
14
|
}
|
|
21
15
|
async updateBankAccount(id, patch, context) {
|
|
22
16
|
const { domain, user, tx } = context.state;
|
|
23
17
|
const repository = (0, shell_1.getRepository)(bank_account_1.BankAccount, tx);
|
|
24
|
-
const bankAccount = await repository.findOne({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
...bankAccount,
|
|
29
|
-
...patch,
|
|
30
|
-
updater: user
|
|
31
|
-
});
|
|
32
|
-
return result;
|
|
18
|
+
const bankAccount = await repository.findOne({ where: { domain: { id: domain.id }, id } });
|
|
19
|
+
if (!bankAccount)
|
|
20
|
+
throw new shell_1.Refusal('bank-account-not-found', {}, 'a bank account was not found - reload and try again');
|
|
21
|
+
return await repository.save({ ...bankAccount, ...patch, updater: user });
|
|
33
22
|
}
|
|
34
23
|
async updateMultipleBankAccount(patches, context) {
|
|
35
24
|
const { domain, user, tx } = context.state;
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
for (let i = 0; i < _createRecords.length; i++) {
|
|
42
|
-
const newRecord = _createRecords[i];
|
|
43
|
-
const result = await bankAccountRepo.save({
|
|
44
|
-
...newRecord,
|
|
45
|
-
domain,
|
|
46
|
-
creator: user,
|
|
47
|
-
updater: user
|
|
48
|
-
});
|
|
49
|
-
results.push({ ...result, cuFlag: '+' });
|
|
25
|
+
const repository = (0, shell_1.getRepository)(bank_account_1.BankAccount, tx);
|
|
26
|
+
const results = [];
|
|
27
|
+
for (const { cuFlag, ...patch } of patches) {
|
|
28
|
+
if (cuFlag?.toUpperCase() === '+') {
|
|
29
|
+
results.push({ ...(await repository.save({ ...patch, domain, creator: user, updater: user })), cuFlag: '+' });
|
|
50
30
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
where: { domain: { id: domain.id }, id: updateRecord.id }
|
|
57
|
-
});
|
|
58
|
-
if (!bankAccount) {
|
|
59
|
-
throw new Error(`failed to find bankAccount to update: ${updateRecord.id}`);
|
|
60
|
-
}
|
|
61
|
-
const result = await bankAccountRepo.save({
|
|
62
|
-
...bankAccount,
|
|
63
|
-
...updateRecord,
|
|
64
|
-
updater: user
|
|
65
|
-
});
|
|
66
|
-
results.push({ ...result, cuFlag: 'M' });
|
|
31
|
+
else if (cuFlag?.toUpperCase() === 'M') {
|
|
32
|
+
const bankAccount = await repository.findOne({ where: { domain: { id: domain.id }, id: patch.id } });
|
|
33
|
+
if (!bankAccount)
|
|
34
|
+
throw new shell_1.Refusal('bank-account-not-found', {}, 'a bank account was not found - reload and try again');
|
|
35
|
+
results.push({ ...(await repository.save({ ...bankAccount, ...patch, updater: user })), cuFlag: 'M' });
|
|
67
36
|
}
|
|
68
37
|
}
|
|
69
38
|
return results;
|
|
70
39
|
}
|
|
71
40
|
async deleteBankAccount(id, context) {
|
|
72
41
|
const { domain, tx } = context.state;
|
|
73
|
-
await (0,
|
|
42
|
+
await (0, bank_account_service_1.deleteBankAccounts)(tx, domain, [id]);
|
|
74
43
|
return true;
|
|
75
44
|
}
|
|
76
45
|
async deleteBankAccounts(ids, context) {
|
|
77
46
|
const { domain, tx } = context.state;
|
|
78
|
-
await (0,
|
|
79
|
-
domain: { id: domain.id },
|
|
80
|
-
id: (0, typeorm_1.In)(ids)
|
|
81
|
-
});
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
async importBankAccounts(bankAccounts, context) {
|
|
85
|
-
const { domain, tx } = context.state;
|
|
86
|
-
await Promise.all(bankAccounts.map(async (bankAccount) => {
|
|
87
|
-
const createdBankAccount = await (0, shell_1.getRepository)(bank_account_1.BankAccount, tx).save({ domain, ...bankAccount });
|
|
88
|
-
}));
|
|
47
|
+
await (0, bank_account_service_1.deleteBankAccounts)(tx, domain, ids);
|
|
89
48
|
return true;
|
|
90
49
|
}
|
|
91
50
|
};
|
|
92
51
|
exports.BankAccountMutation = BankAccountMutation;
|
|
93
52
|
tslib_1.__decorate([
|
|
94
53
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
54
|
+
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
95
55
|
(0, type_graphql_1.Mutation)(returns => bank_account_1.BankAccount, { description: 'To create new BankAccount' }),
|
|
96
56
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('bankAccount')),
|
|
97
57
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
@@ -101,6 +61,7 @@ tslib_1.__decorate([
|
|
|
101
61
|
], BankAccountMutation.prototype, "createBankAccount", null);
|
|
102
62
|
tslib_1.__decorate([
|
|
103
63
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
64
|
+
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
104
65
|
(0, type_graphql_1.Mutation)(returns => bank_account_1.BankAccount, { description: 'To modify BankAccount information' }),
|
|
105
66
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
106
67
|
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
@@ -111,6 +72,7 @@ tslib_1.__decorate([
|
|
|
111
72
|
], BankAccountMutation.prototype, "updateBankAccount", null);
|
|
112
73
|
tslib_1.__decorate([
|
|
113
74
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
75
|
+
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
114
76
|
(0, type_graphql_1.Mutation)(returns => [bank_account_1.BankAccount], { description: "To modify multiple BankAccounts' information" }),
|
|
115
77
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [bank_account_type_1.BankAccountPatch])),
|
|
116
78
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
@@ -120,6 +82,7 @@ tslib_1.__decorate([
|
|
|
120
82
|
], BankAccountMutation.prototype, "updateMultipleBankAccount", null);
|
|
121
83
|
tslib_1.__decorate([
|
|
122
84
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
85
|
+
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
123
86
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete BankAccount' }),
|
|
124
87
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
125
88
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
@@ -129,6 +92,7 @@ tslib_1.__decorate([
|
|
|
129
92
|
], BankAccountMutation.prototype, "deleteBankAccount", null);
|
|
130
93
|
tslib_1.__decorate([
|
|
131
94
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
95
|
+
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
132
96
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple BankAccounts' }),
|
|
133
97
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
134
98
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
@@ -136,16 +100,8 @@ tslib_1.__decorate([
|
|
|
136
100
|
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
137
101
|
tslib_1.__metadata("design:returntype", Promise)
|
|
138
102
|
], BankAccountMutation.prototype, "deleteBankAccounts", null);
|
|
139
|
-
tslib_1.__decorate([
|
|
140
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
141
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple BankAccounts' }),
|
|
142
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('bankAccounts', type => [bank_account_type_1.BankAccountPatch])),
|
|
143
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
144
|
-
tslib_1.__metadata("design:type", Function),
|
|
145
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
146
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
147
|
-
], BankAccountMutation.prototype, "importBankAccounts", null);
|
|
148
103
|
exports.BankAccountMutation = BankAccountMutation = tslib_1.__decorate([
|
|
149
|
-
(0, type_graphql_1.Resolver)(bank_account_1.BankAccount)
|
|
104
|
+
(0, type_graphql_1.Resolver)(bank_account_1.BankAccount),
|
|
105
|
+
(0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals)
|
|
150
106
|
], BankAccountMutation);
|
|
151
107
|
//# sourceMappingURL=bank-account-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank-account-mutation.js","sourceRoot":"","sources":["../../../server/service/bank-account/bank-account-mutation.ts"],"names":[],"mappings":";;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"bank-account-mutation.js","sourceRoot":"","sources":["../../../server/service/bank-account/bank-account-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAqF;AAErF,iDAA6E;AAE7E,iDAA4C;AAC5C,iEAA2D;AAC3D,2DAAsE;AAI/D,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAIxB,AAAN,KAAK,CAAC,iBAAiB,CACD,WAA2B,EACxC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA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,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4DAKpD;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,qFAAqF,CAAC;IAChG,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;IAE9E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;6DAMP;8BA5EU,mBAAmB;IAF/B,IAAA,uBAAQ,EAAC,0BAAW,CAAC;IACrB,IAAA,4BAAa,EAAC,qBAAa,CAAC;GAChB,mBAAmB,CA6E/B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive, UseMiddleware } from 'type-graphql'\n\nimport { getRepository, Refusal, SpeakRefusals } from '@things-factory/shell'\n\nimport { BankAccount } from './bank-account'\nimport { deleteBankAccounts } from './bank-account-service'\nimport { BankAccountPatch, NewBankAccount } from './bank-account-type'\n\n@Resolver(BankAccount)\n@UseMiddleware(SpeakRefusals)\nexport class BankAccountMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => BankAccount, { description: 'To create new BankAccount' })\n async createBankAccount(\n @Arg('bankAccount') bankAccount: NewBankAccount,\n @Ctx() context: ResolverContext\n ): Promise<BankAccount> {\n const { domain, user, tx } = context.state\n\n return await getRepository(BankAccount, tx).save({ ...bankAccount, domain, creator: user, updater: user })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => BankAccount, { description: 'To modify BankAccount information' })\n async updateBankAccount(\n @Arg('id') id: string,\n @Arg('patch') patch: BankAccountPatch,\n @Ctx() context: ResolverContext\n ): Promise<BankAccount> {\n const { domain, user, tx } = context.state\n const repository = getRepository(BankAccount, tx)\n const bankAccount = await repository.findOne({ where: { domain: { id: domain.id }, id } })\n if (!bankAccount)\n throw new Refusal('bank-account-not-found', {}, 'a bank account was not found - reload and try again')\n\n return await repository.save({ ...bankAccount, ...patch, updater: user })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => [BankAccount], { description: \"To modify multiple BankAccounts' information\" })\n async updateMultipleBankAccount(\n @Arg('patches', type => [BankAccountPatch]) patches: BankAccountPatch[],\n @Ctx() context: ResolverContext\n ): Promise<BankAccount[]> {\n const { domain, user, tx } = context.state\n const repository = getRepository(BankAccount, tx)\n const results = []\n\n for (const { cuFlag, ...patch } of patches) {\n if (cuFlag?.toUpperCase() === '+') {\n results.push({ ...(await repository.save({ ...patch, domain, creator: user, updater: user })), cuFlag: '+' })\n } else if (cuFlag?.toUpperCase() === 'M') {\n const bankAccount = await repository.findOne({ where: { domain: { id: domain.id }, id: patch.id } })\n if (!bankAccount)\n throw new Refusal('bank-account-not-found', {}, 'a bank account was not found - reload and try again')\n results.push({ ...(await repository.save({ ...bankAccount, ...patch, updater: user })), cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete BankAccount' })\n async deleteBankAccount(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n await deleteBankAccounts(tx, domain, [id])\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete multiple BankAccounts' })\n async deleteBankAccounts(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n await deleteBankAccounts(tx, domain, ids)\n\n return true\n }\n}\n"]}
|
|
@@ -37,6 +37,7 @@ let BankAccountQuery = class BankAccountQuery {
|
|
|
37
37
|
};
|
|
38
38
|
exports.BankAccountQuery = BankAccountQuery;
|
|
39
39
|
tslib_1.__decorate([
|
|
40
|
+
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query", domainOwnerGranted: true)'),
|
|
40
41
|
(0, type_graphql_1.Query)(returns => bank_account_1.BankAccount, { nullable: true, description: 'To fetch a BankAccount' }),
|
|
41
42
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
42
43
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
@@ -45,6 +46,7 @@ tslib_1.__decorate([
|
|
|
45
46
|
tslib_1.__metadata("design:returntype", Promise)
|
|
46
47
|
], BankAccountQuery.prototype, "bankAccount", null);
|
|
47
48
|
tslib_1.__decorate([
|
|
49
|
+
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query", domainOwnerGranted: true)'),
|
|
48
50
|
(0, type_graphql_1.Query)(returns => bank_account_type_1.BankAccountList, { description: 'To fetch multiple BankAccounts' }),
|
|
49
51
|
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
50
52
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank-account-query.js","sourceRoot":"","sources":["../../../server/service/bank-account/bank-account-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,iDAA4C;AAC5C,2DAAqD;AAG9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;
|
|
1
|
+
{"version":3,"file":"bank-account-query.js","sourceRoot":"","sources":["../../../server/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EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAc,0BAAW;;+CAE7C;2BA5CU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,0BAAW,CAAC;GACT,gBAAgB,CA6C5B","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { BankAccount } from './bank-account'\nimport { BankAccountList } from './bank-account-type'\n\n@Resolver(BankAccount)\nexport class BankAccountQuery {\n @Directive('@privilege(category: \"accounting\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => BankAccount!, { nullable: true, description: 'To fetch a BankAccount' })\n async bankAccount(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<BankAccount> {\n const { domain } = context.state\n\n return await getRepository(BankAccount).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"accounting\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => BankAccountList, { description: 'To fetch multiple BankAccounts' })\n async bankAccounts(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<BankAccountList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(BankAccount),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() bankAccount: BankAccount): Promise<Domain> {\n return bankAccount.domainId && (await getRepository(Domain).findOneBy({ id: bankAccount.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() bankAccount: BankAccount): Promise<User> {\n return bankAccount.updaterId && (await getRepository(User).findOneBy({ id: bankAccount.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() bankAccount: BankAccount): Promise<User> {\n return bankAccount.creatorId && (await getRepository(User).findOneBy({ id: bankAccount.creatorId }))\n }\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
|
+
/** An account that lines were written on is made inactive, not deleted - the lines keep pointing at it. */
|
|
3
|
+
export declare function deleteBankAccounts(tx: EntityManager, domain: {
|
|
4
|
+
id: string;
|
|
5
|
+
}, ids: string[]): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteBankAccounts = deleteBankAccounts;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
5
|
+
const shell_1 = require("@things-factory/shell");
|
|
6
|
+
const transaction_1 = require("../transaction/transaction");
|
|
7
|
+
const bank_account_1 = require("./bank-account");
|
|
8
|
+
/** An account that lines were written on is made inactive, not deleted - the lines keep pointing at it. */
|
|
9
|
+
async function deleteBankAccounts(tx, domain, ids) {
|
|
10
|
+
const repo = tx.getRepository(bank_account_1.BankAccount);
|
|
11
|
+
const found = await repo.find({ where: { domain: { id: domain.id }, id: (0, typeorm_1.In)(ids) } });
|
|
12
|
+
if (found.length !== new Set(ids).size)
|
|
13
|
+
throw new shell_1.Refusal('bank-account-not-found', {}, 'a bank account was not found - reload and try again');
|
|
14
|
+
const used = await tx
|
|
15
|
+
.getRepository(transaction_1.Transaction)
|
|
16
|
+
.count({ where: { domain: { id: domain.id }, bankAccount: { id: (0, typeorm_1.In)(ids) } }, withDeleted: true });
|
|
17
|
+
if (used)
|
|
18
|
+
throw new shell_1.Refusal('bank-account-has-transactions', {}, 'transactions were written on the account - make it inactive instead');
|
|
19
|
+
await repo.softRemove(found);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=bank-account-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bank-account-service.js","sourceRoot":"","sources":["../../../server/service/bank-account/bank-account-service.ts"],"names":[],"mappings":";;AAQA,gDAeC;AAvBD,qCAA2C;AAE3C,iDAA+C;AAE/C,4DAAwD;AACxD,iDAA4C;AAE5C,2GAA2G;AACpG,KAAK,UAAU,kBAAkB,CAAC,EAAiB,EAAE,MAAsB,EAAE,GAAa;IAC/F,MAAM,IAAI,GAAG,EAAE,CAAC,aAAa,CAAC,0BAAW,CAAC,CAAA;IAC1C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAA;IACpF,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI;QACpC,MAAM,IAAI,eAAO,CAAC,wBAAwB,EAAE,EAAE,EAAE,qDAAqD,CAAC,CAAA;IACxG,MAAM,IAAI,GAAG,MAAM,EAAE;SAClB,aAAa,CAAC,yBAAW,CAAC;SAC1B,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,GAAG,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;IACnG,IAAI,IAAI;QACN,MAAM,IAAI,eAAO,CACf,+BAA+B,EAC/B,EAAE,EACF,qEAAqE,CACtE,CAAA;IACH,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC","sourcesContent":["import { EntityManager, In } from 'typeorm'\n\nimport { Refusal } from '@things-factory/shell'\n\nimport { Transaction } from '../transaction/transaction'\nimport { BankAccount } from './bank-account'\n\n/** An account that lines were written on is made inactive, not deleted - the lines keep pointing at it. */\nexport async function deleteBankAccounts(tx: EntityManager, domain: { id: string }, ids: string[]): Promise<void> {\n const repo = tx.getRepository(BankAccount)\n const found = await repo.find({ where: { domain: { id: domain.id }, id: In(ids) } })\n if (found.length !== new Set(ids).size)\n throw new Refusal('bank-account-not-found', {}, 'a bank account was not found - reload and try again')\n const used = await tx\n .getRepository(Transaction)\n .count({ where: { domain: { id: domain.id }, bankAccount: { id: In(ids) } }, withDeleted: true })\n if (used)\n throw new Refusal(\n 'bank-account-has-transactions',\n {},\n 'transactions were written on the account - make it inactive instead'\n )\n await repo.softRemove(found)\n}\n"]}
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
import { AccountType, BankAccount,
|
|
1
|
+
import { AccountType, BankAccount, BankAccountPurpose } from './bank-account';
|
|
2
2
|
export declare class NewBankAccount {
|
|
3
3
|
name: string;
|
|
4
4
|
description?: string;
|
|
5
|
-
accountHolderName?: string;
|
|
6
|
-
accountNumber?: string;
|
|
7
5
|
bankName?: string;
|
|
8
|
-
|
|
6
|
+
accountNumber?: string;
|
|
7
|
+
accountType?: AccountType;
|
|
9
8
|
currency?: string;
|
|
9
|
+
timezone?: string;
|
|
10
|
+
purpose?: BankAccountPurpose;
|
|
11
|
+
statedBalance?: number;
|
|
12
|
+
statedBalanceDate?: string;
|
|
10
13
|
active?: boolean;
|
|
11
|
-
ownerType: OwnerType;
|
|
12
|
-
ownerId: string;
|
|
13
|
-
iban?: string;
|
|
14
|
-
bic?: string;
|
|
15
|
-
country?: string;
|
|
16
|
-
image?: string;
|
|
17
14
|
}
|
|
18
15
|
export declare class BankAccountPatch {
|
|
19
16
|
id?: string;
|
|
20
17
|
name?: string;
|
|
21
18
|
description?: string;
|
|
22
|
-
accountHolderName?: string;
|
|
23
|
-
accountNumber?: string;
|
|
24
19
|
bankName?: string;
|
|
25
|
-
|
|
20
|
+
accountNumber?: string;
|
|
21
|
+
accountType?: AccountType;
|
|
26
22
|
currency?: string;
|
|
23
|
+
timezone?: string;
|
|
24
|
+
purpose?: BankAccountPurpose;
|
|
25
|
+
statedBalance?: number;
|
|
26
|
+
statedBalanceDate?: string;
|
|
27
27
|
active?: boolean;
|
|
28
|
-
ownerType: OwnerType;
|
|
29
|
-
ownerId: string;
|
|
30
|
-
iban?: string;
|
|
31
|
-
bic?: string;
|
|
32
|
-
country?: string;
|
|
33
|
-
image?: string;
|
|
34
28
|
cuFlag?: string;
|
|
35
29
|
}
|
|
36
30
|
export declare class BankAccountList {
|
|
@@ -8,146 +8,122 @@ let NewBankAccount = class NewBankAccount {
|
|
|
8
8
|
};
|
|
9
9
|
exports.NewBankAccount = NewBankAccount;
|
|
10
10
|
tslib_1.__decorate([
|
|
11
|
-
(0, type_graphql_1.Field)(),
|
|
11
|
+
(0, type_graphql_1.Field)({ description: 'Name of the account, unique in the domain' }),
|
|
12
12
|
tslib_1.__metadata("design:type", String)
|
|
13
13
|
], NewBankAccount.prototype, "name", void 0);
|
|
14
14
|
tslib_1.__decorate([
|
|
15
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
15
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Description' }),
|
|
16
16
|
tslib_1.__metadata("design:type", String)
|
|
17
17
|
], NewBankAccount.prototype, "description", void 0);
|
|
18
18
|
tslib_1.__decorate([
|
|
19
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
19
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Bank name' }),
|
|
20
20
|
tslib_1.__metadata("design:type", String)
|
|
21
|
-
], NewBankAccount.prototype, "
|
|
21
|
+
], NewBankAccount.prototype, "bankName", void 0);
|
|
22
22
|
tslib_1.__decorate([
|
|
23
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
23
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Account number' }),
|
|
24
24
|
tslib_1.__metadata("design:type", String)
|
|
25
25
|
], NewBankAccount.prototype, "accountNumber", void 0);
|
|
26
26
|
tslib_1.__decorate([
|
|
27
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
28
|
-
tslib_1.__metadata("design:type", String)
|
|
29
|
-
], NewBankAccount.prototype, "bankName", void 0);
|
|
30
|
-
tslib_1.__decorate([
|
|
31
|
-
(0, type_graphql_1.Field)(type => bank_account_1.AccountType, { description: 'Type of the account (Bank or Card)' }),
|
|
27
|
+
(0, type_graphql_1.Field)(type => bank_account_1.AccountType, { nullable: true, description: 'Type of the account (bank or card)' }),
|
|
32
28
|
tslib_1.__metadata("design:type", String)
|
|
33
29
|
], NewBankAccount.prototype, "accountType", void 0);
|
|
34
30
|
tslib_1.__decorate([
|
|
35
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
31
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'ISO 4217 code - the currency of the account' }),
|
|
36
32
|
tslib_1.__metadata("design:type", String)
|
|
37
33
|
], NewBankAccount.prototype, "currency", void 0);
|
|
38
34
|
tslib_1.__decorate([
|
|
39
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
40
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
41
|
-
], NewBankAccount.prototype, "active", void 0);
|
|
42
|
-
tslib_1.__decorate([
|
|
43
|
-
(0, type_graphql_1.Field)(type => bank_account_1.OwnerType, { description: 'Type of the owner of the bank account' }),
|
|
44
|
-
tslib_1.__metadata("design:type", String)
|
|
45
|
-
], NewBankAccount.prototype, "ownerType", void 0);
|
|
46
|
-
tslib_1.__decorate([
|
|
47
|
-
(0, type_graphql_1.Field)({ description: 'ID of the owner of the bank account' }),
|
|
35
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'IANA time zone the bank keeps the account in' }),
|
|
48
36
|
tslib_1.__metadata("design:type", String)
|
|
49
|
-
], NewBankAccount.prototype, "
|
|
37
|
+
], NewBankAccount.prototype, "timezone", void 0);
|
|
50
38
|
tslib_1.__decorate([
|
|
51
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
39
|
+
(0, type_graphql_1.Field)(type => bank_account_1.BankAccountPurpose, { nullable: true, description: 'What the money in the account may be used for' }),
|
|
52
40
|
tslib_1.__metadata("design:type", String)
|
|
53
|
-
], NewBankAccount.prototype, "
|
|
41
|
+
], NewBankAccount.prototype, "purpose", void 0);
|
|
54
42
|
tslib_1.__decorate([
|
|
55
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
56
|
-
tslib_1.__metadata("design:type",
|
|
57
|
-
], NewBankAccount.prototype, "
|
|
43
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'A balance someone read off the account' }),
|
|
44
|
+
tslib_1.__metadata("design:type", Number)
|
|
45
|
+
], NewBankAccount.prototype, "statedBalance", void 0);
|
|
58
46
|
tslib_1.__decorate([
|
|
59
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
47
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD - the day the stated balance was read' }),
|
|
60
48
|
tslib_1.__metadata("design:type", String)
|
|
61
|
-
], NewBankAccount.prototype, "
|
|
49
|
+
], NewBankAccount.prototype, "statedBalanceDate", void 0);
|
|
62
50
|
tslib_1.__decorate([
|
|
63
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
64
|
-
tslib_1.__metadata("design:type",
|
|
65
|
-
], NewBankAccount.prototype, "
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'An inactive account is not offered for new lines' }),
|
|
52
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
53
|
+
], NewBankAccount.prototype, "active", void 0);
|
|
66
54
|
exports.NewBankAccount = NewBankAccount = tslib_1.__decorate([
|
|
67
|
-
(0, type_graphql_1.InputType)()
|
|
55
|
+
(0, type_graphql_1.InputType)({ description: 'A new bank account' })
|
|
68
56
|
], NewBankAccount);
|
|
69
57
|
let BankAccountPatch = class BankAccountPatch {
|
|
70
58
|
};
|
|
71
59
|
exports.BankAccountPatch = BankAccountPatch;
|
|
72
60
|
tslib_1.__decorate([
|
|
73
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
61
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'The account to change' }),
|
|
74
62
|
tslib_1.__metadata("design:type", String)
|
|
75
63
|
], BankAccountPatch.prototype, "id", void 0);
|
|
76
64
|
tslib_1.__decorate([
|
|
77
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Name of the account, unique in the domain' }),
|
|
78
66
|
tslib_1.__metadata("design:type", String)
|
|
79
67
|
], BankAccountPatch.prototype, "name", void 0);
|
|
80
68
|
tslib_1.__decorate([
|
|
81
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Description' }),
|
|
82
70
|
tslib_1.__metadata("design:type", String)
|
|
83
71
|
], BankAccountPatch.prototype, "description", void 0);
|
|
84
72
|
tslib_1.__decorate([
|
|
85
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
73
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Bank name' }),
|
|
86
74
|
tslib_1.__metadata("design:type", String)
|
|
87
|
-
], BankAccountPatch.prototype, "
|
|
75
|
+
], BankAccountPatch.prototype, "bankName", void 0);
|
|
88
76
|
tslib_1.__decorate([
|
|
89
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
77
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Account number' }),
|
|
90
78
|
tslib_1.__metadata("design:type", String)
|
|
91
79
|
], BankAccountPatch.prototype, "accountNumber", void 0);
|
|
92
80
|
tslib_1.__decorate([
|
|
93
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
94
|
-
tslib_1.__metadata("design:type", String)
|
|
95
|
-
], BankAccountPatch.prototype, "bankName", void 0);
|
|
96
|
-
tslib_1.__decorate([
|
|
97
|
-
(0, type_graphql_1.Field)(type => bank_account_1.AccountType, { description: 'Type of the account (Bank or Card)' }),
|
|
81
|
+
(0, type_graphql_1.Field)(type => bank_account_1.AccountType, { nullable: true, description: 'Type of the account (bank or card)' }),
|
|
98
82
|
tslib_1.__metadata("design:type", String)
|
|
99
83
|
], BankAccountPatch.prototype, "accountType", void 0);
|
|
100
84
|
tslib_1.__decorate([
|
|
101
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
85
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'ISO 4217 code - the currency of the account' }),
|
|
102
86
|
tslib_1.__metadata("design:type", String)
|
|
103
87
|
], BankAccountPatch.prototype, "currency", void 0);
|
|
104
88
|
tslib_1.__decorate([
|
|
105
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
106
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
107
|
-
], BankAccountPatch.prototype, "active", void 0);
|
|
108
|
-
tslib_1.__decorate([
|
|
109
|
-
(0, type_graphql_1.Field)(type => bank_account_1.OwnerType, { description: 'Type of the owner of the bank account' }),
|
|
110
|
-
tslib_1.__metadata("design:type", String)
|
|
111
|
-
], BankAccountPatch.prototype, "ownerType", void 0);
|
|
112
|
-
tslib_1.__decorate([
|
|
113
|
-
(0, type_graphql_1.Field)({ description: 'ID of the owner of the bank account' }),
|
|
89
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'IANA time zone the bank keeps the account in' }),
|
|
114
90
|
tslib_1.__metadata("design:type", String)
|
|
115
|
-
], BankAccountPatch.prototype, "
|
|
91
|
+
], BankAccountPatch.prototype, "timezone", void 0);
|
|
116
92
|
tslib_1.__decorate([
|
|
117
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
93
|
+
(0, type_graphql_1.Field)(type => bank_account_1.BankAccountPurpose, { nullable: true, description: 'What the money in the account may be used for' }),
|
|
118
94
|
tslib_1.__metadata("design:type", String)
|
|
119
|
-
], BankAccountPatch.prototype, "
|
|
95
|
+
], BankAccountPatch.prototype, "purpose", void 0);
|
|
120
96
|
tslib_1.__decorate([
|
|
121
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
122
|
-
tslib_1.__metadata("design:type",
|
|
123
|
-
], BankAccountPatch.prototype, "
|
|
97
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'A balance someone read off the account' }),
|
|
98
|
+
tslib_1.__metadata("design:type", Number)
|
|
99
|
+
], BankAccountPatch.prototype, "statedBalance", void 0);
|
|
124
100
|
tslib_1.__decorate([
|
|
125
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
101
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD - the day the stated balance was read' }),
|
|
126
102
|
tslib_1.__metadata("design:type", String)
|
|
127
|
-
], BankAccountPatch.prototype, "
|
|
103
|
+
], BankAccountPatch.prototype, "statedBalanceDate", void 0);
|
|
128
104
|
tslib_1.__decorate([
|
|
129
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
|
130
|
-
tslib_1.__metadata("design:type",
|
|
131
|
-
], BankAccountPatch.prototype, "
|
|
105
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'An inactive account is not offered for new lines' }),
|
|
106
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
107
|
+
], BankAccountPatch.prototype, "active", void 0);
|
|
132
108
|
tslib_1.__decorate([
|
|
133
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
109
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '+ adds, M changes' }),
|
|
134
110
|
tslib_1.__metadata("design:type", String)
|
|
135
111
|
], BankAccountPatch.prototype, "cuFlag", void 0);
|
|
136
112
|
exports.BankAccountPatch = BankAccountPatch = tslib_1.__decorate([
|
|
137
|
-
(0, type_graphql_1.InputType)()
|
|
113
|
+
(0, type_graphql_1.InputType)({ description: 'A change to a bank account, or a grid row: cuFlag + adds, M changes' })
|
|
138
114
|
], BankAccountPatch);
|
|
139
115
|
let BankAccountList = class BankAccountList {
|
|
140
116
|
};
|
|
141
117
|
exports.BankAccountList = BankAccountList;
|
|
142
118
|
tslib_1.__decorate([
|
|
143
|
-
(0, type_graphql_1.Field)(type => [bank_account_1.BankAccount]),
|
|
119
|
+
(0, type_graphql_1.Field)(type => [bank_account_1.BankAccount], { description: 'The accounts on this page' }),
|
|
144
120
|
tslib_1.__metadata("design:type", Array)
|
|
145
121
|
], BankAccountList.prototype, "items", void 0);
|
|
146
122
|
tslib_1.__decorate([
|
|
147
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
123
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many there are in all' }),
|
|
148
124
|
tslib_1.__metadata("design:type", Number)
|
|
149
125
|
], BankAccountList.prototype, "total", void 0);
|
|
150
126
|
exports.BankAccountList = BankAccountList = tslib_1.__decorate([
|
|
151
|
-
(0, type_graphql_1.ObjectType)()
|
|
127
|
+
(0, type_graphql_1.ObjectType)({ description: 'A page of bank accounts' })
|
|
152
128
|
], BankAccountList);
|
|
153
129
|
//# sourceMappingURL=bank-account-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank-account-type.js","sourceRoot":"","sources":["../../../server/service/bank-account/bank-account-type.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"bank-account-type.js","sourceRoot":"","sources":["../../../server/service/bank-account/bank-account-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAE3E,iDAA6E;AAGtE,IAAM,cAAc,GAApB,MAAM,cAAc;CAiC1B,CAAA;AAjCY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;4CACxD;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;;mDAClC;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;;gDACnC;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IA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AA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;gDAC7C;2BAtCJ,gBAAgB;IAD5B,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,qEAAqE,EAAE,CAAC;GACrF,gBAAgB,CAuC5B;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AANY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAW,CAAC,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;8CACvD;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,yBAAyB,EAAE,CAAC;GAC1C,eAAe,CAM3B","sourcesContent":["import { ObjectType, Field, Float, InputType, Int, ID } from 'type-graphql'\n\nimport { AccountType, BankAccount, BankAccountPurpose } from './bank-account'\n\n@InputType({ description: 'A new bank account' })\nexport class NewBankAccount {\n @Field({ description: 'Name of the account, unique in the domain' })\n name: string\n\n @Field({ nullable: true, description: 'Description' })\n description?: string\n\n @Field({ nullable: true, description: 'Bank name' })\n bankName?: string\n\n @Field({ nullable: true, description: 'Account number' })\n accountNumber?: string\n\n @Field(type => AccountType, { nullable: true, description: 'Type of the account (bank or card)' })\n accountType?: AccountType\n\n @Field({ nullable: true, description: 'ISO 4217 code - the currency of the account' })\n currency?: string\n\n @Field({ nullable: true, description: 'IANA time zone the bank keeps the account in' })\n timezone?: string\n\n @Field(type => BankAccountPurpose, { nullable: true, description: 'What the money in the account may be used for' })\n purpose?: BankAccountPurpose\n\n @Field(type => Float, { nullable: true, description: 'A balance someone read off the account' })\n statedBalance?: number\n\n @Field({ nullable: true, description: 'YYYY-MM-DD - the day the stated balance was read' })\n statedBalanceDate?: string\n\n @Field({ nullable: true, description: 'An inactive account is not offered for new lines' })\n active?: boolean\n}\n\n@InputType({ description: 'A change to a bank account, or a grid row: cuFlag + adds, M changes' })\nexport class BankAccountPatch {\n @Field(type => ID, { nullable: true, description: 'The account to change' })\n id?: string\n\n @Field({ nullable: true, description: 'Name of the account, unique in the domain' })\n name?: string\n\n @Field({ nullable: true, description: 'Description' })\n description?: string\n\n @Field({ nullable: true, description: 'Bank name' })\n bankName?: string\n\n @Field({ nullable: true, description: 'Account number' })\n accountNumber?: string\n\n @Field(type => AccountType, { nullable: true, description: 'Type of the account (bank or card)' })\n accountType?: AccountType\n\n @Field({ nullable: true, description: 'ISO 4217 code - the currency of the account' })\n currency?: string\n\n @Field({ nullable: true, description: 'IANA time zone the bank keeps the account in' })\n timezone?: string\n\n @Field(type => BankAccountPurpose, { nullable: true, description: 'What the money in the account may be used for' })\n purpose?: BankAccountPurpose\n\n @Field(type => Float, { nullable: true, description: 'A balance someone read off the account' })\n statedBalance?: number\n\n @Field({ nullable: true, description: 'YYYY-MM-DD - the day the stated balance was read' })\n statedBalanceDate?: string\n\n @Field({ nullable: true, description: 'An inactive account is not offered for new lines' })\n active?: boolean\n\n @Field({ nullable: true, description: '+ adds, M changes' })\n cuFlag?: string\n}\n\n@ObjectType({ description: 'A page of bank accounts' })\nexport class BankAccountList {\n @Field(type => [BankAccount], { description: 'The accounts on this page' })\n items: BankAccount[]\n\n @Field(type => Int, { description: 'How many there are in all' })\n total: number\n}\n"]}
|