@things-factory/accounting 8.0.0-beta.9 → 8.0.2
Sign up to get free protection for your applications and to get access to all the features.
- 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 +10 -0
- package/client/components/accounting-category-selector.ts +136 -0
- package/client/components/accounting-category-view.ts +75 -0
- package/client/grist-editors/grist-editor-accounting-category-object.ts +83 -0
- package/client/grist-editors/grist-renderer-accounting-category-object.ts +13 -0
- package/client/index.ts +0 -0
- package/client/pages/account/account-importer.ts +97 -0
- package/client/pages/account/account-list-page.ts +364 -0
- package/client/pages/accounting-category/accounting-category-importer.ts +97 -0
- package/client/pages/accounting-category/accounting-category-list-page.ts +368 -0
- package/client/pages/accounting-category/accounting-category-tree-page.ts +338 -0
- package/client/pages/accounting-document/accounting-document-importer.ts +90 -0
- package/client/pages/accounting-document/accounting-document-list-page.ts +398 -0
- package/client/pages/financial-statement/financial-statement-importer.ts +97 -0
- package/client/pages/financial-statement/financial-statement-list-page.ts +338 -0
- 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 +97 -0
- package/client/pages/income-statement/income-statement-list-page.ts +338 -0
- package/client/pages/payment/payment-importer.ts +90 -0
- package/client/pages/payment/payment-list-page.ts +398 -0
- package/client/pages/transaction/transaction-importer.ts +97 -0
- package/client/pages/transaction/transaction-list-page.ts +338 -0
- package/client/route.ts +35 -0
- package/client/tsconfig.json +13 -0
- package/client/types/accounting-category.ts +23 -0
- package/client/types/index.ts +1 -0
- package/dist-client/pages/accounting-category/accounting-category-tree-page.js +1 -1
- package/dist-client/pages/accounting-category/accounting-category-tree-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/index.d.ts +2 -3
- package/dist-server/service/index.js +0 -5
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/payment/index.d.ts +2 -1
- package/dist-server/service/payment/payment-history.d.ts +1 -8
- package/dist-server/service/payment/payment-history.js +10 -41
- package/dist-server/service/payment/payment-history.js.map +1 -1
- package/dist-server/service/payment/payment-type.d.ts +1 -7
- package/dist-server/service/payment/payment-type.js +0 -24
- package/dist-server/service/payment/payment-type.js.map +1 -1
- package/dist-server/service/payment/payment.d.ts +0 -12
- package/dist-server/service/payment/payment.js +1 -36
- package/dist-server/service/payment/payment.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/server/activities/activity-book.ts +172 -0
- package/server/activities/activity-expense.ts +149 -0
- package/server/activities/index.ts +18 -0
- package/server/controllers/index.ts +1 -0
- package/server/controllers/summary-statements.ts +166 -0
- package/server/index.ts +6 -0
- package/server/middlewares/index.ts +3 -0
- package/server/migrations/1725200507196-seed-fiscal-entities.ts +106 -0
- package/server/migrations/1725201467183-seed-accounts.ts +339 -0
- package/server/migrations/index.ts +9 -0
- package/server/routes.ts +26 -0
- package/server/service/account/account-history.ts +117 -0
- package/server/service/account/account-mutation.ts +140 -0
- package/server/service/account/account-query.ts +51 -0
- package/server/service/account/account-type.ts +44 -0
- package/server/service/account/account.ts +97 -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-history.ts +129 -0
- package/server/service/accounting-category/accounting-category-mutation.ts +148 -0
- package/server/service/accounting-category/accounting-category-query.ts +74 -0
- package/server/service/accounting-category/accounting-category-type.ts +48 -0
- package/server/service/accounting-category/accounting-category.ts +100 -0
- package/server/service/accounting-category/event-subscriber.ts +20 -0
- package/server/service/accounting-category/index.ts +9 -0
- package/server/service/accounting-document/accounting-document-history.ts +123 -0
- package/server/service/accounting-document/accounting-document-mutation.ts +137 -0
- package/server/service/accounting-document/accounting-document-query.ts +48 -0
- package/server/service/accounting-document/accounting-document-type.ts +52 -0
- package/server/service/accounting-document/accounting-document.ts +93 -0
- package/server/service/accounting-document/event-subscriber.ts +17 -0
- package/server/service/accounting-document/index.ts +9 -0
- package/server/service/common-type.ts +12 -0
- package/server/service/financial-statement/event-subscriber.ts +17 -0
- package/server/service/financial-statement/financial-statement-history.ts +129 -0
- package/server/service/financial-statement/financial-statement-line-item.ts +82 -0
- package/server/service/financial-statement/financial-statement-mutation.ts +148 -0
- package/server/service/financial-statement/financial-statement-query.ts +53 -0
- package/server/service/financial-statement/financial-statement-type.ts +51 -0
- package/server/service/financial-statement/financial-statement.ts +116 -0
- package/server/service/financial-statement/index.ts +10 -0
- package/server/service/fiscal-month/fiscal-month-mutation.ts +145 -0
- package/server/service/fiscal-month/fiscal-month-query.ts +58 -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 +148 -0
- package/server/service/fiscal-quarter/fiscal-quarter-query.ts +60 -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 +145 -0
- package/server/service/fiscal-year/fiscal-year-query.ts +53 -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/event-subscriber.ts +17 -0
- package/server/service/income-statement/income-statement-history.ts +133 -0
- package/server/service/income-statement/income-statement-line-item.ts +84 -0
- package/server/service/income-statement/income-statement-mutation.ts +147 -0
- package/server/service/income-statement/income-statement-query.ts +50 -0
- package/server/service/income-statement/income-statement-type.ts +51 -0
- package/server/service/income-statement/income-statement.ts +120 -0
- package/server/service/income-statement/index.ts +10 -0
- package/server/service/index.ts +108 -0
- package/server/service/payment/event-subscriber.ts +17 -0
- package/server/service/payment/index.ts +9 -0
- package/server/service/payment/payment-history.ts +132 -0
- package/server/service/payment/payment-mutation.ts +139 -0
- package/server/service/payment/payment-query.ts +50 -0
- package/server/service/payment/payment-type.ts +64 -0
- package/server/service/payment/payment.ts +123 -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 +161 -0
- package/server/service/transaction/transaction-mutation.ts +146 -0
- package/server/service/transaction/transaction-query.ts +50 -0
- package/server/service/transaction/transaction-type.ts +48 -0
- package/server/service/transaction/transaction.ts +230 -0
- package/server/tsconfig.json +10 -0
- package/dist-client/pages/bank/bank-importer.d.ts +0 -23
- package/dist-client/pages/bank/bank-importer.js +0 -93
- package/dist-client/pages/bank/bank-importer.js.map +0 -1
- package/dist-client/pages/bank/bank-list-page.d.ts +0 -66
- package/dist-client/pages/bank/bank-list-page.js +0 -370
- package/dist-client/pages/bank/bank-list-page.js.map +0 -1
- package/dist-client/pages/bank-account/bank-account-importer.d.ts +0 -23
- package/dist-client/pages/bank-account/bank-account-importer.js +0 -93
- package/dist-client/pages/bank-account/bank-account-importer.js.map +0 -1
- package/dist-client/pages/bank-account/bank-account-list-page.d.ts +0 -66
- package/dist-client/pages/bank-account/bank-account-list-page.js +0 -370
- package/dist-client/pages/bank-account/bank-account-list-page.js.map +0 -1
- package/dist-client/pages/financial-institution/financial-institution-importer.d.ts +0 -23
- package/dist-client/pages/financial-institution/financial-institution-importer.js +0 -93
- package/dist-client/pages/financial-institution/financial-institution-importer.js.map +0 -1
- package/dist-client/pages/financial-institution/financial-institution-list-page.d.ts +0 -66
- package/dist-client/pages/financial-institution/financial-institution-list-page.js +0 -370
- package/dist-client/pages/financial-institution/financial-institution-list-page.js.map +0 -1
- package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +0 -5
- package/dist-server/migrations/1725201567284-seed-country-codes.js +0 -248
- package/dist-server/migrations/1725201567284-seed-country-codes.js.map +0 -1
- package/dist-server/migrations/1725201667385-seed-financial-institutions.d.ts +0 -5
- package/dist-server/migrations/1725201667385-seed-financial-institutions.js +0 -348
- package/dist-server/migrations/1725201667385-seed-financial-institutions.js.map +0 -1
- package/dist-server/service/bank-account/bank-account-history.d.ts +0 -34
- package/dist-server/service/bank-account/bank-account-history.js +0 -172
- package/dist-server/service/bank-account/bank-account-history.js.map +0 -1
- package/dist-server/service/bank-account/bank-account-mutation.d.ts +0 -10
- package/dist-server/service/bank-account/bank-account-mutation.js +0 -128
- package/dist-server/service/bank-account/bank-account-mutation.js.map +0 -1
- package/dist-server/service/bank-account/bank-account-query.d.ts +0 -11
- package/dist-server/service/bank-account/bank-account-query.js +0 -79
- package/dist-server/service/bank-account/bank-account-query.js.map +0 -1
- package/dist-server/service/bank-account/bank-account-type.d.ts +0 -39
- package/dist-server/service/bank-account/bank-account-type.js +0 -153
- package/dist-server/service/bank-account/bank-account-type.js.map +0 -1
- package/dist-server/service/bank-account/bank-account.d.ts +0 -38
- package/dist-server/service/bank-account/bank-account.js +0 -164
- package/dist-server/service/bank-account/bank-account.js.map +0 -1
- package/dist-server/service/bank-account/event-subscriber.d.ts +0 -7
- package/dist-server/service/bank-account/event-subscriber.js +0 -21
- package/dist-server/service/bank-account/event-subscriber.js.map +0 -1
- package/dist-server/service/bank-account/index.d.ts +0 -7
- package/dist-server/service/bank-account/index.js +0 -12
- package/dist-server/service/bank-account/index.js.map +0 -1
- package/dist-server/service/financial-institution/financial-institution-mutation.d.ts +0 -10
- package/dist-server/service/financial-institution/financial-institution-mutation.js +0 -169
- package/dist-server/service/financial-institution/financial-institution-mutation.js.map +0 -1
- package/dist-server/service/financial-institution/financial-institution-query.d.ts +0 -12
- package/dist-server/service/financial-institution/financial-institution-query.js +0 -97
- package/dist-server/service/financial-institution/financial-institution-query.js.map +0 -1
- package/dist-server/service/financial-institution/financial-institution-type.d.ts +0 -32
- package/dist-server/service/financial-institution/financial-institution-type.js +0 -126
- package/dist-server/service/financial-institution/financial-institution-type.js.map +0 -1
- package/dist-server/service/financial-institution/financial-institution.d.ts +0 -34
- package/dist-server/service/financial-institution/financial-institution.js +0 -137
- package/dist-server/service/financial-institution/financial-institution.js.map +0 -1
- package/dist-server/service/financial-institution/index.d.ts +0 -6
- package/dist-server/service/financial-institution/index.js +0 -10
- package/dist-server/service/financial-institution/index.js.map +0 -1
- package/helps/accounting/bank-account.md +0 -160
- package/helps/accounting/bank.md +0 -160
- package/helps/accounting/financial-institution.md +0 -160
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"bank-account-type.js","sourceRoot":"","sources":["../../../server/service/bank-account/bank-account-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAItF,iDAAoE;AAG7D,IAAM,cAAc,GAApB,MAAM,cAAc;CA0C1B,CAAA;AA1CY,wCAAc;AAEzB;IADC,IAAA,oBAAK,GAAE;;4CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;yDAC3C;AAG1B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;qDACxC;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;;gDACnC;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAW,EAAE,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;;mDAC1D;AAGxB;IADC,IAAA,oBAAK,E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;IAD5B,IAAA,wBAAS,GAAE;GACC,gBAAgB,CAgD5B;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AANY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC;;8CACT;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;8CACN;0BALF,eAAe;IAD3B,IAAA,yBAAU,GAAE;GACA,eAAe,CAM3B","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { AccountType, BankAccount, OwnerType } from './bank-account'\n\n@InputType()\nexport class NewBankAccount {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true, description: 'Name of the account holder' })\n accountHolderName?: string // 계좌 소유자의 이름\n\n @Field({ nullable: true, description: 'Bank account number' })\n accountNumber?: string\n\n @Field({ nullable: true, description: 'Bank name' })\n bankName?: string\n\n @Field(type => AccountType, { description: 'Type of the account (Bank or Card)' })\n accountType: AccountType\n\n @Field({ nullable: true, description: 'Currency of the account' })\n currency?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => OwnerType, { description: 'Type of the owner of the bank account' })\n ownerType: OwnerType\n\n @Field({ description: 'ID of the owner of the bank account' })\n ownerId: string\n\n @Field({ nullable: true, description: 'IBAN of the bank account' })\n iban?: string // 은행 계좌의 IBAN\n\n @Field({ nullable: true, description: 'BIC of the bank account' })\n bic?: string // 은행 계좌의 BIC\n\n @Field({ nullable: true, description: 'Country of the bank account' })\n country?: string // 은행 계좌의 국적\n\n @Field({ nullable: true, description: 'Cover image of the bank account' })\n image?: string // 은행 계좌의 커버이미지\n}\n\n@InputType()\nexport class BankAccountPatch {\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, description: 'Name of the account holder' })\n accountHolderName?: string // 계좌 소유자의 이름\n\n @Field({ nullable: true, description: 'Bank account number' })\n accountNumber?: string\n\n @Field({ nullable: true, description: 'Bank name' })\n bankName?: string\n\n @Field(type => AccountType, { description: 'Type of the account (Bank or Card)' })\n accountType: AccountType\n\n @Field({ nullable: true, description: 'Currency of the account' })\n currency?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => OwnerType, { description: 'Type of the owner of the bank account' })\n ownerType: OwnerType\n\n @Field({ description: 'ID of the owner of the bank account' })\n ownerId: string\n\n @Field({ nullable: true, description: 'IBAN of the bank account' })\n iban?: string // 은행 계좌의 IBAN\n\n @Field({ nullable: true, description: 'BIC of the bank account' })\n bic?: string // 은행 계좌의 BIC\n\n @Field({ nullable: true, description: 'Country of the bank account' })\n country?: string // 은행 계좌의 국적\n\n @Field({ nullable: true, description: 'Cover image of the bank account' })\n image?: string // 은행 계좌의 커버이미지\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class BankAccountList {\n @Field(type => [BankAccount])\n items: BankAccount[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { Domain } from '@things-factory/shell';
|
2
|
-
import { User } from '@things-factory/auth-base';
|
3
|
-
export declare enum AccountType {
|
4
|
-
Bank = "Bank",
|
5
|
-
Card = "Card"
|
6
|
-
}
|
7
|
-
export declare enum OwnerType {
|
8
|
-
Company = "Company",
|
9
|
-
Vendor = "Vendor",
|
10
|
-
Employee = "Employee"
|
11
|
-
}
|
12
|
-
export declare class BankAccount {
|
13
|
-
readonly id: string;
|
14
|
-
version?: number;
|
15
|
-
domain?: Domain;
|
16
|
-
domainId?: string;
|
17
|
-
name?: string;
|
18
|
-
description?: string;
|
19
|
-
accountHolderName?: string;
|
20
|
-
accountNumber?: string;
|
21
|
-
bankName?: string;
|
22
|
-
accountType: AccountType;
|
23
|
-
currency?: string;
|
24
|
-
active?: boolean;
|
25
|
-
ownerType: OwnerType;
|
26
|
-
ownerId: string;
|
27
|
-
iban?: string;
|
28
|
-
bic?: string;
|
29
|
-
country?: string;
|
30
|
-
image?: string;
|
31
|
-
createdAt?: Date;
|
32
|
-
updatedAt?: Date;
|
33
|
-
deletedAt?: Date;
|
34
|
-
creator?: User;
|
35
|
-
creatorId?: string;
|
36
|
-
updater?: User;
|
37
|
-
updaterId?: string;
|
38
|
-
}
|
@@ -1,164 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BankAccount = exports.OwnerType = exports.AccountType = void 0;
|
4
|
-
const tslib_1 = require("tslib");
|
5
|
-
const typeorm_1 = require("typeorm");
|
6
|
-
const type_graphql_1 = require("type-graphql");
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
8
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
9
|
-
var AccountType;
|
10
|
-
(function (AccountType) {
|
11
|
-
AccountType["Bank"] = "Bank";
|
12
|
-
AccountType["Card"] = "Card";
|
13
|
-
})(AccountType || (exports.AccountType = AccountType = {}));
|
14
|
-
(0, type_graphql_1.registerEnumType)(AccountType, {
|
15
|
-
name: 'AccountType',
|
16
|
-
description: 'Type of the account (Bank or Card)'
|
17
|
-
});
|
18
|
-
var OwnerType;
|
19
|
-
(function (OwnerType) {
|
20
|
-
OwnerType["Company"] = "Company";
|
21
|
-
OwnerType["Vendor"] = "Vendor";
|
22
|
-
OwnerType["Employee"] = "Employee";
|
23
|
-
})(OwnerType || (exports.OwnerType = OwnerType = {}));
|
24
|
-
(0, type_graphql_1.registerEnumType)(OwnerType, {
|
25
|
-
name: 'OwnerType',
|
26
|
-
description: 'Type of the owner of the bank account'
|
27
|
-
});
|
28
|
-
let BankAccount = class BankAccount {
|
29
|
-
constructor() {
|
30
|
-
this.version = 1;
|
31
|
-
}
|
32
|
-
};
|
33
|
-
exports.BankAccount = BankAccount;
|
34
|
-
tslib_1.__decorate([
|
35
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
36
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
37
|
-
tslib_1.__metadata("design:type", String)
|
38
|
-
], BankAccount.prototype, "id", void 0);
|
39
|
-
tslib_1.__decorate([
|
40
|
-
(0, typeorm_1.VersionColumn)(),
|
41
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
42
|
-
tslib_1.__metadata("design:type", Number)
|
43
|
-
], BankAccount.prototype, "version", void 0);
|
44
|
-
tslib_1.__decorate([
|
45
|
-
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
46
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
47
|
-
tslib_1.__metadata("design:type", shell_1.Domain)
|
48
|
-
], BankAccount.prototype, "domain", void 0);
|
49
|
-
tslib_1.__decorate([
|
50
|
-
(0, typeorm_1.RelationId)((bankAccount) => bankAccount.domain),
|
51
|
-
tslib_1.__metadata("design:type", String)
|
52
|
-
], BankAccount.prototype, "domainId", void 0);
|
53
|
-
tslib_1.__decorate([
|
54
|
-
(0, typeorm_1.Column)({ nullable: false }),
|
55
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
56
|
-
tslib_1.__metadata("design:type", String)
|
57
|
-
], BankAccount.prototype, "name", void 0);
|
58
|
-
tslib_1.__decorate([
|
59
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
60
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
61
|
-
tslib_1.__metadata("design:type", String)
|
62
|
-
], BankAccount.prototype, "description", void 0);
|
63
|
-
tslib_1.__decorate([
|
64
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
65
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Name of the account holder' }),
|
66
|
-
tslib_1.__metadata("design:type", String)
|
67
|
-
], BankAccount.prototype, "accountHolderName", void 0);
|
68
|
-
tslib_1.__decorate([
|
69
|
-
(0, typeorm_1.Column)({ nullable: false }),
|
70
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Bank account number' }),
|
71
|
-
tslib_1.__metadata("design:type", String)
|
72
|
-
], BankAccount.prototype, "accountNumber", void 0);
|
73
|
-
tslib_1.__decorate([
|
74
|
-
(0, typeorm_1.Column)({ nullable: false }),
|
75
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Bank name' }),
|
76
|
-
tslib_1.__metadata("design:type", String)
|
77
|
-
], BankAccount.prototype, "bankName", void 0);
|
78
|
-
tslib_1.__decorate([
|
79
|
-
(0, typeorm_1.Column)({ nullable: false }),
|
80
|
-
(0, type_graphql_1.Field)(type => AccountType, { description: 'Type of the account (Bank or Card)' }),
|
81
|
-
tslib_1.__metadata("design:type", String)
|
82
|
-
], BankAccount.prototype, "accountType", void 0);
|
83
|
-
tslib_1.__decorate([
|
84
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
85
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Currency of the account' }),
|
86
|
-
tslib_1.__metadata("design:type", String)
|
87
|
-
], BankAccount.prototype, "currency", void 0);
|
88
|
-
tslib_1.__decorate([
|
89
|
-
(0, typeorm_1.Column)({ nullable: false, default: false }),
|
90
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
91
|
-
tslib_1.__metadata("design:type", Boolean)
|
92
|
-
], BankAccount.prototype, "active", void 0);
|
93
|
-
tslib_1.__decorate([
|
94
|
-
(0, typeorm_1.Column)({ nullable: false }),
|
95
|
-
(0, type_graphql_1.Field)(type => OwnerType, { description: 'Type of the owner of the bank account' }),
|
96
|
-
tslib_1.__metadata("design:type", String)
|
97
|
-
], BankAccount.prototype, "ownerType", void 0);
|
98
|
-
tslib_1.__decorate([
|
99
|
-
(0, typeorm_1.Column)({ nullable: false }),
|
100
|
-
(0, type_graphql_1.Field)({ description: 'ID of the owner of the bank account' }),
|
101
|
-
tslib_1.__metadata("design:type", String)
|
102
|
-
], BankAccount.prototype, "ownerId", void 0);
|
103
|
-
tslib_1.__decorate([
|
104
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
105
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'IBAN of the bank account' }),
|
106
|
-
tslib_1.__metadata("design:type", String)
|
107
|
-
], BankAccount.prototype, "iban", void 0);
|
108
|
-
tslib_1.__decorate([
|
109
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
110
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'BIC of the bank account' }),
|
111
|
-
tslib_1.__metadata("design:type", String)
|
112
|
-
], BankAccount.prototype, "bic", void 0);
|
113
|
-
tslib_1.__decorate([
|
114
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
115
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Country of the bank account' }),
|
116
|
-
tslib_1.__metadata("design:type", String)
|
117
|
-
], BankAccount.prototype, "country", void 0);
|
118
|
-
tslib_1.__decorate([
|
119
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
120
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Cover image of the bank account' }),
|
121
|
-
tslib_1.__metadata("design:type", String)
|
122
|
-
], BankAccount.prototype, "image", void 0);
|
123
|
-
tslib_1.__decorate([
|
124
|
-
(0, typeorm_1.CreateDateColumn)(),
|
125
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
126
|
-
tslib_1.__metadata("design:type", Date)
|
127
|
-
], BankAccount.prototype, "createdAt", void 0);
|
128
|
-
tslib_1.__decorate([
|
129
|
-
(0, typeorm_1.UpdateDateColumn)(),
|
130
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
131
|
-
tslib_1.__metadata("design:type", Date)
|
132
|
-
], BankAccount.prototype, "updatedAt", void 0);
|
133
|
-
tslib_1.__decorate([
|
134
|
-
(0, typeorm_1.DeleteDateColumn)(),
|
135
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
136
|
-
tslib_1.__metadata("design:type", Date)
|
137
|
-
], BankAccount.prototype, "deletedAt", void 0);
|
138
|
-
tslib_1.__decorate([
|
139
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
140
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
141
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
142
|
-
], BankAccount.prototype, "creator", void 0);
|
143
|
-
tslib_1.__decorate([
|
144
|
-
(0, typeorm_1.RelationId)((bankAccount) => bankAccount.creator),
|
145
|
-
tslib_1.__metadata("design:type", String)
|
146
|
-
], BankAccount.prototype, "creatorId", void 0);
|
147
|
-
tslib_1.__decorate([
|
148
|
-
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
149
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
150
|
-
tslib_1.__metadata("design:type", auth_base_1.User)
|
151
|
-
], BankAccount.prototype, "updater", void 0);
|
152
|
-
tslib_1.__decorate([
|
153
|
-
(0, typeorm_1.RelationId)((bankAccount) => bankAccount.updater),
|
154
|
-
tslib_1.__metadata("design:type", String)
|
155
|
-
], BankAccount.prototype, "updaterId", void 0);
|
156
|
-
exports.BankAccount = BankAccount = tslib_1.__decorate([
|
157
|
-
(0, typeorm_1.Entity)(),
|
158
|
-
(0, typeorm_1.Index)('ix_bank_account_0', (bankAccount) => [bankAccount.domain, bankAccount.name], {
|
159
|
-
where: '"deleted_at" IS NULL',
|
160
|
-
unique: true
|
161
|
-
}),
|
162
|
-
(0, type_graphql_1.ObjectType)({ description: 'Entity for BankAccount' })
|
163
|
-
], BankAccount);
|
164
|
-
//# sourceMappingURL=bank-account.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"bank-account.js","sourceRoot":"","sources":["../../../server/service/bank-account/bank-account.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY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,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;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC5C;AAIlB;IAFC,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;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC5C;sBAhGP,WAAW;IANvB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE;QAChG,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;GACzC,WAAW,CAiGvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n VersionColumn,\n PrimaryGeneratedColumn\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 AccountType {\n Bank = 'Bank',\n Card = 'Card'\n}\n\nregisterEnumType(AccountType, {\n name: 'AccountType',\n description: 'Type of the account (Bank or Card)'\n})\n\nexport enum OwnerType {\n Company = 'Company',\n Vendor = 'Vendor',\n Employee = 'Employee'\n}\n\nregisterEnumType(OwnerType, {\n name: 'OwnerType',\n description: 'Type of the owner of the bank account'\n})\n\n@Entity()\n@Index('ix_bank_account_0', (bankAccount: BankAccount) => [bankAccount.domain, bankAccount.name], {\n where: '\"deleted_at\" IS NULL',\n unique: true\n})\n@ObjectType({ description: 'Entity for BankAccount' })\nexport class BankAccount {\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((bankAccount: BankAccount) => bankAccount.domain)\n domainId?: string\n\n @Column({ nullable: false })\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, description: 'Name of the account holder' })\n accountHolderName?: string // 계좌 소유자의 이름\n\n @Column({ nullable: false })\n @Field({ nullable: true, description: 'Bank account number' })\n accountNumber?: string\n\n @Column({ nullable: false })\n @Field({ nullable: true, description: 'Bank name' })\n bankName?: string\n\n @Column({ nullable: false })\n @Field(type => AccountType, { description: 'Type of the account (Bank or Card)' })\n accountType: AccountType\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Currency of the account' })\n currency?: string\n\n @Column({ nullable: false, default: false })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: false })\n @Field(type => OwnerType, { description: 'Type of the owner of the bank account' })\n ownerType: OwnerType\n\n @Column({ nullable: false })\n @Field({ description: 'ID of the owner of the bank account' })\n ownerId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'IBAN of the bank account' })\n iban?: string // 은행 계좌의 IBAN\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'BIC of the bank account' })\n bic?: string // 은행 계좌의 BIC\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Country of the bank account' })\n country?: string // 은행 계좌의 국적\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Cover image of the bank account' })\n image?: 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((bankAccount: BankAccount) => bankAccount.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((bankAccount: BankAccount) => bankAccount.updater)\n updaterId?: string\n}\n"]}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { HistoryEntitySubscriber } from '@operato/typeorm-history';
|
2
|
-
import { BankAccount } from './bank-account';
|
3
|
-
import { BankAccountHistory } from './bank-account-history';
|
4
|
-
export declare class BankAccountHistoryEntitySubscriber extends HistoryEntitySubscriber<BankAccount, BankAccountHistory> {
|
5
|
-
get entity(): typeof BankAccount;
|
6
|
-
get historyEntity(): typeof BankAccountHistory;
|
7
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BankAccountHistoryEntitySubscriber = 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 bank_account_1 = require("./bank-account");
|
8
|
-
const bank_account_history_1 = require("./bank-account-history");
|
9
|
-
let BankAccountHistoryEntitySubscriber = class BankAccountHistoryEntitySubscriber extends typeorm_history_1.HistoryEntitySubscriber {
|
10
|
-
get entity() {
|
11
|
-
return bank_account_1.BankAccount;
|
12
|
-
}
|
13
|
-
get historyEntity() {
|
14
|
-
return bank_account_history_1.BankAccountHistory;
|
15
|
-
}
|
16
|
-
};
|
17
|
-
exports.BankAccountHistoryEntitySubscriber = BankAccountHistoryEntitySubscriber;
|
18
|
-
exports.BankAccountHistoryEntitySubscriber = BankAccountHistoryEntitySubscriber = tslib_1.__decorate([
|
19
|
-
(0, typeorm_1.EventSubscriber)()
|
20
|
-
], BankAccountHistoryEntitySubscriber);
|
21
|
-
//# sourceMappingURL=event-subscriber.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/bank-account/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,iDAA4C;AAC5C,iEAA2D;AAGpD,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,yCAAwD;IAC9G,IAAW,MAAM;QACf,OAAO,0BAAW,CAAA;IACpB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,yCAAkB,CAAA;IAC3B,CAAC;CACF,CAAA;AARY,gFAAkC;6CAAlC,kCAAkC;IAD9C,IAAA,yBAAe,GAAE;GACL,kCAAkC,CAQ9C","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { BankAccount } from './bank-account'\nimport { BankAccountHistory } from './bank-account-history'\n\n@EventSubscriber()\nexport class BankAccountHistoryEntitySubscriber extends HistoryEntitySubscriber<BankAccount, BankAccountHistory> {\n public get entity() {\n return BankAccount\n }\n\n public get historyEntity() {\n return BankAccountHistory\n }\n}\n"]}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { BankAccount } from './bank-account';
|
2
|
-
import { BankAccountHistoryEntitySubscriber } from './event-subscriber';
|
3
|
-
import { BankAccountQuery } from './bank-account-query';
|
4
|
-
import { BankAccountMutation } from './bank-account-mutation';
|
5
|
-
export declare const entities: (typeof BankAccount)[];
|
6
|
-
export declare const resolvers: (typeof BankAccountQuery | typeof BankAccountMutation)[];
|
7
|
-
export declare const subscribers: (typeof BankAccountHistoryEntitySubscriber)[];
|
@@ -1,12 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
4
|
-
const bank_account_1 = require("./bank-account");
|
5
|
-
const bank_account_history_1 = require("./bank-account-history");
|
6
|
-
const event_subscriber_1 = require("./event-subscriber");
|
7
|
-
const bank_account_query_1 = require("./bank-account-query");
|
8
|
-
const bank_account_mutation_1 = require("./bank-account-mutation");
|
9
|
-
exports.entities = [bank_account_1.BankAccount, bank_account_history_1.BankAccountHistory];
|
10
|
-
exports.resolvers = [bank_account_query_1.BankAccountQuery, bank_account_mutation_1.BankAccountMutation];
|
11
|
-
exports.subscribers = [event_subscriber_1.BankAccountHistoryEntitySubscriber];
|
12
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/bank-account/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,iEAA2D;AAC3D,yDAAuE;AACvE,6DAAuD;AACvD,mEAA6D;AAEhD,QAAA,QAAQ,GAAG,CAAC,0BAAW,EAAE,yCAAkB,CAAC,CAAA;AAC5C,QAAA,SAAS,GAAG,CAAC,qCAAgB,EAAE,2CAAmB,CAAC,CAAA;AACnD,QAAA,WAAW,GAAG,CAAC,qDAAkC,CAAC,CAAA","sourcesContent":["import { BankAccount } from './bank-account'\nimport { BankAccountHistory } from './bank-account-history'\nimport { BankAccountHistoryEntitySubscriber } from './event-subscriber'\nimport { BankAccountQuery } from './bank-account-query'\nimport { BankAccountMutation } from './bank-account-mutation'\n\nexport const entities = [BankAccount, BankAccountHistory]\nexport const resolvers = [BankAccountQuery, BankAccountMutation]\nexport const subscribers = [BankAccountHistoryEntitySubscriber]\n"]}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { FinancialInstitution } from './financial-institution';
|
2
|
-
import { NewFinancialInstitution, FinancialInstitutionPatch } from './financial-institution-type';
|
3
|
-
export declare class FinancialInstitutionMutation {
|
4
|
-
createFinancialInstitution(financialInstitution: NewFinancialInstitution, context: ResolverContext): Promise<FinancialInstitution>;
|
5
|
-
updateFinancialInstitution(id: string, patch: FinancialInstitutionPatch, context: ResolverContext): Promise<FinancialInstitution>;
|
6
|
-
updateMultipleFinancialInstitution(patches: FinancialInstitutionPatch[], context: ResolverContext): Promise<FinancialInstitution[]>;
|
7
|
-
deleteFinancialInstitution(id: string, context: ResolverContext): Promise<boolean>;
|
8
|
-
deleteFinancialInstitutions(ids: string[], context: ResolverContext): Promise<boolean>;
|
9
|
-
importFinancialInstitutions(financialInstitutions: FinancialInstitutionPatch[], context: ResolverContext): Promise<boolean>;
|
10
|
-
}
|
@@ -1,169 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.FinancialInstitutionMutation = void 0;
|
4
|
-
const tslib_1 = require("tslib");
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
6
|
-
const typeorm_1 = require("typeorm");
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
8
|
-
const attachment_base_1 = require("@things-factory/attachment-base");
|
9
|
-
const financial_institution_1 = require("./financial-institution");
|
10
|
-
const financial_institution_type_1 = require("./financial-institution-type");
|
11
|
-
let FinancialInstitutionMutation = class FinancialInstitutionMutation {
|
12
|
-
async createFinancialInstitution(financialInstitution, context) {
|
13
|
-
const { domain, user, tx } = context.state;
|
14
|
-
const result = await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx).save(Object.assign(Object.assign({}, financialInstitution), { domain, creator: user, updater: user }));
|
15
|
-
if (financialInstitution.thumbnail) {
|
16
|
-
await (0, attachment_base_1.createAttachment)(null, {
|
17
|
-
attachment: {
|
18
|
-
file: financialInstitution.thumbnail,
|
19
|
-
refType: financial_institution_1.FinancialInstitution.name,
|
20
|
-
refBy: result.id
|
21
|
-
}
|
22
|
-
}, context);
|
23
|
-
}
|
24
|
-
return result;
|
25
|
-
}
|
26
|
-
async updateFinancialInstitution(id, patch, context) {
|
27
|
-
const { domain, user, tx } = context.state;
|
28
|
-
const repository = (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx);
|
29
|
-
const financialInstitution = await repository.findOne({
|
30
|
-
where: { domain: { id: domain.id }, id }
|
31
|
-
});
|
32
|
-
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, financialInstitution), patch), { updater: user }));
|
33
|
-
if (patch.thumbnail) {
|
34
|
-
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [result.id] }, context);
|
35
|
-
await (0, attachment_base_1.createAttachment)(null, {
|
36
|
-
attachment: {
|
37
|
-
file: patch.thumbnail,
|
38
|
-
refType: financial_institution_1.FinancialInstitution.name,
|
39
|
-
refBy: result.id
|
40
|
-
}
|
41
|
-
}, context);
|
42
|
-
}
|
43
|
-
return result;
|
44
|
-
}
|
45
|
-
async updateMultipleFinancialInstitution(patches, context) {
|
46
|
-
const { domain, user, tx } = context.state;
|
47
|
-
let results = [];
|
48
|
-
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
49
|
-
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
50
|
-
const financialInstitutionRepo = (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx);
|
51
|
-
if (_createRecords.length > 0) {
|
52
|
-
for (let i = 0; i < _createRecords.length; i++) {
|
53
|
-
const newRecord = _createRecords[i];
|
54
|
-
const result = await financialInstitutionRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
55
|
-
if (newRecord.thumbnail) {
|
56
|
-
await (0, attachment_base_1.createAttachment)(null, {
|
57
|
-
attachment: {
|
58
|
-
file: newRecord.thumbnail,
|
59
|
-
refType: financial_institution_1.FinancialInstitution.name,
|
60
|
-
refBy: result.id
|
61
|
-
}
|
62
|
-
}, context);
|
63
|
-
}
|
64
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
65
|
-
}
|
66
|
-
}
|
67
|
-
if (_updateRecords.length > 0) {
|
68
|
-
for (let i = 0; i < _updateRecords.length; i++) {
|
69
|
-
const updateRecord = _updateRecords[i];
|
70
|
-
const financialInstitution = await financialInstitutionRepo.findOneBy({ id: updateRecord.id });
|
71
|
-
const result = await financialInstitutionRepo.save(Object.assign(Object.assign(Object.assign({}, financialInstitution), updateRecord), { updater: user }));
|
72
|
-
if (updateRecord.thumbnail) {
|
73
|
-
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [result.id] }, context);
|
74
|
-
await (0, attachment_base_1.createAttachment)(null, {
|
75
|
-
attachment: {
|
76
|
-
file: updateRecord.thumbnail,
|
77
|
-
refType: financial_institution_1.FinancialInstitution.name,
|
78
|
-
refBy: result.id
|
79
|
-
}
|
80
|
-
}, context);
|
81
|
-
}
|
82
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
83
|
-
}
|
84
|
-
}
|
85
|
-
return results;
|
86
|
-
}
|
87
|
-
async deleteFinancialInstitution(id, context) {
|
88
|
-
const { domain, tx } = context.state;
|
89
|
-
await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx).delete({ domain: { id: domain.id }, id });
|
90
|
-
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
|
91
|
-
return true;
|
92
|
-
}
|
93
|
-
async deleteFinancialInstitutions(ids, context) {
|
94
|
-
const { domain, tx } = context.state;
|
95
|
-
await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx).delete({
|
96
|
-
domain: { id: domain.id },
|
97
|
-
id: (0, typeorm_1.In)(ids)
|
98
|
-
});
|
99
|
-
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: ids }, context);
|
100
|
-
return true;
|
101
|
-
}
|
102
|
-
async importFinancialInstitutions(financialInstitutions, context) {
|
103
|
-
const { domain, tx } = context.state;
|
104
|
-
await Promise.all(financialInstitutions.map(async (financialInstitution) => {
|
105
|
-
const createdFinancialInstitution = await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution, tx).save(Object.assign({ domain }, financialInstitution));
|
106
|
-
}));
|
107
|
-
return true;
|
108
|
-
}
|
109
|
-
};
|
110
|
-
exports.FinancialInstitutionMutation = FinancialInstitutionMutation;
|
111
|
-
tslib_1.__decorate([
|
112
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
113
|
-
(0, type_graphql_1.Mutation)(returns => financial_institution_1.FinancialInstitution, { description: 'To create new FinancialInstitution' }),
|
114
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('financialInstitution')),
|
115
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
116
|
-
tslib_1.__metadata("design:type", Function),
|
117
|
-
tslib_1.__metadata("design:paramtypes", [financial_institution_type_1.NewFinancialInstitution, Object]),
|
118
|
-
tslib_1.__metadata("design:returntype", Promise)
|
119
|
-
], FinancialInstitutionMutation.prototype, "createFinancialInstitution", null);
|
120
|
-
tslib_1.__decorate([
|
121
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
122
|
-
(0, type_graphql_1.Mutation)(returns => financial_institution_1.FinancialInstitution, { description: 'To modify FinancialInstitution information' }),
|
123
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
124
|
-
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
125
|
-
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
126
|
-
tslib_1.__metadata("design:type", Function),
|
127
|
-
tslib_1.__metadata("design:paramtypes", [String, financial_institution_type_1.FinancialInstitutionPatch, Object]),
|
128
|
-
tslib_1.__metadata("design:returntype", Promise)
|
129
|
-
], FinancialInstitutionMutation.prototype, "updateFinancialInstitution", null);
|
130
|
-
tslib_1.__decorate([
|
131
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
132
|
-
(0, type_graphql_1.Mutation)(returns => [financial_institution_1.FinancialInstitution], { description: "To modify multiple FinancialInstitutions' information" }),
|
133
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [financial_institution_type_1.FinancialInstitutionPatch])),
|
134
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
135
|
-
tslib_1.__metadata("design:type", Function),
|
136
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
137
|
-
tslib_1.__metadata("design:returntype", Promise)
|
138
|
-
], FinancialInstitutionMutation.prototype, "updateMultipleFinancialInstitution", null);
|
139
|
-
tslib_1.__decorate([
|
140
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
141
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete FinancialInstitution' }),
|
142
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
143
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
144
|
-
tslib_1.__metadata("design:type", Function),
|
145
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
146
|
-
tslib_1.__metadata("design:returntype", Promise)
|
147
|
-
], FinancialInstitutionMutation.prototype, "deleteFinancialInstitution", null);
|
148
|
-
tslib_1.__decorate([
|
149
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
150
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple FinancialInstitutions' }),
|
151
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
152
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
153
|
-
tslib_1.__metadata("design:type", Function),
|
154
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
155
|
-
tslib_1.__metadata("design:returntype", Promise)
|
156
|
-
], FinancialInstitutionMutation.prototype, "deleteFinancialInstitutions", null);
|
157
|
-
tslib_1.__decorate([
|
158
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
159
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple FinancialInstitutions' }),
|
160
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('financialInstitutions', type => [financial_institution_type_1.FinancialInstitutionPatch])),
|
161
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
162
|
-
tslib_1.__metadata("design:type", Function),
|
163
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
164
|
-
tslib_1.__metadata("design:returntype", Promise)
|
165
|
-
], FinancialInstitutionMutation.prototype, "importFinancialInstitutions", null);
|
166
|
-
exports.FinancialInstitutionMutation = FinancialInstitutionMutation = tslib_1.__decorate([
|
167
|
-
(0, type_graphql_1.Resolver)(financial_institution_1.FinancialInstitution)
|
168
|
-
], FinancialInstitutionMutation);
|
169
|
-
//# sourceMappingURL=financial-institution-mutation.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"financial-institution-mutation.js","sourceRoot":"","sources":["../../../server/service/financial-institution/financial-institution-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,iDAAqD;AAErD,qEAA0F;AAC1F,mEAA8D;AAC9D,6EAAiG;AAG1F,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAGjC,AAAN,KAAK,CAAC,0BAA0B,CAA8B,oBAA6C,EAAS,OAAwB;QAC1I,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAa,EAAC,4CAAoB,EAAE,EAAE,CAAC,CAAC,IAAI,iCAC5D,oBAAoB,KACvB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,IAAI,oBAAoB,CAAC,SAAS,EAAE,CAAC;YACnC,MAAM,IAAA,kCAAgB,EACpB,IAAI,EACJ;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,oBAAoB,CA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IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;IAEvF,mBAAA,IAAA,kBAAG,EAAC,uBAAuB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,sDAAyB,CAAC,CAAC,CAAA;IACjE,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+EAWP;uCA3LU,4BAA4B;IADxC,IAAA,uBAAQ,EAAC,4CAAoB,CAAC;GAClB,4BAA4B,CA4LxC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { getRepository } from '@things-factory/shell'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\nimport { FinancialInstitution } from './financial-institution'\nimport { NewFinancialInstitution, FinancialInstitutionPatch } from './financial-institution-type'\n\n@Resolver(FinancialInstitution)\nexport class FinancialInstitutionMutation {\n @Directive('@transaction')\n @Mutation(returns => FinancialInstitution, { description: 'To create new FinancialInstitution' })\n async createFinancialInstitution(@Arg('financialInstitution') financialInstitution: NewFinancialInstitution, @Ctx() context: ResolverContext): Promise<FinancialInstitution> {\n const { domain, user, tx } = context.state\n\n const result = await getRepository(FinancialInstitution, tx).save({\n ...financialInstitution,\n domain,\n creator: user,\n updater: user\n })\n\n if (financialInstitution.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: financialInstitution.thumbnail,\n refType: FinancialInstitution.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => FinancialInstitution, { description: 'To modify FinancialInstitution information' })\n async updateFinancialInstitution(\n @Arg('id') id: string,\n @Arg('patch') patch: FinancialInstitutionPatch,\n @Ctx() context: ResolverContext\n ): Promise<FinancialInstitution> {\n const { domain, user, tx } = context.state\n\n const repository = getRepository(FinancialInstitution, tx)\n const financialInstitution = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...financialInstitution,\n ...patch,\n updater: user\n })\n\n if (patch.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: patch.thumbnail,\n refType: FinancialInstitution.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [FinancialInstitution], { description: \"To modify multiple FinancialInstitutions' information\" })\n async updateMultipleFinancialInstitution(\n @Arg('patches', type => [FinancialInstitutionPatch]) patches: FinancialInstitutionPatch[],\n @Ctx() context: ResolverContext\n ): Promise<FinancialInstitution[]> {\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 financialInstitutionRepo = getRepository(FinancialInstitution, tx)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await financialInstitutionRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n if (newRecord.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: newRecord.thumbnail,\n refType: FinancialInstitution.name,\n refBy: result.id\n }\n },\n context\n )\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 financialInstitution = await financialInstitutionRepo.findOneBy({ id: updateRecord.id })\n\n const result = await financialInstitutionRepo.save({\n ...financialInstitution,\n ...updateRecord,\n updater: user\n })\n\n if (updateRecord.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: updateRecord.thumbnail,\n refType: FinancialInstitution.name,\n refBy: result.id\n }\n },\n context\n )\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 FinancialInstitution' })\n async deleteFinancialInstitution(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(FinancialInstitution, tx).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 FinancialInstitutions' })\n async deleteFinancialInstitutions(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(FinancialInstitution, tx).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 FinancialInstitutions' })\n async importFinancialInstitutions(\n @Arg('financialInstitutions', type => [FinancialInstitutionPatch]) financialInstitutions: FinancialInstitutionPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n financialInstitutions.map(async (financialInstitution: FinancialInstitutionPatch) => {\n const createdFinancialInstitution: FinancialInstitution = await getRepository(FinancialInstitution, tx).save({ domain, ...financialInstitution })\n })\n )\n\n return true\n }\n}\n"]}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { Domain, ListParam } from '@things-factory/shell';
|
2
|
-
import { User } from '@things-factory/auth-base';
|
3
|
-
import { FinancialInstitution } from './financial-institution';
|
4
|
-
import { FinancialInstitutionList } from './financial-institution-type';
|
5
|
-
export declare class FinancialInstitutionQuery {
|
6
|
-
financialInstitution(id: string, context: ResolverContext): Promise<FinancialInstitution>;
|
7
|
-
financialInstitutions(params: ListParam, context: ResolverContext): Promise<FinancialInstitutionList>;
|
8
|
-
thumbnail(financialInstitution: FinancialInstitution): Promise<string | undefined>;
|
9
|
-
domain(financialInstitution: FinancialInstitution): Promise<Domain>;
|
10
|
-
updater(financialInstitution: FinancialInstitution): Promise<User>;
|
11
|
-
creator(financialInstitution: FinancialInstitution): Promise<User>;
|
12
|
-
}
|
@@ -1,97 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.FinancialInstitutionQuery = void 0;
|
4
|
-
const tslib_1 = require("tslib");
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
6
|
-
const attachment_base_1 = require("@things-factory/attachment-base");
|
7
|
-
const shell_1 = require("@things-factory/shell");
|
8
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
9
|
-
const financial_institution_1 = require("./financial-institution");
|
10
|
-
const financial_institution_type_1 = require("./financial-institution-type");
|
11
|
-
let FinancialInstitutionQuery = class FinancialInstitutionQuery {
|
12
|
-
async financialInstitution(id, context) {
|
13
|
-
const { domain } = context.state;
|
14
|
-
return await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution).findOne({
|
15
|
-
where: { domain: { id: domain.id }, id }
|
16
|
-
});
|
17
|
-
}
|
18
|
-
async financialInstitutions(params, context) {
|
19
|
-
const { domain } = context.state;
|
20
|
-
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
21
|
-
domain,
|
22
|
-
params,
|
23
|
-
repository: await (0, shell_1.getRepository)(financial_institution_1.FinancialInstitution),
|
24
|
-
searchables: ['name', 'description']
|
25
|
-
});
|
26
|
-
const [items, total] = await queryBuilder.getManyAndCount();
|
27
|
-
return { items, total };
|
28
|
-
}
|
29
|
-
async thumbnail(financialInstitution) {
|
30
|
-
const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).findOne({
|
31
|
-
where: {
|
32
|
-
domain: { id: financialInstitution.domainId },
|
33
|
-
refType: financial_institution_1.FinancialInstitution.name,
|
34
|
-
refBy: financialInstitution.id
|
35
|
-
}
|
36
|
-
});
|
37
|
-
return attachment === null || attachment === void 0 ? void 0 : attachment.fullpath;
|
38
|
-
}
|
39
|
-
async domain(financialInstitution) {
|
40
|
-
return financialInstitution.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: financialInstitution.domainId }));
|
41
|
-
}
|
42
|
-
async updater(financialInstitution) {
|
43
|
-
return financialInstitution.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: financialInstitution.updaterId }));
|
44
|
-
}
|
45
|
-
async creator(financialInstitution) {
|
46
|
-
return financialInstitution.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: financialInstitution.creatorId }));
|
47
|
-
}
|
48
|
-
};
|
49
|
-
exports.FinancialInstitutionQuery = FinancialInstitutionQuery;
|
50
|
-
tslib_1.__decorate([
|
51
|
-
(0, type_graphql_1.Query)(returns => financial_institution_1.FinancialInstitution, { nullable: true, description: 'To fetch a FinancialInstitution' }),
|
52
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
53
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
54
|
-
tslib_1.__metadata("design:type", Function),
|
55
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
56
|
-
tslib_1.__metadata("design:returntype", Promise)
|
57
|
-
], FinancialInstitutionQuery.prototype, "financialInstitution", null);
|
58
|
-
tslib_1.__decorate([
|
59
|
-
(0, type_graphql_1.Query)(returns => financial_institution_type_1.FinancialInstitutionList, { description: 'To fetch multiple FinancialInstitutions' }),
|
60
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
61
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
62
|
-
tslib_1.__metadata("design:type", Function),
|
63
|
-
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
64
|
-
tslib_1.__metadata("design:returntype", Promise)
|
65
|
-
], FinancialInstitutionQuery.prototype, "financialInstitutions", null);
|
66
|
-
tslib_1.__decorate([
|
67
|
-
(0, type_graphql_1.FieldResolver)(type => String),
|
68
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
69
|
-
tslib_1.__metadata("design:type", Function),
|
70
|
-
tslib_1.__metadata("design:paramtypes", [financial_institution_1.FinancialInstitution]),
|
71
|
-
tslib_1.__metadata("design:returntype", Promise)
|
72
|
-
], FinancialInstitutionQuery.prototype, "thumbnail", null);
|
73
|
-
tslib_1.__decorate([
|
74
|
-
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
75
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
76
|
-
tslib_1.__metadata("design:type", Function),
|
77
|
-
tslib_1.__metadata("design:paramtypes", [financial_institution_1.FinancialInstitution]),
|
78
|
-
tslib_1.__metadata("design:returntype", Promise)
|
79
|
-
], FinancialInstitutionQuery.prototype, "domain", null);
|
80
|
-
tslib_1.__decorate([
|
81
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
82
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
83
|
-
tslib_1.__metadata("design:type", Function),
|
84
|
-
tslib_1.__metadata("design:paramtypes", [financial_institution_1.FinancialInstitution]),
|
85
|
-
tslib_1.__metadata("design:returntype", Promise)
|
86
|
-
], FinancialInstitutionQuery.prototype, "updater", null);
|
87
|
-
tslib_1.__decorate([
|
88
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
89
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
90
|
-
tslib_1.__metadata("design:type", Function),
|
91
|
-
tslib_1.__metadata("design:paramtypes", [financial_institution_1.FinancialInstitution]),
|
92
|
-
tslib_1.__metadata("design:returntype", Promise)
|
93
|
-
], FinancialInstitutionQuery.prototype, "creator", null);
|
94
|
-
exports.FinancialInstitutionQuery = FinancialInstitutionQuery = tslib_1.__decorate([
|
95
|
-
(0, type_graphql_1.Resolver)(financial_institution_1.FinancialInstitution)
|
96
|
-
], FinancialInstitutionQuery);
|
97
|
-
//# sourceMappingURL=financial-institution-query.js.map
|