@things-factory/accounting 7.0.2 → 8.0.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/client/activities/activity-book-edit.ts +1 -1
- package/client/activities/activity-book-view.ts +1 -1
- package/client/activities/activity-expense-edit.ts +1 -1
- package/client/activities/activity-expense-view.ts +1 -1
- package/client/pages/account/account-importer.ts +19 -8
- package/client/pages/account/account-list-page.ts +5 -6
- package/client/pages/accounting-category/accounting-category-importer.ts +19 -8
- package/client/pages/accounting-category/accounting-category-list-page.ts +5 -5
- package/client/pages/financial-statement/financial-statement-importer.ts +19 -8
- package/client/pages/financial-statement/financial-statement-list-page.ts +5 -6
- package/client/pages/fiscal-month/fiscal-month-importer.ts +90 -0
- package/client/pages/fiscal-month/fiscal-month-list-page.ts +398 -0
- package/client/pages/fiscal-quarter/fiscal-quarter-importer.ts +90 -0
- package/client/pages/fiscal-quarter/fiscal-quarter-list-page.ts +398 -0
- package/client/pages/fiscal-year/fiscal-year-importer.ts +90 -0
- package/client/pages/fiscal-year/fiscal-year-list-page.ts +398 -0
- package/client/pages/income-statement/income-statement-importer.ts +19 -8
- package/client/pages/income-statement/income-statement-list-page.ts +5 -6
- package/client/pages/ledger/ledger-importer.ts +19 -8
- package/client/pages/ledger/ledger-list-page.ts +5 -6
- package/client/pages/transaction/transaction-importer.ts +19 -8
- package/client/pages/transaction/transaction-list-page.ts +5 -6
- package/client/route.ts +17 -5
- package/dist-client/activities/activity-book-edit.js +1 -1
- package/dist-client/activities/activity-book-edit.js.map +1 -1
- package/dist-client/activities/activity-book-view.js +1 -1
- package/dist-client/activities/activity-book-view.js.map +1 -1
- package/dist-client/activities/activity-expense-edit.js +1 -1
- package/dist-client/activities/activity-expense-edit.js.map +1 -1
- package/dist-client/activities/activity-expense-view.js +1 -1
- package/dist-client/activities/activity-expense-view.js.map +1 -1
- package/dist-client/pages/account/account-importer.d.ts +0 -1
- package/dist-client/pages/account/account-importer.js +12 -5
- package/dist-client/pages/account/account-importer.js.map +1 -1
- package/dist-client/pages/account/account-list-page.js +5 -6
- package/dist-client/pages/account/account-list-page.js.map +1 -1
- package/dist-client/pages/accounting-category/accounting-category-importer.d.ts +0 -1
- package/dist-client/pages/accounting-category/accounting-category-importer.js +12 -5
- package/dist-client/pages/accounting-category/accounting-category-importer.js.map +1 -1
- package/dist-client/pages/accounting-category/accounting-category-list-page.js +5 -5
- package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -1
- package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +0 -1
- package/dist-client/pages/financial-statement/financial-statement-importer.js +12 -5
- package/dist-client/pages/financial-statement/financial-statement-importer.js.map +1 -1
- package/dist-client/pages/financial-statement/financial-statement-list-page.js +5 -6
- package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +1 -1
- package/dist-client/pages/fiscal-month/fiscal-month-importer.d.ts +23 -0
- package/dist-client/pages/fiscal-month/fiscal-month-importer.js +93 -0
- package/dist-client/pages/fiscal-month/fiscal-month-importer.js.map +1 -0
- package/dist-client/pages/fiscal-month/fiscal-month-list-page.d.ts +66 -0
- package/dist-client/pages/fiscal-month/fiscal-month-list-page.js +370 -0
- package/dist-client/pages/fiscal-month/fiscal-month-list-page.js.map +1 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.d.ts +23 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js +93 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js.map +1 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.d.ts +66 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js +370 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js.map +1 -0
- package/dist-client/pages/fiscal-year/fiscal-year-importer.d.ts +23 -0
- package/dist-client/pages/fiscal-year/fiscal-year-importer.js +93 -0
- package/dist-client/pages/fiscal-year/fiscal-year-importer.js.map +1 -0
- package/dist-client/pages/fiscal-year/fiscal-year-list-page.d.ts +66 -0
- package/dist-client/pages/fiscal-year/fiscal-year-list-page.js +370 -0
- package/dist-client/pages/fiscal-year/fiscal-year-list-page.js.map +1 -0
- package/dist-client/pages/income-statement/income-statement-importer.d.ts +0 -1
- package/dist-client/pages/income-statement/income-statement-importer.js +12 -5
- package/dist-client/pages/income-statement/income-statement-importer.js.map +1 -1
- package/dist-client/pages/income-statement/income-statement-list-page.js +5 -6
- package/dist-client/pages/income-statement/income-statement-list-page.js.map +1 -1
- package/dist-client/pages/ledger/ledger-importer.d.ts +0 -1
- package/dist-client/pages/ledger/ledger-importer.js +12 -5
- package/dist-client/pages/ledger/ledger-importer.js.map +1 -1
- package/dist-client/pages/ledger/ledger-list-page.js +5 -6
- package/dist-client/pages/ledger/ledger-list-page.js.map +1 -1
- package/dist-client/pages/transaction/transaction-importer.d.ts +0 -1
- package/dist-client/pages/transaction/transaction-importer.js +12 -5
- package/dist-client/pages/transaction/transaction-importer.js.map +1 -1
- package/dist-client/pages/transaction/transaction-list-page.js +5 -6
- package/dist-client/pages/transaction/transaction-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +9 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/index.d.ts +1 -0
- package/dist-server/controllers/index.js +4 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/summary-statements.d.ts +4 -0
- package/dist-server/controllers/summary-statements.js +143 -0
- package/dist-server/controllers/summary-statements.js.map +1 -0
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/1725200507196-seed-fiscal-entities.d.ts +5 -0
- package/dist-server/migrations/1725200507196-seed-fiscal-entities.js +95 -0
- package/dist-server/migrations/1725200507196-seed-fiscal-entities.js.map +1 -0
- package/dist-server/migrations/1725201467183-seed-accounts.d.ts +5 -0
- package/dist-server/migrations/1725201467183-seed-accounts.js +318 -0
- package/dist-server/migrations/1725201467183-seed-accounts.js.map +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js +1 -0
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/account/account-history.js +3 -3
- package/dist-server/service/account/account-history.js.map +1 -1
- package/dist-server/service/account/account-query.js +1 -1
- package/dist-server/service/account/account-query.js.map +1 -1
- package/dist-server/service/account/account.js +1 -1
- package/dist-server/service/account/account.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category-query.js +1 -1
- package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category-type.d.ts +2 -0
- package/dist-server/service/accounting-category/accounting-category-type.js +8 -0
- package/dist-server/service/accounting-category/accounting-category-type.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category.d.ts +1 -0
- package/dist-server/service/accounting-category/accounting-category.js +7 -1
- package/dist-server/service/accounting-category/accounting-category.js.map +1 -1
- package/dist-server/service/common-type.d.ts +5 -0
- package/dist-server/service/common-type.js +15 -0
- package/dist-server/service/common-type.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement-history.js +3 -3
- package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-query.js +1 -1
- package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement.js +1 -1
- package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
- package/dist-server/service/fiscal-month/fiscal-month-mutation.d.ts +10 -0
- package/dist-server/service/fiscal-month/fiscal-month-mutation.js +128 -0
- package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -0
- package/dist-server/service/fiscal-month/fiscal-month-query.d.ts +11 -0
- package/dist-server/service/fiscal-month/fiscal-month-query.js +81 -0
- package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -0
- package/dist-server/service/fiscal-month/fiscal-month-type.d.ts +26 -0
- package/dist-server/service/fiscal-month/fiscal-month-type.js +98 -0
- package/dist-server/service/fiscal-month/fiscal-month-type.js.map +1 -0
- package/dist-server/service/fiscal-month/fiscal-month.d.ts +22 -0
- package/dist-server/service/fiscal-month/fiscal-month.js +99 -0
- package/dist-server/service/fiscal-month/fiscal-month.js.map +1 -0
- package/dist-server/service/fiscal-month/index.d.ts +6 -0
- package/dist-server/service/fiscal-month/index.js +10 -0
- package/dist-server/service/fiscal-month/index.js.map +1 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.d.ts +10 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +128 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.d.ts +11 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +83 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-type.d.ts +24 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js +90 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js.map +1 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter.d.ts +21 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter.js +94 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter.js.map +1 -0
- package/dist-server/service/fiscal-quarter/index.d.ts +6 -0
- package/dist-server/service/fiscal-quarter/index.js +10 -0
- package/dist-server/service/fiscal-quarter/index.js.map +1 -0
- package/dist-server/service/fiscal-year/fiscal-year-mutation.d.ts +10 -0
- package/dist-server/service/fiscal-year/fiscal-year-mutation.js +128 -0
- package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -0
- package/dist-server/service/fiscal-year/fiscal-year-query.d.ts +11 -0
- package/dist-server/service/fiscal-year/fiscal-year-query.js +79 -0
- package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -0
- package/dist-server/service/fiscal-year/fiscal-year-type.d.ts +22 -0
- package/dist-server/service/fiscal-year/fiscal-year-type.js +82 -0
- package/dist-server/service/fiscal-year/fiscal-year-type.js.map +1 -0
- package/dist-server/service/fiscal-year/fiscal-year.d.ts +20 -0
- package/dist-server/service/fiscal-year/fiscal-year.js +89 -0
- package/dist-server/service/fiscal-year/fiscal-year.js.map +1 -0
- package/dist-server/service/fiscal-year/index.d.ts +6 -0
- package/dist-server/service/fiscal-year/index.js +10 -0
- package/dist-server/service/fiscal-year/index.js.map +1 -0
- package/dist-server/service/income-statement/income-statement-history.js +3 -3
- package/dist-server/service/income-statement/income-statement-history.js.map +1 -1
- package/dist-server/service/income-statement/income-statement-query.js +1 -1
- package/dist-server/service/income-statement/income-statement-query.js.map +1 -1
- package/dist-server/service/income-statement/income-statement.js +3 -3
- package/dist-server/service/income-statement/income-statement.js.map +1 -1
- package/dist-server/service/index.d.ts +5 -2
- package/dist-server/service/index.js +19 -3
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/transaction/index.d.ts +1 -2
- package/dist-server/service/transaction/transaction-history.d.ts +10 -2
- package/dist-server/service/transaction/transaction-history.js +43 -6
- package/dist-server/service/transaction/transaction-history.js.map +1 -1
- package/dist-server/service/transaction/transaction-query.js +1 -1
- package/dist-server/service/transaction/transaction-query.js.map +1 -1
- package/dist-server/service/transaction/transaction.d.ts +8 -5
- package/dist-server/service/transaction/transaction.js +33 -10
- package/dist-server/service/transaction/transaction.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/accounting/fiscal-month.md +160 -0
- package/helps/accounting/fiscal-quarter.md +160 -0
- package/helps/accounting/fiscal-year.md +160 -0
- package/package.json +9 -8
- package/server/controllers/index.ts +1 -0
- package/server/controllers/summary-statements.ts +160 -0
- package/server/index.ts +1 -0
- package/server/migrations/1725200507196-seed-fiscal-entities.ts +106 -0
- package/server/migrations/1725201467183-seed-accounts.ts +339 -0
- package/server/routes.ts +2 -0
- package/server/service/account/account-history.ts +5 -5
- package/server/service/account/account-query.ts +1 -1
- package/server/service/account/account.ts +1 -1
- package/server/service/accounting-category/accounting-category-query.ts +1 -1
- package/server/service/accounting-category/accounting-category-type.ts +6 -0
- package/server/service/accounting-category/accounting-category.ts +10 -1
- package/server/service/common-type.ts +12 -0
- package/server/service/financial-statement/financial-statement-history.ts +5 -5
- package/server/service/financial-statement/financial-statement-query.ts +1 -1
- package/server/service/financial-statement/financial-statement.ts +1 -1
- package/server/service/fiscal-month/fiscal-month-mutation.ts +137 -0
- package/server/service/fiscal-month/fiscal-month-query.ts +56 -0
- package/server/service/fiscal-month/fiscal-month-type.ts +66 -0
- package/server/service/fiscal-month/fiscal-month.ts +84 -0
- package/server/service/fiscal-month/index.ts +7 -0
- package/server/service/fiscal-quarter/fiscal-quarter-mutation.ts +137 -0
- package/server/service/fiscal-quarter/fiscal-quarter-query.ts +58 -0
- package/server/service/fiscal-quarter/fiscal-quarter-type.ts +60 -0
- package/server/service/fiscal-quarter/fiscal-quarter.ts +80 -0
- package/server/service/fiscal-quarter/index.ts +7 -0
- package/server/service/fiscal-year/fiscal-year-mutation.ts +137 -0
- package/server/service/fiscal-year/fiscal-year-query.ts +51 -0
- package/server/service/fiscal-year/fiscal-year-type.ts +54 -0
- package/server/service/fiscal-year/fiscal-year.ts +76 -0
- package/server/service/fiscal-year/index.ts +7 -0
- package/server/service/income-statement/income-statement-history.ts +5 -5
- package/server/service/income-statement/income-statement-query.ts +1 -4
- package/server/service/income-statement/income-statement.ts +3 -3
- package/server/service/index.ts +31 -3
- package/server/service/transaction/transaction-history.ts +35 -7
- package/server/service/transaction/transaction-query.ts +1 -4
- package/server/service/transaction/transaction.ts +34 -15
- package/things-factory.config.js +3 -1
@@ -34,7 +34,7 @@ tslib_1.__decorate([
|
|
34
34
|
], IncomeStatement.prototype, "version", void 0);
|
35
35
|
tslib_1.__decorate([
|
36
36
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
37
|
-
(0, type_graphql_1.Field)(
|
37
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
38
38
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
39
39
|
], IncomeStatement.prototype, "domain", void 0);
|
40
40
|
tslib_1.__decorate([
|
@@ -53,7 +53,7 @@ tslib_1.__decorate([
|
|
53
53
|
], IncomeStatement.prototype, "quarter", void 0);
|
54
54
|
tslib_1.__decorate([
|
55
55
|
(0, typeorm_1.Column)({ nullable: true }),
|
56
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
56
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'fiscal month' }),
|
57
57
|
tslib_1.__metadata("design:type", Number)
|
58
58
|
], IncomeStatement.prototype, "month", void 0);
|
59
59
|
tslib_1.__decorate([
|
@@ -111,7 +111,7 @@ tslib_1.__decorate([
|
|
111
111
|
], IncomeStatement.prototype, "updaterId", void 0);
|
112
112
|
exports.IncomeStatement = IncomeStatement = tslib_1.__decorate([
|
113
113
|
(0, typeorm_1.Entity)(),
|
114
|
-
(0, typeorm_1.Index)('ix_income_statement_0', (incomeStatement) => [incomeStatement.domain, incomeStatement.deletedAt], { unique:
|
114
|
+
(0, typeorm_1.Index)('ix_income_statement_0', (incomeStatement) => [incomeStatement.domain, incomeStatement.deletedAt], { unique: false, where: '"deleted_at" IS NULL' }),
|
115
115
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for IncomeStatement' })
|
116
116
|
], IncomeStatement);
|
117
117
|
//# sourceMappingURL=income-statement.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"income-statement.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;AACvB,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAED,IAAA,+BAAgB,EAAC,qBAAqB,EAAE;IACtC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,wCAAwC;CACtD,CAAC,CAAA;AAEF,QAAQ;AAQD,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QAOL,YAAO,GAAY,CAAC,CAAA;IA8DtB,CAAC;CAAA,CAAA;AArEY,0CAAe;AAGjB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;2CACC;AAInB;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,
|
1
|
+
{"version":3,"file":"income-statement.js","sourceRoot":"","sources":["../../../server/service/income-statement/income-statement.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;AACvB,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAED,IAAA,+BAAgB,EAAC,qBAAqB,EAAE;IACtC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,wCAAwC;CACtD,CAAC,CAAA;AAEF,QAAQ;AAQD,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QAOL,YAAO,GAAY,CAAC,CAAA;IA8DtB,CAAC;CAAA,CAAA;AArEY,0CAAe;AAGjB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;2CACC;AAInB;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AAIpB;IAFC,IAAA,mBAAS,EAAC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AAE,KAAK,EAAE,sBAAsB,EAAE,CACjD;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;GAC7C,eAAe,CAqE3B","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 IncomeStatementStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(IncomeStatementStatus, {\n name: 'IncomeStatementStatus',\n description: 'state enumeration of a incomeStatement'\n})\n\n// 손익계산서\n@Entity()\n@Index(\n 'ix_income_statement_0',\n (incomeStatement: IncomeStatement) => [incomeStatement.domain, incomeStatement.deletedAt],\n { unique: false, where: '\"deleted_at\" IS NULL' }\n)\n@ObjectType({ description: 'Entity for IncomeStatement' })\nexport class IncomeStatement {\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((incomeStatement: IncomeStatement) => incomeStatement.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, description: 'fiscal month' })\n month?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n revenue?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n expense?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n netIncome?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\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((incomeStatement: IncomeStatement) => incomeStatement.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((incomeStatement: IncomeStatement) => incomeStatement.updater)\n updaterId?: string\n}\n"]}
|
@@ -3,8 +3,11 @@ export * from './financial-statement/financial-statement';
|
|
3
3
|
export * from './accounting-category/accounting-category';
|
4
4
|
export * from './transaction/transaction';
|
5
5
|
export * from './account/account';
|
6
|
-
export
|
6
|
+
export * from './fiscal-month/fiscal-month';
|
7
|
+
export * from './fiscal-quarter/fiscal-quarter';
|
8
|
+
export * from './fiscal-year/fiscal-year';
|
9
|
+
export declare const entities: (typeof import("./financial-statement/financial-statement").FinancialStatement | typeof import("./income-statement/income-statement").IncomeStatement | typeof import("./accounting-category/accounting-category").AccountingCategory | typeof import("./account/account").Account | typeof import("./transaction/transaction").Transaction | typeof import("./fiscal-year/fiscal-year").FiscalYear | typeof import("./income-statement/income-statement-history").IncomeStatementHistory | typeof import("./financial-statement/financial-statement-history").FinancialStatementHistory | typeof import("./account/account-history").AccountHistory)[];
|
7
10
|
export declare const subscribers: any[];
|
8
11
|
export declare const schema: {
|
9
|
-
resolverClasses: (typeof import("./income-statement/income-statement-query").IncomeStatementQuery | typeof import("./income-statement/income-statement-mutation").IncomeStatementMutation | typeof import("./financial-statement/financial-statement-query").FinancialStatementQuery | typeof import("./financial-statement/financial-statement-mutation").FinancialStatementMutation | typeof import("./accounting-category/accounting-category-query").AccountingCategoryQuery | typeof import("./accounting-category/accounting-category-mutation").AccountingCategoryMutation | typeof import("./transaction/transaction-query").TransactionQuery | typeof import("./transaction/transaction-mutation").TransactionMutation | typeof import("./account/account-query").AccountQuery | typeof import("./account/account-mutation").AccountMutation)[];
|
12
|
+
resolverClasses: (typeof import("./income-statement/income-statement-query").IncomeStatementQuery | typeof import("./income-statement/income-statement-mutation").IncomeStatementMutation | typeof import("./financial-statement/financial-statement-query").FinancialStatementQuery | typeof import("./financial-statement/financial-statement-mutation").FinancialStatementMutation | typeof import("./accounting-category/accounting-category-query").AccountingCategoryQuery | typeof import("./accounting-category/accounting-category-mutation").AccountingCategoryMutation | typeof import("./transaction/transaction-query").TransactionQuery | typeof import("./transaction/transaction-mutation").TransactionMutation | typeof import("./account/account-query").AccountQuery | typeof import("./account/account-mutation").AccountMutation | typeof import("./fiscal-month/fiscal-month-query").FiscalMonthQuery | typeof import("./fiscal-month/fiscal-month-mutation").FiscalMonthMutation | typeof import("./fiscal-quarter/fiscal-quarter-query").FiscalQuarterQuery | typeof import("./fiscal-quarter/fiscal-quarter-mutation").FiscalQuarterMutation | typeof import("./fiscal-year/fiscal-year-query").FiscalYearQuery | typeof import("./fiscal-year/fiscal-year-mutation").FiscalYearMutation)[];
|
10
13
|
};
|
@@ -8,19 +8,28 @@ tslib_1.__exportStar(require("./financial-statement/financial-statement"), expor
|
|
8
8
|
tslib_1.__exportStar(require("./accounting-category/accounting-category"), exports);
|
9
9
|
tslib_1.__exportStar(require("./transaction/transaction"), exports);
|
10
10
|
tslib_1.__exportStar(require("./account/account"), exports);
|
11
|
+
tslib_1.__exportStar(require("./fiscal-month/fiscal-month"), exports);
|
12
|
+
tslib_1.__exportStar(require("./fiscal-quarter/fiscal-quarter"), exports);
|
13
|
+
tslib_1.__exportStar(require("./fiscal-year/fiscal-year"), exports);
|
11
14
|
/* IMPORT ENTITIES AND RESOLVERS */
|
12
15
|
const income_statement_1 = require("./income-statement");
|
13
16
|
const financial_statement_1 = require("./financial-statement");
|
14
17
|
const accounting_category_1 = require("./accounting-category");
|
15
18
|
const transaction_1 = require("./transaction");
|
16
19
|
const account_1 = require("./account");
|
20
|
+
const fiscal_month_1 = require("./fiscal-month");
|
21
|
+
const fiscal_quarter_1 = require("./fiscal-quarter");
|
22
|
+
const fiscal_year_1 = require("./fiscal-year");
|
17
23
|
exports.entities = [
|
18
24
|
/* ENTITIES */
|
19
25
|
...income_statement_1.entities,
|
20
26
|
...financial_statement_1.entities,
|
21
27
|
...accounting_category_1.entities,
|
22
28
|
...transaction_1.entities,
|
23
|
-
...account_1.entities
|
29
|
+
...account_1.entities,
|
30
|
+
...fiscal_month_1.entities,
|
31
|
+
...fiscal_quarter_1.entities,
|
32
|
+
...fiscal_year_1.entities
|
24
33
|
];
|
25
34
|
exports.subscribers = [
|
26
35
|
/* SUBSCRIBERS */
|
@@ -28,7 +37,11 @@ exports.subscribers = [
|
|
28
37
|
...financial_statement_1.subscribers,
|
29
38
|
...accounting_category_1.subscribers,
|
30
39
|
...transaction_1.subscribers,
|
31
|
-
...account_1.subscribers
|
40
|
+
...account_1.subscribers,
|
41
|
+
...fiscal_year_1.subscribers,
|
42
|
+
...fiscal_month_1.subscribers,
|
43
|
+
...fiscal_quarter_1.subscribers,
|
44
|
+
...fiscal_year_1.subscribers
|
32
45
|
];
|
33
46
|
exports.schema = {
|
34
47
|
resolverClasses: [
|
@@ -37,7 +50,10 @@ exports.schema = {
|
|
37
50
|
...financial_statement_1.resolvers,
|
38
51
|
...accounting_category_1.resolvers,
|
39
52
|
...transaction_1.resolvers,
|
40
|
-
...account_1.resolvers
|
53
|
+
...account_1.resolvers,
|
54
|
+
...fiscal_month_1.resolvers,
|
55
|
+
...fiscal_quarter_1.resolvers,
|
56
|
+
...fiscal_year_1.resolvers
|
41
57
|
]
|
42
58
|
};
|
43
59
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,8EAAmD;AACnD,oFAAyD;AACzD,oFAAyD;AACzD,oEAAyC;AACzC,4DAAiC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,8EAAmD;AACnD,oFAAyD;AACzD,oFAAyD;AACzD,oEAAyC;AACzC,4DAAiC;AACjC,sEAA2C;AAC3C,0EAA+C;AAC/C,oEAAyC;AAEzC,mCAAmC;AACnC,yDAI2B;AAC3B,+DAI8B;AAC9B,+DAI8B;AAC9B,+CAIsB;AACtB,uCAIkB;AAClB,iDAIuB;AACvB,qDAIyB;AACzB,+CAIsB;AAET,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,2BAAuB;IAC1B,GAAG,8BAA0B;IAC7B,GAAG,8BAA0B;IAC7B,GAAG,sBAAmB;IACtB,GAAG,kBAAe;IAClB,GAAG,uBAAmB;IACtB,GAAG,yBAAqB;IACxB,GAAG,sBAAkB;CACtB,CAAA;AAEY,QAAA,WAAW,GAAG;IACzB,iBAAiB;IACjB,GAAG,8BAA0B;IAC7B,GAAG,iCAA6B;IAChC,GAAG,iCAA6B;IAChC,GAAG,yBAAsB;IACzB,GAAG,qBAAkB;IACrB,GAAG,yBAAqB;IACxB,GAAG,0BAAsB;IACzB,GAAG,4BAAwB;IAC3B,GAAG,yBAAqB;CACzB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,4BAAwB;QAC3B,GAAG,+BAA2B;QAC9B,GAAG,+BAA2B;QAC9B,GAAG,uBAAoB;QACvB,GAAG,mBAAgB;QACnB,GAAG,wBAAoB;QACvB,GAAG,0BAAsB;QACzB,GAAG,uBAAmB;KACvB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './income-statement/income-statement'\nexport * from './financial-statement/financial-statement'\nexport * from './accounting-category/accounting-category'\nexport * from './transaction/transaction'\nexport * from './account/account'\nexport * from './fiscal-month/fiscal-month'\nexport * from './fiscal-quarter/fiscal-quarter'\nexport * from './fiscal-year/fiscal-year'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport {\n entities as IncomeStatementEntities,\n resolvers as IncomeStatementResolvers,\n subscribers as IncomeStatementSubscribers\n} from './income-statement'\nimport {\n entities as FinancialStatementEntities,\n resolvers as FinancialStatementResolvers,\n subscribers as FinancialStatementSubscribers\n} from './financial-statement'\nimport {\n entities as AccountingCategoryEntities,\n resolvers as AccountingCategoryResolvers,\n subscribers as AccountingCategorySubscribers\n} from './accounting-category'\nimport {\n entities as TransactionEntities,\n resolvers as TransactionResolvers,\n subscribers as TransactionSubscribers\n} from './transaction'\nimport {\n entities as AccountEntities,\n resolvers as AccountResolvers,\n subscribers as AccountSubscribers\n} from './account'\nimport {\n entities as FiscalMonthEntities,\n resolvers as FiscalMonthResolvers,\n subscribers as FiscalMonthSubscribers\n} from './fiscal-month'\nimport {\n entities as FiscalQuarterEntities,\n resolvers as FiscalQuarterResolvers,\n subscribers as FiscalQuarterSubscribers\n} from './fiscal-quarter'\nimport {\n entities as FiscalYearEntities,\n resolvers as FiscalYearResolvers,\n subscribers as FiscalYearSubscribers\n} from './fiscal-year'\n\nexport const entities = [\n /* ENTITIES */\n ...IncomeStatementEntities,\n ...FinancialStatementEntities,\n ...AccountingCategoryEntities,\n ...TransactionEntities,\n ...AccountEntities,\n ...FiscalMonthEntities,\n ...FiscalQuarterEntities,\n ...FiscalYearEntities\n]\n\nexport const subscribers = [\n /* SUBSCRIBERS */\n ...IncomeStatementSubscribers,\n ...FinancialStatementSubscribers,\n ...AccountingCategorySubscribers,\n ...TransactionSubscribers,\n ...AccountSubscribers,\n ...FiscalYearSubscribers,\n ...FiscalMonthSubscribers,\n ...FiscalQuarterSubscribers,\n ...FiscalYearSubscribers\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...IncomeStatementResolvers,\n ...FinancialStatementResolvers,\n ...AccountingCategoryResolvers,\n ...TransactionResolvers,\n ...AccountResolvers,\n ...FiscalMonthResolvers,\n ...FiscalQuarterResolvers,\n ...FiscalYearResolvers\n ]\n}\n"]}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { Transaction } from './transaction';
|
2
|
-
import { TransactionHistory } from './transaction-history';
|
3
2
|
import { TransactionQuery } from './transaction-query';
|
4
3
|
import { TransactionMutation } from './transaction-mutation';
|
5
4
|
import { TransactionHistoryEntitySubscriber } from './event-subscriber';
|
6
|
-
export declare const entities: (typeof Transaction
|
5
|
+
export declare const entities: (typeof Transaction)[];
|
7
6
|
export declare const resolvers: (typeof TransactionQuery | typeof TransactionMutation)[];
|
8
7
|
export declare const subscribers: (typeof TransactionHistoryEntitySubscriber)[];
|
@@ -2,16 +2,24 @@ import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-hist
|
|
2
2
|
import { User } from '@things-factory/auth-base';
|
3
3
|
import { Domain } from '@things-factory/shell';
|
4
4
|
import { Transaction, TransactionType } from './transaction';
|
5
|
+
import { Account } from '../account/account';
|
5
6
|
export declare class TransactionHistory implements HistoryEntityInterface<Transaction> {
|
6
7
|
readonly id: string;
|
7
8
|
version?: number;
|
8
9
|
domain?: Domain;
|
9
10
|
domainId?: string;
|
10
|
-
name
|
11
|
+
name?: string;
|
11
12
|
description?: string;
|
13
|
+
currency?: string;
|
14
|
+
amount?: number;
|
12
15
|
active?: boolean;
|
13
16
|
type?: TransactionType;
|
14
|
-
|
17
|
+
account?: Account;
|
18
|
+
accountId?: string;
|
19
|
+
year?: number;
|
20
|
+
quarter?: number;
|
21
|
+
month?: number;
|
22
|
+
occurredAt: Date;
|
15
23
|
createdAt?: Date;
|
16
24
|
updatedAt?: Date;
|
17
25
|
deletedAt?: Date;
|
@@ -9,11 +9,13 @@ const auth_base_1 = require("@things-factory/auth-base");
|
|
9
9
|
const env_1 = require("@things-factory/env");
|
10
10
|
const shell_1 = require("@things-factory/shell");
|
11
11
|
const transaction_1 = require("./transaction");
|
12
|
+
const account_1 = require("../account/account");
|
12
13
|
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
13
14
|
const DATABASE_TYPE = ORMCONFIG.type;
|
14
15
|
let TransactionHistory = class TransactionHistory {
|
15
16
|
constructor() {
|
16
17
|
this.version = 1;
|
18
|
+
this.amount = 0;
|
17
19
|
}
|
18
20
|
};
|
19
21
|
exports.TransactionHistory = TransactionHistory;
|
@@ -29,7 +31,7 @@ tslib_1.__decorate([
|
|
29
31
|
], TransactionHistory.prototype, "version", void 0);
|
30
32
|
tslib_1.__decorate([
|
31
33
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
32
|
-
(0, type_graphql_1.Field)(
|
34
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
33
35
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
34
36
|
], TransactionHistory.prototype, "domain", void 0);
|
35
37
|
tslib_1.__decorate([
|
@@ -38,7 +40,7 @@ tslib_1.__decorate([
|
|
38
40
|
], TransactionHistory.prototype, "domainId", void 0);
|
39
41
|
tslib_1.__decorate([
|
40
42
|
(0, typeorm_1.Column)(),
|
41
|
-
(0, type_graphql_1.Field)(),
|
43
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
42
44
|
tslib_1.__metadata("design:type", String)
|
43
45
|
], TransactionHistory.prototype, "name", void 0);
|
44
46
|
tslib_1.__decorate([
|
@@ -46,6 +48,16 @@ tslib_1.__decorate([
|
|
46
48
|
(0, type_graphql_1.Field)({ nullable: true }),
|
47
49
|
tslib_1.__metadata("design:type", String)
|
48
50
|
], TransactionHistory.prototype, "description", void 0);
|
51
|
+
tslib_1.__decorate([
|
52
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
53
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
54
|
+
tslib_1.__metadata("design:type", String)
|
55
|
+
], TransactionHistory.prototype, "currency", void 0);
|
56
|
+
tslib_1.__decorate([
|
57
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
58
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
59
|
+
tslib_1.__metadata("design:type", Number)
|
60
|
+
], TransactionHistory.prototype, "amount", void 0);
|
49
61
|
tslib_1.__decorate([
|
50
62
|
(0, typeorm_1.Column)({ nullable: true }),
|
51
63
|
(0, type_graphql_1.Field)({ nullable: true }),
|
@@ -57,22 +69,47 @@ tslib_1.__decorate([
|
|
57
69
|
tslib_1.__metadata("design:type", Number)
|
58
70
|
], TransactionHistory.prototype, "type", void 0);
|
59
71
|
tslib_1.__decorate([
|
60
|
-
(0, typeorm_1.
|
72
|
+
(0, typeorm_1.ManyToOne)(type => account_1.Account),
|
61
73
|
(0, type_graphql_1.Field)({ nullable: true }),
|
74
|
+
tslib_1.__metadata("design:type", account_1.Account)
|
75
|
+
], TransactionHistory.prototype, "account", void 0);
|
76
|
+
tslib_1.__decorate([
|
77
|
+
(0, typeorm_1.RelationId)((transaction) => transaction.account),
|
62
78
|
tslib_1.__metadata("design:type", String)
|
63
|
-
], TransactionHistory.prototype, "
|
79
|
+
], TransactionHistory.prototype, "accountId", void 0);
|
80
|
+
tslib_1.__decorate([
|
81
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
82
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'fiscal year' }),
|
83
|
+
tslib_1.__metadata("design:type", Number)
|
84
|
+
], TransactionHistory.prototype, "year", void 0);
|
64
85
|
tslib_1.__decorate([
|
65
86
|
(0, typeorm_1.Column)({ nullable: true }),
|
87
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'fiscal quarter' }),
|
88
|
+
tslib_1.__metadata("design:type", Number)
|
89
|
+
], TransactionHistory.prototype, "quarter", void 0);
|
90
|
+
tslib_1.__decorate([
|
91
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
92
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'fiscal month' }),
|
93
|
+
tslib_1.__metadata("design:type", Number)
|
94
|
+
], TransactionHistory.prototype, "month", void 0);
|
95
|
+
tslib_1.__decorate([
|
96
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: false }),
|
97
|
+
(0, type_graphql_1.Field)({ nullable: false, description: 'The exact date and time the transaction occurred' }),
|
98
|
+
tslib_1.__metadata("design:type", Date // 트랜잭션이 발생한 실제 시점(날짜와 시간)
|
99
|
+
)
|
100
|
+
], TransactionHistory.prototype, "occurredAt", void 0);
|
101
|
+
tslib_1.__decorate([
|
102
|
+
(0, typeorm_1.Column)(),
|
66
103
|
(0, type_graphql_1.Field)({ nullable: true }),
|
67
104
|
tslib_1.__metadata("design:type", Date)
|
68
105
|
], TransactionHistory.prototype, "createdAt", void 0);
|
69
106
|
tslib_1.__decorate([
|
70
|
-
(0, typeorm_1.Column)(
|
107
|
+
(0, typeorm_1.Column)(),
|
71
108
|
(0, type_graphql_1.Field)({ nullable: true }),
|
72
109
|
tslib_1.__metadata("design:type", Date)
|
73
110
|
], TransactionHistory.prototype, "updatedAt", void 0);
|
74
111
|
tslib_1.__decorate([
|
75
|
-
(0, typeorm_1.Column)(
|
112
|
+
(0, typeorm_1.Column)(),
|
76
113
|
(0, type_graphql_1.Field)({ nullable: true }),
|
77
114
|
tslib_1.__metadata("design:type", Date)
|
78
115
|
], TransactionHistory.prototype, "deletedAt", void 0);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction-history.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,+CAA4D;
|
1
|
+
{"version":3,"file":"transaction-history.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,+CAA4D;AAC5D,gDAA4C;AAE5C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,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,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU;QAClB,IAAI,EAAE,mCAAiB;KACxB,CAAC;;kDAC+B;6BAtGtB,kBAAkB;IAhB9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE,kBAAkB,CAAC,OAAO,CAAC,EACvG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,kBAAsC,EAAE,EAAE,CAAC;QAC1C,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,UAAU;QAC7B,kBAAkB,CAAC,OAAO;KAC3B,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CAuG9B","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 { Transaction, TransactionType } from './transaction'\nimport { Account } from '../account/account'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_transaction_history_0',\n (transactionHistory: TransactionHistory) => [transactionHistory.originalId, transactionHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_transaction_history_1',\n (transactionHistory: TransactionHistory) => [\n transactionHistory.domain,\n transactionHistory.originalId,\n transactionHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of Transaction' })\nexport class TransactionHistory implements HistoryEntityInterface<Transaction> {\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((transaction: Transaction) => transaction.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 currency?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n amount?: number = 0\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: TransactionType\n\n @ManyToOne(type => Account)\n @Field({ nullable: true })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: 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, description: 'fiscal month' })\n month?: number\n\n @Column({ type: 'timestamp', nullable: false })\n @Field({ nullable: false, description: 'The exact date and time the transaction occurred' })\n occurredAt: Date // 트랜잭션이 발생한 실제 시점(날짜와 시간)\n\n @Column()\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column()\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((transaction: Transaction) => transaction.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.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"]}
|
@@ -46,7 +46,7 @@ tslib_1.__decorate([
|
|
46
46
|
], TransactionQuery.prototype, "transaction", null);
|
47
47
|
tslib_1.__decorate([
|
48
48
|
(0, type_graphql_1.Query)(returns => transaction_type_1.TransactionList, { description: 'To fetch multiple Transactions' }),
|
49
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)(
|
49
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
50
50
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
51
51
|
tslib_1.__metadata("design:type", Function),
|
52
52
|
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction-query.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,+CAA2C;AAC3C,yDAAoD;AAG7C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAErB,AAAN,KAAK,CAAC,WAAW,CAAY,EAAU,EAAS,OAAwB;QACtE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,yBAAW,CAAC,CAAC,OAAO,CAAC;YAC9C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,YAAY,
|
1
|
+
{"version":3,"file":"transaction-query.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,+CAA2C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QAC5C,OAAO,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAA;IAC3E,CAAC;CACF,CAAA;AAxCY,4CAAgB;AAErB;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,yBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IACvE,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;mDAM9C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,kCAAe,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IACjE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;oDAa3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAc,yBAAW;;8CAE5C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAc,yBAAW;;+CAE7C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAc,yBAAW;;+CAE7C;2BAvCU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,yBAAW,CAAC;GACT,gBAAgB,CAwC5B","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 { Transaction } from './transaction'\nimport { TransactionList } from './transaction-type'\n\n@Resolver(Transaction)\nexport class TransactionQuery {\n @Query(returns => Transaction!, { nullable: true, description: 'To fetch a Transaction' })\n async transaction(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Transaction> {\n const { domain } = context.state\n\n return await getRepository(Transaction).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => TransactionList, { description: 'To fetch multiple Transactions' })\n async transactions(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TransactionList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Transaction),\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() transaction: Transaction): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: transaction.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() transaction: Transaction): Promise<User> {\n return await getRepository(User).findOneBy({ id: transaction.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() transaction: Transaction): Promise<User> {\n return await getRepository(User).findOneBy({ id: transaction.creatorId })\n }\n}\n"]}
|
@@ -2,10 +2,10 @@ import { Domain } from '@things-factory/shell';
|
|
2
2
|
import { User } from '@things-factory/auth-base';
|
3
3
|
import { Account } from '../account/account';
|
4
4
|
export declare enum TransactionType {
|
5
|
-
Income = 0
|
6
|
-
Expense = 1
|
7
|
-
Asset = 2
|
8
|
-
Liability = 3
|
5
|
+
Income = 0,
|
6
|
+
Expense = 1,
|
7
|
+
Asset = 2,
|
8
|
+
Liability = 3,
|
9
9
|
Equity = 4
|
10
10
|
}
|
11
11
|
export declare class Transaction {
|
@@ -15,13 +15,16 @@ export declare class Transaction {
|
|
15
15
|
domainId?: string;
|
16
16
|
name?: string;
|
17
17
|
description?: string;
|
18
|
-
date?: Date;
|
19
18
|
currency?: string;
|
20
19
|
amount?: number;
|
21
20
|
active?: boolean;
|
22
21
|
type?: TransactionType;
|
23
22
|
account?: Account;
|
24
23
|
accountId?: string;
|
24
|
+
year?: number;
|
25
|
+
quarter?: number;
|
26
|
+
month?: number;
|
27
|
+
occurredAt: Date;
|
25
28
|
createdAt?: Date;
|
26
29
|
updatedAt?: Date;
|
27
30
|
deletedAt?: Date;
|
@@ -13,11 +13,11 @@ var TransactionType;
|
|
13
13
|
TransactionType[TransactionType["Expense"] = 1] = "Expense";
|
14
14
|
TransactionType[TransactionType["Asset"] = 2] = "Asset";
|
15
15
|
TransactionType[TransactionType["Liability"] = 3] = "Liability";
|
16
|
-
TransactionType[TransactionType["Equity"] = 4] = "Equity";
|
16
|
+
TransactionType[TransactionType["Equity"] = 4] = "Equity";
|
17
17
|
})(TransactionType || (exports.TransactionType = TransactionType = {}));
|
18
18
|
(0, type_graphql_1.registerEnumType)(TransactionType, {
|
19
19
|
name: 'TransactionType',
|
20
|
-
description: '
|
20
|
+
description: 'Type enumeration of a transaction'
|
21
21
|
});
|
22
22
|
let Transaction = class Transaction {
|
23
23
|
constructor() {
|
@@ -38,7 +38,7 @@ tslib_1.__decorate([
|
|
38
38
|
], Transaction.prototype, "version", void 0);
|
39
39
|
tslib_1.__decorate([
|
40
40
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
41
|
-
(0, type_graphql_1.Field)(
|
41
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
42
42
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
43
43
|
], Transaction.prototype, "domain", void 0);
|
44
44
|
tslib_1.__decorate([
|
@@ -55,11 +55,6 @@ tslib_1.__decorate([
|
|
55
55
|
(0, type_graphql_1.Field)({ nullable: true }),
|
56
56
|
tslib_1.__metadata("design:type", String)
|
57
57
|
], Transaction.prototype, "description", 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", Date)
|
62
|
-
], Transaction.prototype, "date", void 0);
|
63
58
|
tslib_1.__decorate([
|
64
59
|
(0, typeorm_1.Column)({ nullable: true }),
|
65
60
|
(0, type_graphql_1.Field)({ nullable: true }),
|
@@ -89,6 +84,27 @@ tslib_1.__decorate([
|
|
89
84
|
(0, typeorm_1.RelationId)((transaction) => transaction.account),
|
90
85
|
tslib_1.__metadata("design:type", String)
|
91
86
|
], Transaction.prototype, "accountId", void 0);
|
87
|
+
tslib_1.__decorate([
|
88
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
89
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'fiscal year' }),
|
90
|
+
tslib_1.__metadata("design:type", Number)
|
91
|
+
], Transaction.prototype, "year", void 0);
|
92
|
+
tslib_1.__decorate([
|
93
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
94
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'fiscal quarter' }),
|
95
|
+
tslib_1.__metadata("design:type", Number)
|
96
|
+
], Transaction.prototype, "quarter", void 0);
|
97
|
+
tslib_1.__decorate([
|
98
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
99
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'fiscal month' }),
|
100
|
+
tslib_1.__metadata("design:type", Number)
|
101
|
+
], Transaction.prototype, "month", void 0);
|
102
|
+
tslib_1.__decorate([
|
103
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: false }),
|
104
|
+
(0, type_graphql_1.Field)({ nullable: false, description: 'The exact date and time the transaction occurred' }),
|
105
|
+
tslib_1.__metadata("design:type", Date // 트랜잭션이 발생한 실제 시점(날짜와 시간)
|
106
|
+
)
|
107
|
+
], Transaction.prototype, "occurredAt", void 0);
|
92
108
|
tslib_1.__decorate([
|
93
109
|
(0, typeorm_1.CreateDateColumn)(),
|
94
110
|
(0, type_graphql_1.Field)({ nullable: true }),
|
@@ -123,8 +139,15 @@ tslib_1.__decorate([
|
|
123
139
|
tslib_1.__metadata("design:type", String)
|
124
140
|
], Transaction.prototype, "updaterId", void 0);
|
125
141
|
exports.Transaction = Transaction = tslib_1.__decorate([
|
142
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for Transaction' }),
|
126
143
|
(0, typeorm_1.Entity)(),
|
127
|
-
(0, typeorm_1.Index)('ix_transaction_0', (transaction) => [transaction.domain, transaction.
|
128
|
-
|
144
|
+
(0, typeorm_1.Index)('ix_transaction_0', (transaction) => [transaction.domain, transaction.occurredAt], {
|
145
|
+
unique: true,
|
146
|
+
where: '"deleted_at" IS NULL'
|
147
|
+
}),
|
148
|
+
(0, typeorm_1.Index)('ix_transaction_1', (transaction) => [transaction.domain, transaction.year, transaction.quarter, transaction.month], {
|
149
|
+
unique: true,
|
150
|
+
where: '"deleted_at" IS NULL'
|
151
|
+
})
|
129
152
|
], Transaction);
|
130
153
|
//# sourceMappingURL=transaction.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAChD,gDAA4C;AAE5C,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,yDAAM,CAAA;IACN,2DAAO,CAAA;IACP,uDAAK,CAAA;IACL,+DAAS,CAAA;IACT,yDAAM,CAAA
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAChD,gDAA4C;AAE5C,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,yDAAM,CAAA;IACN,2DAAO,CAAA;IACP,uDAAK,CAAA;IACL,+DAAS,CAAA;IACT,yDAAM,CAAA;AACR,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE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Z,KAAK,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,eAAK,EACJ,kBAAkB,EAClB,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,EAC5G;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CACF;GACY,WAAW,CAwFvB","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 { Account } from '../account/account'\n\nexport enum TransactionType {\n Income,\n Expense,\n Asset,\n Liability,\n Equity\n}\n\nregisterEnumType(TransactionType, {\n name: 'TransactionType',\n description: 'Type enumeration of a transaction'\n})\n\n@ObjectType({ description: 'Entity for Transaction' })\n@Entity()\n@Index('ix_transaction_0', (transaction: Transaction) => [transaction.domain, transaction.occurredAt], {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n})\n@Index(\n 'ix_transaction_1',\n (transaction: Transaction) => [transaction.domain, transaction.year, transaction.quarter, transaction.month],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n }\n)\nexport class Transaction {\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((transaction: Transaction) => transaction.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 currency?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n amount?: number = 0\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: TransactionType\n\n @ManyToOne(type => Account)\n @Field({ nullable: true })\n account?: Account\n\n @RelationId((transaction: Transaction) => transaction.account)\n accountId?: 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, description: 'fiscal month' })\n month?: number\n\n @Column({ type: 'timestamp', nullable: false })\n @Field({ nullable: false, description: 'The exact date and time the transaction occurred' })\n occurredAt: Date // 트랜잭션이 발생한 실제 시점(날짜와 시간)\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((transaction: Transaction) => transaction.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((transaction: Transaction) => transaction.updater)\n updaterId?: string\n}\n"]}
|