@things-factory/ops-master 10.1.33 → 10.1.34

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 (66) hide show
  1. package/dist-client/index.d.ts +1 -0
  2. package/dist-client/index.js +1 -0
  3. package/dist-client/index.js.map +1 -1
  4. package/dist-client/master-change-approval.d.ts +7 -0
  5. package/dist-client/master-change-approval.js +20 -0
  6. package/dist-client/master-change-approval.js.map +1 -0
  7. package/dist-client/pages/master/test-specification.d.ts +22 -85
  8. package/dist-client/pages/master/test-specification.js +190 -405
  9. package/dist-client/pages/master/test-specification.js.map +1 -1
  10. package/dist-client/tsconfig.tsbuildinfo +1 -1
  11. package/dist-server/service/asset/asset-master-resolver.js +38 -34
  12. package/dist-server/service/asset/asset-master-resolver.js.map +1 -1
  13. package/dist-server/service/asset/index.d.ts +2 -2
  14. package/dist-server/service/equipment/equipment-master-resolver.js +54 -49
  15. package/dist-server/service/equipment/equipment-master-resolver.js.map +1 -1
  16. package/dist-server/service/equipment/index.d.ts +2 -2
  17. package/dist-server/service/index.d.ts +8 -2
  18. package/dist-server/service/index.js +8 -0
  19. package/dist-server/service/index.js.map +1 -1
  20. package/dist-server/service/location/index.d.ts +1 -1
  21. package/dist-server/service/location/location-master-resolver.js +34 -31
  22. package/dist-server/service/location/location-master-resolver.js.map +1 -1
  23. package/dist-server/service/master-change-policy.d.ts +23 -0
  24. package/dist-server/service/master-change-policy.js +129 -0
  25. package/dist-server/service/master-change-policy.js.map +1 -0
  26. package/dist-server/service/master-crud.js +6 -0
  27. package/dist-server/service/master-crud.js.map +1 -1
  28. package/dist-server/service/material/index.d.ts +2 -2
  29. package/dist-server/service/material/material-master-resolver.js +55 -51
  30. package/dist-server/service/material/material-master-resolver.js.map +1 -1
  31. package/dist-server/service/operation/index.d.ts +1 -1
  32. package/dist-server/service/operation/operation-master-resolver.js +28 -25
  33. package/dist-server/service/operation/operation-master-resolver.js.map +1 -1
  34. package/dist-server/service/personnel/index.d.ts +2 -2
  35. package/dist-server/service/personnel/personnel-master-resolver.js +38 -34
  36. package/dist-server/service/personnel/personnel-master-resolver.js.map +1 -1
  37. package/dist-server/service/quality/nonconformance-cause-resolver.js +17 -14
  38. package/dist-server/service/quality/nonconformance-cause-resolver.js.map +1 -1
  39. package/dist-server/service/recipe/index.d.ts +2 -2
  40. package/dist-server/service/recipe/recipe-master-resolver.js +32 -28
  41. package/dist-server/service/recipe/recipe-master-resolver.js.map +1 -1
  42. package/dist-server/service/test-spec/index.d.ts +3 -2
  43. package/dist-server/service/test-spec/index.js +4 -2
  44. package/dist-server/service/test-spec/index.js.map +1 -1
  45. package/dist-server/service/test-spec/test-spec-effective-list.d.ts +32 -0
  46. package/dist-server/service/test-spec/test-spec-effective-list.js +40 -0
  47. package/dist-server/service/test-spec/test-spec-effective-list.js.map +1 -0
  48. package/dist-server/service/test-spec/test-spec-master-resolver.d.ts +4 -14
  49. package/dist-server/service/test-spec/test-spec-master-resolver.js +12 -83
  50. package/dist-server/service/test-spec/test-spec-master-resolver.js.map +1 -1
  51. package/dist-server/service/test-spec/test-spec-query.js +7 -1
  52. package/dist-server/service/test-spec/test-spec-query.js.map +1 -1
  53. package/dist-server/service/test-spec/test-spec-revision-resolver.d.ts +52 -0
  54. package/dist-server/service/test-spec/test-spec-revision-resolver.js +76 -0
  55. package/dist-server/service/test-spec/test-spec-revision-resolver.js.map +1 -0
  56. package/dist-server/service/test-spec/test-spec-revision-service.d.ts +117 -0
  57. package/dist-server/service/test-spec/test-spec-revision-service.js +519 -0
  58. package/dist-server/service/test-spec/test-spec-revision-service.js.map +1 -0
  59. package/dist-server/service/test-spec/test-spec-revision.d.ts +82 -0
  60. package/dist-server/service/test-spec/test-spec-revision.js +329 -0
  61. package/dist-server/service/test-spec/test-spec-revision.js.map +1 -0
  62. package/dist-server/service/test-spec/test-specification.d.ts +4 -0
  63. package/dist-server/service/test-spec/test-specification.js +11 -2
  64. package/dist-server/service/test-spec/test-specification.js.map +1 -1
  65. package/dist-server/tsconfig.tsbuildinfo +1 -1
  66. package/package.json +9 -6
@@ -0,0 +1,82 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ import type { TestSpecification } from './test-specification';
4
+ import { MasterChangePolicy } from '../master-change-policy';
5
+ import type { TestSpecificationCriterion } from '@operato/ops-contract';
6
+ /** Content and the proposed effective date freeze together. Worklist owns the decision. */
7
+ export declare class TestSpecificationRevision {
8
+ policy: MasterChangePolicy;
9
+ policyId: string;
10
+ id: string;
11
+ domain: Domain;
12
+ domainId: string;
13
+ spec: TestSpecification;
14
+ specId: string;
15
+ baseRevision: TestSpecificationRevision | null;
16
+ baseRevisionId: string | null;
17
+ baseGeneration: number;
18
+ editGeneration: number;
19
+ version: string;
20
+ description: string | null;
21
+ criteria: TestSpecificationCriterion[];
22
+ effectiveFrom: Date;
23
+ reason: string;
24
+ creator: User;
25
+ creatorId: string;
26
+ createdAt: Date;
27
+ frozenAt: Date | null;
28
+ contentHash: string | null;
29
+ /** Opaque product decision ID: the common master module does not depend on worklist. */
30
+ activityInstanceId: string | null;
31
+ }
32
+ /** An append-only generation of the complete schedule for one specification. */
33
+ export declare class TestSpecificationPlan {
34
+ policy: MasterChangePolicy;
35
+ policyId: string;
36
+ publishedRevision: TestSpecificationRevision;
37
+ publishedRevisionId: string;
38
+ releaseKind: 'approved' | 'policy';
39
+ publisher: User;
40
+ publisherId: string;
41
+ id: string;
42
+ domain: Domain;
43
+ domainId: string;
44
+ spec: TestSpecification;
45
+ specId: string;
46
+ generation: number;
47
+ recordedAt: Date;
48
+ activityInstanceId: string | null;
49
+ approver: User;
50
+ approverId: string;
51
+ submissionHash: string;
52
+ }
53
+ export declare class TestSpecificationSegment {
54
+ id: string;
55
+ domain: Domain;
56
+ domainId: string;
57
+ spec: TestSpecification;
58
+ specId: string;
59
+ plan: TestSpecificationPlan;
60
+ planId: string;
61
+ revision: TestSpecificationRevision;
62
+ revisionId: string;
63
+ validFrom: Date;
64
+ validTo: Date | null;
65
+ }
66
+ /** Permanent evidence of the selected revision, also the retroactivity interlock. */
67
+ export declare class TestSpecificationBasis {
68
+ id: string;
69
+ domain: Domain;
70
+ domainId: string;
71
+ spec: TestSpecification;
72
+ specId: string;
73
+ recordKey: string;
74
+ revision: TestSpecificationRevision;
75
+ revisionId: string;
76
+ plan: TestSpecificationPlan;
77
+ planId: string;
78
+ contentHash: string;
79
+ businessTime: Date;
80
+ resolvedAt: Date;
81
+ }
82
+ export declare const TEST_SPEC_REVISION_ENTITIES: (typeof TestSpecificationRevision | typeof TestSpecificationPlan | typeof TestSpecificationSegment | typeof TestSpecificationBasis)[];
@@ -0,0 +1,329 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TEST_SPEC_REVISION_ENTITIES = exports.TestSpecificationBasis = exports.TestSpecificationSegment = exports.TestSpecificationPlan = exports.TestSpecificationRevision = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const auth_base_1 = require("@things-factory/auth-base");
8
+ const master_change_policy_1 = require("../master-change-policy");
9
+ // Relations own the columns and RelationId exposes read-only identifiers.
10
+ // Where a composite FK is declared, disable only the redundant single-column FK;
11
+ // the database still enforces existence, domain and specification together.
12
+ /** Content and the proposed effective date freeze together. Worklist owns the decision. */
13
+ let TestSpecificationRevision = class TestSpecificationRevision {
14
+ };
15
+ exports.TestSpecificationRevision = TestSpecificationRevision;
16
+ tslib_1.__decorate([
17
+ (0, typeorm_1.ManyToOne)(() => master_change_policy_1.MasterChangePolicy, { nullable: false, createForeignKeyConstraints: false }),
18
+ tslib_1.__metadata("design:type", master_change_policy_1.MasterChangePolicy)
19
+ ], TestSpecificationRevision.prototype, "policy", void 0);
20
+ tslib_1.__decorate([
21
+ (0, typeorm_1.RelationId)((row) => row.policy),
22
+ tslib_1.__metadata("design:type", String)
23
+ ], TestSpecificationRevision.prototype, "policyId", void 0);
24
+ tslib_1.__decorate([
25
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
26
+ tslib_1.__metadata("design:type", String)
27
+ ], TestSpecificationRevision.prototype, "id", void 0);
28
+ tslib_1.__decorate([
29
+ (0, typeorm_1.ManyToOne)(() => shell_1.Domain, { nullable: false }),
30
+ tslib_1.__metadata("design:type", shell_1.Domain)
31
+ ], TestSpecificationRevision.prototype, "domain", void 0);
32
+ tslib_1.__decorate([
33
+ (0, typeorm_1.RelationId)((row) => row.domain),
34
+ tslib_1.__metadata("design:type", String)
35
+ ], TestSpecificationRevision.prototype, "domainId", void 0);
36
+ tslib_1.__decorate([
37
+ (0, typeorm_1.ManyToOne)('TestSpecification', { nullable: false, createForeignKeyConstraints: false }),
38
+ tslib_1.__metadata("design:type", Function)
39
+ ], TestSpecificationRevision.prototype, "spec", void 0);
40
+ tslib_1.__decorate([
41
+ (0, typeorm_1.RelationId)((row) => row.spec),
42
+ tslib_1.__metadata("design:type", String)
43
+ ], TestSpecificationRevision.prototype, "specId", void 0);
44
+ tslib_1.__decorate([
45
+ (0, typeorm_1.ManyToOne)(() => TestSpecificationRevision, { nullable: true, createForeignKeyConstraints: false }),
46
+ tslib_1.__metadata("design:type", TestSpecificationRevision)
47
+ ], TestSpecificationRevision.prototype, "baseRevision", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.RelationId)((row) => row.baseRevision),
50
+ tslib_1.__metadata("design:type", String)
51
+ ], TestSpecificationRevision.prototype, "baseRevisionId", void 0);
52
+ tslib_1.__decorate([
53
+ (0, typeorm_1.Column)('int'),
54
+ tslib_1.__metadata("design:type", Number)
55
+ ], TestSpecificationRevision.prototype, "baseGeneration", void 0);
56
+ tslib_1.__decorate([
57
+ (0, typeorm_1.Column)('int', { default: 0 }),
58
+ tslib_1.__metadata("design:type", Number)
59
+ ], TestSpecificationRevision.prototype, "editGeneration", void 0);
60
+ tslib_1.__decorate([
61
+ (0, typeorm_1.Column)('varchar'),
62
+ tslib_1.__metadata("design:type", String)
63
+ ], TestSpecificationRevision.prototype, "version", void 0);
64
+ tslib_1.__decorate([
65
+ (0, typeorm_1.Column)('text', { nullable: true }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], TestSpecificationRevision.prototype, "description", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.Column)('simple-json'),
70
+ tslib_1.__metadata("design:type", Array)
71
+ ], TestSpecificationRevision.prototype, "criteria", void 0);
72
+ tslib_1.__decorate([
73
+ (0, typeorm_1.Column)({ type: Date }),
74
+ tslib_1.__metadata("design:type", Date)
75
+ ], TestSpecificationRevision.prototype, "effectiveFrom", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.Column)('text'),
78
+ tslib_1.__metadata("design:type", String)
79
+ ], TestSpecificationRevision.prototype, "reason", void 0);
80
+ tslib_1.__decorate([
81
+ (0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: false }),
82
+ tslib_1.__metadata("design:type", auth_base_1.User)
83
+ ], TestSpecificationRevision.prototype, "creator", void 0);
84
+ tslib_1.__decorate([
85
+ (0, typeorm_1.RelationId)((row) => row.creator),
86
+ tslib_1.__metadata("design:type", String)
87
+ ], TestSpecificationRevision.prototype, "creatorId", void 0);
88
+ tslib_1.__decorate([
89
+ (0, typeorm_1.Column)({ type: Date }),
90
+ tslib_1.__metadata("design:type", Date)
91
+ ], TestSpecificationRevision.prototype, "createdAt", void 0);
92
+ tslib_1.__decorate([
93
+ (0, typeorm_1.Column)({ type: Date, nullable: true }),
94
+ tslib_1.__metadata("design:type", Date)
95
+ ], TestSpecificationRevision.prototype, "frozenAt", void 0);
96
+ tslib_1.__decorate([
97
+ (0, typeorm_1.Column)('varchar', { nullable: true }),
98
+ tslib_1.__metadata("design:type", String)
99
+ ], TestSpecificationRevision.prototype, "contentHash", void 0);
100
+ tslib_1.__decorate([
101
+ (0, typeorm_1.Column)('varchar', { nullable: true }),
102
+ tslib_1.__metadata("design:type", String)
103
+ ], TestSpecificationRevision.prototype, "activityInstanceId", void 0);
104
+ exports.TestSpecificationRevision = TestSpecificationRevision = tslib_1.__decorate([
105
+ (0, typeorm_1.Entity)('ops_test_spec_revision'),
106
+ (0, typeorm_1.Index)('ix_test_spec_revision_subject', ['domain', 'spec', 'id'], { unique: true }),
107
+ (0, typeorm_1.Index)('ix_test_spec_revision_list', ['domain', 'spec', 'createdAt']),
108
+ (0, typeorm_1.ForeignKey)(() => master_change_policy_1.MasterChangePolicy, ['domain', 'policy'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
109
+ (0, typeorm_1.ForeignKey)('TestSpecification', ['domain', 'spec'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
110
+ (0, typeorm_1.ForeignKey)('TestSpecificationRevision', ['domain', 'spec', 'baseRevision'], ['domain', 'spec', 'id'], {
111
+ onDelete: 'RESTRICT'
112
+ })
113
+ ], TestSpecificationRevision);
114
+ /** An append-only generation of the complete schedule for one specification. */
115
+ let TestSpecificationPlan = class TestSpecificationPlan {
116
+ };
117
+ exports.TestSpecificationPlan = TestSpecificationPlan;
118
+ tslib_1.__decorate([
119
+ (0, typeorm_1.ManyToOne)(() => master_change_policy_1.MasterChangePolicy, { nullable: false, createForeignKeyConstraints: false }),
120
+ tslib_1.__metadata("design:type", master_change_policy_1.MasterChangePolicy)
121
+ ], TestSpecificationPlan.prototype, "policy", void 0);
122
+ tslib_1.__decorate([
123
+ (0, typeorm_1.RelationId)((row) => row.policy),
124
+ tslib_1.__metadata("design:type", String)
125
+ ], TestSpecificationPlan.prototype, "policyId", void 0);
126
+ tslib_1.__decorate([
127
+ (0, typeorm_1.ManyToOne)(() => TestSpecificationRevision, { nullable: false, createForeignKeyConstraints: false }),
128
+ tslib_1.__metadata("design:type", TestSpecificationRevision)
129
+ ], TestSpecificationPlan.prototype, "publishedRevision", void 0);
130
+ tslib_1.__decorate([
131
+ (0, typeorm_1.RelationId)((row) => row.publishedRevision),
132
+ tslib_1.__metadata("design:type", String)
133
+ ], TestSpecificationPlan.prototype, "publishedRevisionId", void 0);
134
+ tslib_1.__decorate([
135
+ (0, typeorm_1.Column)('varchar'),
136
+ tslib_1.__metadata("design:type", String)
137
+ ], TestSpecificationPlan.prototype, "releaseKind", void 0);
138
+ tslib_1.__decorate([
139
+ (0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: false }),
140
+ tslib_1.__metadata("design:type", auth_base_1.User)
141
+ ], TestSpecificationPlan.prototype, "publisher", void 0);
142
+ tslib_1.__decorate([
143
+ (0, typeorm_1.RelationId)((row) => row.publisher),
144
+ tslib_1.__metadata("design:type", String)
145
+ ], TestSpecificationPlan.prototype, "publisherId", void 0);
146
+ tslib_1.__decorate([
147
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
148
+ tslib_1.__metadata("design:type", String)
149
+ ], TestSpecificationPlan.prototype, "id", void 0);
150
+ tslib_1.__decorate([
151
+ (0, typeorm_1.ManyToOne)(() => shell_1.Domain, { nullable: false }),
152
+ tslib_1.__metadata("design:type", shell_1.Domain)
153
+ ], TestSpecificationPlan.prototype, "domain", void 0);
154
+ tslib_1.__decorate([
155
+ (0, typeorm_1.RelationId)((row) => row.domain),
156
+ tslib_1.__metadata("design:type", String)
157
+ ], TestSpecificationPlan.prototype, "domainId", void 0);
158
+ tslib_1.__decorate([
159
+ (0, typeorm_1.ManyToOne)('TestSpecification', { nullable: false, createForeignKeyConstraints: false }),
160
+ tslib_1.__metadata("design:type", Function)
161
+ ], TestSpecificationPlan.prototype, "spec", void 0);
162
+ tslib_1.__decorate([
163
+ (0, typeorm_1.RelationId)((row) => row.spec),
164
+ tslib_1.__metadata("design:type", String)
165
+ ], TestSpecificationPlan.prototype, "specId", void 0);
166
+ tslib_1.__decorate([
167
+ (0, typeorm_1.Column)('int'),
168
+ tslib_1.__metadata("design:type", Number)
169
+ ], TestSpecificationPlan.prototype, "generation", void 0);
170
+ tslib_1.__decorate([
171
+ (0, typeorm_1.Column)({ type: Date }),
172
+ tslib_1.__metadata("design:type", Date)
173
+ ], TestSpecificationPlan.prototype, "recordedAt", void 0);
174
+ tslib_1.__decorate([
175
+ (0, typeorm_1.Column)('varchar', { nullable: true }),
176
+ tslib_1.__metadata("design:type", String)
177
+ ], TestSpecificationPlan.prototype, "activityInstanceId", void 0);
178
+ tslib_1.__decorate([
179
+ (0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true }),
180
+ tslib_1.__metadata("design:type", auth_base_1.User)
181
+ ], TestSpecificationPlan.prototype, "approver", void 0);
182
+ tslib_1.__decorate([
183
+ (0, typeorm_1.RelationId)((row) => row.approver),
184
+ tslib_1.__metadata("design:type", String)
185
+ ], TestSpecificationPlan.prototype, "approverId", void 0);
186
+ tslib_1.__decorate([
187
+ (0, typeorm_1.Column)('varchar'),
188
+ tslib_1.__metadata("design:type", String)
189
+ ], TestSpecificationPlan.prototype, "submissionHash", void 0);
190
+ exports.TestSpecificationPlan = TestSpecificationPlan = tslib_1.__decorate([
191
+ (0, typeorm_1.Entity)('ops_test_spec_plan'),
192
+ (0, typeorm_1.Index)('ix_test_spec_plan_generation', ['domain', 'spec', 'generation'], { unique: true }),
193
+ (0, typeorm_1.Index)('ix_test_spec_plan_identity', ['domain', 'spec', 'id'], { unique: true }),
194
+ (0, typeorm_1.Index)('ix_test_spec_plan_decision', ['activityInstanceId'], { unique: true }),
195
+ (0, typeorm_1.Index)('ix_test_spec_plan_publication', ['publishedRevision'], { unique: true }),
196
+ (0, typeorm_1.ForeignKey)(() => master_change_policy_1.MasterChangePolicy, ['domain', 'policy'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
197
+ (0, typeorm_1.ForeignKey)(() => TestSpecificationRevision, ['domain', 'spec', 'publishedRevision'], ['domain', 'spec', 'id'], { onDelete: 'RESTRICT' }),
198
+ (0, typeorm_1.ForeignKey)('TestSpecification', ['domain', 'spec'], ['domain', 'id'], { onDelete: 'RESTRICT' })
199
+ ], TestSpecificationPlan);
200
+ let TestSpecificationSegment = class TestSpecificationSegment {
201
+ };
202
+ exports.TestSpecificationSegment = TestSpecificationSegment;
203
+ tslib_1.__decorate([
204
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
205
+ tslib_1.__metadata("design:type", String)
206
+ ], TestSpecificationSegment.prototype, "id", void 0);
207
+ tslib_1.__decorate([
208
+ (0, typeorm_1.ManyToOne)(() => shell_1.Domain, { nullable: false }),
209
+ tslib_1.__metadata("design:type", shell_1.Domain)
210
+ ], TestSpecificationSegment.prototype, "domain", void 0);
211
+ tslib_1.__decorate([
212
+ (0, typeorm_1.RelationId)((row) => row.domain),
213
+ tslib_1.__metadata("design:type", String)
214
+ ], TestSpecificationSegment.prototype, "domainId", void 0);
215
+ tslib_1.__decorate([
216
+ (0, typeorm_1.ManyToOne)('TestSpecification', { nullable: false, createForeignKeyConstraints: false }),
217
+ tslib_1.__metadata("design:type", Function)
218
+ ], TestSpecificationSegment.prototype, "spec", void 0);
219
+ tslib_1.__decorate([
220
+ (0, typeorm_1.RelationId)((row) => row.spec),
221
+ tslib_1.__metadata("design:type", String)
222
+ ], TestSpecificationSegment.prototype, "specId", void 0);
223
+ tslib_1.__decorate([
224
+ (0, typeorm_1.ManyToOne)(() => TestSpecificationPlan, { nullable: false, createForeignKeyConstraints: false }),
225
+ tslib_1.__metadata("design:type", TestSpecificationPlan)
226
+ ], TestSpecificationSegment.prototype, "plan", void 0);
227
+ tslib_1.__decorate([
228
+ (0, typeorm_1.RelationId)((row) => row.plan),
229
+ tslib_1.__metadata("design:type", String)
230
+ ], TestSpecificationSegment.prototype, "planId", void 0);
231
+ tslib_1.__decorate([
232
+ (0, typeorm_1.ManyToOne)(() => TestSpecificationRevision, { nullable: false, createForeignKeyConstraints: false }),
233
+ tslib_1.__metadata("design:type", TestSpecificationRevision)
234
+ ], TestSpecificationSegment.prototype, "revision", void 0);
235
+ tslib_1.__decorate([
236
+ (0, typeorm_1.RelationId)((row) => row.revision),
237
+ tslib_1.__metadata("design:type", String)
238
+ ], TestSpecificationSegment.prototype, "revisionId", void 0);
239
+ tslib_1.__decorate([
240
+ (0, typeorm_1.Column)({ type: Date }),
241
+ tslib_1.__metadata("design:type", Date)
242
+ ], TestSpecificationSegment.prototype, "validFrom", void 0);
243
+ tslib_1.__decorate([
244
+ (0, typeorm_1.Column)({ type: Date, nullable: true }),
245
+ tslib_1.__metadata("design:type", Date)
246
+ ], TestSpecificationSegment.prototype, "validTo", void 0);
247
+ exports.TestSpecificationSegment = TestSpecificationSegment = tslib_1.__decorate([
248
+ (0, typeorm_1.Entity)('ops_test_spec_segment'),
249
+ (0, typeorm_1.Index)('ix_test_spec_segment_lookup', ['domain', 'spec', 'plan', 'validFrom']),
250
+ (0, typeorm_1.ForeignKey)('TestSpecification', ['domain', 'spec'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
251
+ (0, typeorm_1.ForeignKey)(() => TestSpecificationPlan, ['domain', 'spec', 'plan'], ['domain', 'spec', 'id'], { onDelete: 'RESTRICT' }),
252
+ (0, typeorm_1.ForeignKey)(() => TestSpecificationRevision, ['domain', 'spec', 'revision'], ['domain', 'spec', 'id'], {
253
+ onDelete: 'RESTRICT'
254
+ })
255
+ ], TestSpecificationSegment);
256
+ /** Permanent evidence of the selected revision, also the retroactivity interlock. */
257
+ let TestSpecificationBasis = class TestSpecificationBasis {
258
+ };
259
+ exports.TestSpecificationBasis = TestSpecificationBasis;
260
+ tslib_1.__decorate([
261
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
262
+ tslib_1.__metadata("design:type", String)
263
+ ], TestSpecificationBasis.prototype, "id", void 0);
264
+ tslib_1.__decorate([
265
+ (0, typeorm_1.ManyToOne)(() => shell_1.Domain, { nullable: false }),
266
+ tslib_1.__metadata("design:type", shell_1.Domain)
267
+ ], TestSpecificationBasis.prototype, "domain", void 0);
268
+ tslib_1.__decorate([
269
+ (0, typeorm_1.RelationId)((row) => row.domain),
270
+ tslib_1.__metadata("design:type", String)
271
+ ], TestSpecificationBasis.prototype, "domainId", void 0);
272
+ tslib_1.__decorate([
273
+ (0, typeorm_1.ManyToOne)('TestSpecification', { nullable: false, createForeignKeyConstraints: false }),
274
+ tslib_1.__metadata("design:type", Function)
275
+ ], TestSpecificationBasis.prototype, "spec", void 0);
276
+ tslib_1.__decorate([
277
+ (0, typeorm_1.RelationId)((row) => row.spec),
278
+ tslib_1.__metadata("design:type", String)
279
+ ], TestSpecificationBasis.prototype, "specId", void 0);
280
+ tslib_1.__decorate([
281
+ (0, typeorm_1.Column)('varchar'),
282
+ tslib_1.__metadata("design:type", String)
283
+ ], TestSpecificationBasis.prototype, "recordKey", void 0);
284
+ tslib_1.__decorate([
285
+ (0, typeorm_1.ManyToOne)(() => TestSpecificationRevision, { nullable: false, createForeignKeyConstraints: false }),
286
+ tslib_1.__metadata("design:type", TestSpecificationRevision)
287
+ ], TestSpecificationBasis.prototype, "revision", void 0);
288
+ tslib_1.__decorate([
289
+ (0, typeorm_1.RelationId)((row) => row.revision),
290
+ tslib_1.__metadata("design:type", String)
291
+ ], TestSpecificationBasis.prototype, "revisionId", void 0);
292
+ tslib_1.__decorate([
293
+ (0, typeorm_1.ManyToOne)(() => TestSpecificationPlan, { nullable: false, createForeignKeyConstraints: false }),
294
+ tslib_1.__metadata("design:type", TestSpecificationPlan)
295
+ ], TestSpecificationBasis.prototype, "plan", void 0);
296
+ tslib_1.__decorate([
297
+ (0, typeorm_1.RelationId)((row) => row.plan),
298
+ tslib_1.__metadata("design:type", String)
299
+ ], TestSpecificationBasis.prototype, "planId", void 0);
300
+ tslib_1.__decorate([
301
+ (0, typeorm_1.Column)('varchar'),
302
+ tslib_1.__metadata("design:type", String)
303
+ ], TestSpecificationBasis.prototype, "contentHash", void 0);
304
+ tslib_1.__decorate([
305
+ (0, typeorm_1.Column)({ type: Date }),
306
+ tslib_1.__metadata("design:type", Date)
307
+ ], TestSpecificationBasis.prototype, "businessTime", void 0);
308
+ tslib_1.__decorate([
309
+ (0, typeorm_1.Column)({ type: Date }),
310
+ tslib_1.__metadata("design:type", Date)
311
+ ], TestSpecificationBasis.prototype, "resolvedAt", void 0);
312
+ exports.TestSpecificationBasis = TestSpecificationBasis = tslib_1.__decorate([
313
+ (0, typeorm_1.Entity)('ops_test_spec_basis'),
314
+ (0, typeorm_1.Index)('ix_test_spec_basis_identity', ['domain', 'id', 'revision'], { unique: true }),
315
+ (0, typeorm_1.Index)('ix_test_spec_basis_record', ['domain', 'recordKey'], { unique: true }),
316
+ (0, typeorm_1.Index)('ix_test_spec_basis_time', ['domain', 'spec', 'businessTime']),
317
+ (0, typeorm_1.ForeignKey)('TestSpecification', ['domain', 'spec'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
318
+ (0, typeorm_1.ForeignKey)(() => TestSpecificationPlan, ['domain', 'spec', 'plan'], ['domain', 'spec', 'id'], { onDelete: 'RESTRICT' }),
319
+ (0, typeorm_1.ForeignKey)(() => TestSpecificationRevision, ['domain', 'spec', 'revision'], ['domain', 'spec', 'id'], {
320
+ onDelete: 'RESTRICT'
321
+ })
322
+ ], TestSpecificationBasis);
323
+ exports.TEST_SPEC_REVISION_ENTITIES = [
324
+ TestSpecificationRevision,
325
+ TestSpecificationPlan,
326
+ TestSpecificationSegment,
327
+ TestSpecificationBasis
328
+ ];
329
+ //# sourceMappingURL=test-spec-revision.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-spec-revision.js","sourceRoot":"","sources":["../../../server/service/test-spec/test-spec-revision.ts"],"names":[],"mappings":";;;;AAAA,qCAA0G;AAC1G,iDAA8C;AAC9C,yDAAgD;AAEhD,kEAA4D;AAG5D,0EAA0E;AAC1E,iFAAiF;AACjF,4EAA4E;AAE5E,2FAA2F;AASpF,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;CAkCrC,CAAA;AAlCY,8DAAyB;AAEpC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,yCAAkB,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,2BAA2B,EAAE,KAAK,EAAE,CAAC;sCACrF,y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QAAA,2BAA2B,GAAG;IACzC,yBAAyB;IACzB,qBAAqB;IACrB,wBAAwB;IACxB,sBAAsB;CACvB,CAAA","sourcesContent":["import { Column, Entity, ForeignKey, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport type { TestSpecification } from './test-specification'\nimport { MasterChangePolicy } from '../master-change-policy'\nimport type { TestSpecificationCriterion } from '@operato/ops-contract'\n\n// Relations own the columns and RelationId exposes read-only identifiers.\n// Where a composite FK is declared, disable only the redundant single-column FK;\n// the database still enforces existence, domain and specification together.\n\n/** Content and the proposed effective date freeze together. Worklist owns the decision. */\n@Entity('ops_test_spec_revision')\n@Index('ix_test_spec_revision_subject', ['domain', 'spec', 'id'], { unique: true })\n@Index('ix_test_spec_revision_list', ['domain', 'spec', 'createdAt'])\n@ForeignKey(() => MasterChangePolicy, ['domain', 'policy'], ['domain', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey('TestSpecification', ['domain', 'spec'], ['domain', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey('TestSpecificationRevision', ['domain', 'spec', 'baseRevision'], ['domain', 'spec', 'id'], {\n onDelete: 'RESTRICT'\n})\nexport class TestSpecificationRevision {\n @ManyToOne(() => MasterChangePolicy, { nullable: false, createForeignKeyConstraints: false })\n policy: MasterChangePolicy\n @RelationId((row: TestSpecificationRevision) => row.policy)\n policyId: string\n @PrimaryGeneratedColumn('uuid') id: string\n @ManyToOne(() => Domain, { nullable: false })\n domain: Domain\n @RelationId((row: TestSpecificationRevision) => row.domain)\n domainId: string\n @ManyToOne('TestSpecification', { nullable: false, createForeignKeyConstraints: false })\n spec: TestSpecification\n @RelationId((row: TestSpecificationRevision) => row.spec)\n specId: string\n @ManyToOne(() => TestSpecificationRevision, { nullable: true, createForeignKeyConstraints: false })\n baseRevision: TestSpecificationRevision | null\n @RelationId((row: TestSpecificationRevision) => row.baseRevision)\n baseRevisionId: string | null\n @Column('int') baseGeneration: number\n @Column('int', { default: 0 }) editGeneration: number\n @Column('varchar') version: string\n @Column('text', { nullable: true }) description: string | null\n @Column('simple-json') criteria: TestSpecificationCriterion[]\n @Column({ type: Date }) effectiveFrom: Date\n @Column('text') reason: string\n @ManyToOne(() => User, { nullable: false })\n creator: User\n @RelationId((row: TestSpecificationRevision) => row.creator)\n creatorId: string\n @Column({ type: Date }) createdAt: Date\n @Column({ type: Date, nullable: true }) frozenAt: Date | null\n @Column('varchar', { nullable: true }) contentHash: string | null\n /** Opaque product decision ID: the common master module does not depend on worklist. */\n @Column('varchar', { nullable: true }) activityInstanceId: string | null\n}\n\n/** An append-only generation of the complete schedule for one specification. */\n@Entity('ops_test_spec_plan')\n@Index('ix_test_spec_plan_generation', ['domain', 'spec', 'generation'], { unique: true })\n@Index('ix_test_spec_plan_identity', ['domain', 'spec', 'id'], { unique: true })\n@Index('ix_test_spec_plan_decision', ['activityInstanceId'], { unique: true })\n@Index('ix_test_spec_plan_publication', ['publishedRevision'], { unique: true })\n@ForeignKey(() => MasterChangePolicy, ['domain', 'policy'], ['domain', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey(() => TestSpecificationRevision, ['domain', 'spec', 'publishedRevision'], ['domain', 'spec', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey('TestSpecification', ['domain', 'spec'], ['domain', 'id'], { onDelete: 'RESTRICT' })\nexport class TestSpecificationPlan {\n @ManyToOne(() => MasterChangePolicy, { nullable: false, createForeignKeyConstraints: false })\n policy: MasterChangePolicy\n @RelationId((row: TestSpecificationPlan) => row.policy)\n policyId: string\n @ManyToOne(() => TestSpecificationRevision, { nullable: false, createForeignKeyConstraints: false })\n publishedRevision: TestSpecificationRevision\n @RelationId((row: TestSpecificationPlan) => row.publishedRevision)\n publishedRevisionId: string\n @Column('varchar') releaseKind: 'approved' | 'policy'\n @ManyToOne(() => User, { nullable: false }) publisher: User\n @RelationId((row: TestSpecificationPlan) => row.publisher) publisherId: string\n @PrimaryGeneratedColumn('uuid') id: string\n @ManyToOne(() => Domain, { nullable: false })\n domain: Domain\n @RelationId((row: TestSpecificationPlan) => row.domain)\n domainId: string\n @ManyToOne('TestSpecification', { nullable: false, createForeignKeyConstraints: false })\n spec: TestSpecification\n @RelationId((row: TestSpecificationPlan) => row.spec)\n specId: string\n @Column('int') generation: number\n @Column({ type: Date }) recordedAt: Date\n @Column('varchar', { nullable: true }) activityInstanceId: string | null\n @ManyToOne(() => User, { nullable: true })\n approver: User\n @RelationId((row: TestSpecificationPlan) => row.approver)\n approverId: string\n @Column('varchar') submissionHash: string\n}\n\n@Entity('ops_test_spec_segment')\n@Index('ix_test_spec_segment_lookup', ['domain', 'spec', 'plan', 'validFrom'])\n@ForeignKey('TestSpecification', ['domain', 'spec'], ['domain', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey(() => TestSpecificationPlan, ['domain', 'spec', 'plan'], ['domain', 'spec', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey(() => TestSpecificationRevision, ['domain', 'spec', 'revision'], ['domain', 'spec', 'id'], {\n onDelete: 'RESTRICT'\n})\nexport class TestSpecificationSegment {\n @PrimaryGeneratedColumn('uuid') id: string\n @ManyToOne(() => Domain, { nullable: false })\n domain: Domain\n @RelationId((row: TestSpecificationSegment) => row.domain)\n domainId: string\n @ManyToOne('TestSpecification', { nullable: false, createForeignKeyConstraints: false })\n spec: TestSpecification\n @RelationId((row: TestSpecificationSegment) => row.spec)\n specId: string\n @ManyToOne(() => TestSpecificationPlan, { nullable: false, createForeignKeyConstraints: false })\n plan: TestSpecificationPlan\n @RelationId((row: TestSpecificationSegment) => row.plan)\n planId: string\n @ManyToOne(() => TestSpecificationRevision, { nullable: false, createForeignKeyConstraints: false })\n revision: TestSpecificationRevision\n @RelationId((row: TestSpecificationSegment) => row.revision)\n revisionId: string\n @Column({ type: Date }) validFrom: Date\n @Column({ type: Date, nullable: true }) validTo: Date | null\n}\n\n/** Permanent evidence of the selected revision, also the retroactivity interlock. */\n@Entity('ops_test_spec_basis')\n@Index('ix_test_spec_basis_identity', ['domain', 'id', 'revision'], { unique: true })\n@Index('ix_test_spec_basis_record', ['domain', 'recordKey'], { unique: true })\n@Index('ix_test_spec_basis_time', ['domain', 'spec', 'businessTime'])\n@ForeignKey('TestSpecification', ['domain', 'spec'], ['domain', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey(() => TestSpecificationPlan, ['domain', 'spec', 'plan'], ['domain', 'spec', 'id'], { onDelete: 'RESTRICT' })\n@ForeignKey(() => TestSpecificationRevision, ['domain', 'spec', 'revision'], ['domain', 'spec', 'id'], {\n onDelete: 'RESTRICT'\n})\nexport class TestSpecificationBasis {\n @PrimaryGeneratedColumn('uuid') id: string\n @ManyToOne(() => Domain, { nullable: false })\n domain: Domain\n @RelationId((row: TestSpecificationBasis) => row.domain)\n domainId: string\n @ManyToOne('TestSpecification', { nullable: false, createForeignKeyConstraints: false })\n spec: TestSpecification\n @RelationId((row: TestSpecificationBasis) => row.spec)\n specId: string\n @Column('varchar') recordKey: string\n @ManyToOne(() => TestSpecificationRevision, { nullable: false, createForeignKeyConstraints: false })\n revision: TestSpecificationRevision\n @RelationId((row: TestSpecificationBasis) => row.revision)\n revisionId: string\n @ManyToOne(() => TestSpecificationPlan, { nullable: false, createForeignKeyConstraints: false })\n plan: TestSpecificationPlan\n @RelationId((row: TestSpecificationBasis) => row.plan)\n planId: string\n @Column('varchar') contentHash: string\n @Column({ type: Date }) businessTime: Date\n @Column({ type: Date }) resolvedAt: Date\n}\n\nexport const TEST_SPEC_REVISION_ENTITIES = [\n TestSpecificationRevision,\n TestSpecificationPlan,\n TestSpecificationSegment,\n TestSpecificationBasis\n]\n"]}
@@ -13,6 +13,10 @@ export declare class TestSpecification {
13
13
  readonly id: string;
14
14
  domain?: Domain;
15
15
  domainId?: string;
16
+ /** Changes only when an approved schedule is published. */
17
+ planGeneration: number;
18
+ /** Serializes publication and basis capture without making reads a new schedule. */
19
+ revisionLock: number;
16
20
  /** 표준 `ID` — 자원이 이 값을 가리킨다. */
17
21
  name: string;
18
22
  description?: string;
@@ -24,7 +24,7 @@ tslib_1.__decorate([
24
24
  tslib_1.__metadata("design:type", String)
25
25
  ], TestSpecification.prototype, "id", void 0);
26
26
  tslib_1.__decorate([
27
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
27
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain, { nullable: false }),
28
28
  (0, type_graphql_1.Field)(type => shell_1.Domain),
29
29
  tslib_1.__metadata("design:type", shell_1.Domain)
30
30
  ], TestSpecification.prototype, "domain", void 0);
@@ -32,6 +32,14 @@ tslib_1.__decorate([
32
32
  (0, typeorm_1.RelationId)((spec) => spec.domain),
33
33
  tslib_1.__metadata("design:type", String)
34
34
  ], TestSpecification.prototype, "domainId", void 0);
35
+ tslib_1.__decorate([
36
+ (0, typeorm_1.Column)('int', { default: 0 }),
37
+ tslib_1.__metadata("design:type", Number)
38
+ ], TestSpecification.prototype, "planGeneration", void 0);
39
+ tslib_1.__decorate([
40
+ (0, typeorm_1.Column)('int', { default: 0 }),
41
+ tslib_1.__metadata("design:type", Number)
42
+ ], TestSpecification.prototype, "revisionLock", void 0);
35
43
  tslib_1.__decorate([
36
44
  (0, typeorm_1.Column)(),
37
45
  (0, type_graphql_1.Field)(),
@@ -98,9 +106,10 @@ tslib_1.__decorate([
98
106
  ], TestSpecification.prototype, "updaterId", void 0);
99
107
  exports.TestSpecification = TestSpecification = tslib_1.__decorate([
100
108
  (0, typeorm_1.Entity)({ name: 'ops_test_specification' }),
101
- (0, typeorm_1.Index)('ix_ops_test_specification_0', (spec) => [spec.domain, spec.name, spec.version], {
109
+ (0, typeorm_1.Index)('ix_ops_test_specification_0', (spec) => [spec.domain, spec.name], {
102
110
  unique: true
103
111
  }),
112
+ (0, typeorm_1.Index)('ix_ops_test_specification_identity', (spec) => [spec.domain, spec.id], { unique: true }),
104
113
  (0, type_graphql_1.ObjectType)({ description: 'ISA-95 TestSpecification — what a qualification is verified against' })
105
114
  ], TestSpecification);
106
115
  //# sourceMappingURL=test-specification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"test-specification.js","sourceRoot":"","sources":["../../../server/service/test-spec/test-specification.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAoD;AAEpD,iDAA4D;AAC5D,yDAAgD;AAEhD;;;;;;;;GAQG;AAMI,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAsE7B,CAAA;AAtEY,8CAAiB;AAGnB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;6CACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;iDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,IAAuB,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;mDACpC;AAKjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;+CACI;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACN;AAKpB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACV;AAShB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC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,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC;IAC1C,IAAA,eAAK,EAAC,6BAA6B,EAAE,CAAC,IAAuB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;QACzG,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qEAAqE,EAAE,CAAC;GACtF,iBAAiB,CAsE7B","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, ScalarObject } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n/**\n * `TestSpecification` — **ISA-95 표준 명세**.\n *\n * 자원의 `testSpecificationIds` 가 가리키는 대상이다. 「무엇으로 검증하는가」를 이름으로 답하고,\n * 기준(`criteria`)을 적으면 「판단에 근거가 있는가」까지 물을 수 있다.\n *\n * 버전을 갖는 이유는 같은 명세의 버전이 바뀌면 자격의 뜻도 바뀌기 때문이다 — 어느 버전으로 검증했는지가\n * 남아야 한다.\n */\n@Entity({ name: 'ops_test_specification' })\n@Index('ix_ops_test_specification_0', (spec: TestSpecification) => [spec.domain, spec.name, spec.version], {\n unique: true\n})\n@ObjectType({ description: 'ISA-95 TestSpecification — what a qualification is verified against' })\nexport class TestSpecification {\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((spec: TestSpecification) => spec.domain)\n domainId?: string\n\n /** 표준 `ID` — 자원이 이 값을 가리킨다. */\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n /** 표준 `Version`. 버전이 바뀌면 자격의 뜻이 바뀐다. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n version?: string\n\n /**\n * 판단 기준들 — 표준 `TestSpecificationCriteria`.\n *\n * 한계값에는 단위가 함께 있어야 한다. 섭씨 한계에 화씨 관측을 비교하면 오류보고없이 틀린 답이 나온다.\n */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => ScalarObject, { nullable: true, description: 'TestSpecificationCriterion[]' })\n criteria?: 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((spec: TestSpecification) => spec.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((spec: TestSpecification) => spec.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"test-specification.js","sourceRoot":"","sources":["../../../server/service/test-spec/test-specification.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAoD;AAEpD,iDAA4D;AAC5D,yDAAgD;AAEhD;;;;;;;;GAQG;AAOI,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CA8E7B,CAAA;AA9EY,8CAAiB;AAGnB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;6CACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,C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AoC,EAAE,CAAC,IAAuB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qEAAqE,EAAE,CAAC;GACtF,iBAAiB,CA8E7B","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, ScalarObject } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n/**\n * `TestSpecification` — **ISA-95 표준 명세**.\n *\n * 자원의 `testSpecificationIds` 가 가리키는 대상이다. 「무엇으로 검증하는가」를 이름으로 답하고,\n * 기준(`criteria`)을 적으면 「판단에 근거가 있는가」까지 물을 수 있다.\n *\n * 버전을 갖는 이유는 같은 명세의 버전이 바뀌면 자격의 뜻도 바뀌기 때문이다 — 어느 버전으로 검증했는지가\n * 남아야 한다.\n */\n@Entity({ name: 'ops_test_specification' })\n@Index('ix_ops_test_specification_0', (spec: TestSpecification) => [spec.domain, spec.name], {\n unique: true\n})\n@Index('ix_ops_test_specification_identity', (spec: TestSpecification) => [spec.domain, spec.id], { unique: true })\n@ObjectType({ description: 'ISA-95 TestSpecification — what a qualification is verified against' })\nexport class TestSpecification {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain, { nullable: false })\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((spec: TestSpecification) => spec.domain)\n domainId?: string\n\n /** Changes only when an approved schedule is published. */\n @Column('int', { default: 0 })\n planGeneration: number\n\n /** Serializes publication and basis capture without making reads a new schedule. */\n @Column('int', { default: 0 })\n revisionLock: number\n\n /** 표준 `ID` — 자원이 이 값을 가리킨다. */\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n /** 표준 `Version`. 버전이 바뀌면 자격의 뜻이 바뀐다. */\n @Column({ nullable: true })\n @Field({ nullable: true })\n version?: string\n\n /**\n * 판단 기준들 — 표준 `TestSpecificationCriteria`.\n *\n * 한계값에는 단위가 함께 있어야 한다. 섭씨 한계에 화씨 관측을 비교하면 오류보고없이 틀린 답이 나온다.\n */\n @Column({ type: 'simple-json', nullable: true })\n @Field(type => ScalarObject, { nullable: true, description: 'TestSpecificationCriterion[]' })\n criteria?: 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((spec: TestSpecification) => spec.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((spec: TestSpecification) => spec.updater)\n updaterId?: string\n}\n"]}