@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 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../server/service/account/account.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;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EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAChH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;GACrC,OAAO,CAgEnB;AAhEY,0BAAO","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'\nimport { AccountingCategory } from '../accounting-category/accounting-category'\n\n@Entity()\n@Index('ix_account_0', (account: Account) => [account.domain, account.name, account.deletedAt], { unique: true })\n@ObjectType({ description: 'Entity for Account' })\nexport class Account {\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((account: Account) => account.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true, description: 'Account control number' })\n controlNumber?: string\n\n @Column()\n @Field({ nullable: true, description: 'Account name' })\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(type => AccountingCategory, { nullable: true })\n category?: AccountingCategory\n\n @RelationId((account: Account) => account.category)\n categoryId?: string\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((account: Account) => account.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((account: Account) => account.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountHistoryEntitySubscriber = 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 account_1 = require("./account");
|
|
8
|
+
const account_history_1 = require("./account-history");
|
|
9
|
+
let AccountHistoryEntitySubscriber = class AccountHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
|
|
10
|
+
get entity() {
|
|
11
|
+
return account_1.Account;
|
|
12
|
+
}
|
|
13
|
+
get historyEntity() {
|
|
14
|
+
return account_history_1.AccountHistory;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
AccountHistoryEntitySubscriber = tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.EventSubscriber)()
|
|
19
|
+
], AccountHistoryEntitySubscriber);
|
|
20
|
+
exports.AccountHistoryEntitySubscriber = AccountHistoryEntitySubscriber;
|
|
21
|
+
//# sourceMappingURL=event-subscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/account/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,uCAAmC;AACnC,uDAAkD;AAG3C,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,yCAAgD;IAClG,IAAW,MAAM;QACf,OAAO,iBAAO,CAAA;IAChB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,gCAAc,CAAA;IACvB,CAAC;CACF,CAAA;AARY,8BAA8B;IAD1C,IAAA,yBAAe,GAAE;GACL,8BAA8B,CAQ1C;AARY,wEAA8B","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { Account } from './account'\nimport { AccountHistory } from './account-history'\n\n@EventSubscriber()\nexport class AccountHistoryEntitySubscriber extends HistoryEntitySubscriber<Account, AccountHistory> {\n public get entity() {\n return Account\n }\n\n public get historyEntity() {\n return AccountHistory\n }\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 account_1 = require("./account");
|
|
5
|
+
const account_history_1 = require("./account-history");
|
|
6
|
+
const account_query_1 = require("./account-query");
|
|
7
|
+
const account_mutation_1 = require("./account-mutation");
|
|
8
|
+
const event_subscriber_1 = require("./event-subscriber");
|
|
9
|
+
exports.entities = [account_1.Account, account_history_1.AccountHistory];
|
|
10
|
+
exports.resolvers = [account_query_1.AccountQuery, account_mutation_1.AccountMutation];
|
|
11
|
+
exports.subscribers = [event_subscriber_1.AccountHistoryEntitySubscriber];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/account/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,uDAAkD;AAClD,mDAA8C;AAC9C,yDAAoD;AACpD,yDAAmE;AAEtD,QAAA,QAAQ,GAAG,CAAC,iBAAO,EAAE,gCAAc,CAAC,CAAA;AACpC,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA;AAC3C,QAAA,WAAW,GAAG,CAAC,iDAA8B,CAAC,CAAA","sourcesContent":["import { Account } from './account'\nimport { AccountHistory } from './account-history'\nimport { AccountQuery } from './account-query'\nimport { AccountMutation } from './account-mutation'\nimport { AccountHistoryEntitySubscriber } from './event-subscriber'\n\nexport const entities = [Account, AccountHistory]\nexport const resolvers = [AccountQuery, AccountMutation]\nexport const subscribers = [AccountHistoryEntitySubscriber]\n"]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountingCategoryMutation = 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 accounting_category_1 = require("./accounting-category");
|
|
9
|
+
const accounting_category_type_1 = require("./accounting-category-type");
|
|
10
|
+
let AccountingCategoryMutation = class AccountingCategoryMutation {
|
|
11
|
+
async createAccountingCategory(accountingCategory, context) {
|
|
12
|
+
const { domain, user, tx } = context.state;
|
|
13
|
+
const result = await tx.getRepository(accounting_category_1.AccountingCategory).save(Object.assign(Object.assign({}, accountingCategory), { domain, creator: user, updater: user }));
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
async updateAccountingCategory(id, patch, context) {
|
|
17
|
+
const { domain, user, tx } = context.state;
|
|
18
|
+
const repository = tx.getRepository(accounting_category_1.AccountingCategory);
|
|
19
|
+
const accountingCategory = await repository.findOne({
|
|
20
|
+
where: { domain: { id: domain.id }, id }
|
|
21
|
+
});
|
|
22
|
+
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, accountingCategory), patch), { updater: user }));
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
async updateMultipleAccountingCategory(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 accountingCategoryRepo = tx.getRepository(accounting_category_1.AccountingCategory);
|
|
31
|
+
if (_createRecords.length > 0) {
|
|
32
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
33
|
+
const newRecord = _createRecords[i];
|
|
34
|
+
const result = await accountingCategoryRepo.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 accountingCategory = await accountingCategoryRepo.findOneBy({ id: updateRecord.id });
|
|
42
|
+
const result = await accountingCategoryRepo.save(Object.assign(Object.assign(Object.assign({}, accountingCategory), updateRecord), { updater: user }));
|
|
43
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return results;
|
|
47
|
+
}
|
|
48
|
+
async deleteAccountingCategory(id, context) {
|
|
49
|
+
const { domain, tx } = context.state;
|
|
50
|
+
await tx.getRepository(accounting_category_1.AccountingCategory).delete({ domain: { id: domain.id }, id });
|
|
51
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
async deleteAccountingCategories(ids, context) {
|
|
55
|
+
const { domain, tx } = context.state;
|
|
56
|
+
await tx.getRepository(accounting_category_1.AccountingCategory).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 importAccountingCategories(accountingCategories, context) {
|
|
64
|
+
const { domain, tx } = context.state;
|
|
65
|
+
await Promise.all(accountingCategories.map(async (accountingCategory) => {
|
|
66
|
+
const createdAccountingCategory = await tx
|
|
67
|
+
.getRepository(accounting_category_1.AccountingCategory)
|
|
68
|
+
.save(Object.assign({ domain }, accountingCategory));
|
|
69
|
+
}));
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
75
|
+
(0, type_graphql_1.Mutation)(returns => accounting_category_1.AccountingCategory, { description: 'To create new AccountingCategory' }),
|
|
76
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('accountingCategory')),
|
|
77
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
78
|
+
tslib_1.__metadata("design:type", Function),
|
|
79
|
+
tslib_1.__metadata("design:paramtypes", [accounting_category_type_1.NewAccountingCategory, Object]),
|
|
80
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
81
|
+
], AccountingCategoryMutation.prototype, "createAccountingCategory", null);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
84
|
+
(0, type_graphql_1.Mutation)(returns => accounting_category_1.AccountingCategory, { description: 'To modify AccountingCategory 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, accounting_category_type_1.AccountingCategoryPatch, Object]),
|
|
90
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
91
|
+
], AccountingCategoryMutation.prototype, "updateAccountingCategory", null);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
94
|
+
(0, type_graphql_1.Mutation)(returns => [accounting_category_1.AccountingCategory], { description: "To modify multiple AccountingCategories' information" }),
|
|
95
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [accounting_category_type_1.AccountingCategoryPatch])),
|
|
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
|
+
], AccountingCategoryMutation.prototype, "updateMultipleAccountingCategory", null);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
103
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete AccountingCategory' }),
|
|
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
|
+
], AccountingCategoryMutation.prototype, "deleteAccountingCategory", null);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
112
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple AccountingCategories' }),
|
|
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
|
+
], AccountingCategoryMutation.prototype, "deleteAccountingCategories", null);
|
|
119
|
+
tslib_1.__decorate([
|
|
120
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
121
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple AccountingCategories' }),
|
|
122
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('accountingCategories', type => [accounting_category_type_1.AccountingCategoryPatch])),
|
|
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
|
+
], AccountingCategoryMutation.prototype, "importAccountingCategories", null);
|
|
128
|
+
AccountingCategoryMutation = tslib_1.__decorate([
|
|
129
|
+
(0, type_graphql_1.Resolver)(accounting_category_1.AccountingCategory)
|
|
130
|
+
], AccountingCategoryMutation);
|
|
131
|
+
exports.AccountingCategoryMutation = AccountingCategoryMutation;
|
|
132
|
+
//# sourceMappingURL=accounting-category-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounting-category-mutation.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category-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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sBAAsB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kDAAuB,CAAC,CAAC,CAAA;IAC9D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4EAaP;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 { AccountingCategory } from './accounting-category'\nimport { NewAccountingCategory, AccountingCategoryPatch } from './accounting-category-type'\n\n@Resolver(AccountingCategory)\nexport class AccountingCategoryMutation {\n @Directive('@transaction')\n @Mutation(returns => AccountingCategory, { description: 'To create new AccountingCategory' })\n async createAccountingCategory(\n @Arg('accountingCategory') accountingCategory: NewAccountingCategory,\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategory> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(AccountingCategory).save({\n ...accountingCategory,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => AccountingCategory, { description: 'To modify AccountingCategory information' })\n async updateAccountingCategory(\n @Arg('id') id: string,\n @Arg('patch') patch: AccountingCategoryPatch,\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategory> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(AccountingCategory)\n const accountingCategory = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...accountingCategory,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [AccountingCategory], { description: \"To modify multiple AccountingCategories' information\" })\n async updateMultipleAccountingCategory(\n @Arg('patches', type => [AccountingCategoryPatch]) patches: AccountingCategoryPatch[],\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategory[]> {\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 accountingCategoryRepo = tx.getRepository(AccountingCategory)\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 accountingCategoryRepo.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 accountingCategory = await accountingCategoryRepo.findOneBy({ id: updateRecord.id })\n\n const result = await accountingCategoryRepo.save({\n ...accountingCategory,\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 AccountingCategory' })\n async deleteAccountingCategory(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(AccountingCategory).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 AccountingCategories' })\n async deleteAccountingCategories(\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(AccountingCategory).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 AccountingCategories' })\n async importAccountingCategories(\n @Arg('accountingCategories', type => [AccountingCategoryPatch]) accountingCategories: AccountingCategoryPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n accountingCategories.map(async (accountingCategory: AccountingCategoryPatch) => {\n const createdAccountingCategory: AccountingCategory = await tx\n .getRepository(AccountingCategory)\n .save({ domain, ...accountingCategory })\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.AccountingCategoryQuery = 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 accounting_category_1 = require("./accounting-category");
|
|
9
|
+
const accounting_category_type_1 = require("./accounting-category-type");
|
|
10
|
+
let AccountingCategoryQuery = class AccountingCategoryQuery {
|
|
11
|
+
async accountingCategory(id, context) {
|
|
12
|
+
const { domain } = context.state;
|
|
13
|
+
return await (0, shell_1.getRepository)(accounting_category_1.AccountingCategory).findOne({
|
|
14
|
+
where: { domain: { id: domain.id }, id }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async accountingCategories(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)(accounting_category_1.AccountingCategory),
|
|
23
|
+
searchables: ['name', 'description']
|
|
24
|
+
});
|
|
25
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
26
|
+
return { items, total };
|
|
27
|
+
}
|
|
28
|
+
async domain(accountingCategory) {
|
|
29
|
+
return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: accountingCategory.domainId });
|
|
30
|
+
}
|
|
31
|
+
async updater(accountingCategory) {
|
|
32
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: accountingCategory.updaterId });
|
|
33
|
+
}
|
|
34
|
+
async creator(accountingCategory) {
|
|
35
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: accountingCategory.creatorId });
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, type_graphql_1.Query)(returns => accounting_category_1.AccountingCategory, { nullable: true, description: 'To fetch a AccountingCategory' }),
|
|
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
|
+
], AccountingCategoryQuery.prototype, "accountingCategory", null);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.Query)(returns => accounting_category_type_1.AccountingCategoryList, { description: 'To fetch multiple AccountingCategories' }),
|
|
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
|
+
], AccountingCategoryQuery.prototype, "accountingCategories", 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", [accounting_category_1.AccountingCategory]),
|
|
59
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
60
|
+
], AccountingCategoryQuery.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", [accounting_category_1.AccountingCategory]),
|
|
66
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
67
|
+
], AccountingCategoryQuery.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", [accounting_category_1.AccountingCategory]),
|
|
73
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
74
|
+
], AccountingCategoryQuery.prototype, "creator", null);
|
|
75
|
+
AccountingCategoryQuery = tslib_1.__decorate([
|
|
76
|
+
(0, type_graphql_1.Resolver)(accounting_category_1.AccountingCategory)
|
|
77
|
+
], AccountingCategoryQuery);
|
|
78
|
+
exports.AccountingCategoryQuery = AccountingCategoryQuery;
|
|
79
|
+
//# sourceMappingURL=accounting-category-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounting-category-query.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category-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,EA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A;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iEAMrD;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iDAAsB,EAAE,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAEjG,mBAAA,IAAA,mBAAI,GAAE,CAAA;IACN,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADU,iBAAS;;mEAe1B;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;qDAE1D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,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 { AccountingCategory } from './accounting-category'\nimport { AccountingCategoryList } from './accounting-category-type'\n\n@Resolver(AccountingCategory)\nexport class AccountingCategoryQuery {\n @Query(returns => AccountingCategory!, { nullable: true, description: 'To fetch a AccountingCategory' })\n async accountingCategory(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<AccountingCategory> {\n const { domain } = context.state\n\n return await getRepository(AccountingCategory).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => AccountingCategoryList, { description: 'To fetch multiple AccountingCategories' })\n async accountingCategories(\n @Args() params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategoryList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(AccountingCategory),\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() accountingCategory: AccountingCategory): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: accountingCategory.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() accountingCategory: AccountingCategory): Promise<User> {\n return await getRepository(User).findOneBy({ id: accountingCategory.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() accountingCategory: AccountingCategory): Promise<User> {\n return await getRepository(User).findOneBy({ id: accountingCategory.creatorId })\n }\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountingCategoryList = exports.AccountingCategoryPatch = exports.NewAccountingCategory = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const accounting_category_1 = require("./accounting-category");
|
|
7
|
+
let NewAccountingCategory = class NewAccountingCategory {
|
|
8
|
+
};
|
|
9
|
+
tslib_1.__decorate([
|
|
10
|
+
(0, type_graphql_1.Field)(),
|
|
11
|
+
tslib_1.__metadata("design:type", String)
|
|
12
|
+
], NewAccountingCategory.prototype, "name", void 0);
|
|
13
|
+
tslib_1.__decorate([
|
|
14
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
16
|
+
], NewAccountingCategory.prototype, "description", void 0);
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
19
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
20
|
+
], NewAccountingCategory.prototype, "active", void 0);
|
|
21
|
+
NewAccountingCategory = tslib_1.__decorate([
|
|
22
|
+
(0, type_graphql_1.InputType)()
|
|
23
|
+
], NewAccountingCategory);
|
|
24
|
+
exports.NewAccountingCategory = NewAccountingCategory;
|
|
25
|
+
let AccountingCategoryPatch = class AccountingCategoryPatch {
|
|
26
|
+
};
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
30
|
+
], AccountingCategoryPatch.prototype, "id", void 0);
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
34
|
+
], AccountingCategoryPatch.prototype, "name", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], AccountingCategoryPatch.prototype, "description", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
41
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
42
|
+
], AccountingCategoryPatch.prototype, "active", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
+
tslib_1.__metadata("design:type", String)
|
|
46
|
+
], AccountingCategoryPatch.prototype, "cuFlag", void 0);
|
|
47
|
+
AccountingCategoryPatch = tslib_1.__decorate([
|
|
48
|
+
(0, type_graphql_1.InputType)()
|
|
49
|
+
], AccountingCategoryPatch);
|
|
50
|
+
exports.AccountingCategoryPatch = AccountingCategoryPatch;
|
|
51
|
+
let AccountingCategoryList = class AccountingCategoryList {
|
|
52
|
+
};
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, type_graphql_1.Field)(type => [accounting_category_1.AccountingCategory]),
|
|
55
|
+
tslib_1.__metadata("design:type", Array)
|
|
56
|
+
], AccountingCategoryList.prototype, "items", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
59
|
+
tslib_1.__metadata("design:type", Number)
|
|
60
|
+
], AccountingCategoryList.prototype, "total", void 0);
|
|
61
|
+
AccountingCategoryList = tslib_1.__decorate([
|
|
62
|
+
(0, type_graphql_1.ObjectType)()
|
|
63
|
+
], AccountingCategoryList);
|
|
64
|
+
exports.AccountingCategoryList = AccountingCategoryList;
|
|
65
|
+
//# sourceMappingURL=accounting-category-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounting-category-type.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAEtF,+DAA0D;AAGnD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CASjC,CAAA;AARC;IAAC,IAAA,oBAAK,GAAE;;mDACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACV;AARL,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CASjC;AATY,sDAAqB;AAY3B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAenC,CAAA;AAdC;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,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACX;AAdJ,uBAAuB;IADnC,IAAA,wBAAS,GAAE;GACC,uBAAuB,CAenC;AAfY,0DAAuB;AAkB7B,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 { AccountingCategory } from './accounting-category'\n\n@InputType()\nexport class NewAccountingCategory {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n}\n\n@InputType()\nexport class AccountingCategoryPatch {\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({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class AccountingCategoryList {\n @Field(type => [AccountingCategory])\n items: AccountingCategory[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var AccountingCategory_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AccountingCategory = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const type_graphql_1 = require("type-graphql");
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
9
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
10
|
+
let AccountingCategory = AccountingCategory_1 = class AccountingCategory {
|
|
11
|
+
};
|
|
12
|
+
tslib_1.__decorate([
|
|
13
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
14
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
16
|
+
], AccountingCategory.prototype, "id", void 0);
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
19
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
20
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
21
|
+
], AccountingCategory.prototype, "domain", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.RelationId)((accountingCategory) => accountingCategory.domain),
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
25
|
+
], AccountingCategory.prototype, "domainId", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, typeorm_1.Column)(),
|
|
28
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
30
|
+
], AccountingCategory.prototype, "name", void 0);
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
33
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
34
|
+
tslib_1.__metadata("design:type", String)
|
|
35
|
+
], AccountingCategory.prototype, "description", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
38
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
39
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
40
|
+
], AccountingCategory.prototype, "active", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.ManyToOne)(type => AccountingCategory_1, accountingCategory => accountingCategory.children, { nullable: true }),
|
|
43
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
44
|
+
tslib_1.__metadata("design:type", AccountingCategory)
|
|
45
|
+
], AccountingCategory.prototype, "parent", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.RelationId)((accountingCategory) => accountingCategory.parent),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], AccountingCategory.prototype, "parentId", void 0);
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, typeorm_1.OneToMany)(type => AccountingCategory_1, accountingCategory => accountingCategory.parent),
|
|
52
|
+
(0, type_graphql_1.Field)(type => [AccountingCategory_1]),
|
|
53
|
+
tslib_1.__metadata("design:type", Array)
|
|
54
|
+
], AccountingCategory.prototype, "children", void 0);
|
|
55
|
+
tslib_1.__decorate([
|
|
56
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
57
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
58
|
+
tslib_1.__metadata("design:type", Date)
|
|
59
|
+
], AccountingCategory.prototype, "createdAt", void 0);
|
|
60
|
+
tslib_1.__decorate([
|
|
61
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
62
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
63
|
+
tslib_1.__metadata("design:type", Date)
|
|
64
|
+
], AccountingCategory.prototype, "updatedAt", void 0);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
67
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
68
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
69
|
+
], AccountingCategory.prototype, "creator", void 0);
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, typeorm_1.RelationId)((accountingCategory) => accountingCategory.creator),
|
|
72
|
+
tslib_1.__metadata("design:type", String)
|
|
73
|
+
], AccountingCategory.prototype, "creatorId", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
76
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
77
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
78
|
+
], AccountingCategory.prototype, "updater", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, typeorm_1.RelationId)((accountingCategory) => accountingCategory.updater),
|
|
81
|
+
tslib_1.__metadata("design:type", String)
|
|
82
|
+
], AccountingCategory.prototype, "updaterId", void 0);
|
|
83
|
+
AccountingCategory = AccountingCategory_1 = tslib_1.__decorate([
|
|
84
|
+
(0, typeorm_1.Entity)(),
|
|
85
|
+
(0, typeorm_1.Index)('ix_accounting_category_0', (accountingCategory) => [accountingCategory.domain, accountingCategory.name], { unique: true }),
|
|
86
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for AccountingCategory' })
|
|
87
|
+
], AccountingCategory);
|
|
88
|
+
exports.AccountingCategory = AccountingCategory;
|
|
89
|
+
//# sourceMappingURL=accounting-category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounting-category.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category.ts"],"names":[],"mappings":";;;;;AAAA,qCAUgB;AAChB,+CAAyD;AAEzD,iDAA8C;AAC9C,yDAAgD;AASzC,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;CAwD9B,CAAA;AAvDC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;8CACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,cAAM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EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;qDAAA;AAEhB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;mDAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;qDACjE;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;mDAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;qDACjE;AAvDP,kBAAkB;IAP9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC,EAChG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CAwD9B;AAxDY,gDAAkB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index(\n 'ix_accounting_category_0',\n (accountingCategory: AccountingCategory) => [accountingCategory.domain, accountingCategory.name],\n { unique: true }\n)\n@ObjectType({ description: 'Entity for AccountingCategory' })\nexport class AccountingCategory {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @ManyToOne(type => AccountingCategory, accountingCategory => accountingCategory.children, { nullable: true })\n @Field({ nullable: true })\n parent?: AccountingCategory\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.parent)\n parentId?: string\n\n @OneToMany(type => AccountingCategory, accountingCategory => accountingCategory.parent)\n @Field(type => [AccountingCategory])\n children?: AccountingCategory[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const accounting_category_1 = require("./accounting-category");
|
|
5
|
+
const accounting_category_query_1 = require("./accounting-category-query");
|
|
6
|
+
const accounting_category_mutation_1 = require("./accounting-category-mutation");
|
|
7
|
+
exports.entities = [accounting_category_1.AccountingCategory];
|
|
8
|
+
exports.resolvers = [accounting_category_query_1.AccountingCategoryQuery, accounting_category_mutation_1.AccountingCategoryMutation];
|
|
9
|
+
exports.subscribers = [];
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/accounting-category/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAC1D,2EAAqE;AACrE,iFAA2E;AAE9D,QAAA,QAAQ,GAAG,CAAC,wCAAkB,CAAC,CAAA;AAC/B,QAAA,SAAS,GAAG,CAAC,mDAAuB,EAAE,yDAA0B,CAAC,CAAA;AACjE,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { AccountingCategory } from './accounting-category'\nimport { AccountingCategoryQuery } from './accounting-category-query'\nimport { AccountingCategoryMutation } from './accounting-category-mutation'\n\nexport const entities = [AccountingCategory]\nexport const resolvers = [AccountingCategoryQuery, AccountingCategoryMutation]\nexport const subscribers = []\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancialStatementHistoryEntitySubscriber = 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 financial_statement_1 = require("./financial-statement");
|
|
8
|
+
const financial_statement_history_1 = require("./financial-statement-history");
|
|
9
|
+
let FinancialStatementHistoryEntitySubscriber = class FinancialStatementHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
|
|
10
|
+
get entity() {
|
|
11
|
+
return financial_statement_1.FinancialStatement;
|
|
12
|
+
}
|
|
13
|
+
get historyEntity() {
|
|
14
|
+
return financial_statement_history_1.FinancialStatementHistory;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
FinancialStatementHistoryEntitySubscriber = tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.EventSubscriber)()
|
|
19
|
+
], FinancialStatementHistoryEntitySubscriber);
|
|
20
|
+
exports.FinancialStatementHistoryEntitySubscriber = FinancialStatementHistoryEntitySubscriber;
|
|
21
|
+
//# sourceMappingURL=event-subscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/financial-statement/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,+DAA0D;AAC1D,+EAAyE;AAGlE,IAAM,yCAAyC,GAA/C,MAAM,yCAA0C,SAAQ,yCAAsE;IACnI,IAAW,MAAM;QACf,OAAO,wCAAkB,CAAA;IAC3B,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,uDAAyB,CAAA;IAClC,CAAC;CACF,CAAA;AARY,yCAAyC;IADrD,IAAA,yBAAe,GAAE;GACL,yCAAyC,CAQrD;AARY,8FAAyC","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { FinancialStatement } from './financial-statement'\nimport { FinancialStatementHistory } from './financial-statement-history'\n\n@EventSubscriber()\nexport class FinancialStatementHistoryEntitySubscriber extends HistoryEntitySubscriber<FinancialStatement, FinancialStatementHistory> {\n public get entity() {\n return FinancialStatement\n }\n\n public get historyEntity() {\n return FinancialStatementHistory\n }\n}\n"]}
|