@things-factory/routing-base 5.0.7 → 6.0.0-alpha.0

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 (48) hide show
  1. package/dist-server/controllers/index.js.map +1 -1
  2. package/dist-server/index.js +4 -17
  3. package/dist-server/index.js.map +1 -1
  4. package/dist-server/middlewares/index.js.map +1 -1
  5. package/dist-server/migrations/index.js.map +1 -1
  6. package/dist-server/routes.js +0 -1
  7. package/dist-server/routes.js.map +1 -1
  8. package/dist-server/service/index.js +13 -26
  9. package/dist-server/service/index.js.map +1 -1
  10. package/dist-server/service/operation/index.js +3 -16
  11. package/dist-server/service/operation/index.js.map +1 -1
  12. package/dist-server/service/operation/operation-mutation.js +37 -48
  13. package/dist-server/service/operation/operation-mutation.js.map +1 -1
  14. package/dist-server/service/operation/operation-query.js +42 -55
  15. package/dist-server/service/operation/operation-query.js.map +1 -1
  16. package/dist-server/service/operation/operation-type.js +41 -52
  17. package/dist-server/service/operation/operation-type.js.map +1 -1
  18. package/dist-server/service/operation/operation.js +34 -43
  19. package/dist-server/service/operation/operation.js.map +1 -1
  20. package/dist-server/service/routing/index.js +3 -16
  21. package/dist-server/service/routing/index.js.map +1 -1
  22. package/dist-server/service/routing/routing-mutation.js +37 -48
  23. package/dist-server/service/routing/routing-mutation.js.map +1 -1
  24. package/dist-server/service/routing/routing-query.js +38 -51
  25. package/dist-server/service/routing/routing-query.js.map +1 -1
  26. package/dist-server/service/routing/routing-type.js +28 -36
  27. package/dist-server/service/routing/routing-type.js.map +1 -1
  28. package/dist-server/service/routing/routing.js +28 -37
  29. package/dist-server/service/routing/routing.js.map +1 -1
  30. package/dist-server/service/routing-item/index.js +3 -16
  31. package/dist-server/service/routing-item/index.js.map +1 -1
  32. package/dist-server/service/routing-item/routing-item-mutation.js +37 -48
  33. package/dist-server/service/routing-item/routing-item-mutation.js.map +1 -1
  34. package/dist-server/service/routing-item/routing-item-query.js +40 -53
  35. package/dist-server/service/routing-item/routing-item-query.js.map +1 -1
  36. package/dist-server/service/routing-item/routing-item-type.js +40 -49
  37. package/dist-server/service/routing-item/routing-item-type.js.map +1 -1
  38. package/dist-server/service/routing-item/routing-item.js +38 -47
  39. package/dist-server/service/routing-item/routing-item.js.map +1 -1
  40. package/dist-server/tsconfig.tsbuildinfo +1 -0
  41. package/package.json +5 -5
  42. package/server/routes.ts +0 -2
  43. package/server/service/operation/operation-mutation.ts +15 -9
  44. package/server/service/operation/operation-query.ts +8 -9
  45. package/server/service/routing/routing-mutation.ts +12 -14
  46. package/server/service/routing/routing-query.ts +19 -12
  47. package/server/service/routing-item/routing-item-mutation.ts +17 -20
  48. package/server/service/routing-item/routing-item-query.ts +10 -11
@@ -1,108 +1,97 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
3
  exports.OperationList = exports.OperationPatch = exports.NewOperation = void 0;
16
- const GraphQLUpload_js_1 = __importDefault(require("graphql-upload/GraphQLUpload.js"));
4
+ const tslib_1 = require("tslib");
5
+ const GraphQLUpload_js_1 = tslib_1.__importDefault(require("graphql-upload/GraphQLUpload.js"));
17
6
  const type_graphql_1 = require("type-graphql");
18
7
  const operation_1 = require("./operation");
19
8
  let NewOperation = class NewOperation {
20
9
  };
21
- __decorate([
10
+ tslib_1.__decorate([
22
11
  (0, type_graphql_1.Field)({ nullable: false }),
23
- __metadata("design:type", String)
12
+ tslib_1.__metadata("design:type", String)
24
13
  ], NewOperation.prototype, "name", void 0);
25
- __decorate([
14
+ tslib_1.__decorate([
26
15
  (0, type_graphql_1.Field)({ nullable: true }),
27
- __metadata("design:type", String)
16
+ tslib_1.__metadata("design:type", String)
28
17
  ], NewOperation.prototype, "description", void 0);
29
- __decorate([
18
+ tslib_1.__decorate([
30
19
  (0, type_graphql_1.Field)({ nullable: true }),
31
- __metadata("design:type", String)
20
+ tslib_1.__metadata("design:type", String)
32
21
  ], NewOperation.prototype, "type", void 0);
33
- __decorate([
22
+ tslib_1.__decorate([
34
23
  (0, type_graphql_1.Field)({ nullable: true }),
35
- __metadata("design:type", String)
24
+ tslib_1.__metadata("design:type", String)
36
25
  ], NewOperation.prototype, "operationStdChart", void 0);
37
- __decorate([
26
+ tslib_1.__decorate([
38
27
  (0, type_graphql_1.Field)({ nullable: true }),
39
- __metadata("design:type", String)
28
+ tslib_1.__metadata("design:type", String)
40
29
  ], NewOperation.prototype, "operationStdTime", void 0);
41
- __decorate([
30
+ tslib_1.__decorate([
42
31
  (0, type_graphql_1.Field)({ nullable: true }),
43
- __metadata("design:type", Boolean)
32
+ tslib_1.__metadata("design:type", Boolean)
44
33
  ], NewOperation.prototype, "active", void 0);
45
- __decorate([
34
+ tslib_1.__decorate([
46
35
  (0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
47
- __metadata("design:type", Object)
36
+ tslib_1.__metadata("design:type", Object)
48
37
  ], NewOperation.prototype, "thumbnail", void 0);
49
- NewOperation = __decorate([
38
+ NewOperation = tslib_1.__decorate([
50
39
  (0, type_graphql_1.InputType)()
51
40
  ], NewOperation);
52
41
  exports.NewOperation = NewOperation;
53
42
  let OperationPatch = class OperationPatch {
54
43
  };
55
- __decorate([
44
+ tslib_1.__decorate([
56
45
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
57
- __metadata("design:type", String)
46
+ tslib_1.__metadata("design:type", String)
58
47
  ], OperationPatch.prototype, "id", void 0);
59
- __decorate([
48
+ tslib_1.__decorate([
60
49
  (0, type_graphql_1.Field)({ nullable: true }),
61
- __metadata("design:type", String)
50
+ tslib_1.__metadata("design:type", String)
62
51
  ], OperationPatch.prototype, "name", void 0);
63
- __decorate([
52
+ tslib_1.__decorate([
64
53
  (0, type_graphql_1.Field)({ nullable: true }),
65
- __metadata("design:type", String)
54
+ tslib_1.__metadata("design:type", String)
66
55
  ], OperationPatch.prototype, "description", void 0);
67
- __decorate([
56
+ tslib_1.__decorate([
68
57
  (0, type_graphql_1.Field)({ nullable: true }),
69
- __metadata("design:type", String)
58
+ tslib_1.__metadata("design:type", String)
70
59
  ], OperationPatch.prototype, "type", void 0);
71
- __decorate([
60
+ tslib_1.__decorate([
72
61
  (0, type_graphql_1.Field)({ nullable: true }),
73
- __metadata("design:type", String)
62
+ tslib_1.__metadata("design:type", String)
74
63
  ], OperationPatch.prototype, "operationStdChart", void 0);
75
- __decorate([
64
+ tslib_1.__decorate([
76
65
  (0, type_graphql_1.Field)({ nullable: true }),
77
- __metadata("design:type", String)
66
+ tslib_1.__metadata("design:type", String)
78
67
  ], OperationPatch.prototype, "operationStdTime", void 0);
79
- __decorate([
68
+ tslib_1.__decorate([
80
69
  (0, type_graphql_1.Field)({ nullable: true }),
81
- __metadata("design:type", Boolean)
70
+ tslib_1.__metadata("design:type", Boolean)
82
71
  ], OperationPatch.prototype, "active", void 0);
83
- __decorate([
72
+ tslib_1.__decorate([
84
73
  (0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
85
- __metadata("design:type", Object)
74
+ tslib_1.__metadata("design:type", Object)
86
75
  ], OperationPatch.prototype, "thumbnail", void 0);
87
- __decorate([
76
+ tslib_1.__decorate([
88
77
  (0, type_graphql_1.Field)(),
89
- __metadata("design:type", String)
78
+ tslib_1.__metadata("design:type", String)
90
79
  ], OperationPatch.prototype, "cuFlag", void 0);
91
- OperationPatch = __decorate([
80
+ OperationPatch = tslib_1.__decorate([
92
81
  (0, type_graphql_1.InputType)()
93
82
  ], OperationPatch);
94
83
  exports.OperationPatch = OperationPatch;
95
84
  let OperationList = class OperationList {
96
85
  };
97
- __decorate([
86
+ tslib_1.__decorate([
98
87
  (0, type_graphql_1.Field)(type => [operation_1.Operation]),
99
- __metadata("design:type", Array)
88
+ tslib_1.__metadata("design:type", Array)
100
89
  ], OperationList.prototype, "items", void 0);
101
- __decorate([
90
+ tslib_1.__decorate([
102
91
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
103
- __metadata("design:type", Number)
92
+ tslib_1.__metadata("design:type", Number)
104
93
  ], OperationList.prototype, "total", void 0);
105
- OperationList = __decorate([
94
+ OperationList = tslib_1.__decorate([
106
95
  (0, type_graphql_1.ObjectType)()
107
96
  ], OperationList);
108
97
  exports.OperationList = OperationList;
@@ -1 +1 @@
1
- {"version":3,"file":"operation-type.js","sourceRoot":"","sources":["../../../server/service/operation/operation-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,uFAA2D;AAC3D,+CAAoE;AAEpE,2CAAuC;AAGvC,IAAa,YAAY,GAAzB,MAAa,YAAY;CAqBxB,CAAA;AAnBC;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CACf;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACA;AAG1B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACD;AAGzB;IADC,IAAA,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AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;AALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB;AANY,sCAAa"}
1
+ {"version":3,"file":"operation-type.js","sourceRoot":"","sources":["../../../server/service/operation/operation-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAoE;AAEpE,2CAAuC;AAGvC,IAAa,YAAY,GAAzB,MAAa,YAAY;CAqBxB,CAAA;AAnBC;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CACf;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACA;AAG1B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACD;AAGzB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAC3B;AApBX,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAqBxB;AArBY,oCAAY;AAwBzB,IAAa,cAAc,GAA3B,MAAa,cAAc;CA2B1B,CAAA;AAzBC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACd;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACA;AAG1B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACD;AAGzB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC3B;AAGtB;IADC,IAAA,oBAAK,GAAE;;8CACM;AA1BH,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CA2B1B;AA3BY,wCAAc;AA8B3B,IAAa,aAAa,GAA1B,MAAa,aAAa;CAMzB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,CAAC;;4CACT;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;AALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB;AANY,sCAAa","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { Operation } from './operation'\n\n@InputType()\nexport class NewOperation {\n @Field({ nullable: false })\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n operationStdChart?: string\n\n @Field({ nullable: true })\n operationStdTime?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class OperationPatch {\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?: string\n\n @Field({ nullable: true })\n operationStdChart?: string\n\n @Field({ nullable: true })\n operationStdTime?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class OperationList {\n @Field(type => [Operation])\n items: Operation[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,16 +1,7 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var _a, _b, _c;
12
2
  Object.defineProperty(exports, "__esModule", { value: true });
13
3
  exports.Operation = exports.OperationStatus = void 0;
4
+ const tslib_1 = require("tslib");
14
5
  const type_graphql_1 = require("type-graphql");
15
6
  const typeorm_1 = require("typeorm");
16
7
  const auth_base_1 = require("@things-factory/auth-base");
@@ -32,97 +23,97 @@ var OperationStatus;
32
23
  });
33
24
  let Operation = class Operation {
34
25
  };
35
- __decorate([
26
+ tslib_1.__decorate([
36
27
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
37
28
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: false }),
38
- __metadata("design:type", String)
29
+ tslib_1.__metadata("design:type", String)
39
30
  ], Operation.prototype, "id", void 0);
40
- __decorate([
31
+ tslib_1.__decorate([
41
32
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
42
33
  (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: false }),
43
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
34
+ tslib_1.__metadata("design:type", shell_1.Domain)
44
35
  ], Operation.prototype, "domain", void 0);
45
- __decorate([
36
+ tslib_1.__decorate([
46
37
  (0, typeorm_1.RelationId)((operation) => operation.domain),
47
- __metadata("design:type", String)
38
+ tslib_1.__metadata("design:type", String)
48
39
  ], Operation.prototype, "domainId", void 0);
49
- __decorate([
40
+ tslib_1.__decorate([
50
41
  (0, typeorm_1.Column)(),
51
42
  (0, type_graphql_1.Field)({ nullable: false }),
52
- __metadata("design:type", String)
43
+ tslib_1.__metadata("design:type", String)
53
44
  ], Operation.prototype, "name", void 0);
54
- __decorate([
45
+ tslib_1.__decorate([
55
46
  (0, typeorm_1.Column)({
56
47
  nullable: true
57
48
  }),
58
49
  (0, type_graphql_1.Field)({ nullable: true }),
59
- __metadata("design:type", String)
50
+ tslib_1.__metadata("design:type", String)
60
51
  ], Operation.prototype, "description", void 0);
61
- __decorate([
52
+ tslib_1.__decorate([
62
53
  (0, typeorm_1.Column)({
63
54
  nullable: true
64
55
  }),
65
56
  (0, type_graphql_1.Field)({ nullable: true }),
66
- __metadata("design:type", String)
57
+ tslib_1.__metadata("design:type", String)
67
58
  ], Operation.prototype, "type", void 0);
68
- __decorate([
59
+ tslib_1.__decorate([
69
60
  (0, typeorm_1.Column)({
70
61
  nullable: true
71
62
  }),
72
63
  (0, type_graphql_1.Field)({ nullable: true }),
73
- __metadata("design:type", String)
64
+ tslib_1.__metadata("design:type", String)
74
65
  ], Operation.prototype, "operationStdChart", void 0);
75
- __decorate([
66
+ tslib_1.__decorate([
76
67
  (0, typeorm_1.Column)({
77
68
  nullable: true
78
69
  }),
79
70
  (0, type_graphql_1.Field)({ nullable: true }),
80
- __metadata("design:type", String)
71
+ tslib_1.__metadata("design:type", String)
81
72
  ], Operation.prototype, "operationStdTime", void 0);
82
- __decorate([
73
+ tslib_1.__decorate([
83
74
  (0, typeorm_1.Column)({
84
75
  nullable: true
85
76
  }),
86
77
  (0, type_graphql_1.Field)({ nullable: true }),
87
- __metadata("design:type", Boolean)
78
+ tslib_1.__metadata("design:type", Boolean)
88
79
  ], Operation.prototype, "active", void 0);
89
- __decorate([
80
+ tslib_1.__decorate([
90
81
  (0, type_graphql_1.Field)(type => String, { nullable: true }),
91
- __metadata("design:type", String)
82
+ tslib_1.__metadata("design:type", String)
92
83
  ], Operation.prototype, "thumbnail", void 0);
93
- __decorate([
84
+ tslib_1.__decorate([
94
85
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
95
86
  nullable: true
96
87
  }),
97
88
  (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
98
- __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
89
+ tslib_1.__metadata("design:type", auth_base_1.User)
99
90
  ], Operation.prototype, "creator", void 0);
100
- __decorate([
91
+ tslib_1.__decorate([
101
92
  (0, typeorm_1.RelationId)((operation) => operation.creator),
102
- __metadata("design:type", String)
93
+ tslib_1.__metadata("design:type", String)
103
94
  ], Operation.prototype, "creatorId", void 0);
104
- __decorate([
95
+ tslib_1.__decorate([
105
96
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
106
97
  nullable: true
107
98
  }),
108
99
  (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
109
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
100
+ tslib_1.__metadata("design:type", auth_base_1.User)
110
101
  ], Operation.prototype, "updater", void 0);
111
- __decorate([
102
+ tslib_1.__decorate([
112
103
  (0, typeorm_1.RelationId)((operation) => operation.creator),
113
- __metadata("design:type", String)
104
+ tslib_1.__metadata("design:type", String)
114
105
  ], Operation.prototype, "updaterId", void 0);
115
- __decorate([
106
+ tslib_1.__decorate([
116
107
  (0, typeorm_1.CreateDateColumn)(),
117
108
  (0, type_graphql_1.Field)({ nullable: true }),
118
- __metadata("design:type", Date)
109
+ tslib_1.__metadata("design:type", Date)
119
110
  ], Operation.prototype, "createdAt", void 0);
120
- __decorate([
111
+ tslib_1.__decorate([
121
112
  (0, typeorm_1.UpdateDateColumn)(),
122
113
  (0, type_graphql_1.Field)({ nullable: true }),
123
- __metadata("design:type", Date)
114
+ tslib_1.__metadata("design:type", Date)
124
115
  ], Operation.prototype, "updatedAt", void 0);
125
- Operation = __decorate([
116
+ Operation = tslib_1.__decorate([
126
117
  (0, typeorm_1.Entity)(),
127
118
  (0, typeorm_1.Index)('ix_operation_0', (operation) => [operation.domain, operation.name], { unique: true }),
128
119
  (0, type_graphql_1.ObjectType)({ description: 'Entity for Operation' })
@@ -1 +1 @@
1
- {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../server/service/operation/operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,IAAY,eASX;AATD,WAAY,eAAe;IACzB,wCAAqB,CAAA;IACrB,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,mCAAgB,CAAA;IAChB,8BAAW,CAAA;IACX,mCAAgB,CAAA;IAChB,gCAAa,CAAA;AACf,CAAC,EATW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAS1B;AAED,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kCAAkC;CAChD,CAAC,CAAA;AAKF,IAAa,SAAS,GAAtB,MAAa,SAAS;CA0ErB,CAAA;AAvEC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CA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E,CAAC;GACvC,SAAS,CA0ErB;AA1EY,8BAAS"}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../server/service/operation/operation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,IAAY,eASX;AATD,WAAY,eAAe;IACzB,wCAAqB,CAAA;IACrB,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,mCAAgB,CAAA;IAChB,8BAAW,CAAA;IACX,mCAAgB,CAAA;IAChB,gCAAa,CAAA;AACf,CAAC,EATW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAS1B;AAED,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kCAAkC;CAChD,CAAC,CAAA;AAKF,IAAa,SAAS,GAAtB,MAAa,SAAS;CA0ErB,CAAA;AAvEC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qCACpB;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;sCACnC,cAAM;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;;2CACvC;AAIhB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;uCACf;AAMZ;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,E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A;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;AAIlB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;4CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;4CAAA;AAzEL,SAAS;IAHrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;GACvC,SAAS,CA0ErB;AA1EY,8BAAS","sourcesContent":["import { Field, ID, ObjectType, registerEnumType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nexport enum OperationStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B',\n ASSY = 'Assembly',\n INV = 'Inventory',\n PACK = 'Packing',\n SMT = 'SMT',\n STD = 'Standard',\n TEST = 'Test'\n}\n\nregisterEnumType(OperationStatus, {\n name: 'OperationStatus',\n description: 'state enumeration of a operation'\n})\n\n@Entity()\n@Index('ix_operation_0', (operation: Operation) => [operation.domain, operation.name], { unique: true })\n@ObjectType({ description: 'Entity for Operation' })\nexport class Operation {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { nullable: false })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: false })\n domain: Domain\n\n @RelationId((operation: Operation) => operation.domain)\n domainId: string\n\n @Column()\n @Field({ nullable: false })\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n type?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n operationStdChart?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n operationStdTime?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => String, { nullable: true })\n thumbnail?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((operation: Operation) => operation.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((operation: Operation) => operation.creator)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n}\n"]}
@@ -1,25 +1,12 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
3
  exports.resolvers = exports.entities = void 0;
4
+ const tslib_1 = require("tslib");
18
5
  const routing_1 = require("./routing");
19
6
  const routing_mutation_1 = require("./routing-mutation");
20
7
  const routing_query_1 = require("./routing-query");
21
8
  exports.entities = [routing_1.Routing];
22
9
  exports.resolvers = [routing_query_1.RoutingQuery, routing_mutation_1.RoutingMutation];
23
- __exportStar(require("./routing-query"), exports);
24
- __exportStar(require("./routing-mutation"), exports);
10
+ tslib_1.__exportStar(require("./routing-query"), exports);
11
+ tslib_1.__exportStar(require("./routing-mutation"), exports);
25
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/routing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAmC;AACnC,yDAAoD;AACpD,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA;AAExD,kDAA+B;AAC/B,qDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/routing/index.ts"],"names":[],"mappings":";;;;AAAA,uCAAmC;AACnC,yDAAoD;AACpD,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA;AAExD,0DAA+B;AAC/B,6DAAkC","sourcesContent":["import { Routing } from './routing'\nimport { RoutingMutation } from './routing-mutation'\nimport { RoutingQuery } from './routing-query'\n\nexport const entities = [Routing]\nexport const resolvers = [RoutingQuery, RoutingMutation]\n\nexport * from './routing-query'\nexport * from './routing-mutation'\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
3
  exports.RoutingMutation = void 0;
4
+ const tslib_1 = require("tslib");
16
5
  const type_graphql_1 = require("type-graphql");
17
6
  const typeorm_1 = require("typeorm");
18
7
  const routing_1 = require("./routing");
@@ -26,7 +15,7 @@ let RoutingMutation = class RoutingMutation {
26
15
  const { domain, user, tx } = context.state;
27
16
  const repository = tx.getRepository(routing_1.Routing);
28
17
  const routing = await repository.findOne({
29
- where: { domain, id }
18
+ where: { domain: { id: domain.id }, id }
30
19
  });
31
20
  return await repository.save(Object.assign(Object.assign(Object.assign({}, routing), patch), { updater: user }));
32
21
  }
@@ -46,7 +35,7 @@ let RoutingMutation = class RoutingMutation {
46
35
  if (_updateRecords.length > 0) {
47
36
  for (let i = 0; i < _updateRecords.length; i++) {
48
37
  const newRecord = _updateRecords[i];
49
- const routing = await routingRepo.findOne(newRecord.id);
38
+ const routing = await routingRepo.findOneBy({ id: newRecord.id });
50
39
  const result = await routingRepo.save(Object.assign(Object.assign(Object.assign({}, routing), newRecord), { updater: user }));
51
40
  results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
52
41
  }
@@ -55,65 +44,65 @@ let RoutingMutation = class RoutingMutation {
55
44
  }
56
45
  async deleteRouting(id, context) {
57
46
  const { domain, tx } = context.state;
58
- await tx.getRepository(routing_1.Routing).delete({ domain, id });
47
+ await tx.getRepository(routing_1.Routing).delete({ domain: { id: domain.id }, id });
59
48
  return true;
60
49
  }
61
50
  async deleteRoutings(ids, context) {
62
51
  const { domain, tx } = context.state;
63
52
  await tx.getRepository(routing_1.Routing).delete({
64
- domain,
53
+ domain: { id: domain.id },
65
54
  id: (0, typeorm_1.In)(ids)
66
55
  });
67
56
  return true;
68
57
  }
69
58
  };
70
- __decorate([
59
+ tslib_1.__decorate([
71
60
  (0, type_graphql_1.Directive)('@transaction'),
72
61
  (0, type_graphql_1.Mutation)(returns => routing_1.Routing, { description: 'To create new Routing' }),
73
- __param(0, (0, type_graphql_1.Arg)('routing')),
74
- __param(1, (0, type_graphql_1.Ctx)()),
75
- __metadata("design:type", Function),
76
- __metadata("design:paramtypes", [routing_type_1.NewRouting, Object]),
77
- __metadata("design:returntype", Promise)
62
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('routing')),
63
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
64
+ tslib_1.__metadata("design:type", Function),
65
+ tslib_1.__metadata("design:paramtypes", [routing_type_1.NewRouting, Object]),
66
+ tslib_1.__metadata("design:returntype", Promise)
78
67
  ], RoutingMutation.prototype, "createRouting", null);
79
- __decorate([
68
+ tslib_1.__decorate([
80
69
  (0, type_graphql_1.Directive)('@transaction'),
81
70
  (0, type_graphql_1.Mutation)(returns => routing_1.Routing, { description: 'To modify Routing information' }),
82
- __param(0, (0, type_graphql_1.Arg)('id')),
83
- __param(1, (0, type_graphql_1.Arg)('patch')),
84
- __param(2, (0, type_graphql_1.Ctx)()),
85
- __metadata("design:type", Function),
86
- __metadata("design:paramtypes", [String, routing_type_1.RoutingPatch, Object]),
87
- __metadata("design:returntype", Promise)
71
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
72
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
73
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
74
+ tslib_1.__metadata("design:type", Function),
75
+ tslib_1.__metadata("design:paramtypes", [String, routing_type_1.RoutingPatch, Object]),
76
+ tslib_1.__metadata("design:returntype", Promise)
88
77
  ], RoutingMutation.prototype, "updateRouting", null);
89
- __decorate([
78
+ tslib_1.__decorate([
90
79
  (0, type_graphql_1.Directive)('@transaction'),
91
80
  (0, type_graphql_1.Mutation)(returns => [routing_1.Routing], { description: "To modify multiple Routings' information" }),
92
- __param(0, (0, type_graphql_1.Arg)('patches', type => [routing_type_1.RoutingPatch])),
93
- __param(1, (0, type_graphql_1.Ctx)()),
94
- __metadata("design:type", Function),
95
- __metadata("design:paramtypes", [Array, Object]),
96
- __metadata("design:returntype", Promise)
81
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [routing_type_1.RoutingPatch])),
82
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
83
+ tslib_1.__metadata("design:type", Function),
84
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
85
+ tslib_1.__metadata("design:returntype", Promise)
97
86
  ], RoutingMutation.prototype, "updateMultipleRouting", null);
98
- __decorate([
87
+ tslib_1.__decorate([
99
88
  (0, type_graphql_1.Directive)('@transaction'),
100
89
  (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Routing' }),
101
- __param(0, (0, type_graphql_1.Arg)('id')),
102
- __param(1, (0, type_graphql_1.Ctx)()),
103
- __metadata("design:type", Function),
104
- __metadata("design:paramtypes", [String, Object]),
105
- __metadata("design:returntype", Promise)
90
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
91
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
92
+ tslib_1.__metadata("design:type", Function),
93
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
94
+ tslib_1.__metadata("design:returntype", Promise)
106
95
  ], RoutingMutation.prototype, "deleteRouting", null);
107
- __decorate([
96
+ tslib_1.__decorate([
108
97
  (0, type_graphql_1.Directive)('@transaction'),
109
98
  (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple routings' }),
110
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
111
- __param(1, (0, type_graphql_1.Ctx)()),
112
- __metadata("design:type", Function),
113
- __metadata("design:paramtypes", [Array, Object]),
114
- __metadata("design:returntype", Promise)
99
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
100
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
101
+ tslib_1.__metadata("design:type", Function),
102
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
103
+ tslib_1.__metadata("design:returntype", Promise)
115
104
  ], RoutingMutation.prototype, "deleteRoutings", null);
116
- RoutingMutation = __decorate([
105
+ RoutingMutation = tslib_1.__decorate([
117
106
  (0, type_graphql_1.Resolver)(routing_1.Routing)
118
107
  ], RoutingMutation);
119
108
  exports.RoutingMutation = RoutingMutation;
@@ -1 +1 @@
1
- {"version":3,"file":"routing-mutation.js","sourceRoot":"","sources":["../../../server/service/routing/routing-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA2C;AAC3C,uCAAmC;AACnC,iDAAyD;AAGzD,IAAa,eAAe,GAA5B,MAAa,eAAe;IAG1B,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAY;QAC1E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,iBAAO,CAAC,CAAC,IAAI,iCACtC,OAAO,KACV,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,aAAa,CACN,EAAU,EACP,KAAmB,EAC1B,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,iBAAO,CAAC,CAAA;QAC5C,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACvC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;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AAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,iBAAO,CAAC,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;IAEzF,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,2BAAY,CAAC,CAAC,CAAA;IACtC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4DAwCP;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAKhD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDASvE;AArGU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,eAAe,CAsG3B;AAtGY,0CAAe","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Routing } from './routing'\nimport { NewRouting, RoutingPatch } from './routing-type'\n\n@Resolver(Routing)\nexport class RoutingMutation {\n @Directive('@transaction')\n @Mutation(returns => Routing, { description: 'To create new Routing' })\n async createRouting(@Arg('routing') routing: NewRouting, @Ctx() context: ResolverContext): Promise<Routing> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(Routing).save({\n ...routing,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Routing, { description: 'To modify Routing information' })\n async updateRouting(\n @Arg('id') id: string,\n @Arg('patch') patch: RoutingPatch,\n @Ctx() context: ResolverContext\n ): Promise<Routing> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Routing)\n const routing = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n return await repository.save({\n ...routing,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [Routing], { description: \"To modify multiple Routings' information\" })\n async updateMultipleRouting(\n @Arg('patches', type => [RoutingPatch]) patches: RoutingPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Routing[]> {\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 routingRepo = tx.getRepository(Routing)\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 routingRepo.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 newRecord = _updateRecords[i]\n const routing = await routingRepo.findOneBy({ id: newRecord.id })\n\n const result = await routingRepo.save({\n ...routing,\n ...newRecord,\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 Routing' })\n async deleteRouting(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Routing).delete({ domain: { id: domain.id }, id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple routings' })\n async deleteRoutings(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Routing).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n}\n"]}