@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.
- package/.dockerignore +31 -0
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/master-axes.d.ts +33 -0
- package/dist-client/pages/master-axes.js +176 -0
- package/dist-client/pages/master-axes.js.map +1 -0
- package/dist-client/pages/master-list.d.ts +68 -0
- package/dist-client/pages/master-list.js +267 -0
- package/dist-client/pages/master-list.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +8 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +5 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/service/asset/asset-lifecycle.d.ts +83 -0
- package/dist-server/service/asset/asset-lifecycle.js +99 -0
- package/dist-server/service/asset/asset-lifecycle.js.map +1 -0
- package/dist-server/service/asset/asset-master-resolver.d.ts +44 -0
- package/dist-server/service/asset/asset-master-resolver.js +140 -0
- package/dist-server/service/asset/asset-master-resolver.js.map +1 -0
- package/dist-server/service/asset/asset-master.d.ts +21 -0
- package/dist-server/service/asset/asset-master.js +25 -0
- package/dist-server/service/asset/asset-master.js.map +1 -0
- package/dist-server/service/asset/asset-query.d.ts +8 -0
- package/dist-server/service/asset/asset-query.js +50 -0
- package/dist-server/service/asset/asset-query.js.map +1 -0
- package/dist-server/service/asset/index.d.ts +6 -0
- package/dist-server/service/asset/index.js +10 -0
- package/dist-server/service/asset/index.js.map +1 -0
- package/dist-server/service/asset/physical-asset-class.d.ts +34 -0
- package/dist-server/service/asset/physical-asset-class.js +104 -0
- package/dist-server/service/asset/physical-asset-class.js.map +1 -0
- package/dist-server/service/asset/physical-asset.d.ts +53 -0
- package/dist-server/service/asset/physical-asset.js +123 -0
- package/dist-server/service/asset/physical-asset.js.map +1 -0
- package/dist-server/service/equipment/equipment-class.d.ts +34 -0
- package/dist-server/service/equipment/equipment-class.js +104 -0
- package/dist-server/service/equipment/equipment-class.js.map +1 -0
- package/dist-server/service/equipment/equipment-master-resolver.d.ts +60 -0
- package/dist-server/service/equipment/equipment-master-resolver.js +200 -0
- package/dist-server/service/equipment/equipment-master-resolver.js.map +1 -0
- package/dist-server/service/equipment/equipment-master.d.ts +29 -0
- package/dist-server/service/equipment/equipment-master.js +36 -0
- package/dist-server/service/equipment/equipment-master.js.map +1 -0
- package/dist-server/service/equipment/equipment-query.d.ts +8 -0
- package/dist-server/service/equipment/equipment-query.js +50 -0
- package/dist-server/service/equipment/equipment-query.js.map +1 -0
- package/dist-server/service/equipment/equipment.d.ts +45 -0
- package/dist-server/service/equipment/equipment.js +133 -0
- package/dist-server/service/equipment/equipment.js.map +1 -0
- package/dist-server/service/equipment/index.d.ts +8 -0
- package/dist-server/service/equipment/index.js +12 -0
- package/dist-server/service/equipment/index.js.map +1 -0
- package/dist-server/service/equipment/state-period-rules.d.ts +76 -0
- package/dist-server/service/equipment/state-period-rules.js +88 -0
- package/dist-server/service/equipment/state-period-rules.js.map +1 -0
- package/dist-server/service/equipment/stop-reason-query.d.ts +11 -0
- package/dist-server/service/equipment/stop-reason-query.js +39 -0
- package/dist-server/service/equipment/stop-reason-query.js.map +1 -0
- package/dist-server/service/equipment/stop-reason.d.ts +58 -0
- package/dist-server/service/equipment/stop-reason.js +114 -0
- package/dist-server/service/equipment/stop-reason.js.map +1 -0
- package/dist-server/service/index.d.ts +46 -0
- package/dist-server/service/index.js +80 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/location/index.d.ts +5 -0
- package/dist-server/service/location/index.js +9 -0
- package/dist-server/service/location/index.js.map +1 -0
- package/dist-server/service/location/location-master-resolver.d.ts +28 -0
- package/dist-server/service/location/location-master-resolver.js +80 -0
- package/dist-server/service/location/location-master-resolver.js.map +1 -0
- package/dist-server/service/location/location-master.d.ts +24 -0
- package/dist-server/service/location/location-master.js +27 -0
- package/dist-server/service/location/location-master.js.map +1 -0
- package/dist-server/service/location/location-query.d.ts +7 -0
- package/dist-server/service/location/location-query.js +41 -0
- package/dist-server/service/location/location-query.js.map +1 -0
- package/dist-server/service/location/operational-location.d.ts +52 -0
- package/dist-server/service/location/operational-location.js +132 -0
- package/dist-server/service/location/operational-location.js.map +1 -0
- package/dist-server/service/master-axis.d.ts +29 -0
- package/dist-server/service/master-axis.js +39 -0
- package/dist-server/service/master-axis.js.map +1 -0
- package/dist-server/service/master-crud.d.ts +44 -0
- package/dist-server/service/master-crud.js +73 -0
- package/dist-server/service/master-crud.js.map +1 -0
- package/dist-server/service/master-list.d.ts +12 -0
- package/dist-server/service/master-list.js +24 -0
- package/dist-server/service/master-list.js.map +1 -0
- package/dist-server/service/material/index.d.ts +6 -0
- package/dist-server/service/material/index.js +10 -0
- package/dist-server/service/material/index.js.map +1 -0
- package/dist-server/service/material/material-class.d.ts +34 -0
- package/dist-server/service/material/material-class.js +104 -0
- package/dist-server/service/material/material-class.js.map +1 -0
- package/dist-server/service/material/material-definition.d.ts +42 -0
- package/dist-server/service/material/material-definition.js +112 -0
- package/dist-server/service/material/material-definition.js.map +1 -0
- package/dist-server/service/material/material-master-resolver.d.ts +44 -0
- package/dist-server/service/material/material-master-resolver.js +140 -0
- package/dist-server/service/material/material-master-resolver.js.map +1 -0
- package/dist-server/service/material/material-master.d.ts +9 -0
- package/dist-server/service/material/material-master.js +24 -0
- package/dist-server/service/material/material-master.js.map +1 -0
- package/dist-server/service/material/material-query.d.ts +8 -0
- package/dist-server/service/material/material-query.js +50 -0
- package/dist-server/service/material/material-query.js.map +1 -0
- package/dist-server/service/operation/index.d.ts +5 -0
- package/dist-server/service/operation/index.js +9 -0
- package/dist-server/service/operation/index.js.map +1 -0
- package/dist-server/service/operation/operation-definition.d.ts +52 -0
- package/dist-server/service/operation/operation-definition.js +142 -0
- package/dist-server/service/operation/operation-definition.js.map +1 -0
- package/dist-server/service/operation/operation-master-resolver.d.ts +28 -0
- package/dist-server/service/operation/operation-master-resolver.js +80 -0
- package/dist-server/service/operation/operation-master-resolver.js.map +1 -0
- package/dist-server/service/operation/operation-master.d.ts +21 -0
- package/dist-server/service/operation/operation-master.js +28 -0
- package/dist-server/service/operation/operation-master.js.map +1 -0
- package/dist-server/service/operation/operation-query.d.ts +7 -0
- package/dist-server/service/operation/operation-query.js +41 -0
- package/dist-server/service/operation/operation-query.js.map +1 -0
- package/dist-server/service/personnel/index.d.ts +6 -0
- package/dist-server/service/personnel/index.js +10 -0
- package/dist-server/service/personnel/index.js.map +1 -0
- package/dist-server/service/personnel/person.d.ts +51 -0
- package/dist-server/service/personnel/person.js +119 -0
- package/dist-server/service/personnel/person.js.map +1 -0
- package/dist-server/service/personnel/personnel-class.d.ts +54 -0
- package/dist-server/service/personnel/personnel-class.js +114 -0
- package/dist-server/service/personnel/personnel-class.js.map +1 -0
- package/dist-server/service/personnel/personnel-master-resolver.d.ts +44 -0
- package/dist-server/service/personnel/personnel-master-resolver.js +140 -0
- package/dist-server/service/personnel/personnel-master-resolver.js.map +1 -0
- package/dist-server/service/personnel/personnel-master.d.ts +39 -0
- package/dist-server/service/personnel/personnel-master.js +34 -0
- package/dist-server/service/personnel/personnel-master.js.map +1 -0
- package/dist-server/service/personnel/personnel-query.d.ts +21 -0
- package/dist-server/service/personnel/personnel-query.js +57 -0
- package/dist-server/service/personnel/personnel-query.js.map +1 -0
- package/dist-server/service/personnel/qualification.d.ts +97 -0
- package/dist-server/service/personnel/qualification.js +122 -0
- package/dist-server/service/personnel/qualification.js.map +1 -0
- package/dist-server/service/resource/resource-class.d.ts +25 -0
- package/dist-server/service/resource/resource-class.js +29 -0
- package/dist-server/service/resource/resource-class.js.map +1 -0
- package/dist-server/service/status/axis-stamp.d.ts +16 -0
- package/dist-server/service/status/axis-stamp.js +22 -0
- package/dist-server/service/status/axis-stamp.js.map +1 -0
- package/dist-server/service/status/index.d.ts +3 -0
- package/dist-server/service/status/index.js +7 -0
- package/dist-server/service/status/index.js.map +1 -0
- package/dist-server/service/status/master-status.d.ts +45 -0
- package/dist-server/service/status/master-status.js +129 -0
- package/dist-server/service/status/master-status.js.map +1 -0
- package/dist-server/service/test-spec/index.d.ts +5 -0
- package/dist-server/service/test-spec/index.js +9 -0
- package/dist-server/service/test-spec/index.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-master-resolver.d.ts +28 -0
- package/dist-server/service/test-spec/test-spec-master-resolver.js +80 -0
- package/dist-server/service/test-spec/test-spec-master-resolver.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-master.d.ts +6 -0
- package/dist-server/service/test-spec/test-spec-master.js +18 -0
- package/dist-server/service/test-spec/test-spec-master.js.map +1 -0
- package/dist-server/service/test-spec/test-spec-query.d.ts +7 -0
- package/dist-server/service/test-spec/test-spec-query.js +41 -0
- package/dist-server/service/test-spec/test-spec-query.js.map +1 -0
- package/dist-server/service/test-spec/test-specification.d.ts +41 -0
- package/dist-server/service/test-spec/test-specification.js +106 -0
- package/dist-server/service/test-spec/test-specification.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +50 -0
- package/things-factory.config.js +12 -0
- package/translations/en.json +53 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +53 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationDefinition = 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
|
+
* 공정 정의 — **ISA-95 `OperationsSegment`**(`OperationsDefinition` 소속).
|
|
11
|
+
*
|
|
12
|
+
* 이 자리가 답하는 것은 「이 공정이 얼마나 걸리고 무엇을 필요로 하는가」다. 예측이 쓰는 소요시간의
|
|
13
|
+
* 근거이고, 정상상태 상한과 병목을 공정별로 낼 수 있게 하는 값이다.
|
|
14
|
+
*
|
|
15
|
+
* ── 필요 자원을 적지 않으면 사람이 없는 공장이 된다 ─────────────────────────
|
|
16
|
+
* 인원 명세가 없으면 사람은 예측에 존재하지 않는다. 설비만 있으면 언제나 가동되는 공장이 되고, 현장에서
|
|
17
|
+
* 가장 자주 모자라는 자원이 만드는 줄이 통째로 사라진다. 등급으로 요구한다 — 「용접 자격자 2명」.
|
|
18
|
+
*/
|
|
19
|
+
let OperationDefinition = class OperationDefinition {
|
|
20
|
+
};
|
|
21
|
+
exports.OperationDefinition = OperationDefinition;
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
24
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
25
|
+
tslib_1.__metadata("design:type", String)
|
|
26
|
+
], OperationDefinition.prototype, "id", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
29
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain),
|
|
30
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
31
|
+
], OperationDefinition.prototype, "domain", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.RelationId)((operation) => operation.domain),
|
|
34
|
+
tslib_1.__metadata("design:type", String)
|
|
35
|
+
], OperationDefinition.prototype, "domainId", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.Column)(),
|
|
38
|
+
(0, type_graphql_1.Field)(),
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
40
|
+
], OperationDefinition.prototype, "name", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
43
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], OperationDefinition.prototype, "description", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.Column)(),
|
|
48
|
+
(0, type_graphql_1.Field)(),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], OperationDefinition.prototype, "intent", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
53
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
55
|
+
], OperationDefinition.prototype, "locationType", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
58
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
59
|
+
tslib_1.__metadata("design:type", String)
|
|
60
|
+
], OperationDefinition.prototype, "resourceType", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
63
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
64
|
+
tslib_1.__metadata("design:type", String)
|
|
65
|
+
], OperationDefinition.prototype, "bizStep", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
68
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
+
tslib_1.__metadata("design:type", String)
|
|
70
|
+
], OperationDefinition.prototype, "duration", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
73
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'DurationVariability as JSON text' }),
|
|
74
|
+
tslib_1.__metadata("design:type", Object)
|
|
75
|
+
], OperationDefinition.prototype, "variability", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
78
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'OperationParameter[] as JSON text' }),
|
|
79
|
+
tslib_1.__metadata("design:type", Array)
|
|
80
|
+
], OperationDefinition.prototype, "parameters", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
83
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'PersonnelSpecification[] as JSON text' }),
|
|
84
|
+
tslib_1.__metadata("design:type", Array)
|
|
85
|
+
], OperationDefinition.prototype, "personnelSpecification", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
88
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'PhysicalAssetSpecification[] as JSON text' }),
|
|
89
|
+
tslib_1.__metadata("design:type", Array)
|
|
90
|
+
], OperationDefinition.prototype, "physicalAssetSpecification", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
+
tslib_1.__metadata("design:type", Date
|
|
95
|
+
/**
|
|
96
|
+
* 언제까지 유효한가 — 표준 `EffectiveEndDate`.
|
|
97
|
+
*
|
|
98
|
+
* **없앨 때 행을 지우지 않고 이 칸을 채운다.** 지우면 그것을 가리키는 지난 기록이 가리킬 것을 잃는다.
|
|
99
|
+
*/
|
|
100
|
+
)
|
|
101
|
+
], OperationDefinition.prototype, "effectiveStart", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
104
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
105
|
+
tslib_1.__metadata("design:type", Date)
|
|
106
|
+
], OperationDefinition.prototype, "effectiveEnd", void 0);
|
|
107
|
+
tslib_1.__decorate([
|
|
108
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
109
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
110
|
+
tslib_1.__metadata("design:type", Date)
|
|
111
|
+
], OperationDefinition.prototype, "createdAt", void 0);
|
|
112
|
+
tslib_1.__decorate([
|
|
113
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
114
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
115
|
+
tslib_1.__metadata("design:type", Date)
|
|
116
|
+
], OperationDefinition.prototype, "updatedAt", void 0);
|
|
117
|
+
tslib_1.__decorate([
|
|
118
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
119
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
120
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
121
|
+
], OperationDefinition.prototype, "creator", void 0);
|
|
122
|
+
tslib_1.__decorate([
|
|
123
|
+
(0, typeorm_1.RelationId)((operation) => operation.creator),
|
|
124
|
+
tslib_1.__metadata("design:type", String)
|
|
125
|
+
], OperationDefinition.prototype, "creatorId", void 0);
|
|
126
|
+
tslib_1.__decorate([
|
|
127
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
128
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
129
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
130
|
+
], OperationDefinition.prototype, "updater", void 0);
|
|
131
|
+
tslib_1.__decorate([
|
|
132
|
+
(0, typeorm_1.RelationId)((operation) => operation.updater),
|
|
133
|
+
tslib_1.__metadata("design:type", String)
|
|
134
|
+
], OperationDefinition.prototype, "updaterId", void 0);
|
|
135
|
+
exports.OperationDefinition = OperationDefinition = tslib_1.__decorate([
|
|
136
|
+
(0, typeorm_1.Entity)({ name: 'ops_operation_definition' }),
|
|
137
|
+
(0, typeorm_1.Index)('ix_ops_operation_definition_0', (operation) => [operation.domain, operation.name], {
|
|
138
|
+
unique: true
|
|
139
|
+
}),
|
|
140
|
+
(0, type_graphql_1.ObjectType)({ description: 'ISA-95 OperationsSegment — what an operation takes and requires' })
|
|
141
|
+
], OperationDefinition);
|
|
142
|
+
//# sourceMappingURL=operation-definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-definition.js","sourceRoot":"","sources":["../../../server/service/operation/operation-definition.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAoD;AAEpD,iDAA8C;AAC9C,yDAAgD;AAEhD;;;;;;;;;GASG;AAMI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAqG/B,CAAA;AArGY,kDAAmB;AAGrB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;+CACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;mDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,SAA8B,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;;qDAChD;AAKjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;iDACI;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACN;AAKpB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;mDACM;AAKd;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAA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Gd;IADC,IAAA,oBAAU,EAAC,CAAC,SAA8B,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;sDAChD;8BApGP,mBAAmB;IAL/B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC;IAC5C,IAAA,eAAK,EAAC,+BAA+B,EAAE,CAAC,SAA8B,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE;QAC9G,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iEAAiE,EAAE,CAAC;GAClF,mBAAmB,CAqG/B","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 * 공정 정의 — **ISA-95 `OperationsSegment`**(`OperationsDefinition` 소속).\n *\n * 이 자리가 답하는 것은 「이 공정이 얼마나 걸리고 무엇을 필요로 하는가」다. 예측이 쓰는 소요시간의\n * 근거이고, 정상상태 상한과 병목을 공정별로 낼 수 있게 하는 값이다.\n *\n * ── 필요 자원을 적지 않으면 사람이 없는 공장이 된다 ─────────────────────────\n * 인원 명세가 없으면 사람은 예측에 존재하지 않는다. 설비만 있으면 언제나 가동되는 공장이 되고, 현장에서\n * 가장 자주 모자라는 자원이 만드는 줄이 통째로 사라진다. 등급으로 요구한다 — 「용접 자격자 2명」.\n */\n@Entity({ name: 'ops_operation_definition' })\n@Index('ix_ops_operation_definition_0', (operation: OperationDefinition) => [operation.domain, operation.name], {\n unique: true\n})\n@ObjectType({ description: 'ISA-95 OperationsSegment — what an operation takes and requires' })\nexport class OperationDefinition {\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((operation: OperationDefinition) => operation.domain)\n domainId?: string\n\n /** 공정 키 — 라우트의 단계가 이 값을 가리킨다. */\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n /** 무엇을 하는 공정인가 — `transport` · `process` · `dwell`. */\n @Column()\n @Field()\n intent: string\n\n /** 이 공정이 벌어지는 자리 타입. 없으면 커널이 어디서 일하는지 정할 수 없다. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n locationType?: string\n\n /** 필요한 설비 종류. `dwell` 은 자원을 잡지 않는다. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n resourceType?: string\n\n /** 방출할 CBV bizStep URN. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n bizStep?: string\n\n /** 소요시간 — 표준 `Duration`. ISO 8601 기간 표기다. 없으면 커널이 기본값을 쓴다. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n duration?: string\n\n /** 소요시간 변동 — 표준 밖 확장. 없으면 상수다. */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => String, { nullable: true, description: 'DurationVariability as JSON text' })\n variability?: Record<string, unknown>\n\n /** 공정 모수 — 표준 `ParameterSpecification`. 수율 · 셋업 시간 · 온도가 여기 온다. */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => String, { nullable: true, description: 'OperationParameter[] as JSON text' })\n parameters?: Record<string, unknown>[]\n\n /** 필요 인원 — 표준 `PersonnelSpecification`(등급 + 수량). */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => String, { nullable: true, description: 'PersonnelSpecification[] as JSON text' })\n personnelSpecification?: Record<string, unknown>[]\n\n /** 필요 물리 자산 — 표준 `PhysicalAssetSpecification`. 빈 팔레트가 없어 출고가 못 나가는 일은 잦다. */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => String, { nullable: true, description: 'PhysicalAssetSpecification[] as JSON text' })\n physicalAssetSpecification?: Record<string, unknown>[]\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((operation: OperationDefinition) => operation.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((operation: OperationDefinition) => operation.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ListParam } from '@things-factory/shell';
|
|
2
|
+
import { MasterPatch } from '../master-crud';
|
|
3
|
+
import { OperationDefinition } from './operation-definition';
|
|
4
|
+
/**
|
|
5
|
+
* 공정 축을 채우고 고친다.
|
|
6
|
+
*
|
|
7
|
+
* ── 왜 마스터는 그리드에서 고칠 수 있나 ────────────────────────────────────
|
|
8
|
+
* 업무 기록과 달리 마스터는 **선언**이다. 「이 사람이 용접 자격을 갖는다」는 일어난 일이 아니라 지금의
|
|
9
|
+
* 규정이고, 규정은 바뀐다. 없앨 때 행을 지우지 않고 유효 기간의 끝을 채우는 것이 그래서다 —
|
|
10
|
+
* 지우면 그것을 가리키는 지난 기록이 가리킬 것을 잃는다.
|
|
11
|
+
*
|
|
12
|
+
* 규칙은 `master-crud.ts` 한 곳에 있다. 여기는 축의 이름만 붙인다.
|
|
13
|
+
*/
|
|
14
|
+
export declare class OperationDefinitionList {
|
|
15
|
+
items: OperationDefinition[];
|
|
16
|
+
total: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class OperationDefinitionResolver {
|
|
19
|
+
operationDefinitions(params: ListParam, context: ResolverContext): Promise<OperationDefinitionList>;
|
|
20
|
+
/**
|
|
21
|
+
* 그리드가 보낸 변경을 한 번에 적용한다.
|
|
22
|
+
*
|
|
23
|
+
* 패치를 `ScalarObject` 로 받는다 — 축마다 입력 타입을 따로 만들면 칸을 하나 더할 때마다 두 곳을
|
|
24
|
+
* 고쳐야 하고, 한쪽을 빠뜨리면 그 칸이 오류 보고 없이 저장되지 않는다. 돌려주는 것은 타입이 있는
|
|
25
|
+
* 엔티티라 무엇이 저장됐는지 스키마로 확인할 수 있다.
|
|
26
|
+
*/
|
|
27
|
+
updateMultipleOperationDefinition(patches: MasterPatch[], context: ResolverContext): Promise<OperationDefinition[]>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationDefinitionResolver = exports.OperationDefinitionList = 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 operation_definition_1 = require("./operation-definition");
|
|
11
|
+
/**
|
|
12
|
+
* 공정 축을 채우고 고친다.
|
|
13
|
+
*
|
|
14
|
+
* ── 왜 마스터는 그리드에서 고칠 수 있나 ────────────────────────────────────
|
|
15
|
+
* 업무 기록과 달리 마스터는 **선언**이다. 「이 사람이 용접 자격을 갖는다」는 일어난 일이 아니라 지금의
|
|
16
|
+
* 규정이고, 규정은 바뀐다. 없앨 때 행을 지우지 않고 유효 기간의 끝을 채우는 것이 그래서다 —
|
|
17
|
+
* 지우면 그것을 가리키는 지난 기록이 가리킬 것을 잃는다.
|
|
18
|
+
*
|
|
19
|
+
* 규칙은 `master-crud.ts` 한 곳에 있다. 여기는 축의 이름만 붙인다.
|
|
20
|
+
*/
|
|
21
|
+
let OperationDefinitionList = class OperationDefinitionList {
|
|
22
|
+
};
|
|
23
|
+
exports.OperationDefinitionList = OperationDefinitionList;
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, type_graphql_1.Field)(type => [operation_definition_1.OperationDefinition]),
|
|
26
|
+
tslib_1.__metadata("design:type", Array)
|
|
27
|
+
], OperationDefinitionList.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
|
+
], OperationDefinitionList.prototype, "total", void 0);
|
|
32
|
+
exports.OperationDefinitionList = OperationDefinitionList = tslib_1.__decorate([
|
|
33
|
+
(0, type_graphql_1.ObjectType)({ description: 'A page of operation definitions' })
|
|
34
|
+
], OperationDefinitionList);
|
|
35
|
+
let OperationDefinitionResolver = class OperationDefinitionResolver {
|
|
36
|
+
async operationDefinitions(params, context) {
|
|
37
|
+
const { domain } = context.state;
|
|
38
|
+
const { items, total } = await (0, master_list_1.listMaster)('operationDefinition', params, domain);
|
|
39
|
+
return { items: items, total };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 그리드가 보낸 변경을 한 번에 적용한다.
|
|
43
|
+
*
|
|
44
|
+
* 패치를 `ScalarObject` 로 받는다 — 축마다 입력 타입을 따로 만들면 칸을 하나 더할 때마다 두 곳을
|
|
45
|
+
* 고쳐야 하고, 한쪽을 빠뜨리면 그 칸이 오류 보고 없이 저장되지 않는다. 돌려주는 것은 타입이 있는
|
|
46
|
+
* 엔티티라 무엇이 저장됐는지 스키마로 확인할 수 있다.
|
|
47
|
+
*/
|
|
48
|
+
async updateMultipleOperationDefinition(patches, context) {
|
|
49
|
+
const { domain, user, tx } = context.state;
|
|
50
|
+
const axis = (0, master_axis_1.masterAxisOf)('operationDefinition');
|
|
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.OperationDefinitionResolver = OperationDefinitionResolver;
|
|
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 => OperationDefinitionList, { description: 'To fetch operation definitions' }),
|
|
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
|
+
], OperationDefinitionResolver.prototype, "operationDefinitions", 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 => [operation_definition_1.OperationDefinition], { description: 'To create, change or retire operation definitions' }),
|
|
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
|
+
], OperationDefinitionResolver.prototype, "updateMultipleOperationDefinition", null);
|
|
77
|
+
exports.OperationDefinitionResolver = OperationDefinitionResolver = tslib_1.__decorate([
|
|
78
|
+
(0, type_graphql_1.Resolver)(operation_definition_1.OperationDefinition)
|
|
79
|
+
], OperationDefinitionResolver);
|
|
80
|
+
//# sourceMappingURL=operation-master-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-master-resolver.js","sourceRoot":"","sources":["../../../server/service/operation/operation-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 { OperationDefinition } from './operation-definition'\n\n/**\n * 공정 축을 채우고 고친다.\n *\n * ── 왜 마스터는 그리드에서 고칠 수 있나 ────────────────────────────────────\n * 업무 기록과 달리 마스터는 **선언**이다. 「이 사람이 용접 자격을 갖는다」는 일어난 일이 아니라 지금의\n * 규정이고, 규정은 바뀐다. 없앨 때 행을 지우지 않고 유효 기간의 끝을 채우는 것이 그래서다 —\n * 지우면 그것을 가리키는 지난 기록이 가리킬 것을 잃는다.\n *\n * 규칙은 `master-crud.ts` 한 곳에 있다. 여기는 축의 이름만 붙인다.\n */\n\n@ObjectType({ description: 'A page of operation definitions' })\nexport class OperationDefinitionList {\n @Field(type => [OperationDefinition])\n items: OperationDefinition[]\n\n @Field(type => Int)\n total: number\n}\n\n@Resolver(OperationDefinition)\nexport class OperationDefinitionResolver {\n @Directive('@privilege(category: \"ops-master\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => OperationDefinitionList, { description: 'To fetch operation definitions' })\n async operationDefinitions(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<OperationDefinitionList> {\n const { domain } = context.state\n const { items, total } = await listMaster('operationDefinition', params, domain)\n\n return { items: items as OperationDefinition[], 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 => [OperationDefinition], { description: 'To create, change or retire operation definitions' })\n async updateMultipleOperationDefinition(\n @Arg('patches', type => [ScalarObject]) patches: MasterPatch[],\n @Ctx() context: ResolverContext\n ): Promise<OperationDefinition[]> {\n const { domain, user, tx } = context.state\n const axis = masterAxisOf('operationDefinition')\n\n const saved = await saveMasterPatches(tx, domain, axis.entity, patches, user, {\n hasEffectivePeriod: axis.hasEffectivePeriod\n })\n\n return saved as OperationDefinition[]\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OperationDefinition } from './operation-definition';
|
|
2
|
+
/** 트윈 선언의 `operations` 한 항목 — 계약의 `OperationDef` 모양이다. */
|
|
3
|
+
export interface OperationEntry {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
intent: string;
|
|
7
|
+
locationType?: string;
|
|
8
|
+
resourceType?: string;
|
|
9
|
+
bizStep?: string;
|
|
10
|
+
duration?: string;
|
|
11
|
+
variability?: unknown;
|
|
12
|
+
parameters?: unknown[];
|
|
13
|
+
personnelSpecification?: unknown[];
|
|
14
|
+
physicalAssetSpecification?: unknown[];
|
|
15
|
+
effectiveStart?: string;
|
|
16
|
+
effectiveEnd?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function toOperationEntry(operation: OperationDefinition): OperationEntry;
|
|
19
|
+
export declare function operationMaster(operations: OperationDefinition[]): {
|
|
20
|
+
operations: OperationEntry[];
|
|
21
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toOperationEntry = toOperationEntry;
|
|
4
|
+
exports.operationMaster = operationMaster;
|
|
5
|
+
const resource_class_1 = require("../resource/resource-class");
|
|
6
|
+
function toOperationEntry(operation) {
|
|
7
|
+
/* `key` 와 `label` 과 `intent` 는 비울 수 없다 — 셋이 없으면 그 공정은 실행 단위가 되지 못한다. */
|
|
8
|
+
const out = {
|
|
9
|
+
key: operation.name,
|
|
10
|
+
label: operation.description ?? operation.name,
|
|
11
|
+
intent: operation.intent
|
|
12
|
+
};
|
|
13
|
+
(0, resource_class_1.put)(out, 'locationType', operation.locationType);
|
|
14
|
+
(0, resource_class_1.put)(out, 'resourceType', operation.resourceType);
|
|
15
|
+
(0, resource_class_1.put)(out, 'bizStep', operation.bizStep);
|
|
16
|
+
(0, resource_class_1.put)(out, 'duration', operation.duration);
|
|
17
|
+
(0, resource_class_1.put)(out, 'variability', operation.variability);
|
|
18
|
+
(0, resource_class_1.put)(out, 'parameters', operation.parameters);
|
|
19
|
+
(0, resource_class_1.put)(out, 'personnelSpecification', operation.personnelSpecification);
|
|
20
|
+
(0, resource_class_1.put)(out, 'physicalAssetSpecification', operation.physicalAssetSpecification);
|
|
21
|
+
(0, resource_class_1.put)(out, 'effectiveStart', (0, resource_class_1.iso)(operation.effectiveStart));
|
|
22
|
+
(0, resource_class_1.put)(out, 'effectiveEnd', (0, resource_class_1.iso)(operation.effectiveEnd));
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
function operationMaster(operations) {
|
|
26
|
+
return { operations: operations.map(toOperationEntry) };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=operation-master.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-master.js","sourceRoot":"","sources":["../../../server/service/operation/operation-master.ts"],"names":[],"mappings":";;AAoBA,4CAoBC;AAED,0CAEC;AA5CD,+DAAqD;AAoBrD,SAAgB,gBAAgB,CAAC,SAA8B;IAC7D,wEAAwE;IACxE,MAAM,GAAG,GAA4B;QACnC,GAAG,EAAE,SAAS,CAAC,IAAI;QACnB,KAAK,EAAE,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI;QAC9C,MAAM,EAAE,SAAS,CAAC,MAAM;KACzB,CAAA;IAED,IAAA,oBAAG,EAAC,GAAG,EAAE,cAAc,EAAE,SAAS,CAAC,YAAY,CAAC,CAAA;IAChD,IAAA,oBAAG,EAAC,GAAG,EAAE,cAAc,EAAE,SAAS,CAAC,YAAY,CAAC,CAAA;IAChD,IAAA,oBAAG,EAAC,GAAG,EAAE,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IACtC,IAAA,oBAAG,EAAC,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;IACxC,IAAA,oBAAG,EAAC,GAAG,EAAE,aAAa,EAAE,SAAS,CAAC,WAAW,CAAC,CAAA;IAC9C,IAAA,oBAAG,EAAC,GAAG,EAAE,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC,CAAA;IAC5C,IAAA,oBAAG,EAAC,GAAG,EAAE,wBAAwB,EAAE,SAAS,CAAC,sBAAsB,CAAC,CAAA;IACpE,IAAA,oBAAG,EAAC,GAAG,EAAE,4BAA4B,EAAE,SAAS,CAAC,0BAA0B,CAAC,CAAA;IAC5E,IAAA,oBAAG,EAAC,GAAG,EAAE,gBAAgB,EAAE,IAAA,oBAAG,EAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAA;IACzD,IAAA,oBAAG,EAAC,GAAG,EAAE,cAAc,EAAE,IAAA,oBAAG,EAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAA;IAErD,OAAO,GAAgC,CAAA;AACzC,CAAC;AAED,SAAgB,eAAe,CAAC,UAAiC;IAC/D,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAA;AACzD,CAAC","sourcesContent":["import { iso, put } from '../resource/resource-class'\nimport type { OperationDefinition } from './operation-definition'\n\n/** 트윈 선언의 `operations` 한 항목 — 계약의 `OperationDef` 모양이다. */\nexport interface OperationEntry {\n key: string\n label: string\n intent: string\n locationType?: string\n resourceType?: string\n bizStep?: string\n duration?: string\n variability?: unknown\n parameters?: unknown[]\n personnelSpecification?: unknown[]\n physicalAssetSpecification?: unknown[]\n effectiveStart?: string\n effectiveEnd?: string\n}\n\nexport function toOperationEntry(operation: OperationDefinition): OperationEntry {\n /* `key` 와 `label` 과 `intent` 는 비울 수 없다 — 셋이 없으면 그 공정은 실행 단위가 되지 못한다. */\n const out: Record<string, unknown> = {\n key: operation.name,\n label: operation.description ?? operation.name,\n intent: operation.intent\n }\n\n put(out, 'locationType', operation.locationType)\n put(out, 'resourceType', operation.resourceType)\n put(out, 'bizStep', operation.bizStep)\n put(out, 'duration', operation.duration)\n put(out, 'variability', operation.variability)\n put(out, 'parameters', operation.parameters)\n put(out, 'personnelSpecification', operation.personnelSpecification)\n put(out, 'physicalAssetSpecification', operation.physicalAssetSpecification)\n put(out, 'effectiveStart', iso(operation.effectiveStart))\n put(out, 'effectiveEnd', iso(operation.effectiveEnd))\n\n return out as unknown as OperationEntry\n}\n\nexport function operationMaster(operations: OperationDefinition[]): { operations: OperationEntry[] } {\n return { operations: operations.map(toOperationEntry) }\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationQuery = exports.OperationMaster = 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 operation_definition_1 = require("./operation-definition");
|
|
8
|
+
const operation_master_1 = require("./operation-master");
|
|
9
|
+
let OperationMaster = class OperationMaster {
|
|
10
|
+
};
|
|
11
|
+
exports.OperationMaster = OperationMaster;
|
|
12
|
+
tslib_1.__decorate([
|
|
13
|
+
(0, type_graphql_1.Field)(type => String, { description: 'OperationDef[] as JSON text' }),
|
|
14
|
+
tslib_1.__metadata("design:type", String)
|
|
15
|
+
], OperationMaster.prototype, "operations", void 0);
|
|
16
|
+
exports.OperationMaster = OperationMaster = tslib_1.__decorate([
|
|
17
|
+
(0, type_graphql_1.ObjectType)({ description: 'Operation definitions as the twin receives them' })
|
|
18
|
+
], OperationMaster);
|
|
19
|
+
let OperationQuery = class OperationQuery {
|
|
20
|
+
/** 공정 정의 전체 — 라우트의 단계가 이 키를 가리킨다. */
|
|
21
|
+
async operationMaster(context) {
|
|
22
|
+
const { domain } = context.state;
|
|
23
|
+
const operations = await (0, shell_1.getRepository)(operation_definition_1.OperationDefinition).find({
|
|
24
|
+
where: { domain: { id: domain.id } },
|
|
25
|
+
order: { name: 'ASC' }
|
|
26
|
+
});
|
|
27
|
+
return { operations: JSON.stringify((0, operation_master_1.operationMaster)(operations).operations) };
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.OperationQuery = OperationQuery;
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, type_graphql_1.Query)(returns => OperationMaster, { description: 'Operation definitions 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
|
+
], OperationQuery.prototype, "operationMaster", null);
|
|
38
|
+
exports.OperationQuery = OperationQuery = tslib_1.__decorate([
|
|
39
|
+
(0, type_graphql_1.Resolver)(operation_definition_1.OperationDefinition)
|
|
40
|
+
], OperationQuery);
|
|
41
|
+
//# sourceMappingURL=operation-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-query.js","sourceRoot":"","sources":["../../../server/service/operation/operation-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,iDAAqD;AAErD,iEAA4D;AAC5D,yDAA4E;AAGrE,IAAM,eAAe,GAArB,MAAM,eAAe;CAG3B,CAAA;AAHY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;mDACpD;0BAFP,eAAe;IAD3B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;GAClE,eAAe,CAG3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,qCAAqC;IAE/B,AAAN,KAAK,CAAC,eAAe,CAAQ,OAAwB;QACnD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,UAAU,GAAG,MAAM,IAAA,qBAAa,EAAC,0CAAmB,CAAC,CAAC,IAAI,CAAC;YAC/D,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,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,IAAA,kCAAoB,EAAC,UAAU,CAAC,CAAC,UAAU,CAAC,EAAE,CAAA;IACpF,CAAC;CACF,CAAA;AAbY,wCAAc;AAGnB;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,eAAe,EAAE,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;IAC1E,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAS3B;yBAZU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,0CAAmB,CAAC;GACjB,cAAc,CAa1B","sourcesContent":["import { Ctx, Field, ObjectType, Query, Resolver } from 'type-graphql'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { OperationDefinition } from './operation-definition'\nimport { operationMaster as buildOperationMaster } from './operation-master'\n\n@ObjectType({ description: 'Operation definitions as the twin receives them' })\nexport class OperationMaster {\n @Field(type => String, { description: 'OperationDef[] as JSON text' })\n operations: string\n}\n\n@Resolver(OperationDefinition)\nexport class OperationQuery {\n /** 공정 정의 전체 — 라우트의 단계가 이 키를 가리킨다. */\n @Query(returns => OperationMaster, { description: 'Operation definitions for the twin to pull' })\n async operationMaster(@Ctx() context: ResolverContext): Promise<OperationMaster> {\n const { domain } = context.state\n\n const operations = await getRepository(OperationDefinition).find({\n where: { domain: { id: domain.id } },\n order: { name: 'ASC' }\n })\n\n return { operations: JSON.stringify(buildOperationMaster(operations).operations) }\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Person } from './person';
|
|
2
|
+
import { PersonnelClass } from './personnel-class';
|
|
3
|
+
import { PersonnelQuery } from './personnel-query';
|
|
4
|
+
import { PersonnelClassResolver, PersonResolver } from './personnel-master-resolver';
|
|
5
|
+
export declare const entities: (typeof Person | typeof PersonnelClass)[];
|
|
6
|
+
export declare const resolvers: (typeof PersonnelClassResolver | typeof PersonResolver | typeof PersonnelQuery)[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const person_1 = require("./person");
|
|
5
|
+
const personnel_class_1 = require("./personnel-class");
|
|
6
|
+
const personnel_query_1 = require("./personnel-query");
|
|
7
|
+
const personnel_master_resolver_1 = require("./personnel-master-resolver");
|
|
8
|
+
exports.entities = [personnel_class_1.PersonnelClass, person_1.Person];
|
|
9
|
+
exports.resolvers = [personnel_query_1.PersonnelQuery, personnel_master_resolver_1.PersonnelClassResolver, personnel_master_resolver_1.PersonResolver];
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/personnel/index.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AACjC,uDAAkD;AAClD,uDAAkD;AAClD,2EAAoF;AAEvE,QAAA,QAAQ,GAAG,CAAC,gCAAc,EAAE,eAAM,CAAC,CAAA;AACnC,QAAA,SAAS,GAAG,CAAC,gCAAc,EAAE,kDAAsB,EAAE,0CAAc,CAAC,CAAA","sourcesContent":["import { Person } from './person'\nimport { PersonnelClass } from './personnel-class'\nimport { PersonnelQuery } from './personnel-query'\nimport { PersonnelClassResolver, PersonResolver } from './personnel-master-resolver'\n\nexport const entities = [PersonnelClass, Person]\nexport const resolvers = [PersonnelQuery, PersonnelClassResolver, PersonResolver]\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
/**
|
|
4
|
+
* 작업자 — **ISA-95 `Person`**.
|
|
5
|
+
*
|
|
6
|
+
* 사람은 설비와 다르게 산다. 고장 나지 않고 교대로 일하며, 자격이 만료된다. 그래서 자원 넷을 한 그릇에
|
|
7
|
+
* 담지 않는다 — 한쪽의 어휘가 다른 쪽에 붙으면 둘 다 거짓이 된다.
|
|
8
|
+
*
|
|
9
|
+
* 필드 이름은 커널 계약의 `persons` 항목과 같다(`@operato/ops-contract`). 옮길 때 번역이 없다.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Person {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
domain?: Domain;
|
|
14
|
+
domainId?: string;
|
|
15
|
+
/** 표준 `PersonID` — 트윈으로 나갈 때 `persons[].id` 가 된다. */
|
|
16
|
+
name: string;
|
|
17
|
+
/** 사람이 읽는 이름. 표준 `PersonName`. */
|
|
18
|
+
description?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 속한 등급들 — 표준 `PersonnelClassID`(복수).
|
|
21
|
+
*
|
|
22
|
+
* 복수인 것이 중요하다. 한 사람이 용접 자격과 지게차 자격을 함께 갖는 일이 흔하고, 하나만 담으면
|
|
23
|
+
* 그 사람은 한쪽 공정에서 보이지 않는다.
|
|
24
|
+
*/
|
|
25
|
+
personnelClassIds?: string[];
|
|
26
|
+
/** 이 사람이 주로 있는 자리 — 표준 `OperationalLocation`. */
|
|
27
|
+
homeLocation?: string;
|
|
28
|
+
/** 근무 캘린더 — 표준 `WorkCalendar`. 교대 이름과 구간이 여기 있다. */
|
|
29
|
+
workCalendar?: Record<string, unknown>[];
|
|
30
|
+
/** 개체 속성 — 표준 `PersonProperty`. `classPropertyId` 로 등급 속성을 구체화한다. */
|
|
31
|
+
properties?: Record<string, unknown>[];
|
|
32
|
+
/** 이 사람에게 요구되는 `TestSpecification` 참조들 — 표준 `TestSpecificationID`. 참조만 갖는다. */
|
|
33
|
+
testSpecificationIds?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* `TestResult` — 표준 `TestResult`.
|
|
36
|
+
*
|
|
37
|
+
* 등급이 `TestSpecification` 을 요구하는데 그 사람에게 결과가 아예 없으면, 자격이 성립하는지 판단할 수 없다.
|
|
38
|
+
* 만료되었거나 떨어졌으면 그 사람에게 작업이 가지 않는다.
|
|
39
|
+
*/
|
|
40
|
+
testResults?: Record<string, unknown>[];
|
|
41
|
+
/** 언제부터 이 사람이 현장에 있나 — 표준 `EffectiveStartDate`. 입사 예정자를 미리 등록할 수 있다. */
|
|
42
|
+
effectiveStart?: Date;
|
|
43
|
+
/** 언제까지 — 표준 `EffectiveEndDate`. 퇴사한 사람이 영원히 배정 대상으로 남지 않게 한다. */
|
|
44
|
+
effectiveEnd?: Date;
|
|
45
|
+
createdAt?: Date;
|
|
46
|
+
updatedAt?: Date;
|
|
47
|
+
creator?: User;
|
|
48
|
+
creatorId?: string;
|
|
49
|
+
updater?: User;
|
|
50
|
+
updaterId?: string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Person = 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
|
+
* 작업자 — **ISA-95 `Person`**.
|
|
11
|
+
*
|
|
12
|
+
* 사람은 설비와 다르게 산다. 고장 나지 않고 교대로 일하며, 자격이 만료된다. 그래서 자원 넷을 한 그릇에
|
|
13
|
+
* 담지 않는다 — 한쪽의 어휘가 다른 쪽에 붙으면 둘 다 거짓이 된다.
|
|
14
|
+
*
|
|
15
|
+
* 필드 이름은 커널 계약의 `persons` 항목과 같다(`@operato/ops-contract`). 옮길 때 번역이 없다.
|
|
16
|
+
*/
|
|
17
|
+
let Person = class Person {
|
|
18
|
+
};
|
|
19
|
+
exports.Person = Person;
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
24
|
+
], Person.prototype, "id", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
27
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain),
|
|
28
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
29
|
+
], Person.prototype, "domain", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.RelationId)((person) => person.domain),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], Person.prototype, "domainId", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.Column)(),
|
|
36
|
+
(0, type_graphql_1.Field)(),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], Person.prototype, "name", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
41
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], Person.prototype, "description", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
46
|
+
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
47
|
+
tslib_1.__metadata("design:type", Array)
|
|
48
|
+
], Person.prototype, "personnelClassIds", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
52
|
+
tslib_1.__metadata("design:type", String)
|
|
53
|
+
], Person.prototype, "homeLocation", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
56
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'WorkCalendarEntry[] as JSON text' }),
|
|
57
|
+
tslib_1.__metadata("design:type", Array)
|
|
58
|
+
], Person.prototype, "workCalendar", void 0);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
61
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'ResourceProperty[] as JSON text' }),
|
|
62
|
+
tslib_1.__metadata("design:type", Array)
|
|
63
|
+
], Person.prototype, "properties", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
66
|
+
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
67
|
+
tslib_1.__metadata("design:type", Array)
|
|
68
|
+
], Person.prototype, "testSpecificationIds", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
71
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true, description: 'TestResult[] as JSON text' }),
|
|
72
|
+
tslib_1.__metadata("design:type", Array)
|
|
73
|
+
], Person.prototype, "testResults", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
76
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
|
+
tslib_1.__metadata("design:type", Date
|
|
78
|
+
/** 언제까지 — 표준 `EffectiveEndDate`. 퇴사한 사람이 영원히 배정 대상으로 남지 않게 한다. */
|
|
79
|
+
)
|
|
80
|
+
], Person.prototype, "effectiveStart", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
83
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
84
|
+
tslib_1.__metadata("design:type", Date)
|
|
85
|
+
], Person.prototype, "effectiveEnd", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
88
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
89
|
+
tslib_1.__metadata("design:type", Date)
|
|
90
|
+
], Person.prototype, "createdAt", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
+
tslib_1.__metadata("design:type", Date)
|
|
95
|
+
], Person.prototype, "updatedAt", void 0);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
98
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
99
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
100
|
+
], Person.prototype, "creator", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_1.RelationId)((person) => person.creator),
|
|
103
|
+
tslib_1.__metadata("design:type", String)
|
|
104
|
+
], Person.prototype, "creatorId", void 0);
|
|
105
|
+
tslib_1.__decorate([
|
|
106
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
107
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
108
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
109
|
+
], Person.prototype, "updater", void 0);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
(0, typeorm_1.RelationId)((person) => person.updater),
|
|
112
|
+
tslib_1.__metadata("design:type", String)
|
|
113
|
+
], Person.prototype, "updaterId", void 0);
|
|
114
|
+
exports.Person = Person = tslib_1.__decorate([
|
|
115
|
+
(0, typeorm_1.Entity)({ name: 'ops_person' }),
|
|
116
|
+
(0, typeorm_1.Index)('ix_ops_person_0', (person) => [person.domain, person.name], { unique: true }),
|
|
117
|
+
(0, type_graphql_1.ObjectType)({ description: 'ISA-95 Person — a worker who can be assigned to operations' })
|
|
118
|
+
], Person);
|
|
119
|
+
//# sourceMappingURL=person.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person.js","sourceRoot":"","sources":["../../../server/service/personnel/person.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAoD;AAEpD,iDAA8C;AAC9C,yDAAgD;AAEhD;;;;;;;GAOG;AAII,IAAM,MAAM,GAAZ,MAAM,MAAM;CA6FlB,CAAA;AA7FY,wBAAM;AAGR;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;kCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;sCAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;;wCAC7B;AAKjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;oCACI;AAKZ;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACN;AAUpB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,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,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC5F,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4DAA4D,EAAE,CAAC;GAC7E,MAAM,CA6FlB","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 * 작업자 — **ISA-95 `Person`**.\n *\n * 사람은 설비와 다르게 산다. 고장 나지 않고 교대로 일하며, 자격이 만료된다. 그래서 자원 넷을 한 그릇에\n * 담지 않는다 — 한쪽의 어휘가 다른 쪽에 붙으면 둘 다 거짓이 된다.\n *\n * 필드 이름은 커널 계약의 `persons` 항목과 같다(`@operato/ops-contract`). 옮길 때 번역이 없다.\n */\n@Entity({ name: 'ops_person' })\n@Index('ix_ops_person_0', (person: Person) => [person.domain, person.name], { unique: true })\n@ObjectType({ description: 'ISA-95 Person — a worker who can be assigned to operations' })\nexport class Person {\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((person: Person) => person.domain)\n domainId?: string\n\n /** 표준 `PersonID` — 트윈으로 나갈 때 `persons[].id` 가 된다. */\n @Column()\n @Field()\n name: string\n\n /** 사람이 읽는 이름. 표준 `PersonName`. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n /**\n * 속한 등급들 — 표준 `PersonnelClassID`(복수).\n *\n * 복수인 것이 중요하다. 한 사람이 용접 자격과 지게차 자격을 함께 갖는 일이 흔하고, 하나만 담으면\n * 그 사람은 한쪽 공정에서 보이지 않는다.\n */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => [String], { nullable: true })\n personnelClassIds?: string[]\n\n /** 이 사람이 주로 있는 자리 — 표준 `OperationalLocation`. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n homeLocation?: string\n\n /** 근무 캘린더 — 표준 `WorkCalendar`. 교대 이름과 구간이 여기 있다. */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => String, { nullable: true, description: 'WorkCalendarEntry[] as JSON text' })\n workCalendar?: Record<string, unknown>[]\n\n /** 개체 속성 — 표준 `PersonProperty`. `classPropertyId` 로 등급 속성을 구체화한다. */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => String, { nullable: true, description: 'ResourceProperty[] as JSON text' })\n properties?: Record<string, unknown>[]\n\n /** 이 사람에게 요구되는 `TestSpecification` 참조들 — 표준 `TestSpecificationID`. 참조만 갖는다. */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => [String], { nullable: true })\n testSpecificationIds?: string[]\n\n /**\n * `TestResult` — 표준 `TestResult`.\n *\n * 등급이 `TestSpecification` 을 요구하는데 그 사람에게 결과가 아예 없으면, 자격이 성립하는지 판단할 수 없다.\n * 만료되었거나 떨어졌으면 그 사람에게 작업이 가지 않는다.\n */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => String, { nullable: true, description: 'TestResult[] as JSON text' })\n testResults?: Record<string, unknown>[]\n\n /** 언제부터 이 사람이 현장에 있나 — 표준 `EffectiveStartDate`. 입사 예정자를 미리 등록할 수 있다. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n effectiveStart?: Date\n\n /** 언제까지 — 표준 `EffectiveEndDate`. 퇴사한 사람이 영원히 배정 대상으로 남지 않게 한다. */\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((person: Person) => person.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((person: Person) => person.updater)\n updaterId?: string\n}\n"]}
|