@things-factory/ops-master 10.0.18

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 (181) hide show
  1. package/.dockerignore +31 -0
  2. package/dist-client/index.d.ts +1 -0
  3. package/dist-client/index.js +2 -0
  4. package/dist-client/index.js.map +1 -0
  5. package/dist-client/pages/master-axes.d.ts +33 -0
  6. package/dist-client/pages/master-axes.js +176 -0
  7. package/dist-client/pages/master-axes.js.map +1 -0
  8. package/dist-client/pages/master-list.d.ts +68 -0
  9. package/dist-client/pages/master-list.js +267 -0
  10. package/dist-client/pages/master-list.js.map +1 -0
  11. package/dist-client/route.d.ts +1 -0
  12. package/dist-client/route.js +8 -0
  13. package/dist-client/route.js.map +1 -0
  14. package/dist-client/tsconfig.tsbuildinfo +1 -0
  15. package/dist-server/index.d.ts +1 -0
  16. package/dist-server/index.js +5 -0
  17. package/dist-server/index.js.map +1 -0
  18. package/dist-server/service/asset/asset-lifecycle.d.ts +83 -0
  19. package/dist-server/service/asset/asset-lifecycle.js +99 -0
  20. package/dist-server/service/asset/asset-lifecycle.js.map +1 -0
  21. package/dist-server/service/asset/asset-master-resolver.d.ts +44 -0
  22. package/dist-server/service/asset/asset-master-resolver.js +140 -0
  23. package/dist-server/service/asset/asset-master-resolver.js.map +1 -0
  24. package/dist-server/service/asset/asset-master.d.ts +21 -0
  25. package/dist-server/service/asset/asset-master.js +25 -0
  26. package/dist-server/service/asset/asset-master.js.map +1 -0
  27. package/dist-server/service/asset/asset-query.d.ts +8 -0
  28. package/dist-server/service/asset/asset-query.js +50 -0
  29. package/dist-server/service/asset/asset-query.js.map +1 -0
  30. package/dist-server/service/asset/index.d.ts +6 -0
  31. package/dist-server/service/asset/index.js +10 -0
  32. package/dist-server/service/asset/index.js.map +1 -0
  33. package/dist-server/service/asset/physical-asset-class.d.ts +34 -0
  34. package/dist-server/service/asset/physical-asset-class.js +104 -0
  35. package/dist-server/service/asset/physical-asset-class.js.map +1 -0
  36. package/dist-server/service/asset/physical-asset.d.ts +53 -0
  37. package/dist-server/service/asset/physical-asset.js +123 -0
  38. package/dist-server/service/asset/physical-asset.js.map +1 -0
  39. package/dist-server/service/equipment/equipment-class.d.ts +34 -0
  40. package/dist-server/service/equipment/equipment-class.js +104 -0
  41. package/dist-server/service/equipment/equipment-class.js.map +1 -0
  42. package/dist-server/service/equipment/equipment-master-resolver.d.ts +60 -0
  43. package/dist-server/service/equipment/equipment-master-resolver.js +200 -0
  44. package/dist-server/service/equipment/equipment-master-resolver.js.map +1 -0
  45. package/dist-server/service/equipment/equipment-master.d.ts +29 -0
  46. package/dist-server/service/equipment/equipment-master.js +36 -0
  47. package/dist-server/service/equipment/equipment-master.js.map +1 -0
  48. package/dist-server/service/equipment/equipment-query.d.ts +8 -0
  49. package/dist-server/service/equipment/equipment-query.js +50 -0
  50. package/dist-server/service/equipment/equipment-query.js.map +1 -0
  51. package/dist-server/service/equipment/equipment.d.ts +45 -0
  52. package/dist-server/service/equipment/equipment.js +133 -0
  53. package/dist-server/service/equipment/equipment.js.map +1 -0
  54. package/dist-server/service/equipment/index.d.ts +8 -0
  55. package/dist-server/service/equipment/index.js +12 -0
  56. package/dist-server/service/equipment/index.js.map +1 -0
  57. package/dist-server/service/equipment/state-period-rules.d.ts +76 -0
  58. package/dist-server/service/equipment/state-period-rules.js +88 -0
  59. package/dist-server/service/equipment/state-period-rules.js.map +1 -0
  60. package/dist-server/service/equipment/stop-reason-query.d.ts +11 -0
  61. package/dist-server/service/equipment/stop-reason-query.js +39 -0
  62. package/dist-server/service/equipment/stop-reason-query.js.map +1 -0
  63. package/dist-server/service/equipment/stop-reason.d.ts +58 -0
  64. package/dist-server/service/equipment/stop-reason.js +114 -0
  65. package/dist-server/service/equipment/stop-reason.js.map +1 -0
  66. package/dist-server/service/index.d.ts +46 -0
  67. package/dist-server/service/index.js +80 -0
  68. package/dist-server/service/index.js.map +1 -0
  69. package/dist-server/service/location/index.d.ts +5 -0
  70. package/dist-server/service/location/index.js +9 -0
  71. package/dist-server/service/location/index.js.map +1 -0
  72. package/dist-server/service/location/location-master-resolver.d.ts +28 -0
  73. package/dist-server/service/location/location-master-resolver.js +80 -0
  74. package/dist-server/service/location/location-master-resolver.js.map +1 -0
  75. package/dist-server/service/location/location-master.d.ts +24 -0
  76. package/dist-server/service/location/location-master.js +27 -0
  77. package/dist-server/service/location/location-master.js.map +1 -0
  78. package/dist-server/service/location/location-query.d.ts +7 -0
  79. package/dist-server/service/location/location-query.js +41 -0
  80. package/dist-server/service/location/location-query.js.map +1 -0
  81. package/dist-server/service/location/operational-location.d.ts +52 -0
  82. package/dist-server/service/location/operational-location.js +132 -0
  83. package/dist-server/service/location/operational-location.js.map +1 -0
  84. package/dist-server/service/master-axis.d.ts +29 -0
  85. package/dist-server/service/master-axis.js +39 -0
  86. package/dist-server/service/master-axis.js.map +1 -0
  87. package/dist-server/service/master-crud.d.ts +44 -0
  88. package/dist-server/service/master-crud.js +73 -0
  89. package/dist-server/service/master-crud.js.map +1 -0
  90. package/dist-server/service/master-list.d.ts +12 -0
  91. package/dist-server/service/master-list.js +24 -0
  92. package/dist-server/service/master-list.js.map +1 -0
  93. package/dist-server/service/material/index.d.ts +6 -0
  94. package/dist-server/service/material/index.js +10 -0
  95. package/dist-server/service/material/index.js.map +1 -0
  96. package/dist-server/service/material/material-class.d.ts +34 -0
  97. package/dist-server/service/material/material-class.js +104 -0
  98. package/dist-server/service/material/material-class.js.map +1 -0
  99. package/dist-server/service/material/material-definition.d.ts +42 -0
  100. package/dist-server/service/material/material-definition.js +112 -0
  101. package/dist-server/service/material/material-definition.js.map +1 -0
  102. package/dist-server/service/material/material-master-resolver.d.ts +44 -0
  103. package/dist-server/service/material/material-master-resolver.js +140 -0
  104. package/dist-server/service/material/material-master-resolver.js.map +1 -0
  105. package/dist-server/service/material/material-master.d.ts +9 -0
  106. package/dist-server/service/material/material-master.js +24 -0
  107. package/dist-server/service/material/material-master.js.map +1 -0
  108. package/dist-server/service/material/material-query.d.ts +8 -0
  109. package/dist-server/service/material/material-query.js +50 -0
  110. package/dist-server/service/material/material-query.js.map +1 -0
  111. package/dist-server/service/operation/index.d.ts +5 -0
  112. package/dist-server/service/operation/index.js +9 -0
  113. package/dist-server/service/operation/index.js.map +1 -0
  114. package/dist-server/service/operation/operation-definition.d.ts +52 -0
  115. package/dist-server/service/operation/operation-definition.js +142 -0
  116. package/dist-server/service/operation/operation-definition.js.map +1 -0
  117. package/dist-server/service/operation/operation-master-resolver.d.ts +28 -0
  118. package/dist-server/service/operation/operation-master-resolver.js +80 -0
  119. package/dist-server/service/operation/operation-master-resolver.js.map +1 -0
  120. package/dist-server/service/operation/operation-master.d.ts +21 -0
  121. package/dist-server/service/operation/operation-master.js +28 -0
  122. package/dist-server/service/operation/operation-master.js.map +1 -0
  123. package/dist-server/service/operation/operation-query.d.ts +7 -0
  124. package/dist-server/service/operation/operation-query.js +41 -0
  125. package/dist-server/service/operation/operation-query.js.map +1 -0
  126. package/dist-server/service/personnel/index.d.ts +6 -0
  127. package/dist-server/service/personnel/index.js +10 -0
  128. package/dist-server/service/personnel/index.js.map +1 -0
  129. package/dist-server/service/personnel/person.d.ts +51 -0
  130. package/dist-server/service/personnel/person.js +119 -0
  131. package/dist-server/service/personnel/person.js.map +1 -0
  132. package/dist-server/service/personnel/personnel-class.d.ts +54 -0
  133. package/dist-server/service/personnel/personnel-class.js +114 -0
  134. package/dist-server/service/personnel/personnel-class.js.map +1 -0
  135. package/dist-server/service/personnel/personnel-master-resolver.d.ts +44 -0
  136. package/dist-server/service/personnel/personnel-master-resolver.js +140 -0
  137. package/dist-server/service/personnel/personnel-master-resolver.js.map +1 -0
  138. package/dist-server/service/personnel/personnel-master.d.ts +39 -0
  139. package/dist-server/service/personnel/personnel-master.js +34 -0
  140. package/dist-server/service/personnel/personnel-master.js.map +1 -0
  141. package/dist-server/service/personnel/personnel-query.d.ts +21 -0
  142. package/dist-server/service/personnel/personnel-query.js +57 -0
  143. package/dist-server/service/personnel/personnel-query.js.map +1 -0
  144. package/dist-server/service/personnel/qualification.d.ts +97 -0
  145. package/dist-server/service/personnel/qualification.js +122 -0
  146. package/dist-server/service/personnel/qualification.js.map +1 -0
  147. package/dist-server/service/resource/resource-class.d.ts +25 -0
  148. package/dist-server/service/resource/resource-class.js +29 -0
  149. package/dist-server/service/resource/resource-class.js.map +1 -0
  150. package/dist-server/service/status/axis-stamp.d.ts +16 -0
  151. package/dist-server/service/status/axis-stamp.js +22 -0
  152. package/dist-server/service/status/axis-stamp.js.map +1 -0
  153. package/dist-server/service/status/index.d.ts +3 -0
  154. package/dist-server/service/status/index.js +7 -0
  155. package/dist-server/service/status/index.js.map +1 -0
  156. package/dist-server/service/status/master-status.d.ts +45 -0
  157. package/dist-server/service/status/master-status.js +129 -0
  158. package/dist-server/service/status/master-status.js.map +1 -0
  159. package/dist-server/service/test-spec/index.d.ts +5 -0
  160. package/dist-server/service/test-spec/index.js +9 -0
  161. package/dist-server/service/test-spec/index.js.map +1 -0
  162. package/dist-server/service/test-spec/test-spec-master-resolver.d.ts +28 -0
  163. package/dist-server/service/test-spec/test-spec-master-resolver.js +80 -0
  164. package/dist-server/service/test-spec/test-spec-master-resolver.js.map +1 -0
  165. package/dist-server/service/test-spec/test-spec-master.d.ts +6 -0
  166. package/dist-server/service/test-spec/test-spec-master.js +18 -0
  167. package/dist-server/service/test-spec/test-spec-master.js.map +1 -0
  168. package/dist-server/service/test-spec/test-spec-query.d.ts +7 -0
  169. package/dist-server/service/test-spec/test-spec-query.js +41 -0
  170. package/dist-server/service/test-spec/test-spec-query.js.map +1 -0
  171. package/dist-server/service/test-spec/test-specification.d.ts +41 -0
  172. package/dist-server/service/test-spec/test-specification.js +106 -0
  173. package/dist-server/service/test-spec/test-specification.js.map +1 -0
  174. package/dist-server/tsconfig.tsbuildinfo +1 -0
  175. package/package.json +50 -0
  176. package/things-factory.config.js +12 -0
  177. package/translations/en.json +53 -0
  178. package/translations/ja.json +1 -0
  179. package/translations/ko.json +53 -0
  180. package/translations/ms.json +1 -0
  181. package/translations/zh.json +1 -0
@@ -0,0 +1,58 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ /**
4
+ * 설비가 왜 섰나 — **사유의 목록.**
5
+ *
6
+ * ── 왜 마스터로 두나 ────────────────────────────────────────────────────────
7
+ * 사유를 자유 문장으로 받으면 「금형교체」 · 「금형 교체」 · 「몰드교환」이 서로 다른 사유가 된다. 그러면
8
+ * 「무엇 때문에 가장 많이 멈추나」에 답할 수 없다 — 그 답이 정지 사유를 적는 유일한 이유다.
9
+ *
10
+ * ── `status` 가 가동률을 정하고, 사유는 무엇을 고칠지 정한다 ────────────────
11
+ * ISO 22400 에서 가동률을 깎느냐 마느냐는 **상태**가 정한다(`down` · `idle` 은 깎고 `planned-stop` 은
12
+ * 깎지 않는다). 사유는 그 상태 안에서 **무엇을 고쳐야 하나**를 말한다.
13
+ *
14
+ * 그래서 사유마다 어느 상태에 쓰이는지 적어 둔다. 「점심시간」을 `down` 으로 적으면 가동률이 알리지
15
+ * 않고 낮아지고, 「고장」을 `planned-stop` 으로 적으면 알리지 않고 높아진다. 둘 다 조용한 거짓이다.
16
+ */
17
+ export declare class StopReason {
18
+ readonly id: string;
19
+ domain?: Domain;
20
+ domainId?: string;
21
+ /** 사유 코드 — 상태 구간이 이 값을 가리킨다. */
22
+ name: string;
23
+ description?: string;
24
+ /**
25
+ * 이 사유가 쓰이는 상태 — `down` · `idle` · `setup` · `planned-stop`.
26
+ *
27
+ * 어휘는 계약의 `EQUIPMENT_STATUS` 다. `busy` 는 여기 오지 않는다 — 돌고 있는 것에는 사유가 없다.
28
+ */
29
+ status: string;
30
+ /**
31
+ * 상위 사유 — 사유는 나무다.
32
+ *
33
+ * 「설비 고장」 아래 「금형 파손」 · 「모터 과열」이 온다. 위로 모아 보면 「고장으로 몇 시간」이 나오고,
34
+ * 아래로 내려가면 「무엇을 고칠까」가 나온다. 한 단으로만 두면 둘 중 하나를 잃는다.
35
+ */
36
+ parentName?: string;
37
+ /**
38
+ * 이 사유를 적을 때 상세를 함께 받나.
39
+ *
40
+ * 「기타」로만 적히는 사유가 목록의 절반을 차지하면 분류가 없는 것과 같다. 상세를 요구하는 사유를
41
+ * 표시해 두어 화면이 그때만 묻게 한다.
42
+ */
43
+ detailRequired?: boolean;
44
+ /** 언제부터 — 표준 `EffectiveStartDate`. */
45
+ effectiveStart?: Date;
46
+ /**
47
+ * 언제까지 — 표준 `EffectiveEndDate`.
48
+ *
49
+ * 쓰지 않는 사유는 지우지 않고 이 칸을 채운다. 지우면 그 사유로 적힌 지난 구간이 가리킬 것을 잃는다.
50
+ */
51
+ effectiveEnd?: Date;
52
+ createdAt?: Date;
53
+ updatedAt?: Date;
54
+ creator?: User;
55
+ creatorId?: string;
56
+ updater?: User;
57
+ updaterId?: string;
58
+ }
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StopReason = 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
+ /**
10
+ * 설비가 왜 섰나 — **사유의 목록.**
11
+ *
12
+ * ── 왜 마스터로 두나 ────────────────────────────────────────────────────────
13
+ * 사유를 자유 문장으로 받으면 「금형교체」 · 「금형 교체」 · 「몰드교환」이 서로 다른 사유가 된다. 그러면
14
+ * 「무엇 때문에 가장 많이 멈추나」에 답할 수 없다 — 그 답이 정지 사유를 적는 유일한 이유다.
15
+ *
16
+ * ── `status` 가 가동률을 정하고, 사유는 무엇을 고칠지 정한다 ────────────────
17
+ * ISO 22400 에서 가동률을 깎느냐 마느냐는 **상태**가 정한다(`down` · `idle` 은 깎고 `planned-stop` 은
18
+ * 깎지 않는다). 사유는 그 상태 안에서 **무엇을 고쳐야 하나**를 말한다.
19
+ *
20
+ * 그래서 사유마다 어느 상태에 쓰이는지 적어 둔다. 「점심시간」을 `down` 으로 적으면 가동률이 알리지
21
+ * 않고 낮아지고, 「고장」을 `planned-stop` 으로 적으면 알리지 않고 높아진다. 둘 다 조용한 거짓이다.
22
+ */
23
+ let StopReason = class StopReason {
24
+ };
25
+ exports.StopReason = StopReason;
26
+ tslib_1.__decorate([
27
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
28
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
29
+ tslib_1.__metadata("design:type", String)
30
+ ], StopReason.prototype, "id", void 0);
31
+ tslib_1.__decorate([
32
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
33
+ (0, type_graphql_1.Field)(type => shell_1.Domain),
34
+ tslib_1.__metadata("design:type", shell_1.Domain)
35
+ ], StopReason.prototype, "domain", void 0);
36
+ tslib_1.__decorate([
37
+ (0, typeorm_1.RelationId)((reason) => reason.domain),
38
+ tslib_1.__metadata("design:type", String)
39
+ ], StopReason.prototype, "domainId", void 0);
40
+ tslib_1.__decorate([
41
+ (0, typeorm_1.Column)(),
42
+ (0, type_graphql_1.Field)({ description: 'the reason code a state period refers to' }),
43
+ tslib_1.__metadata("design:type", String)
44
+ ], StopReason.prototype, "name", void 0);
45
+ tslib_1.__decorate([
46
+ (0, typeorm_1.Column)({ nullable: true }),
47
+ (0, type_graphql_1.Field)({ nullable: true }),
48
+ tslib_1.__metadata("design:type", String)
49
+ ], StopReason.prototype, "description", void 0);
50
+ tslib_1.__decorate([
51
+ (0, typeorm_1.Column)(),
52
+ (0, type_graphql_1.Field)({ description: 'which equipment status this reason belongs to' }),
53
+ tslib_1.__metadata("design:type", String)
54
+ ], StopReason.prototype, "status", void 0);
55
+ tslib_1.__decorate([
56
+ (0, typeorm_1.Column)({ nullable: true }),
57
+ (0, type_graphql_1.Field)({ nullable: true, description: 'parent reason — reasons form a tree' }),
58
+ tslib_1.__metadata("design:type", String)
59
+ ], StopReason.prototype, "parentName", void 0);
60
+ tslib_1.__decorate([
61
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
62
+ (0, type_graphql_1.Field)({ nullable: true, description: 'whether the floor must add a note when choosing this reason' }),
63
+ tslib_1.__metadata("design:type", Boolean)
64
+ ], StopReason.prototype, "detailRequired", void 0);
65
+ tslib_1.__decorate([
66
+ (0, typeorm_1.Column)({ nullable: true }),
67
+ (0, type_graphql_1.Field)({ nullable: true }),
68
+ tslib_1.__metadata("design:type", Date
69
+ /**
70
+ * 언제까지 — 표준 `EffectiveEndDate`.
71
+ *
72
+ * 쓰지 않는 사유는 지우지 않고 이 칸을 채운다. 지우면 그 사유로 적힌 지난 구간이 가리킬 것을 잃는다.
73
+ */
74
+ )
75
+ ], StopReason.prototype, "effectiveStart", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.Column)({ nullable: true }),
78
+ (0, type_graphql_1.Field)({ nullable: true }),
79
+ tslib_1.__metadata("design:type", Date)
80
+ ], StopReason.prototype, "effectiveEnd", void 0);
81
+ tslib_1.__decorate([
82
+ (0, typeorm_1.CreateDateColumn)(),
83
+ (0, type_graphql_1.Field)({ nullable: true }),
84
+ tslib_1.__metadata("design:type", Date)
85
+ ], StopReason.prototype, "createdAt", void 0);
86
+ tslib_1.__decorate([
87
+ (0, typeorm_1.UpdateDateColumn)(),
88
+ (0, type_graphql_1.Field)({ nullable: true }),
89
+ tslib_1.__metadata("design:type", Date)
90
+ ], StopReason.prototype, "updatedAt", void 0);
91
+ tslib_1.__decorate([
92
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
93
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
94
+ tslib_1.__metadata("design:type", auth_base_1.User)
95
+ ], StopReason.prototype, "creator", void 0);
96
+ tslib_1.__decorate([
97
+ (0, typeorm_1.RelationId)((reason) => reason.creator),
98
+ tslib_1.__metadata("design:type", String)
99
+ ], StopReason.prototype, "creatorId", void 0);
100
+ tslib_1.__decorate([
101
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
102
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
103
+ tslib_1.__metadata("design:type", auth_base_1.User)
104
+ ], StopReason.prototype, "updater", void 0);
105
+ tslib_1.__decorate([
106
+ (0, typeorm_1.RelationId)((reason) => reason.updater),
107
+ tslib_1.__metadata("design:type", String)
108
+ ], StopReason.prototype, "updaterId", void 0);
109
+ exports.StopReason = StopReason = tslib_1.__decorate([
110
+ (0, typeorm_1.Entity)({ name: 'ops_stop_reason' }),
111
+ (0, typeorm_1.Index)('ix_ops_stop_reason_0', (reason) => [reason.domain, reason.name], { unique: true }),
112
+ (0, type_graphql_1.ObjectType)({ description: 'A classified reason an equipment was not producing' })
113
+ ], StopReason);
114
+ //# sourceMappingURL=stop-reason.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stop-reason.js","sourceRoot":"","sources":["../../../server/service/equipment/stop-reason.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAoD;AAEpD,iDAA8C;AAC9C,yDAAgD;AAEhD;;;;;;;;;;;;;GAaG;AAII,IAAM,UAAU,GAAhB,MAAM,UAAU;CAqFtB,CAAA;AArFY,gCAAU;AAGZ;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;sCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;0CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,MAAkB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;;4CACjC;AAKjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;;wCACvD;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AASpB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;;0CAC1D;AAUd;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;;8CAC3D;AAUnB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,6DAA6D,EAAE,CAAC;;kDAC9E;AAKxB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACT,IAAI;IAErB;;;;OAIG;;kDANkB;AASrB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACX,IAAI;gDAAA;AAInB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;6CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;6CAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,MAAkB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;;6CACjC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,MAAkB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;;6CACjC;qBApFP,UAAU;IAHtB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;IACnC,IAAA,eAAK,EAAC,sBAAsB,EAAE,CAAC,MAAkB,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;GACrE,UAAU,CAqFtB","sourcesContent":["import {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { Field, ID, ObjectType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n/**\n * 설비가 왜 섰나 — **사유의 목록.**\n *\n * ── 왜 마스터로 두나 ────────────────────────────────────────────────────────\n * 사유를 자유 문장으로 받으면 「금형교체」 · 「금형 교체」 · 「몰드교환」이 서로 다른 사유가 된다. 그러면\n * 「무엇 때문에 가장 많이 멈추나」에 답할 수 없다 — 그 답이 정지 사유를 적는 유일한 이유다.\n *\n * ── `status` 가 가동률을 정하고, 사유는 무엇을 고칠지 정한다 ────────────────\n * ISO 22400 에서 가동률을 깎느냐 마느냐는 **상태**가 정한다(`down` · `idle` 은 깎고 `planned-stop` 은\n * 깎지 않는다). 사유는 그 상태 안에서 **무엇을 고쳐야 하나**를 말한다.\n *\n * 그래서 사유마다 어느 상태에 쓰이는지 적어 둔다. 「점심시간」을 `down` 으로 적으면 가동률이 알리지\n * 않고 낮아지고, 「고장」을 `planned-stop` 으로 적으면 알리지 않고 높아진다. 둘 다 조용한 거짓이다.\n */\n@Entity({ name: 'ops_stop_reason' })\n@Index('ix_ops_stop_reason_0', (reason: StopReason) => [reason.domain, reason.name], { unique: true })\n@ObjectType({ description: 'A classified reason an equipment was not producing' })\nexport class StopReason {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((reason: StopReason) => reason.domain)\n domainId?: string\n\n /** 사유 코드 — 상태 구간이 이 값을 가리킨다. */\n @Column()\n @Field({ description: 'the reason code a state period refers to' })\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n /**\n * 이 사유가 쓰이는 상태 — `down` · `idle` · `setup` · `planned-stop`.\n *\n * 어휘는 계약의 `EQUIPMENT_STATUS` 다. `busy` 는 여기 오지 않는다 — 돌고 있는 것에는 사유가 없다.\n */\n @Column()\n @Field({ description: 'which equipment status this reason belongs to' })\n status: string\n\n /**\n * 상위 사유 — 사유는 나무다.\n *\n * 「설비 고장」 아래 「금형 파손」 · 「모터 과열」이 온다. 위로 모아 보면 「고장으로 몇 시간」이 나오고,\n * 아래로 내려가면 「무엇을 고칠까」가 나온다. 한 단으로만 두면 둘 중 하나를 잃는다.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'parent reason — reasons form a tree' })\n parentName?: string\n\n /**\n * 이 사유를 적을 때 상세를 함께 받나.\n *\n * 「기타」로만 적히는 사유가 목록의 절반을 차지하면 분류가 없는 것과 같다. 상세를 요구하는 사유를\n * 표시해 두어 화면이 그때만 묻게 한다.\n */\n @Column({ type: 'boolean', nullable: true })\n @Field({ nullable: true, description: 'whether the floor must add a note when choosing this reason' })\n detailRequired?: boolean\n\n /** 언제부터 — 표준 `EffectiveStartDate`. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n effectiveStart?: Date\n\n /**\n * 언제까지 — 표준 `EffectiveEndDate`.\n *\n * 쓰지 않는 사유는 지우지 않고 이 칸을 채운다. 지우면 그 사유로 적힌 지난 구간이 가리킬 것을 잃는다.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n effectiveEnd?: Date\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((reason: StopReason) => reason.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((reason: StopReason) => reason.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,46 @@
1
+ export * from './resource/resource-class';
2
+ export * from './personnel/personnel-master-resolver';
3
+ export * from './equipment/equipment-master-resolver';
4
+ export * from './asset/asset-master-resolver';
5
+ export * from './material/material-master-resolver';
6
+ export * from './location/location-master-resolver';
7
+ export * from './operation/operation-master-resolver';
8
+ export * from './test-spec/test-spec-master-resolver';
9
+ export * from './master-crud';
10
+ export * from './master-axis';
11
+ export * from './master-list';
12
+ export * from './personnel/person';
13
+ export * from './personnel/personnel-class';
14
+ export * from './personnel/personnel-master';
15
+ export * from './personnel/personnel-query';
16
+ export * from './personnel/qualification';
17
+ export * from './equipment/equipment';
18
+ export * from './equipment/equipment-class';
19
+ export * from './equipment/state-period-rules';
20
+ export * from './equipment/stop-reason';
21
+ export * from './equipment/equipment-master';
22
+ export * from './equipment/equipment-query';
23
+ export * from './asset/asset-lifecycle';
24
+ export * from './asset/physical-asset';
25
+ export * from './asset/physical-asset-class';
26
+ export * from './asset/asset-master';
27
+ export * from './asset/asset-query';
28
+ export * from './location/operational-location';
29
+ export * from './location/location-master';
30
+ export * from './location/location-query';
31
+ export * from './material/material-class';
32
+ export * from './material/material-definition';
33
+ export * from './material/material-master';
34
+ export * from './material/material-query';
35
+ export * from './operation/operation-definition';
36
+ export * from './operation/operation-master';
37
+ export * from './operation/operation-query';
38
+ export * from './test-spec/test-specification';
39
+ export * from './test-spec/test-spec-master';
40
+ export * from './test-spec/test-spec-query';
41
+ export * from './status/axis-stamp';
42
+ export * from './status/master-status';
43
+ export declare const entities: (typeof import("./equipment/equipment").Equipment | typeof import("./equipment/equipment-class").EquipmentClass | typeof import("./equipment/stop-reason").StopReason | typeof import("./material/material-definition").MaterialDefinition | typeof import("./operation/operation-definition").OperationDefinition | typeof import("./location/operational-location").OperationalLocation | typeof import("./personnel/person").Person | typeof import("./asset/physical-asset").PhysicalAsset | typeof import("./test-spec/test-specification").TestSpecification)[];
44
+ export declare const schema: {
45
+ resolverClasses: (typeof import("./personnel/personnel-master-resolver").PersonnelClassResolver | typeof import("./personnel/personnel-master-resolver").PersonResolver | typeof import("./equipment/equipment-master-resolver").EquipmentClassResolver | typeof import("./equipment/equipment-master-resolver").EquipmentResolver | typeof import("./equipment/equipment-master-resolver").StopReasonResolver | typeof import("./asset/asset-master-resolver").PhysicalAssetClassResolver | typeof import("./asset/asset-master-resolver").PhysicalAssetResolver | typeof import("./material/material-master-resolver").MaterialClassResolver | typeof import("./material/material-master-resolver").MaterialDefinitionResolver | typeof import("./location/location-master-resolver").OperationalLocationResolver | typeof import("./operation/operation-master-resolver").OperationDefinitionResolver | typeof import("./test-spec/test-spec-master-resolver").TestSpecificationResolver | typeof import("./personnel/personnel-query").PersonnelQuery | typeof import("./equipment/equipment-query").EquipmentQuery | typeof import("./asset/asset-query").AssetQuery | typeof import("./location/location-query").LocationQuery | typeof import("./material/material-query").MaterialQuery | typeof import("./operation/operation-query").OperationQuery | typeof import("./test-spec/test-spec-query").TestSpecificationQuery | typeof import("./status/master-status").OpsMasterStatusQuery | typeof import("./equipment/stop-reason-query").StopReasonQuery)[];
46
+ };
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.schema = exports.entities = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* EXPORT ENTITY TYPES */
6
+ tslib_1.__exportStar(require("./resource/resource-class"), exports);
7
+ tslib_1.__exportStar(require("./personnel/personnel-master-resolver"), exports);
8
+ tslib_1.__exportStar(require("./equipment/equipment-master-resolver"), exports);
9
+ tslib_1.__exportStar(require("./asset/asset-master-resolver"), exports);
10
+ tslib_1.__exportStar(require("./material/material-master-resolver"), exports);
11
+ tslib_1.__exportStar(require("./location/location-master-resolver"), exports);
12
+ tslib_1.__exportStar(require("./operation/operation-master-resolver"), exports);
13
+ tslib_1.__exportStar(require("./test-spec/test-spec-master-resolver"), exports);
14
+ tslib_1.__exportStar(require("./master-crud"), exports);
15
+ tslib_1.__exportStar(require("./master-axis"), exports);
16
+ tslib_1.__exportStar(require("./master-list"), exports);
17
+ tslib_1.__exportStar(require("./personnel/person"), exports);
18
+ tslib_1.__exportStar(require("./personnel/personnel-class"), exports);
19
+ tslib_1.__exportStar(require("./personnel/personnel-master"), exports);
20
+ tslib_1.__exportStar(require("./personnel/personnel-query"), exports);
21
+ tslib_1.__exportStar(require("./personnel/qualification"), exports);
22
+ tslib_1.__exportStar(require("./equipment/equipment"), exports);
23
+ tslib_1.__exportStar(require("./equipment/equipment-class"), exports);
24
+ tslib_1.__exportStar(require("./equipment/state-period-rules"), exports);
25
+ tslib_1.__exportStar(require("./equipment/stop-reason"), exports);
26
+ tslib_1.__exportStar(require("./equipment/equipment-master"), exports);
27
+ tslib_1.__exportStar(require("./equipment/equipment-query"), exports);
28
+ tslib_1.__exportStar(require("./asset/asset-lifecycle"), exports);
29
+ tslib_1.__exportStar(require("./asset/physical-asset"), exports);
30
+ tslib_1.__exportStar(require("./asset/physical-asset-class"), exports);
31
+ tslib_1.__exportStar(require("./asset/asset-master"), exports);
32
+ tslib_1.__exportStar(require("./asset/asset-query"), exports);
33
+ tslib_1.__exportStar(require("./location/operational-location"), exports);
34
+ tslib_1.__exportStar(require("./location/location-master"), exports);
35
+ tslib_1.__exportStar(require("./location/location-query"), exports);
36
+ tslib_1.__exportStar(require("./material/material-class"), exports);
37
+ tslib_1.__exportStar(require("./material/material-definition"), exports);
38
+ tslib_1.__exportStar(require("./material/material-master"), exports);
39
+ tslib_1.__exportStar(require("./material/material-query"), exports);
40
+ tslib_1.__exportStar(require("./operation/operation-definition"), exports);
41
+ tslib_1.__exportStar(require("./operation/operation-master"), exports);
42
+ tslib_1.__exportStar(require("./operation/operation-query"), exports);
43
+ tslib_1.__exportStar(require("./test-spec/test-specification"), exports);
44
+ tslib_1.__exportStar(require("./test-spec/test-spec-master"), exports);
45
+ tslib_1.__exportStar(require("./test-spec/test-spec-query"), exports);
46
+ tslib_1.__exportStar(require("./status/axis-stamp"), exports);
47
+ tslib_1.__exportStar(require("./status/master-status"), exports);
48
+ /* IMPORT ENTITIES AND RESOLVERS */
49
+ const asset_1 = require("./asset");
50
+ const equipment_1 = require("./equipment");
51
+ const location_1 = require("./location");
52
+ const material_1 = require("./material");
53
+ const operation_1 = require("./operation");
54
+ const personnel_1 = require("./personnel");
55
+ const status_1 = require("./status");
56
+ const test_spec_1 = require("./test-spec");
57
+ exports.entities = [
58
+ /* ENTITIES */
59
+ ...personnel_1.entities,
60
+ ...equipment_1.entities,
61
+ ...asset_1.entities,
62
+ ...location_1.entities,
63
+ ...material_1.entities,
64
+ ...operation_1.entities,
65
+ ...test_spec_1.entities
66
+ ];
67
+ exports.schema = {
68
+ resolverClasses: [
69
+ /* RESOLVER CLASSES */
70
+ ...personnel_1.resolvers,
71
+ ...equipment_1.resolvers,
72
+ ...asset_1.resolvers,
73
+ ...location_1.resolvers,
74
+ ...material_1.resolvers,
75
+ ...operation_1.resolvers,
76
+ ...test_spec_1.resolvers,
77
+ ...status_1.resolvers
78
+ ]
79
+ };
80
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,oEAAyC;AACzC,gFAAqD;AACrD,gFAAqD;AACrD,wEAA6C;AAC7C,8EAAmD;AACnD,8EAAmD;AACnD,gFAAqD;AACrD,gFAAqD;AACrD,wDAA6B;AAC7B,wDAA6B;AAC7B,wDAA6B;AAC7B,6DAAkC;AAClC,sEAA2C;AAC3C,uEAA4C;AAC5C,sEAA2C;AAC3C,oEAAyC;AACzC,gEAAqC;AACrC,sEAA2C;AAC3C,yEAA8C;AAC9C,kEAAuC;AACvC,uEAA4C;AAC5C,sEAA2C;AAC3C,kEAAuC;AACvC,iEAAsC;AACtC,uEAA4C;AAC5C,+DAAoC;AACpC,8DAAmC;AACnC,0EAA+C;AAC/C,qEAA0C;AAC1C,oEAAyC;AACzC,oEAAyC;AACzC,yEAA8C;AAC9C,qEAA0C;AAC1C,oEAAyC;AACzC,2EAAgD;AAChD,uEAA4C;AAC5C,sEAA2C;AAC3C,yEAA8C;AAC9C,uEAA4C;AAC5C,sEAA2C;AAC3C,8DAAmC;AACnC,iEAAsC;AAEtC,mCAAmC;AACnC,mCAAgF;AAChF,2CAA4F;AAC5F,yCAAyF;AACzF,yCAAyF;AACzF,2CAA4F;AAC5F,2CAA4F;AAC5F,qCAAuD;AACvD,2CAA0F;AAE7E,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,oBAAiB;IACpB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,oBAAgB;CACpB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,qBAAkB;QACrB,GAAG,qBAAkB;QACrB,GAAG,iBAAc;QACjB,GAAG,oBAAiB;QACpB,GAAG,oBAAiB;QACpB,GAAG,qBAAkB;QACrB,GAAG,qBAAiB;QACpB,GAAG,kBAAe;KACnB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './resource/resource-class'\nexport * from './personnel/personnel-master-resolver'\nexport * from './equipment/equipment-master-resolver'\nexport * from './asset/asset-master-resolver'\nexport * from './material/material-master-resolver'\nexport * from './location/location-master-resolver'\nexport * from './operation/operation-master-resolver'\nexport * from './test-spec/test-spec-master-resolver'\nexport * from './master-crud'\nexport * from './master-axis'\nexport * from './master-list'\nexport * from './personnel/person'\nexport * from './personnel/personnel-class'\nexport * from './personnel/personnel-master'\nexport * from './personnel/personnel-query'\nexport * from './personnel/qualification'\nexport * from './equipment/equipment'\nexport * from './equipment/equipment-class'\nexport * from './equipment/state-period-rules'\nexport * from './equipment/stop-reason'\nexport * from './equipment/equipment-master'\nexport * from './equipment/equipment-query'\nexport * from './asset/asset-lifecycle'\nexport * from './asset/physical-asset'\nexport * from './asset/physical-asset-class'\nexport * from './asset/asset-master'\nexport * from './asset/asset-query'\nexport * from './location/operational-location'\nexport * from './location/location-master'\nexport * from './location/location-query'\nexport * from './material/material-class'\nexport * from './material/material-definition'\nexport * from './material/material-master'\nexport * from './material/material-query'\nexport * from './operation/operation-definition'\nexport * from './operation/operation-master'\nexport * from './operation/operation-query'\nexport * from './test-spec/test-specification'\nexport * from './test-spec/test-spec-master'\nexport * from './test-spec/test-spec-query'\nexport * from './status/axis-stamp'\nexport * from './status/master-status'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as AssetEntities, resolvers as AssetResolvers } from './asset'\nimport { entities as EquipmentEntities, resolvers as EquipmentResolvers } from './equipment'\nimport { entities as LocationEntities, resolvers as LocationResolvers } from './location'\nimport { entities as MaterialEntities, resolvers as MaterialResolvers } from './material'\nimport { entities as OperationEntities, resolvers as OperationResolvers } from './operation'\nimport { entities as PersonnelEntities, resolvers as PersonnelResolvers } from './personnel'\nimport { resolvers as StatusResolvers } from './status'\nimport { entities as TestSpecEntities, resolvers as TestSpecResolvers } from './test-spec'\n\nexport const entities = [\n /* ENTITIES */\n ...PersonnelEntities,\n ...EquipmentEntities,\n ...AssetEntities,\n ...LocationEntities,\n ...MaterialEntities,\n ...OperationEntities,\n ...TestSpecEntities\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...PersonnelResolvers,\n ...EquipmentResolvers,\n ...AssetResolvers,\n ...LocationResolvers,\n ...MaterialResolvers,\n ...OperationResolvers,\n ...TestSpecResolvers,\n ...StatusResolvers\n ]\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { LocationQuery } from './location-query';
2
+ import { OperationalLocation } from './operational-location';
3
+ import { OperationalLocationResolver } from './location-master-resolver';
4
+ export declare const entities: (typeof OperationalLocation)[];
5
+ export declare const resolvers: (typeof OperationalLocationResolver | typeof LocationQuery)[];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const location_query_1 = require("./location-query");
5
+ const operational_location_1 = require("./operational-location");
6
+ const location_master_resolver_1 = require("./location-master-resolver");
7
+ exports.entities = [operational_location_1.OperationalLocation];
8
+ exports.resolvers = [location_query_1.LocationQuery, location_master_resolver_1.OperationalLocationResolver];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/location/index.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAChD,iEAA4D;AAC5D,yEAAwE;AAE3D,QAAA,QAAQ,GAAG,CAAC,0CAAmB,CAAC,CAAA;AAChC,QAAA,SAAS,GAAG,CAAC,8BAAa,EAAE,sDAA2B,CAAC,CAAA","sourcesContent":["import { LocationQuery } from './location-query'\nimport { OperationalLocation } from './operational-location'\nimport { OperationalLocationResolver } from './location-master-resolver'\n\nexport const entities = [OperationalLocation]\nexport const resolvers = [LocationQuery, OperationalLocationResolver]\n"]}
@@ -0,0 +1,28 @@
1
+ import { ListParam } from '@things-factory/shell';
2
+ import { MasterPatch } from '../master-crud';
3
+ import { OperationalLocation } from './operational-location';
4
+ /**
5
+ * 자리 축을 채우고 고친다.
6
+ *
7
+ * ── 왜 마스터는 그리드에서 고칠 수 있나 ────────────────────────────────────
8
+ * 업무 기록과 달리 마스터는 **선언**이다. 「이 사람이 용접 자격을 갖는다」는 일어난 일이 아니라 지금의
9
+ * 규정이고, 규정은 바뀐다. 없앨 때 행을 지우지 않고 유효 기간의 끝을 채우는 것이 그래서다 —
10
+ * 지우면 그것을 가리키는 지난 기록이 가리킬 것을 잃는다.
11
+ *
12
+ * 규칙은 `master-crud.ts` 한 곳에 있다. 여기는 축의 이름만 붙인다.
13
+ */
14
+ export declare class OperationalLocationList {
15
+ items: OperationalLocation[];
16
+ total: number;
17
+ }
18
+ export declare class OperationalLocationResolver {
19
+ operationalLocations(params: ListParam, context: ResolverContext): Promise<OperationalLocationList>;
20
+ /**
21
+ * 그리드가 보낸 변경을 한 번에 적용한다.
22
+ *
23
+ * 패치를 `ScalarObject` 로 받는다 — 축마다 입력 타입을 따로 만들면 칸을 하나 더할 때마다 두 곳을
24
+ * 고쳐야 하고, 한쪽을 빠뜨리면 그 칸이 오류 보고 없이 저장되지 않는다. 돌려주는 것은 타입이 있는
25
+ * 엔티티라 무엇이 저장됐는지 스키마로 확인할 수 있다.
26
+ */
27
+ updateMultipleOperationalLocation(patches: MasterPatch[], context: ResolverContext): Promise<OperationalLocation[]>;
28
+ }
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperationalLocationResolver = exports.OperationalLocationList = 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 master_crud_1 = require("../master-crud");
8
+ const master_axis_1 = require("../master-axis");
9
+ const master_list_1 = require("../master-list");
10
+ const operational_location_1 = require("./operational-location");
11
+ /**
12
+ * 자리 축을 채우고 고친다.
13
+ *
14
+ * ── 왜 마스터는 그리드에서 고칠 수 있나 ────────────────────────────────────
15
+ * 업무 기록과 달리 마스터는 **선언**이다. 「이 사람이 용접 자격을 갖는다」는 일어난 일이 아니라 지금의
16
+ * 규정이고, 규정은 바뀐다. 없앨 때 행을 지우지 않고 유효 기간의 끝을 채우는 것이 그래서다 —
17
+ * 지우면 그것을 가리키는 지난 기록이 가리킬 것을 잃는다.
18
+ *
19
+ * 규칙은 `master-crud.ts` 한 곳에 있다. 여기는 축의 이름만 붙인다.
20
+ */
21
+ let OperationalLocationList = class OperationalLocationList {
22
+ };
23
+ exports.OperationalLocationList = OperationalLocationList;
24
+ tslib_1.__decorate([
25
+ (0, type_graphql_1.Field)(type => [operational_location_1.OperationalLocation]),
26
+ tslib_1.__metadata("design:type", Array)
27
+ ], OperationalLocationList.prototype, "items", void 0);
28
+ tslib_1.__decorate([
29
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
30
+ tslib_1.__metadata("design:type", Number)
31
+ ], OperationalLocationList.prototype, "total", void 0);
32
+ exports.OperationalLocationList = OperationalLocationList = tslib_1.__decorate([
33
+ (0, type_graphql_1.ObjectType)({ description: 'A page of operational locations' })
34
+ ], OperationalLocationList);
35
+ let OperationalLocationResolver = class OperationalLocationResolver {
36
+ async operationalLocations(params, context) {
37
+ const { domain } = context.state;
38
+ const { items, total } = await (0, master_list_1.listMaster)('operationalLocation', params, domain);
39
+ return { items: items, total };
40
+ }
41
+ /**
42
+ * 그리드가 보낸 변경을 한 번에 적용한다.
43
+ *
44
+ * 패치를 `ScalarObject` 로 받는다 — 축마다 입력 타입을 따로 만들면 칸을 하나 더할 때마다 두 곳을
45
+ * 고쳐야 하고, 한쪽을 빠뜨리면 그 칸이 오류 보고 없이 저장되지 않는다. 돌려주는 것은 타입이 있는
46
+ * 엔티티라 무엇이 저장됐는지 스키마로 확인할 수 있다.
47
+ */
48
+ async updateMultipleOperationalLocation(patches, context) {
49
+ const { domain, user, tx } = context.state;
50
+ const axis = (0, master_axis_1.masterAxisOf)('operationalLocation');
51
+ const saved = await (0, master_crud_1.saveMasterPatches)(tx, domain, axis.entity, patches, user, {
52
+ hasEffectivePeriod: axis.hasEffectivePeriod
53
+ });
54
+ return saved;
55
+ }
56
+ };
57
+ exports.OperationalLocationResolver = OperationalLocationResolver;
58
+ tslib_1.__decorate([
59
+ (0, type_graphql_1.Directive)('@privilege(category: "ops-master", privilege: "query", domainOwnerGranted: true)'),
60
+ (0, type_graphql_1.Query)(returns => OperationalLocationList, { description: 'To fetch operational locations' }),
61
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
62
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
63
+ tslib_1.__metadata("design:type", Function),
64
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
65
+ tslib_1.__metadata("design:returntype", Promise)
66
+ ], OperationalLocationResolver.prototype, "operationalLocations", null);
67
+ tslib_1.__decorate([
68
+ (0, type_graphql_1.Directive)('@privilege(category: "ops-master", privilege: "mutation", domainOwnerGranted: true)'),
69
+ (0, type_graphql_1.Directive)('@transaction'),
70
+ (0, type_graphql_1.Mutation)(returns => [operational_location_1.OperationalLocation], { description: 'To create, change or retire operational locations' }),
71
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [shell_1.ScalarObject])),
72
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
73
+ tslib_1.__metadata("design:type", Function),
74
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
75
+ tslib_1.__metadata("design:returntype", Promise)
76
+ ], OperationalLocationResolver.prototype, "updateMultipleOperationalLocation", null);
77
+ exports.OperationalLocationResolver = OperationalLocationResolver = tslib_1.__decorate([
78
+ (0, type_graphql_1.Resolver)(operational_location_1.OperationalLocation)
79
+ ], OperationalLocationResolver);
80
+ //# sourceMappingURL=location-master-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location-master-resolver.js","sourceRoot":"","sources":["../../../server/service/location/location-master-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAA2G;AAE3G,iDAA+D;AAE/D,gDAA+D;AAC/D,gDAA6C;AAC7C,gDAA2C;AAC3C,iEAA4D;AAE5D;;;;;;;;;GASG;AAGI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAMnC,CAAA;AANY,0DAAuB;AAElC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,0CAAmB,CAAC,CAAC;;sDACT;AAG5B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;sDACN;kCALF,uBAAuB;IADnC,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;GAClD,uBAAuB,CAMnC;AAGM,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAGhC,AAAN,KAAK,CAAC,oBAAoB,CAA0B,MAAiB,EAAS,OAAwB;QACpG,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,wBAAU,EAAC,qBAAqB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QAEhF,OAAO,EAAE,KAAK,EAAE,KAA8B,EAAE,KAAK,EAAE,CAAA;IACzD,CAAC;IAED;;;;;;OAMG;IAIG,AAAN,KAAK,CAAC,iCAAiC,CACG,OAAsB,EACvD,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1C,MAAM,IAAI,GAAG,IAAA,0BAAY,EAAC,qBAAqB,CAAC,CAAA;QAEhD,MAAM,KAAK,GAAG,MAAM,IAAA,+BAAiB,EAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;YAC5E,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;SAC5C,CAAC,CAAA;QAEF,OAAO,KAA8B,CAAA;IACvC,CAAC;CACF,CAAA;AAjCY,kEAA2B;AAGhC;IAFL,IAAA,wBAAS,EAAC,kFAAkF,CAAC;IAC7F,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,uBAAuB,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IACjE,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;uEAKpE;AAYK;IAHL,IAAA,wBAAS,EAAC,qFAAqF,CAAC;IAChG,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,0CAAmB,CAAC,EAAE,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC;IAE9G,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,oBAAY,CAAC,CAAC,CAAA;IACtC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oFAUP;sCAhCU,2BAA2B;IADvC,IAAA,uBAAQ,EAAC,0CAAmB,CAAC;GACjB,2BAA2B,CAiCvC","sourcesContent":["import { Args, Arg, Ctx, Directive, Int, Mutation, ObjectType, Field, Query, Resolver } from 'type-graphql'\n\nimport { ListParam, ScalarObject } from '@things-factory/shell'\n\nimport { MasterPatch, saveMasterPatches } from '../master-crud'\nimport { masterAxisOf } from '../master-axis'\nimport { listMaster } from '../master-list'\nimport { OperationalLocation } from './operational-location'\n\n/**\n * 자리 축을 채우고 고친다.\n *\n * ── 왜 마스터는 그리드에서 고칠 수 있나 ────────────────────────────────────\n * 업무 기록과 달리 마스터는 **선언**이다. 「이 사람이 용접 자격을 갖는다」는 일어난 일이 아니라 지금의\n * 규정이고, 규정은 바뀐다. 없앨 때 행을 지우지 않고 유효 기간의 끝을 채우는 것이 그래서다 —\n * 지우면 그것을 가리키는 지난 기록이 가리킬 것을 잃는다.\n *\n * 규칙은 `master-crud.ts` 한 곳에 있다. 여기는 축의 이름만 붙인다.\n */\n\n@ObjectType({ description: 'A page of operational locations' })\nexport class OperationalLocationList {\n @Field(type => [OperationalLocation])\n items: OperationalLocation[]\n\n @Field(type => Int)\n total: number\n}\n\n@Resolver(OperationalLocation)\nexport class OperationalLocationResolver {\n @Directive('@privilege(category: \"ops-master\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => OperationalLocationList, { description: 'To fetch operational locations' })\n async operationalLocations(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<OperationalLocationList> {\n const { domain } = context.state\n const { items, total } = await listMaster('operationalLocation', params, domain)\n\n return { items: items as OperationalLocation[], total }\n }\n\n /**\n * 그리드가 보낸 변경을 한 번에 적용한다.\n *\n * 패치를 `ScalarObject` 로 받는다 — 축마다 입력 타입을 따로 만들면 칸을 하나 더할 때마다 두 곳을\n * 고쳐야 하고, 한쪽을 빠뜨리면 그 칸이 오류 보고 없이 저장되지 않는다. 돌려주는 것은 타입이 있는\n * 엔티티라 무엇이 저장됐는지 스키마로 확인할 수 있다.\n */\n @Directive('@privilege(category: \"ops-master\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => [OperationalLocation], { description: 'To create, change or retire operational locations' })\n async updateMultipleOperationalLocation(\n @Arg('patches', type => [ScalarObject]) patches: MasterPatch[],\n @Ctx() context: ResolverContext\n ): Promise<OperationalLocation[]> {\n const { domain, user, tx } = context.state\n const axis = masterAxisOf('operationalLocation')\n\n const saved = await saveMasterPatches(tx, domain, axis.entity, patches, user, {\n hasEffectivePeriod: axis.hasEffectivePeriod\n })\n\n return saved as OperationalLocation[]\n }\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import type { OperationalLocation } from './operational-location';
2
+ /** 트윈 `ReferenceMaster.locations` 의 한 항목. */
3
+ export interface LocationEntry {
4
+ id: string;
5
+ type: string;
6
+ capacity?: number;
7
+ parallelism?: number;
8
+ parentId?: string;
9
+ level?: string;
10
+ properties?: unknown[];
11
+ testSpecificationIds?: string[];
12
+ effectiveStart?: string;
13
+ effectiveEnd?: string;
14
+ }
15
+ /**
16
+ * 자리를 트윈이 받는 모양으로 옮긴다.
17
+ *
18
+ * **용량이 없으면 칸을 만들지 않는다.** 계약은 `capacity` 를 필수로 적지만, 모르는 값을 임의로 채우면
19
+ * 물품 하나에 포화 경고가 난다. 비워 보내고 받는 쪽이 「모른다」로 다루게 한다.
20
+ */
21
+ export declare function toLocationEntry(location: OperationalLocation): LocationEntry;
22
+ export declare function locationMaster(locations: OperationalLocation[]): {
23
+ locations: LocationEntry[];
24
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toLocationEntry = toLocationEntry;
4
+ exports.locationMaster = locationMaster;
5
+ const resource_class_1 = require("../resource/resource-class");
6
+ /**
7
+ * 자리를 트윈이 받는 모양으로 옮긴다.
8
+ *
9
+ * **용량이 없으면 칸을 만들지 않는다.** 계약은 `capacity` 를 필수로 적지만, 모르는 값을 임의로 채우면
10
+ * 물품 하나에 포화 경고가 난다. 비워 보내고 받는 쪽이 「모른다」로 다루게 한다.
11
+ */
12
+ function toLocationEntry(location) {
13
+ const out = { id: location.name, type: location.type };
14
+ (0, resource_class_1.put)(out, 'capacity', location.capacity === undefined || location.capacity === null ? undefined : Number(location.capacity));
15
+ (0, resource_class_1.put)(out, 'parallelism', location.parallelism === undefined || location.parallelism === null ? undefined : Number(location.parallelism));
16
+ (0, resource_class_1.put)(out, 'parentId', location.parentId);
17
+ (0, resource_class_1.put)(out, 'level', location.level);
18
+ (0, resource_class_1.put)(out, 'properties', location.properties);
19
+ (0, resource_class_1.put)(out, 'testSpecificationIds', location.testSpecificationIds);
20
+ (0, resource_class_1.put)(out, 'effectiveStart', (0, resource_class_1.iso)(location.effectiveStart));
21
+ (0, resource_class_1.put)(out, 'effectiveEnd', (0, resource_class_1.iso)(location.effectiveEnd));
22
+ return out;
23
+ }
24
+ function locationMaster(locations) {
25
+ return { locations: locations.map(toLocationEntry) };
26
+ }
27
+ //# sourceMappingURL=location-master.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location-master.js","sourceRoot":"","sources":["../../../server/service/location/location-master.ts"],"names":[],"mappings":";;AAuBA,0CAaC;AAED,wCAEC;AAxCD,+DAAqD;AAiBrD;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,QAA6B;IAC3D,MAAM,GAAG,GAA4B,EAAE,EAAE,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAA;IAE/E,IAAA,oBAAG,EAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,CAAC,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC3H,IAAA,oBAAG,EAAC,GAAG,EAAE,aAAa,EAAE,QAAQ,CAAC,WAAW,KAAK,SAAS,IAAI,QAAQ,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAA;IACvI,IAAA,oBAAG,EAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IACvC,IAAA,oBAAG,EAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;IACjC,IAAA,oBAAG,EAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAA;IAC3C,IAAA,oBAAG,EAAC,GAAG,EAAE,sBAAsB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAA;IAC/D,IAAA,oBAAG,EAAC,GAAG,EAAE,gBAAgB,EAAE,IAAA,oBAAG,EAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAA;IACxD,IAAA,oBAAG,EAAC,GAAG,EAAE,cAAc,EAAE,IAAA,oBAAG,EAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAA;IAEpD,OAAO,GAA+B,CAAA;AACxC,CAAC;AAED,SAAgB,cAAc,CAAC,SAAgC;IAC7D,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAA;AACtD,CAAC","sourcesContent":["import { iso, put } from '../resource/resource-class'\nimport type { OperationalLocation } from './operational-location'\n\n/** 트윈 `ReferenceMaster.locations` 의 한 항목. */\nexport interface LocationEntry {\n id: string\n type: string\n capacity?: number\n parallelism?: number\n parentId?: string\n level?: string\n properties?: unknown[]\n testSpecificationIds?: string[]\n effectiveStart?: string\n effectiveEnd?: string\n}\n\n/**\n * 자리를 트윈이 받는 모양으로 옮긴다.\n *\n * **용량이 없으면 칸을 만들지 않는다.** 계약은 `capacity` 를 필수로 적지만, 모르는 값을 임의로 채우면\n * 물품 하나에 포화 경고가 난다. 비워 보내고 받는 쪽이 「모른다」로 다루게 한다.\n */\nexport function toLocationEntry(location: OperationalLocation): LocationEntry {\n const out: Record<string, unknown> = { id: location.name, type: location.type }\n\n put(out, 'capacity', location.capacity === undefined || location.capacity === null ? undefined : Number(location.capacity))\n put(out, 'parallelism', location.parallelism === undefined || location.parallelism === null ? undefined : Number(location.parallelism))\n put(out, 'parentId', location.parentId)\n put(out, 'level', location.level)\n put(out, 'properties', location.properties)\n put(out, 'testSpecificationIds', location.testSpecificationIds)\n put(out, 'effectiveStart', iso(location.effectiveStart))\n put(out, 'effectiveEnd', iso(location.effectiveEnd))\n\n return out as unknown as LocationEntry\n}\n\nexport function locationMaster(locations: OperationalLocation[]): { locations: LocationEntry[] } {\n return { locations: locations.map(toLocationEntry) }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export declare class LocationMaster {
2
+ locations: string;
3
+ }
4
+ export declare class LocationQuery {
5
+ /** 자리 축 전체 — 자리가 상위 자리를 가리키므로 한 번에 낸다. */
6
+ locationMaster(context: ResolverContext): Promise<LocationMaster>;
7
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LocationQuery = exports.LocationMaster = 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 location_master_1 = require("./location-master");
8
+ const operational_location_1 = require("./operational-location");
9
+ let LocationMaster = class LocationMaster {
10
+ };
11
+ exports.LocationMaster = LocationMaster;
12
+ tslib_1.__decorate([
13
+ (0, type_graphql_1.Field)(type => String, { description: 'ReferenceMaster locations[] as JSON text' }),
14
+ tslib_1.__metadata("design:type", String)
15
+ ], LocationMaster.prototype, "locations", void 0);
16
+ exports.LocationMaster = LocationMaster = tslib_1.__decorate([
17
+ (0, type_graphql_1.ObjectType)({ description: 'Location master as the twin receives it' })
18
+ ], LocationMaster);
19
+ let LocationQuery = class LocationQuery {
20
+ /** 자리 축 전체 — 자리가 상위 자리를 가리키므로 한 번에 낸다. */
21
+ async locationMaster(context) {
22
+ const { domain } = context.state;
23
+ const locations = await (0, shell_1.getRepository)(operational_location_1.OperationalLocation).find({
24
+ where: { domain: { id: domain.id } },
25
+ order: { name: 'ASC' }
26
+ });
27
+ return { locations: JSON.stringify((0, location_master_1.locationMaster)(locations).locations) };
28
+ }
29
+ };
30
+ exports.LocationQuery = LocationQuery;
31
+ tslib_1.__decorate([
32
+ (0, type_graphql_1.Query)(returns => LocationMaster, { description: 'Location master for the twin to pull' }),
33
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
34
+ tslib_1.__metadata("design:type", Function),
35
+ tslib_1.__metadata("design:paramtypes", [Object]),
36
+ tslib_1.__metadata("design:returntype", Promise)
37
+ ], LocationQuery.prototype, "locationMaster", null);
38
+ exports.LocationQuery = LocationQuery = tslib_1.__decorate([
39
+ (0, type_graphql_1.Resolver)(operational_location_1.OperationalLocation)
40
+ ], LocationQuery);
41
+ //# sourceMappingURL=location-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location-query.js","sourceRoot":"","sources":["../../../server/service/location/location-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,iDAAqD;AAErD,uDAAyE;AACzE,iEAA4D;AAGrD,IAAM,cAAc,GAApB,MAAM,cAAc;CAG1B,CAAA;AAHY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;;iDAClE;yBAFN,cAAc;IAD1B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;GAC1D,cAAc,CAG1B;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,0CAA0C;IAEpC,AAAN,KAAK,CAAC,cAAc,CAAQ,OAAwB;QAClD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,SAAS,GAAG,MAAM,IAAA,qBAAa,EAAC,0CAAmB,CAAC,CAAC,IAAI,CAAC;YAC9D,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE;YACpC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;SACvB,CAAC,CAAA;QAEF,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,IAAA,gCAAmB,EAAC,SAAS,CAAC,CAAC,SAAS,CAAC,EAAE,CAAA;IAChF,CAAC;CACF,CAAA;AAbY,sCAAa;AAGlB;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;IACpE,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;mDAS1B;wBAZU,aAAa;IADzB,IAAA,uBAAQ,EAAC,0CAAmB,CAAC;GACjB,aAAa,CAazB","sourcesContent":["import { Ctx, Field, ObjectType, Query, Resolver } from 'type-graphql'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { locationMaster as buildLocationMaster } from './location-master'\nimport { OperationalLocation } from './operational-location'\n\n@ObjectType({ description: 'Location master as the twin receives it' })\nexport class LocationMaster {\n @Field(type => String, { description: 'ReferenceMaster locations[] as JSON text' })\n locations: string\n}\n\n@Resolver(OperationalLocation)\nexport class LocationQuery {\n /** 자리 축 전체 — 자리가 상위 자리를 가리키므로 한 번에 낸다. */\n @Query(returns => LocationMaster, { description: 'Location master for the twin to pull' })\n async locationMaster(@Ctx() context: ResolverContext): Promise<LocationMaster> {\n const { domain } = context.state\n\n const locations = await getRepository(OperationalLocation).find({\n where: { domain: { id: domain.id } },\n order: { name: 'ASC' }\n })\n\n return { locations: JSON.stringify(buildLocationMaster(locations).locations) }\n }\n}\n"]}