@things-factory/tax-invoice 6.2.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/assets/images/hatiolab-logo.png +0 -0
  3. package/client/bootstrap.ts +0 -0
  4. package/client/index.ts +0 -0
  5. package/client/pages/main.ts +25 -0
  6. package/client/pages/tax-audit-result/tax-audit-result-importer.ts +97 -0
  7. package/client/pages/tax-audit-result/tax-audit-result-list-page.ts +355 -0
  8. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +424 -0
  9. package/client/pages/tax-invoice/tax-invoice-list-page.ts +517 -0
  10. package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +428 -0
  11. package/client/pages/tax-invoice-company/tax-invoice-company-importer.ts +175 -0
  12. package/client/pages/tax-invoice-company/tax-invoice-company-list-page.ts +496 -0
  13. package/client/route.ts +23 -0
  14. package/client/tsconfig.json +11 -0
  15. package/dist-client/bootstrap.d.ts +0 -0
  16. package/dist-client/bootstrap.js +2 -0
  17. package/dist-client/bootstrap.js.map +1 -0
  18. package/dist-client/index.d.ts +0 -0
  19. package/dist-client/index.js +2 -0
  20. package/dist-client/index.js.map +1 -0
  21. package/dist-client/pages/main.d.ts +1 -0
  22. package/dist-client/pages/main.js +27 -0
  23. package/dist-client/pages/main.js.map +1 -0
  24. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.d.ts +22 -0
  25. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.js +100 -0
  26. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.js.map +1 -0
  27. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.d.ts +62 -0
  28. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.js +331 -0
  29. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.js.map +1 -0
  30. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.d.ts +14 -0
  31. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +430 -0
  32. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -0
  33. package/dist-client/pages/tax-invoice/tax-invoice-list-page.d.ts +70 -0
  34. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +500 -0
  35. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -0
  36. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +36 -0
  37. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +419 -0
  38. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -0
  39. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.d.ts +31 -0
  40. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +182 -0
  41. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -0
  42. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.d.ts +57 -0
  43. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js +477 -0
  44. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js.map +1 -0
  45. package/dist-client/route.d.ts +1 -0
  46. package/dist-client/route.js +20 -0
  47. package/dist-client/route.js.map +1 -0
  48. package/dist-client/tsconfig.tsbuildinfo +1 -0
  49. package/dist-server/index.js +6 -0
  50. package/dist-server/index.js.map +1 -0
  51. package/dist-server/routes.js +25 -0
  52. package/dist-server/routes.js.map +1 -0
  53. package/dist-server/service/index.js +37 -0
  54. package/dist-server/service/index.js.map +1 -0
  55. package/dist-server/service/tax-audit-result/event-subscriber.js +21 -0
  56. package/dist-server/service/tax-audit-result/event-subscriber.js.map +1 -0
  57. package/dist-server/service/tax-audit-result/index.js +12 -0
  58. package/dist-server/service/tax-audit-result/index.js.map +1 -0
  59. package/dist-server/service/tax-audit-result/tax-audit-result-history.js +123 -0
  60. package/dist-server/service/tax-audit-result/tax-audit-result-history.js.map +1 -0
  61. package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js +168 -0
  62. package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js.map +1 -0
  63. package/dist-server/service/tax-audit-result/tax-audit-result-query.js +97 -0
  64. package/dist-server/service/tax-audit-result/tax-audit-result-query.js.map +1 -0
  65. package/dist-server/service/tax-audit-result/tax-audit-result-type.js +86 -0
  66. package/dist-server/service/tax-audit-result/tax-audit-result-type.js.map +1 -0
  67. package/dist-server/service/tax-audit-result/tax-audit-result.js +110 -0
  68. package/dist-server/service/tax-audit-result/tax-audit-result.js.map +1 -0
  69. package/dist-server/service/tax-invoice/index.js +9 -0
  70. package/dist-server/service/tax-invoice/index.js.map +1 -0
  71. package/dist-server/service/tax-invoice/tax-invoice-mutation.js +127 -0
  72. package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -0
  73. package/dist-server/service/tax-invoice/tax-invoice-query.js +90 -0
  74. package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -0
  75. package/dist-server/service/tax-invoice/tax-invoice-type.js +553 -0
  76. package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -0
  77. package/dist-server/service/tax-invoice/tax-invoice.js +465 -0
  78. package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -0
  79. package/dist-server/service/tax-invoice-api/index.js +9 -0
  80. package/dist-server/service/tax-invoice-api/index.js.map +1 -0
  81. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +64 -0
  82. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -0
  83. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +79 -0
  84. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -0
  85. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +103 -0
  86. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -0
  87. package/dist-server/service/tax-invoice-api/tax-invoice-api.js +163 -0
  88. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -0
  89. package/dist-server/service/tax-invoice-company/index.js +9 -0
  90. package/dist-server/service/tax-invoice-company/index.js.map +1 -0
  91. package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js +80 -0
  92. package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js.map +1 -0
  93. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js +89 -0
  94. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js.map +1 -0
  95. package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js +100 -0
  96. package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js.map +1 -0
  97. package/dist-server/service/tax-invoice-company/tax-invoice-company.js +166 -0
  98. package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -0
  99. package/dist-server/service/tax-invoice-item/index.js +9 -0
  100. package/dist-server/service/tax-invoice-item/index.js.map +1 -0
  101. package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js +127 -0
  102. package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js.map +1 -0
  103. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js +87 -0
  104. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -0
  105. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +121 -0
  106. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -0
  107. package/dist-server/service/tax-invoice-item/tax-invoice-item.js +115 -0
  108. package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -0
  109. package/dist-server/tsconfig.tsbuildinfo +1 -0
  110. package/helps/tax-invoice/tax-audit-result.md +160 -0
  111. package/helps/tax-invoice/tax-invoice-api.md +160 -0
  112. package/helps/tax-invoice/tax-invoice-send.md +160 -0
  113. package/helps/tax-invoice/tax-invoice.md +160 -0
  114. package/package.json +37 -0
  115. package/server/index.ts +2 -0
  116. package/server/routes.ts +28 -0
  117. package/server/service/index.ts +36 -0
  118. package/server/service/tax-audit-result/event-subscriber.ts +17 -0
  119. package/server/service/tax-audit-result/index.ts +9 -0
  120. package/server/service/tax-audit-result/tax-audit-result-history.ts +110 -0
  121. package/server/service/tax-audit-result/tax-audit-result-mutation.ts +198 -0
  122. package/server/service/tax-audit-result/tax-audit-result-query.ts +62 -0
  123. package/server/service/tax-audit-result/tax-audit-result-type.ts +61 -0
  124. package/server/service/tax-audit-result/tax-audit-result.ts +95 -0
  125. package/server/service/tax-invoice/index.ts +6 -0
  126. package/server/service/tax-invoice/tax-invoice-mutation.ts +122 -0
  127. package/server/service/tax-invoice/tax-invoice-query.ts +54 -0
  128. package/server/service/tax-invoice/tax-invoice-type.ts +411 -0
  129. package/server/service/tax-invoice/tax-invoice.ts +389 -0
  130. package/server/service/tax-invoice-api/index.ts +6 -0
  131. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +67 -0
  132. package/server/service/tax-invoice-api/tax-invoice-api-query.ts +48 -0
  133. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +71 -0
  134. package/server/service/tax-invoice-api/tax-invoice-api.ts +137 -0
  135. package/server/service/tax-invoice-company/index.ts +6 -0
  136. package/server/service/tax-invoice-company/tax-invoice-company-mutation.ts +84 -0
  137. package/server/service/tax-invoice-company/tax-invoice-company-query.ts +53 -0
  138. package/server/service/tax-invoice-company/tax-invoice-company-type.ts +69 -0
  139. package/server/service/tax-invoice-company/tax-invoice-company.ts +142 -0
  140. package/server/service/tax-invoice-item/index.ts +6 -0
  141. package/server/service/tax-invoice-item/tax-invoice-item-mutation.ts +128 -0
  142. package/server/service/tax-invoice-item/tax-invoice-item-query.ts +57 -0
  143. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +86 -0
  144. package/server/service/tax-invoice-item/tax-invoice-item.ts +85 -0
  145. package/server/tsconfig.json +10 -0
  146. package/things-factory.config.js +23 -0
  147. package/translations/en.json +1 -0
  148. package/translations/ja.json +1 -0
  149. package/translations/ko.json +71 -0
  150. package/translations/ms.json +1 -0
  151. package/translations/zh.json +1 -0
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxInvoiceApiQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const auth_base_1 = require("@things-factory/auth-base");
8
+ const tax_invoice_api_1 = require("./tax-invoice-api");
9
+ const tax_invoice_api_type_1 = require("./tax-invoice-api-type");
10
+ let TaxInvoiceApiQuery = class TaxInvoiceApiQuery {
11
+ async taxInvoiceApi(id, context) {
12
+ const { domain } = context.state;
13
+ return await (0, shell_1.getRepository)(tax_invoice_api_1.TaxInvoiceApi).findOne({
14
+ where: { domain: { id: domain.id }, id }
15
+ });
16
+ }
17
+ async taxInvoiceApis(params, context) {
18
+ const { domain } = context.state;
19
+ const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
20
+ domain,
21
+ params,
22
+ repository: await (0, shell_1.getRepository)(tax_invoice_api_1.TaxInvoiceApi),
23
+ searchables: ['name', 'description']
24
+ });
25
+ const [items, total] = await queryBuilder.getManyAndCount();
26
+ return { items, total };
27
+ }
28
+ async domain(taxInvoiceApi) {
29
+ return taxInvoiceApi.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: taxInvoiceApi.domainId }));
30
+ }
31
+ async updater(taxInvoiceApi) {
32
+ return taxInvoiceApi.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: taxInvoiceApi.updaterId }));
33
+ }
34
+ async creator(taxInvoiceApi) {
35
+ return taxInvoiceApi.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: taxInvoiceApi.creatorId }));
36
+ }
37
+ };
38
+ tslib_1.__decorate([
39
+ (0, type_graphql_1.Query)(returns => tax_invoice_api_1.TaxInvoiceApi, { nullable: true, description: 'To fetch a Tax Invoice Api' }),
40
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
41
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
42
+ tslib_1.__metadata("design:type", Function),
43
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
44
+ tslib_1.__metadata("design:returntype", Promise)
45
+ ], TaxInvoiceApiQuery.prototype, "taxInvoiceApi", null);
46
+ tslib_1.__decorate([
47
+ (0, type_graphql_1.Query)(returns => tax_invoice_api_type_1.TaxInvoiceApiList, { description: 'To fetch multiple Tax Invoice Api' }),
48
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
49
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
50
+ tslib_1.__metadata("design:type", Function),
51
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
52
+ tslib_1.__metadata("design:returntype", Promise)
53
+ ], TaxInvoiceApiQuery.prototype, "taxInvoiceApis", null);
54
+ tslib_1.__decorate([
55
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
56
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
57
+ tslib_1.__metadata("design:type", Function),
58
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_api_1.TaxInvoiceApi]),
59
+ tslib_1.__metadata("design:returntype", Promise)
60
+ ], TaxInvoiceApiQuery.prototype, "domain", null);
61
+ tslib_1.__decorate([
62
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
63
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
64
+ tslib_1.__metadata("design:type", Function),
65
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_api_1.TaxInvoiceApi]),
66
+ tslib_1.__metadata("design:returntype", Promise)
67
+ ], TaxInvoiceApiQuery.prototype, "updater", null);
68
+ tslib_1.__decorate([
69
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
70
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
71
+ tslib_1.__metadata("design:type", Function),
72
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_api_1.TaxInvoiceApi]),
73
+ tslib_1.__metadata("design:returntype", Promise)
74
+ ], TaxInvoiceApiQuery.prototype, "creator", null);
75
+ TaxInvoiceApiQuery = tslib_1.__decorate([
76
+ (0, type_graphql_1.Resolver)(tax_invoice_api_1.TaxInvoiceApi)
77
+ ], TaxInvoiceApiQuery);
78
+ exports.TaxInvoiceApiQuery = TaxInvoiceApiQuery;
79
+ //# sourceMappingURL=tax-invoice-api-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-invoice-api-query.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,iDAAuG;AACvG,yDAAgD;AAChD,uDAAiD;AACjD,iEAA0D;AAGnD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEvB,AAAN,KAAK,CAAC,aAAa,CAAY,EAAU,EAAS,OAAwB;QACxE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,+BAAa,CAAC,CAAC,OAAO,CAAC;YAChD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,cAAc,CAAS,MAAiB,EAAS,OAAwB;QAC7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,+BAAa,CAAC;YAC9C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,aAA4B;QAC/C,OAAO,aAAa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AAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAgB,+BAAa;;iDAEjD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAgB,+BAAa;;iDAEjD;AAvCU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,+BAAa,CAAC;GACX,kBAAkB,CAwC9B;AAxCY,gDAAkB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaxInvoiceApi } from './tax-invoice-api'\nimport { TaxInvoiceApiList } from './tax-invoice-api-type'\n\n@Resolver(TaxInvoiceApi)\nexport class TaxInvoiceApiQuery {\n @Query(returns => TaxInvoiceApi!, { nullable: true, description: 'To fetch a Tax Invoice Api' })\n async taxInvoiceApi(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<TaxInvoiceApi> {\n const { domain } = context.state\n\n return await getRepository(TaxInvoiceApi).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => TaxInvoiceApiList, { description: 'To fetch multiple Tax Invoice Api' })\n async taxInvoiceApis(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaxInvoiceApiList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(TaxInvoiceApi),\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() taxInvoiceApi: TaxInvoiceApi): Promise<Domain> {\n return taxInvoiceApi.domainId && (await getRepository(Domain).findOneBy({ id: taxInvoiceApi.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() taxInvoiceApi: TaxInvoiceApi): Promise<User> {\n return taxInvoiceApi.updaterId && (await getRepository(User).findOneBy({ id: taxInvoiceApi.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() taxInvoiceApi: TaxInvoiceApi): Promise<User> {\n return taxInvoiceApi.creatorId && (await getRepository(User).findOneBy({ id: taxInvoiceApi.creatorId }))\n }\n}\n"]}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxInvoiceApiList = exports.TaxInvoiceApiPatch = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const tax_invoice_api_1 = require("./tax-invoice-api");
7
+ let TaxInvoiceApiPatch = class TaxInvoiceApiPatch {
8
+ };
9
+ tslib_1.__decorate([
10
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
11
+ tslib_1.__metadata("design:type", String)
12
+ ], TaxInvoiceApiPatch.prototype, "id", void 0);
13
+ tslib_1.__decorate([
14
+ (0, type_graphql_1.Field)({ nullable: true }),
15
+ tslib_1.__metadata("design:type", String)
16
+ ], TaxInvoiceApiPatch.prototype, "name", void 0);
17
+ tslib_1.__decorate([
18
+ (0, type_graphql_1.Field)({ nullable: true }),
19
+ tslib_1.__metadata("design:type", String)
20
+ ], TaxInvoiceApiPatch.prototype, "description", void 0);
21
+ tslib_1.__decorate([
22
+ (0, type_graphql_1.Field)({ nullable: true }),
23
+ tslib_1.__metadata("design:type", String)
24
+ ], TaxInvoiceApiPatch.prototype, "apiKey", void 0);
25
+ tslib_1.__decorate([
26
+ (0, type_graphql_1.Field)({ nullable: true }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], TaxInvoiceApiPatch.prototype, "apiAccountId", void 0);
29
+ tslib_1.__decorate([
30
+ (0, type_graphql_1.Field)({ nullable: true }),
31
+ tslib_1.__metadata("design:type", String)
32
+ ], TaxInvoiceApiPatch.prototype, "apiAccountPassword", void 0);
33
+ tslib_1.__decorate([
34
+ (0, type_graphql_1.Field)({ nullable: true }),
35
+ tslib_1.__metadata("design:type", String)
36
+ ], TaxInvoiceApiPatch.prototype, "businessRegistrationNumber", void 0);
37
+ tslib_1.__decorate([
38
+ (0, type_graphql_1.Field)({ nullable: true }),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], TaxInvoiceApiPatch.prototype, "branchIdentification", void 0);
41
+ tslib_1.__decorate([
42
+ (0, type_graphql_1.Field)({ nullable: true }),
43
+ tslib_1.__metadata("design:type", String)
44
+ ], TaxInvoiceApiPatch.prototype, "businessName", void 0);
45
+ tslib_1.__decorate([
46
+ (0, type_graphql_1.Field)({ nullable: true }),
47
+ tslib_1.__metadata("design:type", String)
48
+ ], TaxInvoiceApiPatch.prototype, "representativeName", void 0);
49
+ tslib_1.__decorate([
50
+ (0, type_graphql_1.Field)({ nullable: true }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], TaxInvoiceApiPatch.prototype, "address", void 0);
53
+ tslib_1.__decorate([
54
+ (0, type_graphql_1.Field)({ nullable: true }),
55
+ tslib_1.__metadata("design:type", String)
56
+ ], TaxInvoiceApiPatch.prototype, "businessType", void 0);
57
+ tslib_1.__decorate([
58
+ (0, type_graphql_1.Field)({ nullable: true }),
59
+ tslib_1.__metadata("design:type", String)
60
+ ], TaxInvoiceApiPatch.prototype, "industryType", void 0);
61
+ tslib_1.__decorate([
62
+ (0, type_graphql_1.Field)({ nullable: true }),
63
+ tslib_1.__metadata("design:type", String)
64
+ ], TaxInvoiceApiPatch.prototype, "department", void 0);
65
+ tslib_1.__decorate([
66
+ (0, type_graphql_1.Field)({ nullable: true }),
67
+ tslib_1.__metadata("design:type", String)
68
+ ], TaxInvoiceApiPatch.prototype, "contactName", void 0);
69
+ tslib_1.__decorate([
70
+ (0, type_graphql_1.Field)({ nullable: true }),
71
+ tslib_1.__metadata("design:type", String)
72
+ ], TaxInvoiceApiPatch.prototype, "contactPhone", void 0);
73
+ tslib_1.__decorate([
74
+ (0, type_graphql_1.Field)({ nullable: true }),
75
+ tslib_1.__metadata("design:type", String)
76
+ ], TaxInvoiceApiPatch.prototype, "contactEmail", void 0);
77
+ tslib_1.__decorate([
78
+ (0, type_graphql_1.Field)({ nullable: true }),
79
+ tslib_1.__metadata("design:type", String)
80
+ ], TaxInvoiceApiPatch.prototype, "contactCellPhone", void 0);
81
+ tslib_1.__decorate([
82
+ (0, type_graphql_1.Field)({ nullable: true }),
83
+ tslib_1.__metadata("design:type", String)
84
+ ], TaxInvoiceApiPatch.prototype, "cuFlag", void 0);
85
+ TaxInvoiceApiPatch = tslib_1.__decorate([
86
+ (0, type_graphql_1.InputType)()
87
+ ], TaxInvoiceApiPatch);
88
+ exports.TaxInvoiceApiPatch = TaxInvoiceApiPatch;
89
+ let TaxInvoiceApiList = class TaxInvoiceApiList {
90
+ };
91
+ tslib_1.__decorate([
92
+ (0, type_graphql_1.Field)(type => [tax_invoice_api_1.TaxInvoiceApi]),
93
+ tslib_1.__metadata("design:type", Array)
94
+ ], TaxInvoiceApiList.prototype, "items", void 0);
95
+ tslib_1.__decorate([
96
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
97
+ tslib_1.__metadata("design:type", Number)
98
+ ], TaxInvoiceApiList.prototype, "total", void 0);
99
+ TaxInvoiceApiList = tslib_1.__decorate([
100
+ (0, type_graphql_1.ObjectType)()
101
+ ], TaxInvoiceApiList);
102
+ exports.TaxInvoiceApiList = TaxInvoiceApiList;
103
+ //# sourceMappingURL=tax-invoice-api-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-invoice-api-type.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,uDAAiD;AAG1C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAyD9B,CAAA;AAxDC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC3B;AA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IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACD;AAEzB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACX;AAxDJ,kBAAkB;IAD9B,IAAA,wBAAS,GAAE;GACC,kBAAkB,CAyD9B;AAzDY,gDAAkB;AA4DxB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAM7B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,+BAAa,CAAC,CAAC;;gDACT;AAEtB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;gDACN;AALF,iBAAiB;IAD7B,IAAA,yBAAU,GAAE;GACA,iBAAiB,CAM7B;AANY,8CAAiB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\nimport { TaxInvoiceApi } from './tax-invoice-api'\n\n@InputType()\nexport class TaxInvoiceApiPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n apiKey?: string\n\n @Field({ nullable: true })\n apiAccountId?: string\n\n @Field({ nullable: true })\n apiAccountPassword?: string\n\n @Field({ nullable: true })\n businessRegistrationNumber?: string\n\n @Field({ nullable: true })\n branchIdentification?: string\n\n @Field({ nullable: true })\n businessName?: string\n\n @Field({ nullable: true })\n representativeName?: string\n\n @Field({ nullable: true })\n address?: string\n\n @Field({ nullable: true })\n businessType?: string\n\n @Field({ nullable: true })\n industryType?: string\n\n @Field({ nullable: true })\n department?: string\n\n @Field({ nullable: true })\n contactName?: string\n\n @Field({ nullable: true })\n contactPhone?: string\n\n @Field({ nullable: true })\n contactEmail?: string\n\n @Field({ nullable: true })\n contactCellPhone?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class TaxInvoiceApiList {\n @Field(type => [TaxInvoiceApi])\n items: TaxInvoiceApi[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxInvoiceApi = 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
+ let TaxInvoiceApi = class TaxInvoiceApi {
10
+ constructor() {
11
+ this.version = 1;
12
+ }
13
+ };
14
+ tslib_1.__decorate([
15
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
16
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
17
+ tslib_1.__metadata("design:type", String)
18
+ ], TaxInvoiceApi.prototype, "id", void 0);
19
+ tslib_1.__decorate([
20
+ (0, typeorm_1.VersionColumn)(),
21
+ (0, type_graphql_1.Field)({ nullable: true }),
22
+ tslib_1.__metadata("design:type", Number)
23
+ ], TaxInvoiceApi.prototype, "version", void 0);
24
+ tslib_1.__decorate([
25
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
26
+ (0, type_graphql_1.Field)({ nullable: true }),
27
+ tslib_1.__metadata("design:type", shell_1.Domain)
28
+ ], TaxInvoiceApi.prototype, "domain", void 0);
29
+ tslib_1.__decorate([
30
+ (0, typeorm_1.RelationId)((taxInvoiceApi) => taxInvoiceApi.domain),
31
+ tslib_1.__metadata("design:type", String)
32
+ ], TaxInvoiceApi.prototype, "domainId", void 0);
33
+ tslib_1.__decorate([
34
+ (0, type_graphql_1.Field)({ nullable: false }),
35
+ (0, typeorm_1.Column)({ nullable: false }),
36
+ tslib_1.__metadata("design:type", String)
37
+ ], TaxInvoiceApi.prototype, "name", void 0);
38
+ tslib_1.__decorate([
39
+ (0, type_graphql_1.Field)({ nullable: true }),
40
+ (0, typeorm_1.Column)({ nullable: true }),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], TaxInvoiceApi.prototype, "description", void 0);
43
+ tslib_1.__decorate([
44
+ (0, typeorm_1.Column)({ nullable: true, comment: 'API Key', transformer: shell_1.encryptTransformer }),
45
+ (0, type_graphql_1.Field)({ nullable: true, description: 'API Key' }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], TaxInvoiceApi.prototype, "apiKey", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.Column)({ nullable: true, comment: 'API 계정 ID', transformer: shell_1.encryptTransformer }),
50
+ (0, type_graphql_1.Field)({ nullable: true, description: 'API 계정 ID' }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], TaxInvoiceApi.prototype, "apiAccountId", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ nullable: true, comment: 'API 계정 비밀번호', transformer: shell_1.encryptTransformer }),
55
+ (0, type_graphql_1.Field)({ nullable: true, description: 'API 계정 비밀번호' }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], TaxInvoiceApi.prototype, "apiAccountPassword", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.Column)({ nullable: true, comment: '사업자등록번호', transformer: shell_1.encryptTransformer }),
60
+ (0, type_graphql_1.Field)({ nullable: true, description: '사업자등록번호' }),
61
+ tslib_1.__metadata("design:type", String)
62
+ ], TaxInvoiceApi.prototype, "businessRegistrationNumber", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.Column)({ nullable: true, comment: '종사업장 식별 코드' }),
65
+ (0, type_graphql_1.Field)({ nullable: true, description: '종사업장 식별 코드' }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], TaxInvoiceApi.prototype, "branchIdentification", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.Column)({ nullable: true, comment: '사업자명' }),
70
+ (0, type_graphql_1.Field)({ nullable: true, description: '사업자명' }),
71
+ tslib_1.__metadata("design:type", String)
72
+ ], TaxInvoiceApi.prototype, "businessName", void 0);
73
+ tslib_1.__decorate([
74
+ (0, typeorm_1.Column)({ nullable: true, comment: '대표자명' }),
75
+ (0, type_graphql_1.Field)({ nullable: true, description: '대표자명' }),
76
+ tslib_1.__metadata("design:type", String)
77
+ ], TaxInvoiceApi.prototype, "representativeName", void 0);
78
+ tslib_1.__decorate([
79
+ (0, typeorm_1.Column)({ nullable: true, comment: '주소', transformer: shell_1.encryptTransformer }),
80
+ (0, type_graphql_1.Field)({ nullable: true, description: '주소' }),
81
+ tslib_1.__metadata("design:type", String)
82
+ ], TaxInvoiceApi.prototype, "address", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.Column)({ nullable: true, comment: '업태' }),
85
+ (0, type_graphql_1.Field)({ nullable: true, description: '업태' }),
86
+ tslib_1.__metadata("design:type", String)
87
+ ], TaxInvoiceApi.prototype, "businessType", void 0);
88
+ tslib_1.__decorate([
89
+ (0, typeorm_1.Column)({ nullable: true, comment: '업종' }),
90
+ (0, type_graphql_1.Field)({ nullable: true, description: '업종' }),
91
+ tslib_1.__metadata("design:type", String)
92
+ ], TaxInvoiceApi.prototype, "industryType", void 0);
93
+ tslib_1.__decorate([
94
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당 부서' }),
95
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당 부서' }),
96
+ tslib_1.__metadata("design:type", String)
97
+ ], TaxInvoiceApi.prototype, "department", void 0);
98
+ tslib_1.__decorate([
99
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당자명', transformer: shell_1.encryptTransformer }),
100
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당자명' }),
101
+ tslib_1.__metadata("design:type", String)
102
+ ], TaxInvoiceApi.prototype, "contactName", void 0);
103
+ tslib_1.__decorate([
104
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당자 전화번호', transformer: shell_1.encryptTransformer }),
105
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당자 전화번호' }),
106
+ tslib_1.__metadata("design:type", String)
107
+ ], TaxInvoiceApi.prototype, "contactPhone", void 0);
108
+ tslib_1.__decorate([
109
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당자 이메일', transformer: shell_1.encryptTransformer }),
110
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당자 이메일' }),
111
+ tslib_1.__metadata("design:type", String)
112
+ ], TaxInvoiceApi.prototype, "contactEmail", void 0);
113
+ tslib_1.__decorate([
114
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당자 핸드폰 번호', transformer: shell_1.encryptTransformer }),
115
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당자 핸드폰 번호' }),
116
+ tslib_1.__metadata("design:type", String)
117
+ ], TaxInvoiceApi.prototype, "contactCellPhone", void 0);
118
+ tslib_1.__decorate([
119
+ (0, typeorm_1.Column)('simple-json', { nullable: true }),
120
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
121
+ tslib_1.__metadata("design:type", Object)
122
+ ], TaxInvoiceApi.prototype, "attributes", 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
+ ], TaxInvoiceApi.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
+ ], TaxInvoiceApi.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
+ ], TaxInvoiceApi.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
+ ], TaxInvoiceApi.prototype, "creator", void 0);
143
+ tslib_1.__decorate([
144
+ (0, typeorm_1.RelationId)((taxInvoiceApi) => taxInvoiceApi.creator),
145
+ tslib_1.__metadata("design:type", String)
146
+ ], TaxInvoiceApi.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
+ ], TaxInvoiceApi.prototype, "updater", void 0);
152
+ tslib_1.__decorate([
153
+ (0, typeorm_1.RelationId)((taxInvoiceApi) => taxInvoiceApi.updater),
154
+ tslib_1.__metadata("design:type", String)
155
+ ], TaxInvoiceApi.prototype, "updaterId", void 0);
156
+ TaxInvoiceApi = tslib_1.__decorate([
157
+ (0, typeorm_1.Entity)(),
158
+ (0, typeorm_1.Index)('ix_tax_invoice_api_0', (taxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.name, taxInvoiceApi.deletedAt]),
159
+ (0, typeorm_1.Index)('ix_tax_invoice_api_1', (taxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.description, taxInvoiceApi.deletedAt]),
160
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for Tax Invoice Api' })
161
+ ], TaxInvoiceApi);
162
+ exports.TaxInvoiceApi = TaxInvoiceApi;
163
+ //# sourceMappingURL=tax-invoice-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-invoice-api.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api.ts"],"names":[],"mappings":";;;;AAAA,qCAagB;AAChB,+CAAoD;AAEpD,iDAAgF;AAChF,yDAAgD;AAMzC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAAnB;QAOL,YAAO,GAAY,CAAC,CAAA;IA0GtB,CAAC;CAAA,CAAA;AAhHC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,E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AO,CAAC;;gDAClD;AAhHP,aAAa;IAJzB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,sBAAsB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACpI,IAAA,eAAK,EAAC,sBAAsB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAC3I,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;GAC7C,aAAa,CAiHzB;AAjHY,sCAAa","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n OneToOne,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn,\n JoinColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { Domain, ScalarObject, encryptTransformer } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index('ix_tax_invoice_api_0', (taxInvoiceApi: TaxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.name, taxInvoiceApi.deletedAt])\n@Index('ix_tax_invoice_api_1', (taxInvoiceApi: TaxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.description, taxInvoiceApi.deletedAt])\n@ObjectType({ description: 'Entity for Tax Invoice Api' })\nexport class TaxInvoiceApi {\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((taxInvoiceApi: TaxInvoiceApi) => taxInvoiceApi.domain)\n domainId?: string\n\n @Field({ nullable: false })\n @Column({ nullable: false })\n name!: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n description?: string\n\n @Column({ nullable: true, comment: 'API Key', transformer: encryptTransformer })\n @Field({ nullable: true, description: 'API Key' })\n apiKey?: string\n\n @Column({ nullable: true, comment: 'API 계정 ID', transformer: encryptTransformer })\n @Field({ nullable: true, description: 'API 계정 ID' })\n apiAccountId?: string\n\n @Column({ nullable: true, comment: 'API 계정 비밀번호', transformer: encryptTransformer })\n @Field({ nullable: true, description: 'API 계정 비밀번호' })\n apiAccountPassword?: string\n\n @Column({ nullable: true, comment: '사업자등록번호', transformer: encryptTransformer })\n @Field({ nullable: true, description: '사업자등록번호' })\n businessRegistrationNumber?: string\n\n @Column({ nullable: true, comment: '종사업장 식별 코드' })\n @Field({ nullable: true, description: '종사업장 식별 코드' })\n branchIdentification?: string\n\n @Column({ nullable: true, comment: '사업자명' })\n @Field({ nullable: true, description: '사업자명' })\n businessName?: string\n\n @Column({ nullable: true, comment: '대표자명' })\n @Field({ nullable: true, description: '대표자명' })\n representativeName?: string\n\n @Column({ nullable: true, comment: '주소', transformer: encryptTransformer })\n @Field({ nullable: true, description: '주소' })\n address?: string\n\n @Column({ nullable: true, comment: '업태' })\n @Field({ nullable: true, description: '업태' })\n businessType?: string\n\n @Column({ nullable: true, comment: '업종' })\n @Field({ nullable: true, description: '업종' })\n industryType?: string\n\n @Column({ nullable: true, comment: '담당 부서' })\n @Field({ nullable: true, description: '담당 부서' })\n department?: string\n\n @Column({ nullable: true, comment: '담당자명', transformer: encryptTransformer })\n @Field({ nullable: true, description: '담당자명' })\n contactName?: string\n\n @Column({ nullable: true, comment: '담당자 전화번호', transformer: encryptTransformer })\n @Field({ nullable: true, description: '담당자 전화번호' })\n contactPhone?: string\n\n @Column({ nullable: true, comment: '담당자 이메일', transformer: encryptTransformer })\n @Field({ nullable: true, description: '담당자 이메일' })\n contactEmail?: string\n\n @Column({ nullable: true, comment: '담당자 핸드폰 번호', transformer: encryptTransformer })\n @Field({ nullable: true, description: '담당자 핸드폰 번호' })\n contactCellPhone?: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, { nullable: true })\n attributes?: any\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((taxInvoiceApi: TaxInvoiceApi) => taxInvoiceApi.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((taxInvoiceApi: TaxInvoiceApi) => taxInvoiceApi.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const tax_invoice_company_1 = require("./tax-invoice-company");
5
+ const tax_invoice_company_query_1 = require("./tax-invoice-company-query");
6
+ const tax_invoice_company_mutation_1 = require("./tax-invoice-company-mutation");
7
+ exports.entities = [tax_invoice_company_1.TaxInvoiceCompany];
8
+ exports.resolvers = [tax_invoice_company_query_1.TaxInvoiceCompanyQuery, tax_invoice_company_mutation_1.TaxInvoiceCompanyMutation];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-company/index.ts"],"names":[],"mappings":";;;AAAA,+DAAyD;AACzD,2EAAoE;AACpE,iFAA0E;AAE7D,QAAA,QAAQ,GAAG,CAAC,uCAAiB,CAAC,CAAA;AAC9B,QAAA,SAAS,GAAG,CAAC,kDAAsB,EAAE,wDAAyB,CAAC,CAAA","sourcesContent":["import { TaxInvoiceCompany } from './tax-invoice-company'\nimport { TaxInvoiceCompanyQuery } from './tax-invoice-company-query'\nimport { TaxInvoiceCompanyMutation } from './tax-invoice-company-mutation'\n\nexport const entities = [TaxInvoiceCompany]\nexport const resolvers = [TaxInvoiceCompanyQuery, TaxInvoiceCompanyMutation]\n"]}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxInvoiceCompanyMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const typeorm_1 = require("typeorm");
7
+ const tax_invoice_company_1 = require("./tax-invoice-company");
8
+ const tax_invoice_company_type_1 = require("./tax-invoice-company-type");
9
+ let TaxInvoiceCompanyMutation = class TaxInvoiceCompanyMutation {
10
+ async updateMultipleTaxInvoiceCompany(patches, context) {
11
+ const { domain, user, tx } = context.state;
12
+ let results = [];
13
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
14
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
15
+ const taxInvoiceCompanyRepo = tx.getRepository(tax_invoice_company_1.TaxInvoiceCompany);
16
+ if (_createRecords.length > 0) {
17
+ for (let i = 0; i < _createRecords.length; i++) {
18
+ const newRecord = _createRecords[i];
19
+ const result = await taxInvoiceCompanyRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
20
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
21
+ }
22
+ }
23
+ if (_updateRecords.length > 0) {
24
+ for (let i = 0; i < _updateRecords.length; i++) {
25
+ const updateRecord = _updateRecords[i];
26
+ const taxInvoiceCompany = await taxInvoiceCompanyRepo.findOneBy({ id: updateRecord.id });
27
+ const result = await taxInvoiceCompanyRepo.save(Object.assign(Object.assign(Object.assign({}, taxInvoiceCompany), updateRecord), { updater: user }));
28
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
29
+ }
30
+ }
31
+ return results;
32
+ }
33
+ async deleteTaxInvoiceCompanies(ids, context) {
34
+ const { domain, tx } = context.state;
35
+ await tx.getRepository(tax_invoice_company_1.TaxInvoiceCompany).delete({
36
+ domain: { id: domain.id },
37
+ id: (0, typeorm_1.In)(ids)
38
+ });
39
+ return true;
40
+ }
41
+ async importTaxInvoiceCompanies(taxInvoiceCompanies, context) {
42
+ const { domain, tx } = context.state;
43
+ await Promise.all(taxInvoiceCompanies.map(async (taxInvoiceCompany) => {
44
+ const createdTaxInvoiceCompany = await tx.getRepository(tax_invoice_company_1.TaxInvoiceCompany).save(Object.assign({ domain }, taxInvoiceCompany));
45
+ }));
46
+ return true;
47
+ }
48
+ };
49
+ tslib_1.__decorate([
50
+ (0, type_graphql_1.Directive)('@transaction'),
51
+ (0, type_graphql_1.Mutation)(returns => [tax_invoice_company_1.TaxInvoiceCompany], { description: "To modify multiple TaxInvoiceCompanies' information" }),
52
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [tax_invoice_company_type_1.TaxInvoiceCompanyPatch])),
53
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
54
+ tslib_1.__metadata("design:type", Function),
55
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
56
+ tslib_1.__metadata("design:returntype", Promise)
57
+ ], TaxInvoiceCompanyMutation.prototype, "updateMultipleTaxInvoiceCompany", null);
58
+ tslib_1.__decorate([
59
+ (0, type_graphql_1.Directive)('@transaction'),
60
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple TaxInvoiceCompanies' }),
61
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
62
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
63
+ tslib_1.__metadata("design:type", Function),
64
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
65
+ tslib_1.__metadata("design:returntype", Promise)
66
+ ], TaxInvoiceCompanyMutation.prototype, "deleteTaxInvoiceCompanies", null);
67
+ tslib_1.__decorate([
68
+ (0, type_graphql_1.Directive)('@transaction'),
69
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple TaxInvoiceCompanies' }),
70
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('taxInvoiceCompanies', type => [tax_invoice_company_type_1.TaxInvoiceCompanyPatch])),
71
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
72
+ tslib_1.__metadata("design:type", Function),
73
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
74
+ tslib_1.__metadata("design:returntype", Promise)
75
+ ], TaxInvoiceCompanyMutation.prototype, "importTaxInvoiceCompanies", null);
76
+ TaxInvoiceCompanyMutation = tslib_1.__decorate([
77
+ (0, type_graphql_1.Resolver)(tax_invoice_company_1.TaxInvoiceCompany)
78
+ ], TaxInvoiceCompanyMutation);
79
+ exports.TaxInvoiceCompanyMutation = TaxInvoiceCompanyMutation;
80
+ //# sourceMappingURL=tax-invoice-company-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-invoice-company-mutation.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-company/tax-invoice-company-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,+DAAyD;AACzD,yEAAmE;AAG5D,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAG9B,AAAN,KAAK,CAAC,+BAA+B,CACe,OAAiC,EAC5E,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,qBAAqB,GAAG,EAAE,CAAC,aAAa,CAAC,uCAAiB,CAAC,CAAA;Q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,OAAO,EAAE,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAErF,mBAAA,IAAA,kBAAG,EAAC,qBAAqB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,iDAAsB,CAAC,CAAC,CAAA;IAC5D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0EAWP;AA3EU,yBAAyB;IADrC,IAAA,uBAAQ,EAAC,uCAAiB,CAAC;GACf,yBAAyB,CA4ErC;AA5EY,8DAAyB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { TaxInvoiceCompany } from './tax-invoice-company'\nimport { TaxInvoiceCompanyPatch } from './tax-invoice-company-type'\n\n@Resolver(TaxInvoiceCompany)\nexport class TaxInvoiceCompanyMutation {\n @Directive('@transaction')\n @Mutation(returns => [TaxInvoiceCompany], { description: \"To modify multiple TaxInvoiceCompanies' information\" })\n async updateMultipleTaxInvoiceCompany(\n @Arg('patches', type => [TaxInvoiceCompanyPatch]) patches: TaxInvoiceCompanyPatch[],\n @Ctx() context: ResolverContext\n ): Promise<TaxInvoiceCompany[]> {\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 taxInvoiceCompanyRepo = tx.getRepository(TaxInvoiceCompany)\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 taxInvoiceCompanyRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const taxInvoiceCompany = await taxInvoiceCompanyRepo.findOneBy({ id: updateRecord.id })\n\n const result = await taxInvoiceCompanyRepo.save({\n ...taxInvoiceCompany,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple TaxInvoiceCompanies' })\n async deleteTaxInvoiceCompanies(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(TaxInvoiceCompany).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple TaxInvoiceCompanies' })\n async importTaxInvoiceCompanies(\n @Arg('taxInvoiceCompanies', type => [TaxInvoiceCompanyPatch]) taxInvoiceCompanies: TaxInvoiceCompanyPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n taxInvoiceCompanies.map(async (taxInvoiceCompany: TaxInvoiceCompanyPatch) => {\n const createdTaxInvoiceCompany: TaxInvoiceCompany = await tx.getRepository(TaxInvoiceCompany).save({ domain, ...taxInvoiceCompany })\n })\n )\n\n return true\n }\n}\n"]}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxInvoiceCompanyQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const auth_base_1 = require("@things-factory/auth-base");
8
+ const tax_invoice_company_1 = require("./tax-invoice-company");
9
+ const tax_invoice_company_type_1 = require("./tax-invoice-company-type");
10
+ let TaxInvoiceCompanyQuery = class TaxInvoiceCompanyQuery {
11
+ async taxInvoiceCompany(id, context) {
12
+ const { domain } = context.state;
13
+ return await (0, shell_1.getRepository)(tax_invoice_company_1.TaxInvoiceCompany).findOne({
14
+ where: { domain: { id: domain.id }, id }
15
+ });
16
+ }
17
+ async taxInvoiceCompanies(params, context) {
18
+ const { domain } = context.state;
19
+ const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
20
+ domain,
21
+ params,
22
+ repository: await (0, shell_1.getRepository)(tax_invoice_company_1.TaxInvoiceCompany),
23
+ searchables: ['name', 'description']
24
+ });
25
+ const [items, total] = await queryBuilder.getManyAndCount();
26
+ return { items, total };
27
+ }
28
+ async convertedType(taxInvoiceCompany) {
29
+ return tax_invoice_company_1.companyTypeLabel[taxInvoiceCompany.type];
30
+ }
31
+ async domain(taxInvoiceCompany) {
32
+ return taxInvoiceCompany.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: taxInvoiceCompany.domainId }));
33
+ }
34
+ async updater(taxInvoiceCompany) {
35
+ return taxInvoiceCompany.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: taxInvoiceCompany.updaterId }));
36
+ }
37
+ async creator(taxInvoiceCompany) {
38
+ return taxInvoiceCompany.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: taxInvoiceCompany.creatorId }));
39
+ }
40
+ };
41
+ tslib_1.__decorate([
42
+ (0, type_graphql_1.Query)(returns => tax_invoice_company_1.TaxInvoiceCompany, { nullable: true, description: 'To fetch a Tax Invoice Company' }),
43
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
44
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
45
+ tslib_1.__metadata("design:type", Function),
46
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
47
+ tslib_1.__metadata("design:returntype", Promise)
48
+ ], TaxInvoiceCompanyQuery.prototype, "taxInvoiceCompany", null);
49
+ tslib_1.__decorate([
50
+ (0, type_graphql_1.Query)(returns => tax_invoice_company_type_1.TaxInvoiceCompanyList, { description: 'To fetch multiple Tax Invoice Companies' }),
51
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
52
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
53
+ tslib_1.__metadata("design:type", Function),
54
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
55
+ tslib_1.__metadata("design:returntype", Promise)
56
+ ], TaxInvoiceCompanyQuery.prototype, "taxInvoiceCompanies", null);
57
+ tslib_1.__decorate([
58
+ (0, type_graphql_1.FieldResolver)(type => String),
59
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
60
+ tslib_1.__metadata("design:type", Function),
61
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_company_1.TaxInvoiceCompany]),
62
+ tslib_1.__metadata("design:returntype", Promise)
63
+ ], TaxInvoiceCompanyQuery.prototype, "convertedType", null);
64
+ tslib_1.__decorate([
65
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
66
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
67
+ tslib_1.__metadata("design:type", Function),
68
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_company_1.TaxInvoiceCompany]),
69
+ tslib_1.__metadata("design:returntype", Promise)
70
+ ], TaxInvoiceCompanyQuery.prototype, "domain", null);
71
+ tslib_1.__decorate([
72
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
73
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
74
+ tslib_1.__metadata("design:type", Function),
75
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_company_1.TaxInvoiceCompany]),
76
+ tslib_1.__metadata("design:returntype", Promise)
77
+ ], TaxInvoiceCompanyQuery.prototype, "updater", null);
78
+ tslib_1.__decorate([
79
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
80
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
81
+ tslib_1.__metadata("design:type", Function),
82
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_company_1.TaxInvoiceCompany]),
83
+ tslib_1.__metadata("design:returntype", Promise)
84
+ ], TaxInvoiceCompanyQuery.prototype, "creator", null);
85
+ TaxInvoiceCompanyQuery = tslib_1.__decorate([
86
+ (0, type_graphql_1.Resolver)(tax_invoice_company_1.TaxInvoiceCompany)
87
+ ], TaxInvoiceCompanyQuery);
88
+ exports.TaxInvoiceCompanyQuery = TaxInvoiceCompanyQuery;
89
+ //# sourceMappingURL=tax-invoice-company-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-invoice-company-query.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-company/tax-invoice-company-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,iDAAuG;AACvG,yDAAgD;AAChD,+DAA2E;AAC3E,yEAAkE;AAG3D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAE3B,AAAN,KAAK,CAAC,iBAAiB,CAAY,EAAU,EAAS,OAAwB;QAC5E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,uCAAiB,CAAC,CAAC,OAAO,CAAC;YACpD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,mBAAmB,CAAS,MAAiB,EAAS,OAAwB;QAClF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,uCAAiB,CAAC;YAClD,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,aAAa,CAAS,iBAAoC;QAC9D,OAAO,sCAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;IACjD,CAAC;IAGK,AAAN,KAAK,C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AGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAoB,uCAAiB;;oDAExD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAoB,uCAAiB;;qDAEzD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAoB,uCAAiB;;qDAEzD;AA5CU,sBAAsB;IADlC,IAAA,uBAAQ,EAAC,uCAAiB,CAAC;GACf,sBAAsB,CA6ClC;AA7CY,wDAAsB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaxInvoiceCompany, companyTypeLabel } from './tax-invoice-company'\nimport { TaxInvoiceCompanyList } from './tax-invoice-company-type'\n\n@Resolver(TaxInvoiceCompany)\nexport class TaxInvoiceCompanyQuery {\n @Query(returns => TaxInvoiceCompany!, { nullable: true, description: 'To fetch a Tax Invoice Company' })\n async taxInvoiceCompany(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<TaxInvoiceCompany> {\n const { domain } = context.state\n\n return await getRepository(TaxInvoiceCompany).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => TaxInvoiceCompanyList, { description: 'To fetch multiple Tax Invoice Companies' })\n async taxInvoiceCompanies(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaxInvoiceCompanyList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(TaxInvoiceCompany),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async convertedType(@Root() taxInvoiceCompany: TaxInvoiceCompany): Promise<string> {\n return companyTypeLabel[taxInvoiceCompany.type]\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() taxInvoiceCompany: TaxInvoiceCompany): Promise<Domain> {\n return taxInvoiceCompany.domainId && (await getRepository(Domain).findOneBy({ id: taxInvoiceCompany.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() taxInvoiceCompany: TaxInvoiceCompany): Promise<User> {\n return taxInvoiceCompany.updaterId && (await getRepository(User).findOneBy({ id: taxInvoiceCompany.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() taxInvoiceCompany: TaxInvoiceCompany): Promise<User> {\n return taxInvoiceCompany.creatorId && (await getRepository(User).findOneBy({ id: taxInvoiceCompany.creatorId }))\n }\n}\n"]}