@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,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxInvoiceCompanyList = exports.TaxInvoiceCompanyPatch = 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 tax_invoice_company_1 = require("./tax-invoice-company");
8
+ let TaxInvoiceCompanyPatch = class TaxInvoiceCompanyPatch {
9
+ };
10
+ tslib_1.__decorate([
11
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
12
+ tslib_1.__metadata("design:type", String)
13
+ ], TaxInvoiceCompanyPatch.prototype, "id", void 0);
14
+ tslib_1.__decorate([
15
+ (0, type_graphql_1.Field)({ nullable: true }),
16
+ tslib_1.__metadata("design:type", String)
17
+ ], TaxInvoiceCompanyPatch.prototype, "name", void 0);
18
+ tslib_1.__decorate([
19
+ (0, type_graphql_1.Field)({ nullable: true }),
20
+ tslib_1.__metadata("design:type", String)
21
+ ], TaxInvoiceCompanyPatch.prototype, "description", void 0);
22
+ tslib_1.__decorate([
23
+ (0, type_graphql_1.Field)({ nullable: true }),
24
+ tslib_1.__metadata("design:type", Number)
25
+ ], TaxInvoiceCompanyPatch.prototype, "type", void 0);
26
+ tslib_1.__decorate([
27
+ (0, type_graphql_1.Field)({ nullable: true }),
28
+ tslib_1.__metadata("design:type", String)
29
+ ], TaxInvoiceCompanyPatch.prototype, "businessRegistrationNumber", void 0);
30
+ tslib_1.__decorate([
31
+ (0, type_graphql_1.Field)({ nullable: true }),
32
+ tslib_1.__metadata("design:type", String)
33
+ ], TaxInvoiceCompanyPatch.prototype, "branchIdentification", void 0);
34
+ tslib_1.__decorate([
35
+ (0, type_graphql_1.Field)({ nullable: true }),
36
+ tslib_1.__metadata("design:type", String)
37
+ ], TaxInvoiceCompanyPatch.prototype, "businessName", void 0);
38
+ tslib_1.__decorate([
39
+ (0, type_graphql_1.Field)({ nullable: true }),
40
+ tslib_1.__metadata("design:type", String)
41
+ ], TaxInvoiceCompanyPatch.prototype, "representativeName", void 0);
42
+ tslib_1.__decorate([
43
+ (0, type_graphql_1.Field)({ nullable: true }),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], TaxInvoiceCompanyPatch.prototype, "address", void 0);
46
+ tslib_1.__decorate([
47
+ (0, type_graphql_1.Field)({ nullable: true }),
48
+ tslib_1.__metadata("design:type", String)
49
+ ], TaxInvoiceCompanyPatch.prototype, "businessType", void 0);
50
+ tslib_1.__decorate([
51
+ (0, type_graphql_1.Field)({ nullable: true }),
52
+ tslib_1.__metadata("design:type", String)
53
+ ], TaxInvoiceCompanyPatch.prototype, "industryType", void 0);
54
+ tslib_1.__decorate([
55
+ (0, type_graphql_1.Field)({ nullable: true }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], TaxInvoiceCompanyPatch.prototype, "department", void 0);
58
+ tslib_1.__decorate([
59
+ (0, type_graphql_1.Field)({ nullable: true }),
60
+ tslib_1.__metadata("design:type", String)
61
+ ], TaxInvoiceCompanyPatch.prototype, "contactName", void 0);
62
+ tslib_1.__decorate([
63
+ (0, type_graphql_1.Field)({ nullable: true }),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], TaxInvoiceCompanyPatch.prototype, "contactPhone", void 0);
66
+ tslib_1.__decorate([
67
+ (0, type_graphql_1.Field)({ nullable: true }),
68
+ tslib_1.__metadata("design:type", String)
69
+ ], TaxInvoiceCompanyPatch.prototype, "contactEmail", void 0);
70
+ tslib_1.__decorate([
71
+ (0, type_graphql_1.Field)({ nullable: true }),
72
+ tslib_1.__metadata("design:type", String)
73
+ ], TaxInvoiceCompanyPatch.prototype, "contactCellPhone", void 0);
74
+ tslib_1.__decorate([
75
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
76
+ tslib_1.__metadata("design:type", Object)
77
+ ], TaxInvoiceCompanyPatch.prototype, "attributes", void 0);
78
+ tslib_1.__decorate([
79
+ (0, type_graphql_1.Field)({ nullable: true }),
80
+ tslib_1.__metadata("design:type", String)
81
+ ], TaxInvoiceCompanyPatch.prototype, "cuFlag", void 0);
82
+ TaxInvoiceCompanyPatch = tslib_1.__decorate([
83
+ (0, type_graphql_1.InputType)()
84
+ ], TaxInvoiceCompanyPatch);
85
+ exports.TaxInvoiceCompanyPatch = TaxInvoiceCompanyPatch;
86
+ let TaxInvoiceCompanyList = class TaxInvoiceCompanyList {
87
+ };
88
+ tslib_1.__decorate([
89
+ (0, type_graphql_1.Field)(type => [tax_invoice_company_1.TaxInvoiceCompany]),
90
+ tslib_1.__metadata("design:type", Array)
91
+ ], TaxInvoiceCompanyList.prototype, "items", void 0);
92
+ tslib_1.__decorate([
93
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
94
+ tslib_1.__metadata("design:type", Number)
95
+ ], TaxInvoiceCompanyList.prototype, "total", void 0);
96
+ TaxInvoiceCompanyList = tslib_1.__decorate([
97
+ (0, type_graphql_1.ObjectType)()
98
+ ], TaxInvoiceCompanyList);
99
+ exports.TaxInvoiceCompanyList = TaxInvoiceCompanyList;
100
+ //# sourceMappingURL=tax-invoice-company-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-invoice-company-type.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-company/tax-invoice-company-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,iDAAoD;AACpD,+DAAsE;AAG/D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAsDlC,CAAA;AArDC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACR;AAElB;IAAC,IAAA,o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AAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,uCAAiB,CAAC,CAAC;;oDACT;AAE1B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;oDACN;AALF,qBAAqB;IADjC,IAAA,yBAAU,GAAE;GACA,qBAAqB,CAMjC;AANY,sDAAqB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\nimport { ScalarObject } from '@things-factory/shell'\nimport { CompanyType, TaxInvoiceCompany } from './tax-invoice-company'\n\n@InputType()\nexport class TaxInvoiceCompanyPatch {\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 type?: CompanyType\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(type => ScalarObject, { nullable: true })\n attributes?: any\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class TaxInvoiceCompanyList {\n @Field(type => [TaxInvoiceCompany])\n items: TaxInvoiceCompany[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxInvoiceCompany = exports.companyTypeLabel = exports.CompanyType = 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 CompanyType;
10
+ (function (CompanyType) {
11
+ CompanyType[CompanyType["SUPPLIER"] = 10] = "SUPPLIER";
12
+ CompanyType[CompanyType["BUYER"] = 20] = "BUYER"; // 거래처
13
+ })(CompanyType = exports.CompanyType || (exports.CompanyType = {}));
14
+ exports.companyTypeLabel = {
15
+ [CompanyType.SUPPLIER]: '공급자',
16
+ [CompanyType.BUYER]: '거래처'
17
+ };
18
+ (0, type_graphql_1.registerEnumType)(CompanyType, {
19
+ name: 'CompanyType',
20
+ description: 'company type'
21
+ });
22
+ let TaxInvoiceCompany = class TaxInvoiceCompany {
23
+ constructor() {
24
+ this.version = 1;
25
+ }
26
+ };
27
+ tslib_1.__decorate([
28
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
29
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
30
+ tslib_1.__metadata("design:type", String)
31
+ ], TaxInvoiceCompany.prototype, "id", void 0);
32
+ tslib_1.__decorate([
33
+ (0, typeorm_1.VersionColumn)(),
34
+ (0, type_graphql_1.Field)({ nullable: true }),
35
+ tslib_1.__metadata("design:type", Number)
36
+ ], TaxInvoiceCompany.prototype, "version", void 0);
37
+ tslib_1.__decorate([
38
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
39
+ (0, type_graphql_1.Field)({ nullable: true }),
40
+ tslib_1.__metadata("design:type", shell_1.Domain)
41
+ ], TaxInvoiceCompany.prototype, "domain", void 0);
42
+ tslib_1.__decorate([
43
+ (0, typeorm_1.RelationId)((taxInvoiceCompany) => taxInvoiceCompany.domain),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], TaxInvoiceCompany.prototype, "domainId", void 0);
46
+ tslib_1.__decorate([
47
+ (0, type_graphql_1.Field)({ nullable: false }),
48
+ (0, typeorm_1.Column)({ nullable: false }),
49
+ tslib_1.__metadata("design:type", String)
50
+ ], TaxInvoiceCompany.prototype, "name", void 0);
51
+ tslib_1.__decorate([
52
+ (0, type_graphql_1.Field)({ nullable: true }),
53
+ (0, typeorm_1.Column)({ nullable: true }),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], TaxInvoiceCompany.prototype, "description", void 0);
56
+ tslib_1.__decorate([
57
+ (0, type_graphql_1.Field)({ nullable: false }),
58
+ (0, typeorm_1.Column)({ nullable: false }),
59
+ tslib_1.__metadata("design:type", Number)
60
+ ], TaxInvoiceCompany.prototype, "type", void 0);
61
+ tslib_1.__decorate([
62
+ (0, typeorm_1.Column)({ nullable: true, comment: '사업자등록번호', transformer: shell_1.encryptTransformer }),
63
+ (0, type_graphql_1.Field)({ nullable: true, description: '사업자등록번호' }),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], TaxInvoiceCompany.prototype, "businessRegistrationNumber", void 0);
66
+ tslib_1.__decorate([
67
+ (0, typeorm_1.Column)({ nullable: true, comment: '종사업장 식별 코드' }),
68
+ (0, type_graphql_1.Field)({ nullable: true, description: '종사업장 식별 코드' }),
69
+ tslib_1.__metadata("design:type", String)
70
+ ], TaxInvoiceCompany.prototype, "branchIdentification", void 0);
71
+ tslib_1.__decorate([
72
+ (0, typeorm_1.Column)({ nullable: true, comment: '사업자명' }),
73
+ (0, type_graphql_1.Field)({ nullable: true, description: '사업자명' }),
74
+ tslib_1.__metadata("design:type", String)
75
+ ], TaxInvoiceCompany.prototype, "businessName", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.Column)({ nullable: true, comment: '대표자명' }),
78
+ (0, type_graphql_1.Field)({ nullable: true, description: '대표자명' }),
79
+ tslib_1.__metadata("design:type", String)
80
+ ], TaxInvoiceCompany.prototype, "representativeName", void 0);
81
+ tslib_1.__decorate([
82
+ (0, typeorm_1.Column)({ nullable: true, comment: '주소', transformer: shell_1.encryptTransformer }),
83
+ (0, type_graphql_1.Field)({ nullable: true, description: '주소' }),
84
+ tslib_1.__metadata("design:type", String)
85
+ ], TaxInvoiceCompany.prototype, "address", void 0);
86
+ tslib_1.__decorate([
87
+ (0, typeorm_1.Column)({ nullable: true, comment: '업태' }),
88
+ (0, type_graphql_1.Field)({ nullable: true, description: '업태' }),
89
+ tslib_1.__metadata("design:type", String)
90
+ ], TaxInvoiceCompany.prototype, "businessType", void 0);
91
+ tslib_1.__decorate([
92
+ (0, typeorm_1.Column)({ nullable: true, comment: '업종' }),
93
+ (0, type_graphql_1.Field)({ nullable: true, description: '업종' }),
94
+ tslib_1.__metadata("design:type", String)
95
+ ], TaxInvoiceCompany.prototype, "industryType", void 0);
96
+ tslib_1.__decorate([
97
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당 부서' }),
98
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당 부서' }),
99
+ tslib_1.__metadata("design:type", String)
100
+ ], TaxInvoiceCompany.prototype, "department", void 0);
101
+ tslib_1.__decorate([
102
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당자명', transformer: shell_1.encryptTransformer }),
103
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당자명' }),
104
+ tslib_1.__metadata("design:type", String)
105
+ ], TaxInvoiceCompany.prototype, "contactName", void 0);
106
+ tslib_1.__decorate([
107
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당자 전화번호', transformer: shell_1.encryptTransformer }),
108
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당자 전화번호' }),
109
+ tslib_1.__metadata("design:type", String)
110
+ ], TaxInvoiceCompany.prototype, "contactPhone", void 0);
111
+ tslib_1.__decorate([
112
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당자 이메일', transformer: shell_1.encryptTransformer }),
113
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당자 이메일' }),
114
+ tslib_1.__metadata("design:type", String)
115
+ ], TaxInvoiceCompany.prototype, "contactEmail", void 0);
116
+ tslib_1.__decorate([
117
+ (0, typeorm_1.Column)({ nullable: true, comment: '담당자 핸드폰 번호', transformer: shell_1.encryptTransformer }),
118
+ (0, type_graphql_1.Field)({ nullable: true, description: '담당자 핸드폰 번호' }),
119
+ tslib_1.__metadata("design:type", String)
120
+ ], TaxInvoiceCompany.prototype, "contactCellPhone", void 0);
121
+ tslib_1.__decorate([
122
+ (0, typeorm_1.Column)('simple-json', { nullable: true }),
123
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
124
+ tslib_1.__metadata("design:type", Object)
125
+ ], TaxInvoiceCompany.prototype, "attributes", void 0);
126
+ tslib_1.__decorate([
127
+ (0, typeorm_1.CreateDateColumn)(),
128
+ (0, type_graphql_1.Field)({ nullable: true }),
129
+ tslib_1.__metadata("design:type", Date)
130
+ ], TaxInvoiceCompany.prototype, "createdAt", void 0);
131
+ tslib_1.__decorate([
132
+ (0, typeorm_1.UpdateDateColumn)(),
133
+ (0, type_graphql_1.Field)({ nullable: true }),
134
+ tslib_1.__metadata("design:type", Date)
135
+ ], TaxInvoiceCompany.prototype, "updatedAt", void 0);
136
+ tslib_1.__decorate([
137
+ (0, typeorm_1.DeleteDateColumn)(),
138
+ (0, type_graphql_1.Field)({ nullable: true }),
139
+ tslib_1.__metadata("design:type", Date)
140
+ ], TaxInvoiceCompany.prototype, "deletedAt", void 0);
141
+ tslib_1.__decorate([
142
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
143
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
144
+ tslib_1.__metadata("design:type", auth_base_1.User)
145
+ ], TaxInvoiceCompany.prototype, "creator", void 0);
146
+ tslib_1.__decorate([
147
+ (0, typeorm_1.RelationId)((taxInvoiceCompany) => taxInvoiceCompany.creator),
148
+ tslib_1.__metadata("design:type", String)
149
+ ], TaxInvoiceCompany.prototype, "creatorId", void 0);
150
+ tslib_1.__decorate([
151
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
152
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
153
+ tslib_1.__metadata("design:type", auth_base_1.User)
154
+ ], TaxInvoiceCompany.prototype, "updater", void 0);
155
+ tslib_1.__decorate([
156
+ (0, typeorm_1.RelationId)((taxInvoiceCompany) => taxInvoiceCompany.updater),
157
+ tslib_1.__metadata("design:type", String)
158
+ ], TaxInvoiceCompany.prototype, "updaterId", void 0);
159
+ TaxInvoiceCompany = tslib_1.__decorate([
160
+ (0, typeorm_1.Entity)(),
161
+ (0, typeorm_1.Index)('ix_tax_invoice_company_0', (taxInvoiceCompany) => [taxInvoiceCompany.domain, taxInvoiceCompany.name, taxInvoiceCompany.deletedAt]),
162
+ (0, typeorm_1.Index)('ix_tax_invoice_company_1', (taxInvoiceCompany) => [taxInvoiceCompany.domain, taxInvoiceCompany.description, taxInvoiceCompany.deletedAt]),
163
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for TaxInvoice Company' })
164
+ ], TaxInvoiceCompany);
165
+ exports.TaxInvoiceCompany = TaxInvoiceCompany;
166
+ //# sourceMappingURL=tax-invoice-company.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-invoice-company.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-company/tax-invoice-company.ts"],"names":[],"mappings":";;;;AAAA,qCAYgB;AAChB,+CAAsE;AAEtE,iDAAgF;AAChF,yDAAgD;AAGhD,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,sDAAa,CAAA;IACb,gDAAU,CAAA,CAAC,MAAM;AACnB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AACY,QAAA,gBAAgB,GAAG;IAC9B,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,KAAK;IAC7B,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK;CAC3B,CAAA;AACD,IAAA,+BAAgB,EAAC,WAAW,EAAE;IAC5B,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,cAAc;CAC5B,CAAC,CAAA;AAMK,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAAvB;QAOL,YAAO,GAAY,CAAC,CAAA;IAkGtB,CAA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EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,iBAAiB,CAyG7B;AAzGY,8CAAiB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Index,\n Entity,\n OneToOne,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain, ScalarObject, encryptTransformer } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaxInvoiceApi } from '../tax-invoice-api/tax-invoice-api'\n\nexport enum CompanyType {\n SUPPLIER = 10, // 공급자\n BUYER = 20 // 거래처\n}\nexport const companyTypeLabel = {\n [CompanyType.SUPPLIER]: '공급자',\n [CompanyType.BUYER]: '거래처'\n}\nregisterEnumType(CompanyType, {\n name: 'CompanyType',\n description: 'company type'\n})\n\n@Entity()\n@Index('ix_tax_invoice_company_0', (taxInvoiceCompany: TaxInvoiceCompany) => [taxInvoiceCompany.domain, taxInvoiceCompany.name, taxInvoiceCompany.deletedAt])\n@Index('ix_tax_invoice_company_1', (taxInvoiceCompany: TaxInvoiceCompany) => [taxInvoiceCompany.domain, taxInvoiceCompany.description, taxInvoiceCompany.deletedAt])\n@ObjectType({ description: 'Entity for TaxInvoice Company' })\nexport class TaxInvoiceCompany {\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((taxInvoiceCompany: TaxInvoiceCompany) => taxInvoiceCompany.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 @Field({ nullable: false })\n @Column({ nullable: false })\n type!: CompanyType\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((taxInvoiceCompany: TaxInvoiceCompany) => taxInvoiceCompany.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((taxInvoiceCompany: TaxInvoiceCompany) => taxInvoiceCompany.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_item_1 = require("./tax-invoice-item");
5
+ const tax_invoice_item_query_1 = require("./tax-invoice-item-query");
6
+ const tax_invoice_item_mutation_1 = require("./tax-invoice-item-mutation");
7
+ exports.entities = [tax_invoice_item_1.TaxInvoiceItem];
8
+ exports.resolvers = [tax_invoice_item_query_1.TaxInvoiceItemQuery, tax_invoice_item_mutation_1.TaxInvoiceItemMutation];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-item/index.ts"],"names":[],"mappings":";;;AAAA,yDAAmD;AACnD,qEAA8D;AAC9D,2EAAoE;AAEvD,QAAA,QAAQ,GAAG,CAAC,iCAAc,CAAC,CAAA;AAC3B,QAAA,SAAS,GAAG,CAAC,4CAAmB,EAAE,kDAAsB,CAAC,CAAA","sourcesContent":["import { TaxInvoiceItem } from './tax-invoice-item'\nimport { TaxInvoiceItemQuery } from './tax-invoice-item-query'\nimport { TaxInvoiceItemMutation } from './tax-invoice-item-mutation'\n\nexport const entities = [TaxInvoiceItem]\nexport const resolvers = [TaxInvoiceItemQuery, TaxInvoiceItemMutation]\n"]}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxInvoiceItemMutation = 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_item_1 = require("./tax-invoice-item");
8
+ const tax_invoice_item_type_1 = require("./tax-invoice-item-type");
9
+ let TaxInvoiceItemMutation = class TaxInvoiceItemMutation {
10
+ async createTaxInvoiceItem(taxInvoiceItem, context) {
11
+ const { domain, user, tx } = context.state;
12
+ const result = await tx.getRepository(tax_invoice_item_1.TaxInvoiceItem).save(Object.assign(Object.assign({}, taxInvoiceItem), { domain, creator: user, updater: user }));
13
+ return result;
14
+ }
15
+ async updateTaxInvoiceItem(id, patch, context) {
16
+ const { domain, user, tx } = context.state;
17
+ const repository = tx.getRepository(tax_invoice_item_1.TaxInvoiceItem);
18
+ const taxInvoiceItem = await repository.findOne({
19
+ where: { domain: { id: domain.id }, id }
20
+ });
21
+ const result = await repository.save(Object.assign(Object.assign(Object.assign({}, taxInvoiceItem), patch), { updater: user }));
22
+ return result;
23
+ }
24
+ async updateMultipleTaxInvoiceItem(patches, context) {
25
+ const { domain, user, tx } = context.state;
26
+ let results = [];
27
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
28
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
29
+ const taxInvoiceItemRepo = tx.getRepository(tax_invoice_item_1.TaxInvoiceItem);
30
+ if (_createRecords.length > 0) {
31
+ for (let i = 0; i < _createRecords.length; i++) {
32
+ const newRecord = _createRecords[i];
33
+ const result = await taxInvoiceItemRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
34
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
35
+ }
36
+ }
37
+ if (_updateRecords.length > 0) {
38
+ for (let i = 0; i < _updateRecords.length; i++) {
39
+ const updateRecord = _updateRecords[i];
40
+ const taxInvoiceItem = await taxInvoiceItemRepo.findOneBy({ id: updateRecord.id });
41
+ const result = await taxInvoiceItemRepo.save(Object.assign(Object.assign(Object.assign({}, taxInvoiceItem), updateRecord), { updater: user }));
42
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
43
+ }
44
+ }
45
+ return results;
46
+ }
47
+ async deleteTaxInvoiceItem(id, context) {
48
+ const { domain, tx } = context.state;
49
+ await tx.getRepository(tax_invoice_item_1.TaxInvoiceItem).delete({ domain: { id: domain.id }, id });
50
+ return true;
51
+ }
52
+ async deleteTaxInvoiceItems(ids, context) {
53
+ const { domain, tx } = context.state;
54
+ await tx.getRepository(tax_invoice_item_1.TaxInvoiceItem).delete({
55
+ domain: { id: domain.id },
56
+ id: (0, typeorm_1.In)(ids)
57
+ });
58
+ return true;
59
+ }
60
+ async importTaxInvoiceItems(taxInvoiceItems, context) {
61
+ const { domain, tx } = context.state;
62
+ await Promise.all(taxInvoiceItems.map(async (taxInvoiceItem) => {
63
+ const createdTaxInvoiceItem = await tx.getRepository(tax_invoice_item_1.TaxInvoiceItem).save(Object.assign({ domain }, taxInvoiceItem));
64
+ }));
65
+ return true;
66
+ }
67
+ };
68
+ tslib_1.__decorate([
69
+ (0, type_graphql_1.Directive)('@transaction'),
70
+ (0, type_graphql_1.Mutation)(returns => tax_invoice_item_1.TaxInvoiceItem, { description: 'To create new TaxInvoiceItem' }),
71
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('taxInvoiceItem')),
72
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
73
+ tslib_1.__metadata("design:type", Function),
74
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_item_type_1.NewTaxInvoiceItem, Object]),
75
+ tslib_1.__metadata("design:returntype", Promise)
76
+ ], TaxInvoiceItemMutation.prototype, "createTaxInvoiceItem", null);
77
+ tslib_1.__decorate([
78
+ (0, type_graphql_1.Directive)('@transaction'),
79
+ (0, type_graphql_1.Mutation)(returns => tax_invoice_item_1.TaxInvoiceItem, { description: 'To modify TaxInvoiceItem information' }),
80
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
81
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
82
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
83
+ tslib_1.__metadata("design:type", Function),
84
+ tslib_1.__metadata("design:paramtypes", [String, tax_invoice_item_type_1.TaxInvoiceItemPatch, Object]),
85
+ tslib_1.__metadata("design:returntype", Promise)
86
+ ], TaxInvoiceItemMutation.prototype, "updateTaxInvoiceItem", null);
87
+ tslib_1.__decorate([
88
+ (0, type_graphql_1.Directive)('@transaction'),
89
+ (0, type_graphql_1.Mutation)(returns => [tax_invoice_item_1.TaxInvoiceItem], { description: "To modify multiple TaxInvoiceItems' information" }),
90
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [tax_invoice_item_type_1.TaxInvoiceItemPatch])),
91
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
92
+ tslib_1.__metadata("design:type", Function),
93
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
94
+ tslib_1.__metadata("design:returntype", Promise)
95
+ ], TaxInvoiceItemMutation.prototype, "updateMultipleTaxInvoiceItem", null);
96
+ tslib_1.__decorate([
97
+ (0, type_graphql_1.Directive)('@transaction'),
98
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete TaxInvoiceItem' }),
99
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
100
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
101
+ tslib_1.__metadata("design:type", Function),
102
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
103
+ tslib_1.__metadata("design:returntype", Promise)
104
+ ], TaxInvoiceItemMutation.prototype, "deleteTaxInvoiceItem", null);
105
+ tslib_1.__decorate([
106
+ (0, type_graphql_1.Directive)('@transaction'),
107
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple TaxInvoiceItems' }),
108
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
109
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
110
+ tslib_1.__metadata("design:type", Function),
111
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
112
+ tslib_1.__metadata("design:returntype", Promise)
113
+ ], TaxInvoiceItemMutation.prototype, "deleteTaxInvoiceItems", null);
114
+ tslib_1.__decorate([
115
+ (0, type_graphql_1.Directive)('@transaction'),
116
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple TaxInvoiceItems' }),
117
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('taxInvoiceItems', type => [tax_invoice_item_type_1.TaxInvoiceItemPatch])),
118
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
119
+ tslib_1.__metadata("design:type", Function),
120
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
121
+ tslib_1.__metadata("design:returntype", Promise)
122
+ ], TaxInvoiceItemMutation.prototype, "importTaxInvoiceItems", null);
123
+ TaxInvoiceItemMutation = tslib_1.__decorate([
124
+ (0, type_graphql_1.Resolver)(tax_invoice_item_1.TaxInvoiceItem)
125
+ ], TaxInvoiceItemMutation);
126
+ exports.TaxInvoiceItemMutation = TaxInvoiceItemMutation;
127
+ //# sourceMappingURL=tax-invoice-item-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-invoice-item-mutation.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-item/tax-invoice-item-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,yDAAmD;AACnD,mEAAgF;AAGzE,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAG3B,AAAN,KAAK,CAAC,oBAAoB,CAAwB,cAAiC,EAAS,OAAwB;QAClH,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,iCAAc,CAAC,CAAC,IAAI,iCACrD,cAAc,KACjB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,oBAAoB,CAAY,EAAU,EAAgB,KAA0B,EAAS,OAAwB;QACzH,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAA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xInvoiceItem, TaxInvoiceItemPatch } from './tax-invoice-item-type'\n\n@Resolver(TaxInvoiceItem)\nexport class TaxInvoiceItemMutation {\n @Directive('@transaction')\n @Mutation(returns => TaxInvoiceItem, { description: 'To create new TaxInvoiceItem' })\n async createTaxInvoiceItem(@Arg('taxInvoiceItem') taxInvoiceItem: NewTaxInvoiceItem, @Ctx() context: ResolverContext): Promise<TaxInvoiceItem> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(TaxInvoiceItem).save({\n ...taxInvoiceItem,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => TaxInvoiceItem, { description: 'To modify TaxInvoiceItem information' })\n async updateTaxInvoiceItem(@Arg('id') id: string, @Arg('patch') patch: TaxInvoiceItemPatch, @Ctx() context: ResolverContext): Promise<TaxInvoiceItem> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(TaxInvoiceItem)\n const taxInvoiceItem = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...taxInvoiceItem,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [TaxInvoiceItem], { description: \"To modify multiple TaxInvoiceItems' information\" })\n async updateMultipleTaxInvoiceItem(\n @Arg('patches', type => [TaxInvoiceItemPatch]) patches: TaxInvoiceItemPatch[],\n @Ctx() context: ResolverContext\n ): Promise<TaxInvoiceItem[]> {\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 taxInvoiceItemRepo = tx.getRepository(TaxInvoiceItem)\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 taxInvoiceItemRepo.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 taxInvoiceItem = await taxInvoiceItemRepo.findOneBy({ id: updateRecord.id })\n\n const result = await taxInvoiceItemRepo.save({\n ...taxInvoiceItem,\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 TaxInvoiceItem' })\n async deleteTaxInvoiceItem(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(TaxInvoiceItem).delete({ domain: { id: domain.id }, id })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple TaxInvoiceItems' })\n async deleteTaxInvoiceItems(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(TaxInvoiceItem).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 TaxInvoiceItems' })\n async importTaxInvoiceItems(\n @Arg('taxInvoiceItems', type => [TaxInvoiceItemPatch]) taxInvoiceItems: TaxInvoiceItemPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n taxInvoiceItems.map(async (taxInvoiceItem: TaxInvoiceItemPatch) => {\n const createdTaxInvoiceItem: TaxInvoiceItem = await tx.getRepository(TaxInvoiceItem).save({ domain, ...taxInvoiceItem })\n })\n )\n\n return true\n }\n}\n"]}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaxInvoiceItemQuery = 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 tax_invoice_item_1 = require("./tax-invoice-item");
10
+ const tax_invoice_item_type_1 = require("./tax-invoice-item-type");
11
+ let TaxInvoiceItemQuery = class TaxInvoiceItemQuery {
12
+ async taxInvoiceItem(id, context) {
13
+ const { domain } = context.state;
14
+ return await (0, shell_1.getRepository)(tax_invoice_item_1.TaxInvoiceItem).findOne({
15
+ where: { domain: { id: domain.id }, id }
16
+ });
17
+ }
18
+ async taxInvoiceItems(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)(tax_invoice_item_1.TaxInvoiceItem),
24
+ searchables: ['name', 'description']
25
+ });
26
+ const [items, total] = await queryBuilder.getManyAndCount();
27
+ return { items, total };
28
+ }
29
+ async thumbnail(taxInvoiceItem) {
30
+ const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).findOne({
31
+ where: {
32
+ domain: { id: taxInvoiceItem.domainId },
33
+ refType: tax_invoice_item_1.TaxInvoiceItem.name,
34
+ refBy: taxInvoiceItem.id
35
+ }
36
+ });
37
+ return attachment === null || attachment === void 0 ? void 0 : attachment.fullpath;
38
+ }
39
+ async domain(taxInvoiceItem) {
40
+ return taxInvoiceItem.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: taxInvoiceItem.domainId }));
41
+ }
42
+ async creator(taxInvoiceItem) {
43
+ return taxInvoiceItem.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: taxInvoiceItem.creatorId }));
44
+ }
45
+ };
46
+ tslib_1.__decorate([
47
+ (0, type_graphql_1.Query)(returns => tax_invoice_item_1.TaxInvoiceItem, { nullable: true, description: 'To fetch a TaxInvoiceItem' }),
48
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
49
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
50
+ tslib_1.__metadata("design:type", Function),
51
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
52
+ tslib_1.__metadata("design:returntype", Promise)
53
+ ], TaxInvoiceItemQuery.prototype, "taxInvoiceItem", null);
54
+ tslib_1.__decorate([
55
+ (0, type_graphql_1.Query)(returns => tax_invoice_item_type_1.TaxInvoiceItemList, { description: 'To fetch multiple TaxInvoiceItems' }),
56
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
57
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
58
+ tslib_1.__metadata("design:type", Function),
59
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
60
+ tslib_1.__metadata("design:returntype", Promise)
61
+ ], TaxInvoiceItemQuery.prototype, "taxInvoiceItems", null);
62
+ tslib_1.__decorate([
63
+ (0, type_graphql_1.FieldResolver)(type => String),
64
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
65
+ tslib_1.__metadata("design:type", Function),
66
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_item_1.TaxInvoiceItem]),
67
+ tslib_1.__metadata("design:returntype", Promise)
68
+ ], TaxInvoiceItemQuery.prototype, "thumbnail", null);
69
+ tslib_1.__decorate([
70
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
71
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
72
+ tslib_1.__metadata("design:type", Function),
73
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_item_1.TaxInvoiceItem]),
74
+ tslib_1.__metadata("design:returntype", Promise)
75
+ ], TaxInvoiceItemQuery.prototype, "domain", null);
76
+ tslib_1.__decorate([
77
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
78
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
79
+ tslib_1.__metadata("design:type", Function),
80
+ tslib_1.__metadata("design:paramtypes", [tax_invoice_item_1.TaxInvoiceItem]),
81
+ tslib_1.__metadata("design:returntype", Promise)
82
+ ], TaxInvoiceItemQuery.prototype, "creator", null);
83
+ TaxInvoiceItemQuery = tslib_1.__decorate([
84
+ (0, type_graphql_1.Resolver)(tax_invoice_item_1.TaxInvoiceItem)
85
+ ], TaxInvoiceItemQuery);
86
+ exports.TaxInvoiceItemQuery = TaxInvoiceItemQuery;
87
+ //# sourceMappingURL=tax-invoice-item-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tax-invoice-item-query.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-item/tax-invoice-item-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,yDAAmD;AACnD,mEAA4D;AAGrD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAExB,AAAN,KAAK,CAAC,cAAc,CAAY,EAAU,EAAS,OAAwB;QACzE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,iCAAc,CAAC,CAAC,OAAO,CAAC;YACjD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,eAAe,CAAS,MAAiB,EAAS,OAAwB;QAC9E,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,iCAAc,CAAC;YAC/C,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,AA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;;6CAAjB,iBAAS;;0DAa9C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAiB,iCAAc;;oDAUrD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAiB,iCAAc;;iDAElD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAiB,iCAAc;;kDAEnD;AA/CU,mBAAmB;IAD/B,IAAA,uBAAQ,EAAC,iCAAc,CAAC;GACZ,mBAAmB,CAgD/B;AAhDY,kDAAmB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaxInvoiceItem } from './tax-invoice-item'\nimport { TaxInvoiceItemList } from './tax-invoice-item-type'\n\n@Resolver(TaxInvoiceItem)\nexport class TaxInvoiceItemQuery {\n @Query(returns => TaxInvoiceItem!, { nullable: true, description: 'To fetch a TaxInvoiceItem' })\n async taxInvoiceItem(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<TaxInvoiceItem> {\n const { domain } = context.state\n\n return await getRepository(TaxInvoiceItem).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => TaxInvoiceItemList, { description: 'To fetch multiple TaxInvoiceItems' })\n async taxInvoiceItems(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaxInvoiceItemList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(TaxInvoiceItem),\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 thumbnail(@Root() taxInvoiceItem: TaxInvoiceItem): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: taxInvoiceItem.domainId },\n refType: TaxInvoiceItem.name,\n refBy: taxInvoiceItem.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() taxInvoiceItem: TaxInvoiceItem): Promise<Domain> {\n return taxInvoiceItem.domainId && (await getRepository(Domain).findOneBy({ id: taxInvoiceItem.domainId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() taxInvoiceItem: TaxInvoiceItem): Promise<User> {\n return taxInvoiceItem.creatorId && (await getRepository(User).findOneBy({ id: taxInvoiceItem.creatorId }))\n }\n}\n"]}