@things-factory/accounting 6.0.46
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/CHANGELOG.md +8 -0
- package/README.md +31 -0
- package/assets/images/book-activity.jpg +0 -0
- package/assets/images/expense-activity.jpg +0 -0
- package/assets/images/hatiolab-logo.png +0 -0
- package/client/activities/activity-book-edit.ts +88 -0
- package/client/activities/activity-book-view.ts +88 -0
- package/client/activities/activity-expense-edit.ts +88 -0
- package/client/activities/activity-expense-view.ts +88 -0
- package/client/bootstrap.ts +1 -0
- package/client/index.ts +0 -0
- package/client/pages/account/account-importer.ts +97 -0
- package/client/pages/account/account-list-page.ts +348 -0
- package/client/pages/accounting-category/accounting-category-importer.ts +97 -0
- package/client/pages/accounting-category/accounting-category-list-page.ts +348 -0
- package/client/pages/financial-statement/financial-statement-importer.ts +97 -0
- package/client/pages/financial-statement/financial-statement-list-page.ts +348 -0
- package/client/pages/income-statement/income-statement-importer.ts +97 -0
- package/client/pages/income-statement/income-statement-list-page.ts +348 -0
- package/client/pages/ledger/ledger-importer.ts +97 -0
- package/client/pages/ledger/ledger-list-page.ts +332 -0
- package/client/pages/main.ts +24 -0
- package/client/pages/transaction/transaction-importer.ts +97 -0
- package/client/pages/transaction/transaction-list-page.ts +348 -0
- package/client/route.ts +27 -0
- package/client/tsconfig.json +11 -0
- package/dist-client/activities/activity-book-edit.d.ts +14 -0
- package/dist-client/activities/activity-book-edit.js +85 -0
- package/dist-client/activities/activity-book-edit.js.map +1 -0
- package/dist-client/activities/activity-book-view.d.ts +14 -0
- package/dist-client/activities/activity-book-view.js +85 -0
- package/dist-client/activities/activity-book-view.js.map +1 -0
- package/dist-client/activities/activity-expense-edit.d.ts +14 -0
- package/dist-client/activities/activity-expense-edit.js +85 -0
- package/dist-client/activities/activity-expense-edit.js.map +1 -0
- package/dist-client/activities/activity-expense-view.d.ts +14 -0
- package/dist-client/activities/activity-expense-view.js +85 -0
- package/dist-client/activities/activity-expense-view.js.map +1 -0
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +2 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/account/account-importer.d.ts +22 -0
- package/dist-client/pages/account/account-importer.js +100 -0
- package/dist-client/pages/account/account-importer.js.map +1 -0
- package/dist-client/pages/account/account-list-page.d.ts +62 -0
- package/dist-client/pages/account/account-list-page.js +326 -0
- package/dist-client/pages/account/account-list-page.js.map +1 -0
- package/dist-client/pages/accounting-category/accounting-category-importer.d.ts +22 -0
- package/dist-client/pages/accounting-category/accounting-category-importer.js +100 -0
- package/dist-client/pages/accounting-category/accounting-category-importer.js.map +1 -0
- package/dist-client/pages/accounting-category/accounting-category-list-page.d.ts +62 -0
- package/dist-client/pages/accounting-category/accounting-category-list-page.js +326 -0
- package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -0
- package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +22 -0
- package/dist-client/pages/financial-statement/financial-statement-importer.js +100 -0
- package/dist-client/pages/financial-statement/financial-statement-importer.js.map +1 -0
- package/dist-client/pages/financial-statement/financial-statement-list-page.d.ts +62 -0
- package/dist-client/pages/financial-statement/financial-statement-list-page.js +326 -0
- package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +1 -0
- package/dist-client/pages/income-statement/income-statement-importer.d.ts +22 -0
- package/dist-client/pages/income-statement/income-statement-importer.js +100 -0
- package/dist-client/pages/income-statement/income-statement-importer.js.map +1 -0
- package/dist-client/pages/income-statement/income-statement-list-page.d.ts +62 -0
- package/dist-client/pages/income-statement/income-statement-list-page.js +326 -0
- package/dist-client/pages/income-statement/income-statement-list-page.js.map +1 -0
- package/dist-client/pages/ledger/ledger-importer.d.ts +22 -0
- package/dist-client/pages/ledger/ledger-importer.js +100 -0
- package/dist-client/pages/ledger/ledger-importer.js.map +1 -0
- package/dist-client/pages/ledger/ledger-list-page.d.ts +62 -0
- package/dist-client/pages/ledger/ledger-list-page.js +317 -0
- package/dist-client/pages/ledger/ledger-list-page.js.map +1 -0
- package/dist-client/pages/main.d.ts +1 -0
- package/dist-client/pages/main.js +27 -0
- package/dist-client/pages/main.js.map +1 -0
- package/dist-client/pages/transaction/transaction-importer.d.ts +22 -0
- package/dist-client/pages/transaction/transaction-importer.js +100 -0
- package/dist-client/pages/transaction/transaction-importer.js.map +1 -0
- package/dist-client/pages/transaction/transaction-list-page.d.ts +62 -0
- package/dist-client/pages/transaction/transaction-list-page.js +326 -0
- package/dist-client/pages/transaction/transaction-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +23 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/activities/activity-book.js +150 -0
- package/dist-server/activities/activity-book.js.map +1 -0
- package/dist-server/activities/activity-expense.js +150 -0
- package/dist-server/activities/activity-expense.js.map +1 -0
- package/dist-server/activities/index.js +19 -0
- package/dist-server/activities/index.js.map +1 -0
- package/dist-server/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/index.js +7 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/middlewares/index.js +8 -0
- package/dist-server/middlewares/index.js.map +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.js +25 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/account/account-history.js +113 -0
- package/dist-server/service/account/account-history.js.map +1 -0
- package/dist-server/service/account/account-mutation.js +130 -0
- package/dist-server/service/account/account-mutation.js.map +1 -0
- package/dist-server/service/account/account-query.js +79 -0
- package/dist-server/service/account/account-query.js.map +1 -0
- package/dist-server/service/account/account-type.js +65 -0
- package/dist-server/service/account/account-type.js.map +1 -0
- package/dist-server/service/account/account.js +102 -0
- package/dist-server/service/account/account.js.map +1 -0
- package/dist-server/service/account/event-subscriber.js +21 -0
- package/dist-server/service/account/event-subscriber.js.map +1 -0
- package/dist-server/service/account/index.js +12 -0
- package/dist-server/service/account/index.js.map +1 -0
- package/dist-server/service/accounting-category/accounting-category-mutation.js +132 -0
- package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -0
- package/dist-server/service/accounting-category/accounting-category-query.js +79 -0
- package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -0
- package/dist-server/service/accounting-category/accounting-category-type.js +65 -0
- package/dist-server/service/accounting-category/accounting-category-type.js.map +1 -0
- package/dist-server/service/accounting-category/accounting-category.js +89 -0
- package/dist-server/service/accounting-category/accounting-category.js.map +1 -0
- package/dist-server/service/accounting-category/index.js +10 -0
- package/dist-server/service/accounting-category/index.js.map +1 -0
- package/dist-server/service/financial-statement/event-subscriber.js +21 -0
- package/dist-server/service/financial-statement/event-subscriber.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement-history.js +126 -0
- package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement-mutation.js +132 -0
- package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement-query.js +79 -0
- package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement-type.js +77 -0
- package/dist-server/service/financial-statement/financial-statement-type.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement.js +111 -0
- package/dist-server/service/financial-statement/financial-statement.js.map +1 -0
- package/dist-server/service/financial-statement/index.js +12 -0
- package/dist-server/service/financial-statement/index.js.map +1 -0
- package/dist-server/service/income-statement/event-subscriber.js +21 -0
- package/dist-server/service/income-statement/event-subscriber.js.map +1 -0
- package/dist-server/service/income-statement/income-statement-history.js +126 -0
- package/dist-server/service/income-statement/income-statement-history.js.map +1 -0
- package/dist-server/service/income-statement/income-statement-mutation.js +132 -0
- package/dist-server/service/income-statement/income-statement-mutation.js.map +1 -0
- package/dist-server/service/income-statement/income-statement-query.js +79 -0
- package/dist-server/service/income-statement/income-statement-query.js.map +1 -0
- package/dist-server/service/income-statement/income-statement-type.js +77 -0
- package/dist-server/service/income-statement/income-statement-type.js.map +1 -0
- package/dist-server/service/income-statement/income-statement.js +117 -0
- package/dist-server/service/income-statement/income-statement.js.map +1 -0
- package/dist-server/service/income-statement/index.js +12 -0
- package/dist-server/service/income-statement/index.js.map +1 -0
- package/dist-server/service/index.js +43 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/transaction/event-subscriber.js +21 -0
- package/dist-server/service/transaction/event-subscriber.js.map +1 -0
- package/dist-server/service/transaction/index.js +12 -0
- package/dist-server/service/transaction/index.js.map +1 -0
- package/dist-server/service/transaction/transaction-history.js +123 -0
- package/dist-server/service/transaction/transaction-history.js.map +1 -0
- package/dist-server/service/transaction/transaction-mutation.js +130 -0
- package/dist-server/service/transaction/transaction-mutation.js.map +1 -0
- package/dist-server/service/transaction/transaction-query.js +79 -0
- package/dist-server/service/transaction/transaction-query.js.map +1 -0
- package/dist-server/service/transaction/transaction-type.js +73 -0
- package/dist-server/service/transaction/transaction-type.js.map +1 -0
- package/dist-server/service/transaction/transaction.js +130 -0
- package/dist-server/service/transaction/transaction.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/helps/accounting/account.md +160 -0
- package/helps/accounting/accounting-category.md +160 -0
- package/helps/accounting/financial-accounting.md +53 -0
- package/helps/accounting/financial-statement.md +160 -0
- package/helps/accounting/income-statement.md +160 -0
- package/helps/accounting/transaction.md +160 -0
- package/package.json +36 -0
- package/server/activities/activity-book.ts +149 -0
- package/server/activities/activity-expense.ts +149 -0
- package/server/activities/index.ts +19 -0
- package/server/controllers/index.ts +0 -0
- package/server/index.ts +4 -0
- package/server/middlewares/index.ts +3 -0
- package/server/migrations/index.ts +9 -0
- package/server/routes.ts +28 -0
- package/server/service/account/account-history.ts +103 -0
- package/server/service/account/account-mutation.ts +137 -0
- package/server/service/account/account-query.ts +49 -0
- package/server/service/account/account-type.ts +44 -0
- package/server/service/account/account.ts +86 -0
- package/server/service/account/event-subscriber.ts +17 -0
- package/server/service/account/index.ts +9 -0
- package/server/service/accounting-category/accounting-category-mutation.ts +145 -0
- package/server/service/accounting-category/accounting-category-query.ts +51 -0
- package/server/service/accounting-category/accounting-category-type.ts +42 -0
- package/server/service/accounting-category/accounting-category.ts +80 -0
- package/server/service/accounting-category/index.ts +7 -0
- package/server/service/financial-statement/event-subscriber.ts +17 -0
- package/server/service/financial-statement/financial-statement-history.ts +114 -0
- package/server/service/financial-statement/financial-statement-mutation.ts +145 -0
- package/server/service/financial-statement/financial-statement-query.ts +51 -0
- package/server/service/financial-statement/financial-statement-type.ts +51 -0
- package/server/service/financial-statement/financial-statement.ts +100 -0
- package/server/service/financial-statement/index.ts +9 -0
- package/server/service/income-statement/event-subscriber.ts +17 -0
- package/server/service/income-statement/income-statement-history.ts +114 -0
- package/server/service/income-statement/income-statement-mutation.ts +145 -0
- package/server/service/income-statement/income-statement-query.ts +48 -0
- package/server/service/income-statement/income-statement-type.ts +51 -0
- package/server/service/income-statement/income-statement.ts +105 -0
- package/server/service/income-statement/index.ts +9 -0
- package/server/service/index.ts +62 -0
- package/server/service/transaction/event-subscriber.ts +17 -0
- package/server/service/transaction/index.ts +9 -0
- package/server/service/transaction/transaction-history.ts +111 -0
- package/server/service/transaction/transaction-mutation.ts +143 -0
- package/server/service/transaction/transaction-query.ts +48 -0
- package/server/service/transaction/transaction-type.ts +48 -0
- package/server/service/transaction/transaction.ts +115 -0
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +16 -0
- package/translations/en.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancialStatementHistory = 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 financial_statement_1 = require("./financial-statement");
|
|
12
|
+
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
13
|
+
const DATABASE_TYPE = ORMCONFIG.type;
|
|
14
|
+
let FinancialStatementHistory = class FinancialStatementHistory {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.version = 1;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
22
|
+
tslib_1.__metadata("design:type", String)
|
|
23
|
+
], FinancialStatementHistory.prototype, "id", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ nullable: true, default: 1 }),
|
|
26
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
27
|
+
tslib_1.__metadata("design:type", Number)
|
|
28
|
+
], FinancialStatementHistory.prototype, "version", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
31
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
32
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
33
|
+
], FinancialStatementHistory.prototype, "domain", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.RelationId)((financialStatement) => financialStatement.domain),
|
|
36
|
+
tslib_1.__metadata("design:type", String)
|
|
37
|
+
], FinancialStatementHistory.prototype, "domainId", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, typeorm_1.Column)(),
|
|
40
|
+
(0, type_graphql_1.Field)(),
|
|
41
|
+
tslib_1.__metadata("design:type", String)
|
|
42
|
+
], FinancialStatementHistory.prototype, "name", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
45
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], FinancialStatementHistory.prototype, "description", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
50
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
51
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
52
|
+
], FinancialStatementHistory.prototype, "active", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
56
|
+
tslib_1.__metadata("design:type", String)
|
|
57
|
+
], FinancialStatementHistory.prototype, "state", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
60
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
62
|
+
], FinancialStatementHistory.prototype, "params", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
|
+
tslib_1.__metadata("design:type", Date)
|
|
67
|
+
], FinancialStatementHistory.prototype, "createdAt", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
70
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
71
|
+
tslib_1.__metadata("design:type", Date)
|
|
72
|
+
], FinancialStatementHistory.prototype, "updatedAt", void 0);
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
75
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
76
|
+
tslib_1.__metadata("design:type", Date)
|
|
77
|
+
], FinancialStatementHistory.prototype, "deletedAt", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
80
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
81
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
82
|
+
], FinancialStatementHistory.prototype, "creator", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, typeorm_1.RelationId)((financialStatement) => financialStatement.creator),
|
|
85
|
+
tslib_1.__metadata("design:type", String)
|
|
86
|
+
], FinancialStatementHistory.prototype, "creatorId", void 0);
|
|
87
|
+
tslib_1.__decorate([
|
|
88
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
89
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
90
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
91
|
+
], FinancialStatementHistory.prototype, "updater", void 0);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, typeorm_1.RelationId)((financialStatement) => financialStatement.updater),
|
|
94
|
+
tslib_1.__metadata("design:type", String)
|
|
95
|
+
], FinancialStatementHistory.prototype, "updaterId", void 0);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, typeorm_history_1.HistoryOriginalIdColumn)(),
|
|
98
|
+
tslib_1.__metadata("design:type", String)
|
|
99
|
+
], FinancialStatementHistory.prototype, "originalId", void 0);
|
|
100
|
+
tslib_1.__decorate([
|
|
101
|
+
(0, typeorm_history_1.HistoryActionColumn)({
|
|
102
|
+
nullable: false,
|
|
103
|
+
type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
104
|
+
? 'enum'
|
|
105
|
+
: DATABASE_TYPE == 'oracle'
|
|
106
|
+
? 'varchar2'
|
|
107
|
+
: 'smallint',
|
|
108
|
+
enum: typeorm_history_1.HistoryActionType
|
|
109
|
+
}),
|
|
110
|
+
tslib_1.__metadata("design:type", String)
|
|
111
|
+
], FinancialStatementHistory.prototype, "action", void 0);
|
|
112
|
+
FinancialStatementHistory = tslib_1.__decorate([
|
|
113
|
+
(0, typeorm_1.Entity)(),
|
|
114
|
+
(0, typeorm_1.Index)('ix_financial-statement_history_0', (financialStatementHistory) => [
|
|
115
|
+
financialStatementHistory.originalId,
|
|
116
|
+
financialStatementHistory.version
|
|
117
|
+
], { unique: true }),
|
|
118
|
+
(0, typeorm_1.Index)('ix_financial-statement_history_1', (financialStatementHistory) => [
|
|
119
|
+
financialStatementHistory.domain,
|
|
120
|
+
financialStatementHistory.originalId,
|
|
121
|
+
financialStatementHistory.version
|
|
122
|
+
], { unique: true }),
|
|
123
|
+
(0, type_graphql_1.ObjectType)({ description: 'History Entity of FinancialStatement' })
|
|
124
|
+
], FinancialStatementHistory);
|
|
125
|
+
exports.FinancialStatementHistory = FinancialStatementHistory;
|
|
126
|
+
//# sourceMappingURL=financial-statement-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"financial-statement-history.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,+DAAoF;AAEpF,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAqB7B,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAA/B;QAOL,YAAO,GAAY,CAAC,CAAA;IAqEtB,CAAC;CAAA,CAAA;AA3EC;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AAC,CAAC,UAAU;QAChB,IAAI,EAAE,mCAAiB;KACxB,CAAC;;yDAC+B;AA3EtB,yBAAyB;IAnBrC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,kCAAkC,EAClC,CAAC,yBAAoD,EAAE,EAAE,CAAC;QACxD,yBAAyB,CAAC,UAAU;QACpC,yBAAyB,CAAC,OAAO;KAClC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,kCAAkC,EAClC,CAAC,yBAAoD,EAAE,EAAE,CAAC;QACxD,yBAAyB,CAAC,MAAM;QAChC,yBAAyB,CAAC,UAAU;QACpC,yBAAyB,CAAC,OAAO;KAClC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;GACvD,yBAAyB,CA4ErC;AA5EY,8DAAyB","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { FinancialStatement, FinancialStatementStatus } from './financial-statement'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_financial-statement_history_0',\n (financialStatementHistory: FinancialStatementHistory) => [\n financialStatementHistory.originalId,\n financialStatementHistory.version\n ],\n { unique: true }\n)\n@Index(\n 'ix_financial-statement_history_1',\n (financialStatementHistory: FinancialStatementHistory) => [\n financialStatementHistory.domain,\n financialStatementHistory.originalId,\n financialStatementHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of FinancialStatement' })\nexport class FinancialStatementHistory implements HistoryEntityInterface<FinancialStatement> {\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((financialStatement: FinancialStatement) => financialStatement.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: FinancialStatementStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\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((financialStatement: FinancialStatement) => financialStatement.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.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 : 'smallint',\n enum: HistoryActionType\n })\n public action!: HistoryActionType\n}\n"]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancialStatementMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
8
|
+
const financial_statement_1 = require("./financial-statement");
|
|
9
|
+
const financial_statement_type_1 = require("./financial-statement-type");
|
|
10
|
+
let FinancialStatementMutation = class FinancialStatementMutation {
|
|
11
|
+
async createFinancialStatement(financialStatement, context) {
|
|
12
|
+
const { domain, user, tx } = context.state;
|
|
13
|
+
const result = await tx.getRepository(financial_statement_1.FinancialStatement).save(Object.assign(Object.assign({}, financialStatement), { domain, creator: user, updater: user }));
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
async updateFinancialStatement(id, patch, context) {
|
|
17
|
+
const { domain, user, tx } = context.state;
|
|
18
|
+
const repository = tx.getRepository(financial_statement_1.FinancialStatement);
|
|
19
|
+
const financialStatement = await repository.findOne({
|
|
20
|
+
where: { domain: { id: domain.id }, id }
|
|
21
|
+
});
|
|
22
|
+
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, financialStatement), patch), { updater: user }));
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
async updateMultipleFinancialStatement(patches, context) {
|
|
26
|
+
const { domain, user, tx } = context.state;
|
|
27
|
+
let results = [];
|
|
28
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
29
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
30
|
+
const financialStatementRepo = tx.getRepository(financial_statement_1.FinancialStatement);
|
|
31
|
+
if (_createRecords.length > 0) {
|
|
32
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
33
|
+
const newRecord = _createRecords[i];
|
|
34
|
+
const result = await financialStatementRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
35
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (_updateRecords.length > 0) {
|
|
39
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
40
|
+
const updateRecord = _updateRecords[i];
|
|
41
|
+
const financialStatement = await financialStatementRepo.findOneBy({ id: updateRecord.id });
|
|
42
|
+
const result = await financialStatementRepo.save(Object.assign(Object.assign(Object.assign({}, financialStatement), updateRecord), { updater: user }));
|
|
43
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return results;
|
|
47
|
+
}
|
|
48
|
+
async deleteFinancialStatement(id, context) {
|
|
49
|
+
const { domain, tx } = context.state;
|
|
50
|
+
await tx.getRepository(financial_statement_1.FinancialStatement).delete({ domain: { id: domain.id }, id });
|
|
51
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
async deleteFinancialStatements(ids, context) {
|
|
55
|
+
const { domain, tx } = context.state;
|
|
56
|
+
await tx.getRepository(financial_statement_1.FinancialStatement).delete({
|
|
57
|
+
domain: { id: domain.id },
|
|
58
|
+
id: (0, typeorm_1.In)(ids)
|
|
59
|
+
});
|
|
60
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: ids }, context);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
async importFinancialStatements(financialStatements, context) {
|
|
64
|
+
const { domain, tx } = context.state;
|
|
65
|
+
await Promise.all(financialStatements.map(async (financialStatement) => {
|
|
66
|
+
const createdFinancialStatement = await tx
|
|
67
|
+
.getRepository(financial_statement_1.FinancialStatement)
|
|
68
|
+
.save(Object.assign({ domain }, financialStatement));
|
|
69
|
+
}));
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
75
|
+
(0, type_graphql_1.Mutation)(returns => financial_statement_1.FinancialStatement, { description: 'To create new FinancialStatement' }),
|
|
76
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('financialStatement')),
|
|
77
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
78
|
+
tslib_1.__metadata("design:type", Function),
|
|
79
|
+
tslib_1.__metadata("design:paramtypes", [financial_statement_type_1.NewFinancialStatement, Object]),
|
|
80
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
81
|
+
], FinancialStatementMutation.prototype, "createFinancialStatement", null);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
84
|
+
(0, type_graphql_1.Mutation)(returns => financial_statement_1.FinancialStatement, { description: 'To modify FinancialStatement information' }),
|
|
85
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
86
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
87
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
88
|
+
tslib_1.__metadata("design:type", Function),
|
|
89
|
+
tslib_1.__metadata("design:paramtypes", [String, financial_statement_type_1.FinancialStatementPatch, Object]),
|
|
90
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
91
|
+
], FinancialStatementMutation.prototype, "updateFinancialStatement", null);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
94
|
+
(0, type_graphql_1.Mutation)(returns => [financial_statement_1.FinancialStatement], { description: "To modify multiple FinancialStatements' information" }),
|
|
95
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [financial_statement_type_1.FinancialStatementPatch])),
|
|
96
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
97
|
+
tslib_1.__metadata("design:type", Function),
|
|
98
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
99
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
100
|
+
], FinancialStatementMutation.prototype, "updateMultipleFinancialStatement", null);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
103
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete FinancialStatement' }),
|
|
104
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
105
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
106
|
+
tslib_1.__metadata("design:type", Function),
|
|
107
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
108
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
109
|
+
], FinancialStatementMutation.prototype, "deleteFinancialStatement", null);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
112
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple FinancialStatements' }),
|
|
113
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
114
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
115
|
+
tslib_1.__metadata("design:type", Function),
|
|
116
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
117
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
118
|
+
], FinancialStatementMutation.prototype, "deleteFinancialStatements", null);
|
|
119
|
+
tslib_1.__decorate([
|
|
120
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
121
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple FinancialStatements' }),
|
|
122
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('financialStatements', type => [financial_statement_type_1.FinancialStatementPatch])),
|
|
123
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
124
|
+
tslib_1.__metadata("design:type", Function),
|
|
125
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
126
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
127
|
+
], FinancialStatementMutation.prototype, "importFinancialStatements", null);
|
|
128
|
+
FinancialStatementMutation = tslib_1.__decorate([
|
|
129
|
+
(0, type_graphql_1.Resolver)(financial_statement_1.FinancialStatement)
|
|
130
|
+
], FinancialStatementMutation);
|
|
131
|
+
exports.FinancialStatementMutation = FinancialStatementMutation;
|
|
132
|
+
//# sourceMappingURL=financial-statement-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"financial-statement-mutation.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,+DAA0D;AAC1D,yEAA2F;AAGpF,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAG/B,AAAN,KAAK,CAAC,wBAAwB,CACD,kBAAyC,EAC7D,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,wCAAkB,CAAC,CAAC,IAAI,iCACzD,kBAAkB,KACrB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,wBAAwB,CACjB,EAAU,EACP,KAA8B,EACrC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,wCAAkB,CAAC,CAAA;QACvD,MAAM,kBAAkB,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAClD,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,+CAC/B,kBAAkB,GAClB,KAAK,KACR,OA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AAC,CAAC,kDAAuB,CAAC,CAAC,CAAA;IACjD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;kFAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0EAO3D;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAErF,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2EAYP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAErF,mBAAA,IAAA,kBAAG,EAAC,qBAAqB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kDAAuB,CAAC,CAAC,CAAA;IAC7D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2EAaP;AAtIU,0BAA0B;IADtC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,0BAA0B,CAuItC;AAvIY,gEAA0B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { FinancialStatement } from './financial-statement'\nimport { NewFinancialStatement, FinancialStatementPatch } from './financial-statement-type'\n\n@Resolver(FinancialStatement)\nexport class FinancialStatementMutation {\n @Directive('@transaction')\n @Mutation(returns => FinancialStatement, { description: 'To create new FinancialStatement' })\n async createFinancialStatement(\n @Arg('financialStatement') financialStatement: NewFinancialStatement,\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(FinancialStatement).save({\n ...financialStatement,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => FinancialStatement, { description: 'To modify FinancialStatement information' })\n async updateFinancialStatement(\n @Arg('id') id: string,\n @Arg('patch') patch: FinancialStatementPatch,\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(FinancialStatement)\n const financialStatement = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...financialStatement,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [FinancialStatement], { description: \"To modify multiple FinancialStatements' information\" })\n async updateMultipleFinancialStatement(\n @Arg('patches', type => [FinancialStatementPatch]) patches: FinancialStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement[]> {\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 financialStatementRepo = tx.getRepository(FinancialStatement)\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 financialStatementRepo.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 financialStatement = await financialStatementRepo.findOneBy({ id: updateRecord.id })\n\n const result = await financialStatementRepo.save({\n ...financialStatement,\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 @Mutation(returns => Boolean, { description: 'To delete FinancialStatement' })\n async deleteFinancialStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(FinancialStatement).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple FinancialStatements' })\n async deleteFinancialStatements(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(FinancialStatement).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple FinancialStatements' })\n async importFinancialStatements(\n @Arg('financialStatements', type => [FinancialStatementPatch]) financialStatements: FinancialStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n financialStatements.map(async (financialStatement: FinancialStatementPatch) => {\n const createdFinancialStatement: FinancialStatement = await tx\n .getRepository(FinancialStatement)\n .save({ domain, ...financialStatement })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancialStatementQuery = 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 financial_statement_1 = require("./financial-statement");
|
|
9
|
+
const financial_statement_type_1 = require("./financial-statement-type");
|
|
10
|
+
let FinancialStatementQuery = class FinancialStatementQuery {
|
|
11
|
+
async financialStatement(id, context) {
|
|
12
|
+
const { domain } = context.state;
|
|
13
|
+
return await (0, shell_1.getRepository)(financial_statement_1.FinancialStatement).findOne({
|
|
14
|
+
where: { domain: { id: domain.id }, id }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async financialStatements(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)(financial_statement_1.FinancialStatement),
|
|
23
|
+
searchables: ['name', 'description']
|
|
24
|
+
});
|
|
25
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
26
|
+
return { items, total };
|
|
27
|
+
}
|
|
28
|
+
async domain(financialStatement) {
|
|
29
|
+
return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: financialStatement.domainId });
|
|
30
|
+
}
|
|
31
|
+
async updater(financialStatement) {
|
|
32
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: financialStatement.updaterId });
|
|
33
|
+
}
|
|
34
|
+
async creator(financialStatement) {
|
|
35
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: financialStatement.creatorId });
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, type_graphql_1.Query)(returns => financial_statement_1.FinancialStatement, { nullable: true, description: 'To fetch a FinancialStatement' }),
|
|
40
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
41
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
42
|
+
tslib_1.__metadata("design:type", Function),
|
|
43
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
44
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
45
|
+
], FinancialStatementQuery.prototype, "financialStatement", null);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.Query)(returns => financial_statement_type_1.FinancialStatementList, { description: 'To fetch multiple FinancialStatements' }),
|
|
48
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
49
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
50
|
+
tslib_1.__metadata("design:type", Function),
|
|
51
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
52
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
53
|
+
], FinancialStatementQuery.prototype, "financialStatements", null);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
56
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
57
|
+
tslib_1.__metadata("design:type", Function),
|
|
58
|
+
tslib_1.__metadata("design:paramtypes", [financial_statement_1.FinancialStatement]),
|
|
59
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
60
|
+
], FinancialStatementQuery.prototype, "domain", null);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
63
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
64
|
+
tslib_1.__metadata("design:type", Function),
|
|
65
|
+
tslib_1.__metadata("design:paramtypes", [financial_statement_1.FinancialStatement]),
|
|
66
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
67
|
+
], FinancialStatementQuery.prototype, "updater", null);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
70
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
71
|
+
tslib_1.__metadata("design:type", Function),
|
|
72
|
+
tslib_1.__metadata("design:paramtypes", [financial_statement_1.FinancialStatement]),
|
|
73
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
74
|
+
], FinancialStatementQuery.prototype, "creator", null);
|
|
75
|
+
FinancialStatementQuery = tslib_1.__decorate([
|
|
76
|
+
(0, type_graphql_1.Resolver)(financial_statement_1.FinancialStatement)
|
|
77
|
+
], FinancialStatementQuery);
|
|
78
|
+
exports.FinancialStatementQuery = FinancialStatementQuery;
|
|
79
|
+
//# sourceMappingURL=financial-statement-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"financial-statement-query.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,+DAA0D;AAC1D,yEAAmE;AAG5D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAE5B,AAAN,KAAK,CAAC,kBAAkB,CAAY,EAAU,EAAS,OAAwB;QAC7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC,CAAC,OAAO,CAAC;YACrD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,mBAAmB,CACf,MAAiB,EAClB,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC;YACnD,WAAW,EAAE,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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E,CAAA;;6CAAqB,wCAAkB;;sDAE3D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;sDAE3D;AA1CU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,uBAAuB,CA2CnC;AA3CY,0DAAuB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { FinancialStatement } from './financial-statement'\nimport { FinancialStatementList } from './financial-statement-type'\n\n@Resolver(FinancialStatement)\nexport class FinancialStatementQuery {\n @Query(returns => FinancialStatement!, { nullable: true, description: 'To fetch a FinancialStatement' })\n async financialStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<FinancialStatement> {\n const { domain } = context.state\n\n return await getRepository(FinancialStatement).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => FinancialStatementList, { description: 'To fetch multiple FinancialStatements' })\n async financialStatements(\n @Args() params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatementList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(FinancialStatement),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() financialStatement: FinancialStatement): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: financialStatement.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() financialStatement: FinancialStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: financialStatement.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() financialStatement: FinancialStatement): Promise<User> {\n return await getRepository(User).findOneBy({ id: financialStatement.creatorId })\n }\n}\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancialStatementList = exports.FinancialStatementPatch = exports.NewFinancialStatement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const financial_statement_1 = require("./financial-statement");
|
|
7
|
+
let NewFinancialStatement = class NewFinancialStatement {
|
|
8
|
+
};
|
|
9
|
+
tslib_1.__decorate([
|
|
10
|
+
(0, type_graphql_1.Field)(),
|
|
11
|
+
tslib_1.__metadata("design:type", String)
|
|
12
|
+
], NewFinancialStatement.prototype, "name", void 0);
|
|
13
|
+
tslib_1.__decorate([
|
|
14
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
16
|
+
], NewFinancialStatement.prototype, "description", void 0);
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, type_graphql_1.Field)(type => financial_statement_1.FinancialStatementStatus, { nullable: true }),
|
|
19
|
+
tslib_1.__metadata("design:type", String)
|
|
20
|
+
], NewFinancialStatement.prototype, "state", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
23
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
24
|
+
], NewFinancialStatement.prototype, "active", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
27
|
+
tslib_1.__metadata("design:type", String)
|
|
28
|
+
], NewFinancialStatement.prototype, "params", void 0);
|
|
29
|
+
NewFinancialStatement = tslib_1.__decorate([
|
|
30
|
+
(0, type_graphql_1.InputType)()
|
|
31
|
+
], NewFinancialStatement);
|
|
32
|
+
exports.NewFinancialStatement = NewFinancialStatement;
|
|
33
|
+
let FinancialStatementPatch = class FinancialStatementPatch {
|
|
34
|
+
};
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], FinancialStatementPatch.prototype, "id", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
41
|
+
tslib_1.__metadata("design:type", String)
|
|
42
|
+
], FinancialStatementPatch.prototype, "name", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
+
tslib_1.__metadata("design:type", String)
|
|
46
|
+
], FinancialStatementPatch.prototype, "description", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, type_graphql_1.Field)(type => financial_statement_1.FinancialStatementStatus, { nullable: true }),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], FinancialStatementPatch.prototype, "state", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
53
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
54
|
+
], FinancialStatementPatch.prototype, "active", void 0);
|
|
55
|
+
tslib_1.__decorate([
|
|
56
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
57
|
+
tslib_1.__metadata("design:type", String)
|
|
58
|
+
], FinancialStatementPatch.prototype, "cuFlag", void 0);
|
|
59
|
+
FinancialStatementPatch = tslib_1.__decorate([
|
|
60
|
+
(0, type_graphql_1.InputType)()
|
|
61
|
+
], FinancialStatementPatch);
|
|
62
|
+
exports.FinancialStatementPatch = FinancialStatementPatch;
|
|
63
|
+
let FinancialStatementList = class FinancialStatementList {
|
|
64
|
+
};
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, type_graphql_1.Field)(type => [financial_statement_1.FinancialStatement]),
|
|
67
|
+
tslib_1.__metadata("design:type", Array)
|
|
68
|
+
], FinancialStatementList.prototype, "items", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
71
|
+
tslib_1.__metadata("design:type", Number)
|
|
72
|
+
], FinancialStatementList.prototype, "total", void 0);
|
|
73
|
+
FinancialStatementList = tslib_1.__decorate([
|
|
74
|
+
(0, type_graphql_1.ObjectType)()
|
|
75
|
+
], FinancialStatementList);
|
|
76
|
+
exports.FinancialStatementList = FinancialStatementList;
|
|
77
|
+
//# sourceMappingURL=financial-statement-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"financial-statement-type.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAEtF,+DAAoF;AAG7E,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAejC,CAAA;AAdC;IAAC,IAAA,oBAAK,GAAE;;mDACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8CAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDAC5B;AAEhC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACX;AAdJ,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CAejC;AAfY,sDAAqB;AAkB3B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAkBnC,CAAA;AAjBC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8CAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAC5B;AAEhC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACX;AAjBJ,uBAAuB;IADnC,IAAA,wBAAS,GAAE;GACC,uBAAuB,CAkBnC;AAlBY,0DAAuB;AAqB7B,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAMlC,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wCAAkB,CAAC,CAAC;;qDACT;AAE3B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;qDACN;AALF,sBAAsB;IADlC,IAAA,yBAAU,GAAE;GACA,sBAAsB,CAMlC;AANY,wDAAsB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { FinancialStatement, FinancialStatementStatus } from './financial-statement'\n\n@InputType()\nexport class NewFinancialStatement {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => FinancialStatementStatus, { nullable: true })\n state?: FinancialStatementStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class FinancialStatementPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => FinancialStatementStatus, { nullable: true })\n state?: FinancialStatementStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class FinancialStatementList {\n @Field(type => [FinancialStatement])\n items: FinancialStatement[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancialStatement = exports.FinancialStatementStatus = 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
|
+
var FinancialStatementStatus;
|
|
10
|
+
(function (FinancialStatementStatus) {
|
|
11
|
+
FinancialStatementStatus["STATUS_A"] = "STATUS_A";
|
|
12
|
+
FinancialStatementStatus["STATUS_B"] = "STATUS_B";
|
|
13
|
+
})(FinancialStatementStatus = exports.FinancialStatementStatus || (exports.FinancialStatementStatus = {}));
|
|
14
|
+
(0, type_graphql_1.registerEnumType)(FinancialStatementStatus, {
|
|
15
|
+
name: 'FinancialStatementStatus',
|
|
16
|
+
description: 'state enumeration of a financialStatement'
|
|
17
|
+
});
|
|
18
|
+
let FinancialStatement = class FinancialStatement {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.version = 1;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
25
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
27
|
+
], FinancialStatement.prototype, "id", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, typeorm_1.VersionColumn)(),
|
|
30
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
31
|
+
tslib_1.__metadata("design:type", Number)
|
|
32
|
+
], FinancialStatement.prototype, "version", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
35
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
36
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
37
|
+
], FinancialStatement.prototype, "domain", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, typeorm_1.RelationId)((financialStatement) => financialStatement.domain),
|
|
40
|
+
tslib_1.__metadata("design:type", String)
|
|
41
|
+
], FinancialStatement.prototype, "domainId", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'fiscal year' }),
|
|
45
|
+
tslib_1.__metadata("design:type", Number)
|
|
46
|
+
], FinancialStatement.prototype, "year", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
49
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'fiscal quarter' }),
|
|
50
|
+
tslib_1.__metadata("design:type", Number)
|
|
51
|
+
], FinancialStatement.prototype, "quarter", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
54
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
55
|
+
tslib_1.__metadata("design:type", Number)
|
|
56
|
+
], FinancialStatement.prototype, "month", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
59
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
60
|
+
tslib_1.__metadata("design:type", Number)
|
|
61
|
+
], FinancialStatement.prototype, "asset", void 0);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
64
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
65
|
+
tslib_1.__metadata("design:type", Number)
|
|
66
|
+
], FinancialStatement.prototype, "liability", void 0);
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
69
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
70
|
+
tslib_1.__metadata("design:type", Number)
|
|
71
|
+
], FinancialStatement.prototype, "equity", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
74
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
75
|
+
tslib_1.__metadata("design:type", Date)
|
|
76
|
+
], FinancialStatement.prototype, "createdAt", void 0);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
79
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
80
|
+
tslib_1.__metadata("design:type", Date)
|
|
81
|
+
], FinancialStatement.prototype, "updatedAt", void 0);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
84
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
85
|
+
tslib_1.__metadata("design:type", Date)
|
|
86
|
+
], FinancialStatement.prototype, "deletedAt", void 0);
|
|
87
|
+
tslib_1.__decorate([
|
|
88
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
89
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
90
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
91
|
+
], FinancialStatement.prototype, "creator", void 0);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, typeorm_1.RelationId)((financialStatement) => financialStatement.creator),
|
|
94
|
+
tslib_1.__metadata("design:type", String)
|
|
95
|
+
], FinancialStatement.prototype, "creatorId", void 0);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
98
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
99
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
100
|
+
], FinancialStatement.prototype, "updater", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_1.RelationId)((financialStatement) => financialStatement.updater),
|
|
103
|
+
tslib_1.__metadata("design:type", String)
|
|
104
|
+
], FinancialStatement.prototype, "updaterId", void 0);
|
|
105
|
+
FinancialStatement = tslib_1.__decorate([
|
|
106
|
+
(0, typeorm_1.Entity)(),
|
|
107
|
+
(0, typeorm_1.Index)('ix_financial_statement_0', (financialStatement) => [financialStatement.domain, financialStatement.deletedAt], { unique: true }),
|
|
108
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for FinancialStatement' })
|
|
109
|
+
], FinancialStatement);
|
|
110
|
+
exports.FinancialStatement = FinancialStatement;
|
|
111
|
+
//# sourceMappingURL=financial-statement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"financial-statement.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,iDAAqB,CAAA;AACvB,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAED,IAAA,+BAAgB,EAAC,wBAAwB,EAAE;IACzC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,2CAA2C;CACzD,CAAC,CAAA;AASK,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAAxB;QAOL,YAAO,GAAY,CAAC,CAAA;IA0DtB,CAAC;CAAA,CAAA;AAhEC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,E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,CAAC,EACrG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CAiE9B;AAjEY,gDAAkB","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, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum FinancialStatementStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(FinancialStatementStatus, {\n name: 'FinancialStatementStatus',\n description: 'state enumeration of a financialStatement'\n})\n\n@Entity()\n@Index(\n 'ix_financial_statement_0',\n (financialStatement: FinancialStatement) => [financialStatement.domain, financialStatement.deletedAt],\n { unique: true }\n)\n@ObjectType({ description: 'Entity for FinancialStatement' })\nexport class FinancialStatement {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.domain)\n domainId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal year' })\n year?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'fiscal quarter' })\n quarter?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n month?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n asset?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n liability?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n equity?: number\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const financial_statement_1 = require("./financial-statement");
|
|
5
|
+
const financial_statement_history_1 = require("./financial-statement-history");
|
|
6
|
+
const financial_statement_query_1 = require("./financial-statement-query");
|
|
7
|
+
const financial_statement_mutation_1 = require("./financial-statement-mutation");
|
|
8
|
+
const event_subscriber_1 = require("./event-subscriber");
|
|
9
|
+
exports.entities = [financial_statement_1.FinancialStatement, financial_statement_history_1.FinancialStatementHistory];
|
|
10
|
+
exports.resolvers = [financial_statement_query_1.FinancialStatementQuery, financial_statement_mutation_1.FinancialStatementMutation];
|
|
11
|
+
exports.subscribers = [event_subscriber_1.FinancialStatementHistoryEntitySubscriber];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/financial-statement/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAC1D,+EAAyE;AACzE,2EAAqE;AACrE,iFAA2E;AAC3E,yDAA8E;AAEjE,QAAA,QAAQ,GAAG,CAAC,wCAAkB,EAAE,uDAAyB,CAAC,CAAA;AAC1D,QAAA,SAAS,GAAG,CAAC,mDAAuB,EAAE,yDAA0B,CAAC,CAAA;AACjE,QAAA,WAAW,GAAG,CAAC,4DAAyC,CAAC,CAAA","sourcesContent":["import { FinancialStatement } from './financial-statement'\nimport { FinancialStatementHistory } from './financial-statement-history'\nimport { FinancialStatementQuery } from './financial-statement-query'\nimport { FinancialStatementMutation } from './financial-statement-mutation'\nimport { FinancialStatementHistoryEntitySubscriber } from './event-subscriber'\n\nexport const entities = [FinancialStatement, FinancialStatementHistory]\nexport const resolvers = [FinancialStatementQuery, FinancialStatementMutation]\nexport const subscribers = [FinancialStatementHistoryEntitySubscriber]\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IncomeStatementHistoryEntitySubscriber = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const typeorm_history_1 = require("@operato/typeorm-history");
|
|
7
|
+
const income_statement_1 = require("./income-statement");
|
|
8
|
+
const income_statement_history_1 = require("./income-statement-history");
|
|
9
|
+
let IncomeStatementHistoryEntitySubscriber = class IncomeStatementHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
|
|
10
|
+
get entity() {
|
|
11
|
+
return income_statement_1.IncomeStatement;
|
|
12
|
+
}
|
|
13
|
+
get historyEntity() {
|
|
14
|
+
return income_statement_history_1.IncomeStatementHistory;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
IncomeStatementHistoryEntitySubscriber = tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.EventSubscriber)()
|
|
19
|
+
], IncomeStatementHistoryEntitySubscriber);
|
|
20
|
+
exports.IncomeStatementHistoryEntitySubscriber = IncomeStatementHistoryEntitySubscriber;
|
|
21
|
+
//# sourceMappingURL=event-subscriber.js.map
|