@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
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IncomeStatementHistory = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const typeorm_history_1 = require("@operato/typeorm-history");
|
|
8
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
-
const env_1 = require("@things-factory/env");
|
|
10
|
-
const shell_1 = require("@things-factory/shell");
|
|
11
|
-
const income_statement_line_item_1 = require("./income-statement-line-item");
|
|
12
|
-
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
13
|
-
const DATABASE_TYPE = ORMCONFIG.type;
|
|
14
|
-
let IncomeStatementHistory = class IncomeStatementHistory {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.version = 1;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
exports.IncomeStatementHistory = IncomeStatementHistory;
|
|
20
|
-
tslib_1.__decorate([
|
|
21
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
23
|
-
tslib_1.__metadata("design:type", String)
|
|
24
|
-
], IncomeStatementHistory.prototype, "id", void 0);
|
|
25
|
-
tslib_1.__decorate([
|
|
26
|
-
(0, typeorm_1.Column)({ nullable: true, default: 1 }),
|
|
27
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
28
|
-
tslib_1.__metadata("design:type", Number)
|
|
29
|
-
], IncomeStatementHistory.prototype, "version", void 0);
|
|
30
|
-
tslib_1.__decorate([
|
|
31
|
-
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
32
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
33
|
-
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
34
|
-
], IncomeStatementHistory.prototype, "domain", void 0);
|
|
35
|
-
tslib_1.__decorate([
|
|
36
|
-
(0, typeorm_1.RelationId)((incomeStatementHistory) => incomeStatementHistory.domain),
|
|
37
|
-
tslib_1.__metadata("design:type", String)
|
|
38
|
-
], IncomeStatementHistory.prototype, "domainId", void 0);
|
|
39
|
-
tslib_1.__decorate([
|
|
40
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
41
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal year of the income statement' }),
|
|
42
|
-
tslib_1.__metadata("design:type", Number)
|
|
43
|
-
], IncomeStatementHistory.prototype, "year", void 0);
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal quarter of the income statement' }),
|
|
47
|
-
tslib_1.__metadata("design:type", Number)
|
|
48
|
-
], IncomeStatementHistory.prototype, "quarter", void 0);
|
|
49
|
-
tslib_1.__decorate([
|
|
50
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal month of the income statement' }),
|
|
52
|
-
tslib_1.__metadata("design:type", Number)
|
|
53
|
-
], IncomeStatementHistory.prototype, "month", void 0);
|
|
54
|
-
tslib_1.__decorate([
|
|
55
|
-
(0, typeorm_1.Column)((0, shell_1.moneyColumn)({ nullable: true })),
|
|
56
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Total revenue recorded in the income statement' }),
|
|
57
|
-
tslib_1.__metadata("design:type", Number)
|
|
58
|
-
], IncomeStatementHistory.prototype, "revenue", void 0);
|
|
59
|
-
tslib_1.__decorate([
|
|
60
|
-
(0, typeorm_1.Column)((0, shell_1.moneyColumn)({ nullable: true })),
|
|
61
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Total expenses recorded in the income statement' }),
|
|
62
|
-
tslib_1.__metadata("design:type", Number)
|
|
63
|
-
], IncomeStatementHistory.prototype, "expense", void 0);
|
|
64
|
-
tslib_1.__decorate([
|
|
65
|
-
(0, typeorm_1.Column)((0, shell_1.moneyColumn)({ nullable: true })),
|
|
66
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Net income calculated as revenue minus expenses' }),
|
|
67
|
-
tslib_1.__metadata("design:type", Number)
|
|
68
|
-
], IncomeStatementHistory.prototype, "netIncome", void 0);
|
|
69
|
-
tslib_1.__decorate([
|
|
70
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
71
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Indicates whether this income statement is active' }),
|
|
72
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
73
|
-
], IncomeStatementHistory.prototype, "active", void 0);
|
|
74
|
-
tslib_1.__decorate([
|
|
75
|
-
(0, typeorm_1.OneToMany)(type => income_statement_line_item_1.IncomeStatementLineItem, lineItem => lineItem.statement),
|
|
76
|
-
(0, type_graphql_1.Field)(type => [income_statement_line_item_1.IncomeStatementLineItem], { nullable: true }),
|
|
77
|
-
tslib_1.__metadata("design:type", Array)
|
|
78
|
-
], IncomeStatementHistory.prototype, "lineItems", void 0);
|
|
79
|
-
tslib_1.__decorate([
|
|
80
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
81
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
82
|
-
tslib_1.__metadata("design:type", Date)
|
|
83
|
-
], IncomeStatementHistory.prototype, "createdAt", void 0);
|
|
84
|
-
tslib_1.__decorate([
|
|
85
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
86
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
87
|
-
tslib_1.__metadata("design:type", Date)
|
|
88
|
-
], IncomeStatementHistory.prototype, "updatedAt", void 0);
|
|
89
|
-
tslib_1.__decorate([
|
|
90
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
91
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
92
|
-
tslib_1.__metadata("design:type", Date)
|
|
93
|
-
], IncomeStatementHistory.prototype, "deletedAt", void 0);
|
|
94
|
-
tslib_1.__decorate([
|
|
95
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
96
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
97
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
98
|
-
], IncomeStatementHistory.prototype, "creator", void 0);
|
|
99
|
-
tslib_1.__decorate([
|
|
100
|
-
(0, typeorm_1.RelationId)((incomeStatementHistory) => incomeStatementHistory.creator),
|
|
101
|
-
tslib_1.__metadata("design:type", String)
|
|
102
|
-
], IncomeStatementHistory.prototype, "creatorId", void 0);
|
|
103
|
-
tslib_1.__decorate([
|
|
104
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
105
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
106
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
107
|
-
], IncomeStatementHistory.prototype, "updater", void 0);
|
|
108
|
-
tslib_1.__decorate([
|
|
109
|
-
(0, typeorm_1.RelationId)((incomeStatementHistory) => incomeStatementHistory.updater),
|
|
110
|
-
tslib_1.__metadata("design:type", String)
|
|
111
|
-
], IncomeStatementHistory.prototype, "updaterId", void 0);
|
|
112
|
-
tslib_1.__decorate([
|
|
113
|
-
(0, typeorm_history_1.HistoryOriginalIdColumn)(),
|
|
114
|
-
tslib_1.__metadata("design:type", String)
|
|
115
|
-
], IncomeStatementHistory.prototype, "originalId", void 0);
|
|
116
|
-
tslib_1.__decorate([
|
|
117
|
-
(0, typeorm_history_1.HistoryActionColumn)({
|
|
118
|
-
nullable: false,
|
|
119
|
-
type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
120
|
-
? 'enum'
|
|
121
|
-
: DATABASE_TYPE == 'oracle'
|
|
122
|
-
? 'varchar2'
|
|
123
|
-
: DATABASE_TYPE == 'mssql'
|
|
124
|
-
? 'nvarchar'
|
|
125
|
-
: 'varchar',
|
|
126
|
-
enum: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
127
|
-
? typeorm_history_1.HistoryActionType
|
|
128
|
-
: undefined,
|
|
129
|
-
length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 10
|
|
130
|
-
}),
|
|
131
|
-
tslib_1.__metadata("design:type", String)
|
|
132
|
-
], IncomeStatementHistory.prototype, "action", void 0);
|
|
133
|
-
exports.IncomeStatementHistory = IncomeStatementHistory = tslib_1.__decorate([
|
|
134
|
-
(0, typeorm_1.Entity)(),
|
|
135
|
-
(0, typeorm_1.Index)('ix_income-statement_history_0', (incomeStatementHistory) => [
|
|
136
|
-
incomeStatementHistory.originalId,
|
|
137
|
-
incomeStatementHistory.version
|
|
138
|
-
], { unique: true }),
|
|
139
|
-
(0, typeorm_1.Index)('ix_income-statement_history_1', (incomeStatementHistory) => [
|
|
140
|
-
incomeStatementHistory.domain,
|
|
141
|
-
incomeStatementHistory.originalId,
|
|
142
|
-
incomeStatementHistory.version
|
|
143
|
-
], { unique: true }),
|
|
144
|
-
(0, type_graphql_1.ObjectType)({ description: 'History Entity of IncomeStatement' })
|
|
145
|
-
], IncomeStatementHistory);
|
|
146
|
-
//# sourceMappingURL=income-statement-history.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"income-statement-history.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAAyG;AAEzG,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA2D;AAG3D,6EAAsE;AAEtE,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAqB7B,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAA5B;QAOL,YAAO,GAAY,CAAC,CAAA;IAuFtB,CAAC;CAAA,CAAA;AA9FY,wDAAsB;AAGxB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE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AC/B,CAAC,sBAA8C,EAAE,EAAE,CAAC;QAClD,sBAAsB,CAAC,UAAU;QACjC,sBAAsB,CAAC,OAAO;KAC/B,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,+BAA+B,EAC/B,CAAC,sBAA8C,EAAE,EAAE,CAAC;QAClD,sBAAsB,CAAC,MAAM;QAC7B,sBAAsB,CAAC,UAAU;QACjC,sBAAsB,CAAC,OAAO;KAC/B,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;GACpD,sBAAsB,CA8FlC","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain, moneyColumn } from '@things-factory/shell'\n\nimport { IncomeStatement, IncomeStatementStatus } from './income-statement'\nimport { IncomeStatementLineItem } from './income-statement-line-item'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_income-statement_history_0',\n (incomeStatementHistory: IncomeStatementHistory) => [\n incomeStatementHistory.originalId,\n incomeStatementHistory.version\n ],\n { unique: true }\n)\n@Index(\n 'ix_income-statement_history_1',\n (incomeStatementHistory: IncomeStatementHistory) => [\n incomeStatementHistory.domain,\n incomeStatementHistory.originalId,\n incomeStatementHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of IncomeStatement' })\nexport class IncomeStatementHistory implements HistoryEntityInterface<IncomeStatement> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((incomeStatementHistory: IncomeStatementHistory) => incomeStatementHistory.domain)\n domainId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal year of the income statement' })\n year?: number // 회계 연도\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal quarter of the income statement' })\n quarter?: number // 회계 분기\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal month of the income statement' })\n month?: number // 회계 월\n\n @Column(moneyColumn({ nullable: true }))\n @Field({ nullable: true, description: 'Total revenue recorded in the income statement' })\n revenue?: number // 손익계산서에 기록된 총수익\n\n @Column(moneyColumn({ nullable: true }))\n @Field({ nullable: true, description: 'Total expenses recorded in the income statement' })\n expense?: number // 손익계산서에 기록된 총비용\n\n @Column(moneyColumn({ nullable: true }))\n @Field({ nullable: true, description: 'Net income calculated as revenue minus expenses' })\n netIncome?: number // 총수익에서 총비용을 뺀 순이익\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Indicates whether this income statement is active' })\n active?: boolean // 이 손익계산서가 활성 상태인지 여부\n\n @OneToMany(type => IncomeStatementLineItem, lineItem => lineItem.statement)\n @Field(type => [IncomeStatementLineItem], { nullable: true })\n lineItems?: IncomeStatementLineItem[] // 계정별 브레이크다운\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((incomeStatementHistory: IncomeStatementHistory) => incomeStatementHistory.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((incomeStatementHistory: IncomeStatementHistory) => incomeStatementHistory.updater)\n updaterId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'varchar',\n enum:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? HistoryActionType\n : undefined,\n length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 10\n })\n public action!: HistoryActionType\n}\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { User } from '@things-factory/auth-base';
|
|
2
|
-
import { Account } from '../account/account';
|
|
3
|
-
import { IncomeStatement } from './income-statement';
|
|
4
|
-
export declare class IncomeStatementLineItem {
|
|
5
|
-
readonly id: string;
|
|
6
|
-
statement: IncomeStatement;
|
|
7
|
-
statementId: string;
|
|
8
|
-
account: Account;
|
|
9
|
-
accountId: string;
|
|
10
|
-
amount: number;
|
|
11
|
-
description?: string;
|
|
12
|
-
createdAt?: Date;
|
|
13
|
-
updatedAt?: Date;
|
|
14
|
-
deletedAt?: Date;
|
|
15
|
-
creator?: User;
|
|
16
|
-
creatorId?: string;
|
|
17
|
-
updater?: User;
|
|
18
|
-
updaterId?: string;
|
|
19
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IncomeStatementLineItem = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const typeorm_1 = require("typeorm");
|
|
6
|
-
const type_graphql_1 = require("type-graphql");
|
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
|
8
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
-
const account_1 = require("../account/account");
|
|
10
|
-
const income_statement_1 = require("./income-statement");
|
|
11
|
-
let IncomeStatementLineItem = class IncomeStatementLineItem {
|
|
12
|
-
};
|
|
13
|
-
exports.IncomeStatementLineItem = IncomeStatementLineItem;
|
|
14
|
-
tslib_1.__decorate([
|
|
15
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
16
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
17
|
-
tslib_1.__metadata("design:type", String)
|
|
18
|
-
], IncomeStatementLineItem.prototype, "id", void 0);
|
|
19
|
-
tslib_1.__decorate([
|
|
20
|
-
(0, typeorm_1.ManyToOne)(type => income_statement_1.IncomeStatement, statement => statement.lineItems),
|
|
21
|
-
(0, type_graphql_1.Field)(type => income_statement_1.IncomeStatement, { description: 'The income statement this line item belongs to' }),
|
|
22
|
-
tslib_1.__metadata("design:type", income_statement_1.IncomeStatement // 해당 라인 아이템이 속한 손익계산서
|
|
23
|
-
)
|
|
24
|
-
], IncomeStatementLineItem.prototype, "statement", void 0);
|
|
25
|
-
tslib_1.__decorate([
|
|
26
|
-
(0, typeorm_1.RelationId)((lineItem) => lineItem.statement),
|
|
27
|
-
tslib_1.__metadata("design:type", String)
|
|
28
|
-
], IncomeStatementLineItem.prototype, "statementId", void 0);
|
|
29
|
-
tslib_1.__decorate([
|
|
30
|
-
(0, typeorm_1.ManyToOne)(type => account_1.Account),
|
|
31
|
-
(0, type_graphql_1.Field)(type => account_1.Account, { description: 'The financial account associated with this line item' }),
|
|
32
|
-
tslib_1.__metadata("design:type", account_1.Account // 라인 아이템에 연결된 계정
|
|
33
|
-
)
|
|
34
|
-
], IncomeStatementLineItem.prototype, "account", void 0);
|
|
35
|
-
tslib_1.__decorate([
|
|
36
|
-
(0, typeorm_1.RelationId)((lineItem) => lineItem.account),
|
|
37
|
-
tslib_1.__metadata("design:type", String)
|
|
38
|
-
], IncomeStatementLineItem.prototype, "accountId", void 0);
|
|
39
|
-
tslib_1.__decorate([
|
|
40
|
-
(0, typeorm_1.Column)((0, shell_1.moneyColumn)({ nullable: false })),
|
|
41
|
-
(0, type_graphql_1.Field)({ nullable: false, description: 'The monetary amount associated with this account for the income statement' }),
|
|
42
|
-
tslib_1.__metadata("design:type", Number)
|
|
43
|
-
], IncomeStatementLineItem.prototype, "amount", void 0);
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Optional description or notes about this line item' }),
|
|
47
|
-
tslib_1.__metadata("design:type", String)
|
|
48
|
-
], IncomeStatementLineItem.prototype, "description", void 0);
|
|
49
|
-
tslib_1.__decorate([
|
|
50
|
-
(0, typeorm_1.CreateDateColumn)(),
|
|
51
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when this line item was created' }),
|
|
52
|
-
tslib_1.__metadata("design:type", Date // 라인 아이템이 생성된 날짜 및 시간
|
|
53
|
-
)
|
|
54
|
-
], IncomeStatementLineItem.prototype, "createdAt", void 0);
|
|
55
|
-
tslib_1.__decorate([
|
|
56
|
-
(0, typeorm_1.UpdateDateColumn)(),
|
|
57
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when this line item was last updated' }),
|
|
58
|
-
tslib_1.__metadata("design:type", Date // 라인 아이템이 마지막으로 업데이트된 날짜 및 시간
|
|
59
|
-
)
|
|
60
|
-
], IncomeStatementLineItem.prototype, "updatedAt", void 0);
|
|
61
|
-
tslib_1.__decorate([
|
|
62
|
-
(0, typeorm_1.DeleteDateColumn)(),
|
|
63
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when this line item was deleted' }),
|
|
64
|
-
tslib_1.__metadata("design:type", Date // 라인 아이템이 삭제된 날짜 및 시간
|
|
65
|
-
)
|
|
66
|
-
], IncomeStatementLineItem.prototype, "deletedAt", void 0);
|
|
67
|
-
tslib_1.__decorate([
|
|
68
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
69
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created this line item' }),
|
|
70
|
-
tslib_1.__metadata("design:type", auth_base_1.User // 라인 아이템을 생성한 사용자
|
|
71
|
-
)
|
|
72
|
-
], IncomeStatementLineItem.prototype, "creator", void 0);
|
|
73
|
-
tslib_1.__decorate([
|
|
74
|
-
(0, typeorm_1.RelationId)((lineItem) => lineItem.creator),
|
|
75
|
-
tslib_1.__metadata("design:type", String)
|
|
76
|
-
], IncomeStatementLineItem.prototype, "creatorId", void 0);
|
|
77
|
-
tslib_1.__decorate([
|
|
78
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
79
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who last updated this line item' }),
|
|
80
|
-
tslib_1.__metadata("design:type", auth_base_1.User // 라인 아이템을 마지막으로 업데이트한 사용자
|
|
81
|
-
)
|
|
82
|
-
], IncomeStatementLineItem.prototype, "updater", void 0);
|
|
83
|
-
tslib_1.__decorate([
|
|
84
|
-
(0, typeorm_1.RelationId)((lineItem) => lineItem.updater),
|
|
85
|
-
tslib_1.__metadata("design:type", String)
|
|
86
|
-
], IncomeStatementLineItem.prototype, "updaterId", void 0);
|
|
87
|
-
exports.IncomeStatementLineItem = IncomeStatementLineItem = tslib_1.__decorate([
|
|
88
|
-
(0, type_graphql_1.ObjectType)({
|
|
89
|
-
description: 'Line item for an income statement, representing a detailed breakdown of financial accounts'
|
|
90
|
-
}),
|
|
91
|
-
(0, typeorm_1.Entity)(),
|
|
92
|
-
(0, typeorm_1.Index)('ix_income_statement_line_item_0', (lineItem) => [lineItem.statement, lineItem.account], {
|
|
93
|
-
unique: false,
|
|
94
|
-
where: '"deleted_at" IS NULL'
|
|
95
|
-
})
|
|
96
|
-
], IncomeStatementLineItem);
|
|
97
|
-
//# sourceMappingURL=income-statement-line-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"income-statement-line-item.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement-line-item.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAAoD;AAEpD,iDAA2D;AAC3D,yDAAgD;AAChD,gDAA4C;AAC5C,yDAAoD;AAc7C,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAoDnC,CAAA;AApDY,0DAAuB;AAGzB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mDACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,kCAAe,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;IACpE,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kCAAe,EAAE,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;sCACvF,kCAAe,CAAC,sBAAsB;;0DAAvB;AAG1B;IADC,IAAA,oBAAU,EAAC,CAAC,QAAiC,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;;4DACnD;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAO,CAAC;IAC1B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAO,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC;sCACvF,iBAAO,CAAC,iBAAiB;;wDAAlB;AAGhB;IADC,IAAA,oBAAU,EAAC,CAAC,QAAiC,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;0DACnD;AAIjB;IAFC,IAAA,gBAAM,EAAC,IAAA,mBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACxC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,2EAA2E,EAAE,CAAC;;uDACvG;AAId;IAFC,IAAA,g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CACvF,gBAAI,CAAC,0BAA0B;;wDAA3B;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAiC,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;0DAClD;kCAnDP,uBAAuB;IAZnC,IAAA,yBAAU,EAAC;QACV,WAAW,EAAE,4FAA4F;KAC1G,CAAC;IACD,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,iCAAiC,EACjC,CAAC,QAAiC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,EAC7E;QACE,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,sBAAsB;KAC9B,CACF;GACY,uBAAuB,CAoDnC","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { Domain, moneyColumn } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Account } from '../account/account'\nimport { IncomeStatement } from './income-statement'\n\n@ObjectType({\n description: 'Line item for an income statement, representing a detailed breakdown of financial accounts'\n})\n@Entity()\n@Index(\n 'ix_income_statement_line_item_0',\n (lineItem: IncomeStatementLineItem) => [lineItem.statement, lineItem.account],\n {\n unique: false,\n where: '\"deleted_at\" IS NULL'\n }\n)\nexport class IncomeStatementLineItem {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => IncomeStatement, statement => statement.lineItems)\n @Field(type => IncomeStatement, { description: 'The income statement this line item belongs to' })\n statement: IncomeStatement // 해당 라인 아이템이 속한 손익계산서\n\n @RelationId((lineItem: IncomeStatementLineItem) => lineItem.statement)\n statementId: string // 손익계산서의 ID\n\n @ManyToOne(type => Account)\n @Field(type => Account, { description: 'The financial account associated with this line item' })\n account: Account // 라인 아이템에 연결된 계정\n\n @RelationId((lineItem: IncomeStatementLineItem) => lineItem.account)\n accountId: string // 계정의 ID\n\n @Column(moneyColumn({ nullable: false }))\n @Field({ nullable: false, description: 'The monetary amount associated with this account for the income statement' })\n amount: number // 계정과 관련된 금액\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Optional description or notes about this line item' })\n description?: string // 라인 아이템에 대한 선택적 설명 또는 메모\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The date and time when this line item was created' })\n createdAt?: Date // 라인 아이템이 생성된 날짜 및 시간\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The date and time when this line item was last updated' })\n updatedAt?: Date // 라인 아이템이 마지막으로 업데이트된 날짜 및 시간\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'The date and time when this line item was deleted' })\n deletedAt?: Date // 라인 아이템이 삭제된 날짜 및 시간\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created this line item' })\n creator?: User // 라인 아이템을 생성한 사용자\n\n @RelationId((lineItem: IncomeStatementLineItem) => lineItem.creator)\n creatorId?: string // 생성자의 ID\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated this line item' })\n updater?: User // 라인 아이템을 마지막으로 업데이트한 사용자\n\n @RelationId((lineItem: IncomeStatementLineItem) => lineItem.updater)\n updaterId?: string // 업데이트한 사용자의 ID\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IncomeStatement } from './income-statement';
|
|
2
|
-
import { NewIncomeStatement, IncomeStatementPatch } from './income-statement-type';
|
|
3
|
-
export declare class IncomeStatementMutation {
|
|
4
|
-
createIncomeStatement(incomeStatement: NewIncomeStatement, context: ResolverContext): Promise<IncomeStatement>;
|
|
5
|
-
updateIncomeStatement(id: string, patch: IncomeStatementPatch, context: ResolverContext): Promise<IncomeStatement>;
|
|
6
|
-
updateMultipleIncomeStatement(patches: IncomeStatementPatch[], context: ResolverContext): Promise<IncomeStatement[]>;
|
|
7
|
-
deleteIncomeStatement(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
-
deleteIncomeStatements(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
-
importIncomeStatements(incomeStatements: IncomeStatementPatch[], context: ResolverContext): Promise<boolean>;
|
|
10
|
-
}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IncomeStatementMutation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
|
8
|
-
const income_statement_1 = require("./income-statement");
|
|
9
|
-
const income_statement_type_1 = require("./income-statement-type");
|
|
10
|
-
let IncomeStatementMutation = class IncomeStatementMutation {
|
|
11
|
-
async createIncomeStatement(incomeStatement, context) {
|
|
12
|
-
const { domain, user, tx } = context.state;
|
|
13
|
-
const result = await (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx).save({
|
|
14
|
-
...incomeStatement,
|
|
15
|
-
domain,
|
|
16
|
-
creator: user,
|
|
17
|
-
updater: user
|
|
18
|
-
});
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
async updateIncomeStatement(id, patch, context) {
|
|
22
|
-
const { domain, user, tx } = context.state;
|
|
23
|
-
const repository = (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx);
|
|
24
|
-
const incomeStatement = await repository.findOne({
|
|
25
|
-
where: { domain: { id: domain.id }, id }
|
|
26
|
-
});
|
|
27
|
-
const result = await repository.save({
|
|
28
|
-
...incomeStatement,
|
|
29
|
-
...patch,
|
|
30
|
-
updater: user
|
|
31
|
-
});
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
async updateMultipleIncomeStatement(patches, context) {
|
|
35
|
-
const { domain, user, tx } = context.state;
|
|
36
|
-
let results = [];
|
|
37
|
-
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
38
|
-
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
39
|
-
const incomeStatementRepo = (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx);
|
|
40
|
-
if (_createRecords.length > 0) {
|
|
41
|
-
for (let i = 0; i < _createRecords.length; i++) {
|
|
42
|
-
const newRecord = _createRecords[i];
|
|
43
|
-
const result = await incomeStatementRepo.save({
|
|
44
|
-
...newRecord,
|
|
45
|
-
domain,
|
|
46
|
-
creator: user,
|
|
47
|
-
updater: user
|
|
48
|
-
});
|
|
49
|
-
results.push({ ...result, cuFlag: '+' });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (_updateRecords.length > 0) {
|
|
53
|
-
for (let i = 0; i < _updateRecords.length; i++) {
|
|
54
|
-
const updateRecord = _updateRecords[i];
|
|
55
|
-
const incomeStatement = await incomeStatementRepo.findOne({
|
|
56
|
-
where: { domain: { id: domain.id }, id: updateRecord.id }
|
|
57
|
-
});
|
|
58
|
-
if (!incomeStatement) {
|
|
59
|
-
throw new Error(`failed to find incomeStatement to update: ${updateRecord.id}`);
|
|
60
|
-
}
|
|
61
|
-
const result = await incomeStatementRepo.save({
|
|
62
|
-
...incomeStatement,
|
|
63
|
-
...updateRecord,
|
|
64
|
-
updater: user
|
|
65
|
-
});
|
|
66
|
-
results.push({ ...result, cuFlag: 'M' });
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return results;
|
|
70
|
-
}
|
|
71
|
-
async deleteIncomeStatement(id, context) {
|
|
72
|
-
const { domain, tx } = context.state;
|
|
73
|
-
await (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx).delete({ domain: { id: domain.id }, id });
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
async deleteIncomeStatements(ids, context) {
|
|
77
|
-
const { domain, tx } = context.state;
|
|
78
|
-
await (0, shell_1.getRepository)(income_statement_1.IncomeStatement, tx).delete({
|
|
79
|
-
domain: { id: domain.id },
|
|
80
|
-
id: (0, typeorm_1.In)(ids)
|
|
81
|
-
});
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
async importIncomeStatements(incomeStatements, context) {
|
|
85
|
-
const { domain, tx } = context.state;
|
|
86
|
-
await Promise.all(incomeStatements.map(async (incomeStatement) => {
|
|
87
|
-
const createdIncomeStatement = await tx
|
|
88
|
-
.getRepository(income_statement_1.IncomeStatement)
|
|
89
|
-
.save({ domain, ...incomeStatement });
|
|
90
|
-
}));
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
exports.IncomeStatementMutation = IncomeStatementMutation;
|
|
95
|
-
tslib_1.__decorate([
|
|
96
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
97
|
-
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
98
|
-
(0, type_graphql_1.Mutation)(returns => income_statement_1.IncomeStatement, { description: 'To create new IncomeStatement' }),
|
|
99
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('incomeStatement')),
|
|
100
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
101
|
-
tslib_1.__metadata("design:type", Function),
|
|
102
|
-
tslib_1.__metadata("design:paramtypes", [income_statement_type_1.NewIncomeStatement, Object]),
|
|
103
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
104
|
-
], IncomeStatementMutation.prototype, "createIncomeStatement", null);
|
|
105
|
-
tslib_1.__decorate([
|
|
106
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
107
|
-
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
108
|
-
(0, type_graphql_1.Mutation)(returns => income_statement_1.IncomeStatement, { description: 'To modify IncomeStatement information' }),
|
|
109
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
110
|
-
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
111
|
-
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
112
|
-
tslib_1.__metadata("design:type", Function),
|
|
113
|
-
tslib_1.__metadata("design:paramtypes", [String, income_statement_type_1.IncomeStatementPatch, Object]),
|
|
114
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
115
|
-
], IncomeStatementMutation.prototype, "updateIncomeStatement", null);
|
|
116
|
-
tslib_1.__decorate([
|
|
117
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
118
|
-
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
119
|
-
(0, type_graphql_1.Mutation)(returns => [income_statement_1.IncomeStatement], { description: "To modify multiple IncomeStatements' information" }),
|
|
120
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [income_statement_type_1.IncomeStatementPatch])),
|
|
121
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
122
|
-
tslib_1.__metadata("design:type", Function),
|
|
123
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
124
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
125
|
-
], IncomeStatementMutation.prototype, "updateMultipleIncomeStatement", null);
|
|
126
|
-
tslib_1.__decorate([
|
|
127
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
128
|
-
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
129
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete IncomeStatement' }),
|
|
130
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
131
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
132
|
-
tslib_1.__metadata("design:type", Function),
|
|
133
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
134
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
135
|
-
], IncomeStatementMutation.prototype, "deleteIncomeStatement", null);
|
|
136
|
-
tslib_1.__decorate([
|
|
137
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
138
|
-
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
139
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple IncomeStatements' }),
|
|
140
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
141
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
142
|
-
tslib_1.__metadata("design:type", Function),
|
|
143
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
144
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
145
|
-
], IncomeStatementMutation.prototype, "deleteIncomeStatements", null);
|
|
146
|
-
tslib_1.__decorate([
|
|
147
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
148
|
-
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "mutation", domainOwnerGranted: true)'),
|
|
149
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple IncomeStatements' }),
|
|
150
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('incomeStatements', type => [income_statement_type_1.IncomeStatementPatch])),
|
|
151
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
152
|
-
tslib_1.__metadata("design:type", Function),
|
|
153
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
154
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
155
|
-
], IncomeStatementMutation.prototype, "importIncomeStatements", null);
|
|
156
|
-
exports.IncomeStatementMutation = IncomeStatementMutation = tslib_1.__decorate([
|
|
157
|
-
(0, type_graphql_1.Resolver)(income_statement_1.IncomeStatement)
|
|
158
|
-
], IncomeStatementMutation);
|
|
159
|
-
//# sourceMappingURL=income-statement-mutation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"income-statement-mutation.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,iDAAqD;AAErD,yDAAoD;AACpD,mEAAkF;AAG3E,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAI5B,AAAN,KAAK,CAAC,qBAAqB,CACD,eAAmC,EACpD,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAa,EAAC,kCAAe,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC;YAC3D,GAAG,eAAe;YAClB,MAAM;YACN,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAKK,AAAN,KAAK,CAAC,qBAAqB,CACd,EAAU,EACP,KAA2B,EAClC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,kCAAe,EAAE,EAAE,CAAC,CAAA;QACrD,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC;YACnC,GAAG,eAAe;YAClB,GAAG,KAAK;YACR,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAKK,AAAN,KAAK,CAAC,6BAA6B,CACe,OAA+B,EACxE,OAAwB;QAE/B,MA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C,IAAA,uBAAQ,EAAC,kCAAe,CAAC;GACb,uBAAuB,CAgJnC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { getRepository } from '@things-factory/shell'\n\nimport { IncomeStatement } from './income-statement'\nimport { NewIncomeStatement, IncomeStatementPatch } from './income-statement-type'\n\n@Resolver(IncomeStatement)\nexport class IncomeStatementMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => IncomeStatement, { description: 'To create new IncomeStatement' })\n async createIncomeStatement(\n @Arg('incomeStatement') incomeStatement: NewIncomeStatement,\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatement> {\n const { domain, user, tx } = context.state\n\n const result = await getRepository(IncomeStatement, tx).save({\n ...incomeStatement,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => IncomeStatement, { description: 'To modify IncomeStatement information' })\n async updateIncomeStatement(\n @Arg('id') id: string,\n @Arg('patch') patch: IncomeStatementPatch,\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatement> {\n const { domain, user, tx } = context.state\n\n const repository = getRepository(IncomeStatement, tx)\n const incomeStatement = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...incomeStatement,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => [IncomeStatement], { description: \"To modify multiple IncomeStatements' information\" })\n async updateMultipleIncomeStatement(\n @Arg('patches', type => [IncomeStatementPatch]) patches: IncomeStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<IncomeStatement[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const incomeStatementRepo = getRepository(IncomeStatement, tx)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await incomeStatementRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const incomeStatement = await incomeStatementRepo.findOne({\n where: { domain: { id: domain.id }, id: updateRecord.id }\n })\n\n if (!incomeStatement) {\n throw new Error(`failed to find incomeStatement to update: ${updateRecord.id}`)\n }\n\n const result = await incomeStatementRepo.save({\n ...incomeStatement,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, 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 IncomeStatement' })\n async deleteIncomeStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(IncomeStatement, tx).delete({ domain: { id: domain.id }, 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 IncomeStatements' })\n async deleteIncomeStatements(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(IncomeStatement, tx).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"accounting\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple IncomeStatements' })\n async importIncomeStatements(\n @Arg('incomeStatements', type => [IncomeStatementPatch]) incomeStatements: IncomeStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n incomeStatements.map(async (incomeStatement: IncomeStatementPatch) => {\n const createdIncomeStatement: IncomeStatement = await tx\n .getRepository(IncomeStatement)\n .save({ domain, ...incomeStatement })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Domain, ListParam } from '@things-factory/shell';
|
|
2
|
-
import { User } from '@things-factory/auth-base';
|
|
3
|
-
import { IncomeStatement } from './income-statement';
|
|
4
|
-
import { IncomeStatementList } from './income-statement-type';
|
|
5
|
-
export declare class IncomeStatementQuery {
|
|
6
|
-
incomeStatement(id: string, context: ResolverContext): Promise<IncomeStatement>;
|
|
7
|
-
incomeStatements(params: ListParam, context: ResolverContext): Promise<IncomeStatementList>;
|
|
8
|
-
domain(incomeStatement: IncomeStatement): Promise<Domain>;
|
|
9
|
-
updater(incomeStatement: IncomeStatement): Promise<User>;
|
|
10
|
-
creator(incomeStatement: IncomeStatement): Promise<User>;
|
|
11
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IncomeStatementQuery = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const shell_1 = require("@things-factory/shell");
|
|
7
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
-
const income_statement_1 = require("./income-statement");
|
|
9
|
-
const income_statement_type_1 = require("./income-statement-type");
|
|
10
|
-
let IncomeStatementQuery = class IncomeStatementQuery {
|
|
11
|
-
async incomeStatement(id, context) {
|
|
12
|
-
const { domain } = context.state;
|
|
13
|
-
return await (0, shell_1.getRepository)(income_statement_1.IncomeStatement).findOne({
|
|
14
|
-
where: { domain: { id: domain.id }, id }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
async incomeStatements(params, context) {
|
|
18
|
-
const { domain } = context.state;
|
|
19
|
-
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
20
|
-
domain,
|
|
21
|
-
params,
|
|
22
|
-
repository: await (0, shell_1.getRepository)(income_statement_1.IncomeStatement),
|
|
23
|
-
searchables: ['name', 'description']
|
|
24
|
-
});
|
|
25
|
-
const [items, total] = await queryBuilder.getManyAndCount();
|
|
26
|
-
return { items, total };
|
|
27
|
-
}
|
|
28
|
-
async domain(incomeStatement) {
|
|
29
|
-
return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: incomeStatement.domainId });
|
|
30
|
-
}
|
|
31
|
-
async updater(incomeStatement) {
|
|
32
|
-
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: incomeStatement.updaterId });
|
|
33
|
-
}
|
|
34
|
-
async creator(incomeStatement) {
|
|
35
|
-
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: incomeStatement.creatorId });
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.IncomeStatementQuery = IncomeStatementQuery;
|
|
39
|
-
tslib_1.__decorate([
|
|
40
|
-
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query", domainOwnerGranted: true)'),
|
|
41
|
-
(0, type_graphql_1.Query)(returns => income_statement_1.IncomeStatement, { nullable: true, description: 'To fetch a IncomeStatement' }),
|
|
42
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
43
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
44
|
-
tslib_1.__metadata("design:type", Function),
|
|
45
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
46
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
47
|
-
], IncomeStatementQuery.prototype, "incomeStatement", null);
|
|
48
|
-
tslib_1.__decorate([
|
|
49
|
-
(0, type_graphql_1.Directive)('@privilege(category: "accounting", privilege: "query", domainOwnerGranted: true)'),
|
|
50
|
-
(0, type_graphql_1.Query)(returns => income_statement_type_1.IncomeStatementList, { description: 'To fetch multiple IncomeStatements' }),
|
|
51
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
52
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
53
|
-
tslib_1.__metadata("design:type", Function),
|
|
54
|
-
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
55
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
56
|
-
], IncomeStatementQuery.prototype, "incomeStatements", null);
|
|
57
|
-
tslib_1.__decorate([
|
|
58
|
-
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
59
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
60
|
-
tslib_1.__metadata("design:type", Function),
|
|
61
|
-
tslib_1.__metadata("design:paramtypes", [income_statement_1.IncomeStatement]),
|
|
62
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
63
|
-
], IncomeStatementQuery.prototype, "domain", null);
|
|
64
|
-
tslib_1.__decorate([
|
|
65
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
66
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
67
|
-
tslib_1.__metadata("design:type", Function),
|
|
68
|
-
tslib_1.__metadata("design:paramtypes", [income_statement_1.IncomeStatement]),
|
|
69
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
70
|
-
], IncomeStatementQuery.prototype, "updater", null);
|
|
71
|
-
tslib_1.__decorate([
|
|
72
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
73
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
74
|
-
tslib_1.__metadata("design:type", Function),
|
|
75
|
-
tslib_1.__metadata("design:paramtypes", [income_statement_1.IncomeStatement]),
|
|
76
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
77
|
-
], IncomeStatementQuery.prototype, "creator", null);
|
|
78
|
-
exports.IncomeStatementQuery = IncomeStatementQuery = tslib_1.__decorate([
|
|
79
|
-
(0, type_graphql_1.Resolver)(income_statement_1.IncomeStatement)
|
|
80
|
-
], IncomeStatementQuery);
|
|
81
|
-
//# sourceMappingURL=income-statement-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"income-statement-query.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,yDAAoD;AACpD,mEAA6D;AAGtD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAGzB,AAAN,KAAK,CAAC,eAAe,CAAY,EAAU,EAAS,OAAwB;QAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,kCAAe,CAAC,CAAC,OAAO,CAAC;YAClD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CAAS,MAAiB,EAAS,OAAwB;QAC/E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,kCAAe,CAAC;YAChD,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,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IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAkB,kCAAe;;mDAErD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAkB,kCAAe;;mDAErD;+BAzCU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,kCAAe,CAAC;GACb,oBAAoB,CA0ChC","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 { IncomeStatement } from './income-statement'\nimport { IncomeStatementList } from './income-statement-type'\n\n@Resolver(IncomeStatement)\nexport class IncomeStatementQuery {\n @Directive('@privilege(category: \"accounting\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => IncomeStatement!, { nullable: true, description: 'To fetch a IncomeStatement' })\n async incomeStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<IncomeStatement> {\n const { domain } = context.state\n\n return await getRepository(IncomeStatement).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"accounting\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => IncomeStatementList, { description: 'To fetch multiple IncomeStatements' })\n async incomeStatements(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<IncomeStatementList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(IncomeStatement),\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() incomeStatement: IncomeStatement): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: incomeStatement.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() incomeStatement: IncomeStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: incomeStatement.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() incomeStatement: IncomeStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: incomeStatement.creatorId })\n }\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IncomeStatement, IncomeStatementStatus } from './income-statement';
|
|
2
|
-
export declare class NewIncomeStatement {
|
|
3
|
-
name: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
state?: IncomeStatementStatus;
|
|
6
|
-
active?: boolean;
|
|
7
|
-
params?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class IncomeStatementPatch {
|
|
10
|
-
id?: string;
|
|
11
|
-
name?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
state?: IncomeStatementStatus;
|
|
14
|
-
active?: boolean;
|
|
15
|
-
cuFlag?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare class IncomeStatementList {
|
|
18
|
-
items: IncomeStatement[];
|
|
19
|
-
total: number;
|
|
20
|
-
}
|