@things-factory/worklist 10.1.5 → 10.1.7
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/dist-client/components/activity-approval-ribon.js +17 -2
- package/dist-client/components/activity-approval-ribon.js.map +1 -1
- package/dist-client/components/activity-instance-preview.js +5 -4
- package/dist-client/components/activity-instance-preview.js.map +1 -1
- package/dist-client/components/activity-starter-form.js +14 -10
- package/dist-client/components/activity-starter-form.js.map +1 -1
- package/dist-client/components/activity-thread-timeline.d.ts +2 -2
- package/dist-client/components/decision-slots.d.ts +118 -0
- package/dist-client/components/decision-slots.js +125 -0
- package/dist-client/components/decision-slots.js.map +1 -0
- package/dist-client/components/mutation-outcome.d.ts +57 -0
- package/dist-client/components/mutation-outcome.js +78 -0
- package/dist-client/components/mutation-outcome.js.map +1 -0
- package/dist-client/components/say-outcome.d.ts +25 -0
- package/dist-client/components/say-outcome.js +51 -0
- package/dist-client/components/say-outcome.js.map +1 -0
- package/dist-client/pages/activity/activity-list-page.js +28 -12
- package/dist-client/pages/activity/activity-list-page.js.map +1 -1
- package/dist-client/pages/activity/activity-model-item-list.js +4 -3
- package/dist-client/pages/activity/activity-model-item-list.js.map +1 -1
- package/dist-client/pages/activity/activity-page.d.ts +2 -2
- package/dist-client/pages/activity/activity-page.js +25 -21
- package/dist-client/pages/activity/activity-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-importer.js +4 -3
- package/dist-client/pages/activity-approval/activity-approval-importer.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-list-page.js +8 -9
- package/dist-client/pages/activity-approval/activity-approval-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +75 -1
- package/dist-client/pages/activity-approval/activity-approval-page.js +487 -57
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-catalog/activity-catalog-page.d.ts +11 -0
- package/dist-client/pages/activity-catalog/activity-catalog-page.js +48 -1
- package/dist-client/pages/activity-catalog/activity-catalog-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-start-page.js +24 -18
- package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.js +1 -0
- package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -1
- package/dist-client/pages/activity-stats/activity-stats-importer.js +4 -3
- package/dist-client/pages/activity-stats/activity-stats-importer.js.map +1 -1
- package/dist-client/pages/activity-stats/activity-stats-list-page.js +8 -9
- package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-importer.js +4 -3
- package/dist-client/pages/activity-template/activity-template-importer.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-list-page.js +8 -9
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-model-item-list.js +4 -3
- package/dist-client/pages/activity-template/activity-template-model-item-list.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-importer.js +4 -3
- package/dist-client/pages/activity-thread/activity-thread-importer.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-list-page.js +8 -9
- package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.js +22 -20
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.js +1 -0
- package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view.d.ts +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +27 -0
- package/dist-client/pages/installable-activity/installable-activity-list-page.js +70 -11
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
- package/dist-client/pages/todo/draft-list-page.js +1 -0
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/activity-approval/approval-line.d.ts +32 -0
- package/dist-server/controllers/activity-approval/approval-line.js +35 -0
- package/dist-server/controllers/activity-approval/approval-line.js.map +1 -1
- package/dist-server/controllers/activity-approval/approve.js +17 -0
- package/dist-server/controllers/activity-approval/approve.js.map +1 -1
- package/dist-server/controllers/activity-approval/reject.js +21 -1
- package/dist-server/controllers/activity-approval/reject.js.map +1 -1
- package/dist-server/controllers/activity-installation/activity-installation-controller.js +5 -9
- package/dist-server/controllers/activity-installation/activity-installation-controller.js.map +1 -1
- package/dist-server/controllers/activity-installation/installable-to-activity.d.ts +62 -0
- package/dist-server/controllers/activity-installation/installable-to-activity.js +53 -0
- package/dist-server/controllers/activity-installation/installable-to-activity.js.map +1 -0
- package/dist-server/controllers/activity-installation/registry-conflict.d.ts +32 -0
- package/dist-server/controllers/activity-installation/registry-conflict.js +21 -0
- package/dist-server/controllers/activity-installation/registry-conflict.js.map +1 -0
- package/dist-server/controllers/activity-instance/draft.js +3 -0
- package/dist-server/controllers/activity-instance/draft.js.map +1 -1
- package/dist-server/controllers/activity-instance/entitlement.d.ts +25 -0
- package/dist-server/controllers/activity-instance/entitlement.js +108 -0
- package/dist-server/controllers/activity-instance/entitlement.js.map +1 -0
- package/dist-server/controllers/activity-instance/issue.js +10 -0
- package/dist-server/controllers/activity-instance/issue.js.map +1 -1
- package/dist-server/controllers/activity-instance/pick.js +8 -0
- package/dist-server/controllers/activity-instance/pick.js.map +1 -1
- package/dist-server/service/activity/activity-decision-key-item-type.d.ts +160 -0
- package/dist-server/service/activity/activity-decision-key-item-type.js +176 -0
- package/dist-server/service/activity/activity-decision-key-item-type.js.map +1 -0
- package/dist-server/service/activity/activity-type.d.ts +3 -0
- package/dist-server/service/activity/activity-type.js +8 -0
- package/dist-server/service/activity/activity-type.js.map +1 -1
- package/dist-server/service/activity/activity.d.ts +30 -0
- package/dist-server/service/activity/activity.js +14 -0
- package/dist-server/service/activity/activity.js.map +1 -1
- package/dist-server/service/activity/decision-key-declaration.d.ts +33 -0
- package/dist-server/service/activity/decision-key-declaration.js +67 -0
- package/dist-server/service/activity/decision-key-declaration.js.map +1 -0
- package/dist-server/service/activity/{credential-guard-subscriber.d.ts → declaration-guard-subscriber.d.ts} +6 -1
- package/dist-server/service/activity/declaration-guard-subscriber.js +46 -0
- package/dist-server/service/activity/declaration-guard-subscriber.js.map +1 -0
- package/dist-server/service/activity/index.d.ts +2 -2
- package/dist-server/service/activity/index.js +2 -2
- package/dist-server/service/activity/index.js.map +1 -1
- package/dist-server/service/activity/search-key-declaration.d.ts +38 -0
- package/dist-server/service/activity/search-key-declaration.js +49 -0
- package/dist-server/service/activity/search-key-declaration.js.map +1 -0
- package/dist-server/service/activity-instance/activity-instance-mutation.js +20 -9
- package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-query.js +25 -2
- package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
- package/dist-server/service/index.d.ts +2 -2
- package/dist-server/service/installable-activity/installable-activity-mutation.js +24 -0
- package/dist-server/service/installable-activity/installable-activity-mutation.js.map +1 -1
- package/dist-server/service/installable-activity/installable-activity.d.ts +9 -0
- package/dist-server/service/installable-activity/installable-activity.js +5 -0
- package/dist-server/service/installable-activity/installable-activity.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/translations/en.json +33 -6
- package/translations/ja.json +27 -0
- package/translations/ko.json +33 -6
- package/translations/ms.json +27 -0
- package/translations/zh.json +27 -0
- package/dist-server/service/activity/credential-guard-subscriber.js +0 -35
- package/dist-server/service/activity/credential-guard-subscriber.js.map +0 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActivityDecisionKeyItem = exports.ActivityDecisionRole = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
/**
|
|
7
|
+
* The part an input value plays on the approval screen.
|
|
8
|
+
*
|
|
9
|
+
* ── The shape of the set: three tenses, and five others ───────────────────
|
|
10
|
+
* Three of the eight say something about the subject at a point in time, and the other five do not:
|
|
11
|
+
*
|
|
12
|
+
* past evidence what the decision was made from (may repeat)
|
|
13
|
+
* present currentState how things stand right now
|
|
14
|
+
* future consequence what approving would change (may repeat)
|
|
15
|
+
*
|
|
16
|
+
* subject what this is about
|
|
17
|
+
* reason what a person wrote
|
|
18
|
+
* policy why it came up for approval at all
|
|
19
|
+
* headline one sentence built from the values
|
|
20
|
+
* reversibility whether approving can be undone
|
|
21
|
+
*
|
|
22
|
+
* Every mis-slotting found so far was the same mistake in that column: currentState under
|
|
23
|
+
* consequence read the present as the future, and evidence under currentState read the past as the
|
|
24
|
+
* present. So when a ninth role is asked for, the first question is whether the value is the
|
|
25
|
+
* subject's past, present or future — if it is, one of those three already holds it. If it is not,
|
|
26
|
+
* whoever asks should be able to say what it is instead. (2026-09-10, architect's ruling)
|
|
27
|
+
*
|
|
28
|
+
* ── Why the keys and the values are spelled the same ──────────────────────
|
|
29
|
+
* type-graphql publishes an enum by its **keys** when the field names the enum type, and by its
|
|
30
|
+
* **values** when the field leaves the type off. One word in a @Field decorator therefore decides
|
|
31
|
+
* what a client receives, and a schema-improving edit far away can flip it. That has already cost
|
|
32
|
+
* this repository twice: ApprovalLineItem.participation arrives as `Reference` and was compared
|
|
33
|
+
* against `reference`, false every time; the catalog page read `NotWorklist` where its selector,
|
|
34
|
+
* i18n key and stage list all said `notworklist`.
|
|
35
|
+
*
|
|
36
|
+
* Writing each key as its own value takes the choice away — either spelling produces the same
|
|
37
|
+
* string. ActivityModelItemInoutType and ActivityModelItemType are written the same way.
|
|
38
|
+
*
|
|
39
|
+
* ── The set is closed, and widening it is the architect's call ────────────
|
|
40
|
+
* Left open as a free string, a convention becomes suffix-appending: every lane invents its own
|
|
41
|
+
* word for the same slot and the screen ends up switching on a dozen spellings, printing the
|
|
42
|
+
* unmatched ones. Adding a role here is an architecture decision, not a lane's. (2026-09-09,
|
|
43
|
+
* architect's ruling)
|
|
44
|
+
*/
|
|
45
|
+
var ActivityDecisionRole;
|
|
46
|
+
(function (ActivityDecisionRole) {
|
|
47
|
+
/** One sentence built from the values: 「폐기 30 EA」, 「3에서 1로 올림」. */
|
|
48
|
+
ActivityDecisionRole["headline"] = "headline";
|
|
49
|
+
/** What the decision is about — one identifier. */
|
|
50
|
+
ActivityDecisionRole["subject"] = "subject";
|
|
51
|
+
/** What the person who raised it wrote. Absent, the screen says so rather than leaving a gap. */
|
|
52
|
+
ActivityDecisionRole["reason"] = "reason";
|
|
53
|
+
/**
|
|
54
|
+
* What changes on approval: 「주문 넷이 뒤로 밀린다」. The only role that may appear more than once.
|
|
55
|
+
*
|
|
56
|
+
* Named consequence rather than effect because TwinCommand.effect already means the opposite in
|
|
57
|
+
* time: { status, at, seen }, what the source reported back after the command was dispatched.
|
|
58
|
+
* That one is an observation and past; this one is a prediction and future. Using a real term for
|
|
59
|
+
* the wrong meaning is worse than coining one, and plant already writes .consequence for exactly
|
|
60
|
+
* this sense in its stop-reason dialog. (2026-09-10, architect's ruling)
|
|
61
|
+
*/
|
|
62
|
+
ActivityDecisionRole["consequence"] = "consequence";
|
|
63
|
+
/** Why this came up for approval at all: 「폐기는 100 이상이면 결재」. */
|
|
64
|
+
ActivityDecisionRole["policy"] = "policy";
|
|
65
|
+
/**
|
|
66
|
+
* What is measured to be true right now — about the world, not about the request.
|
|
67
|
+
*
|
|
68
|
+
* The other roles all describe what is being asked for. This one does not, and putting it under
|
|
69
|
+
* consequence made the screen say the opposite of the truth: the twin's current readings would
|
|
70
|
+
* have read as things the approval causes.
|
|
71
|
+
*
|
|
72
|
+
* Not named observed: ops-contract already has observedBy for which observation backs a declared
|
|
73
|
+
* property, and TwinCommand.effect is an observation too, so observed would sit in the most
|
|
74
|
+
* confusable spot between them. (2026-09-10, architect's ruling) plant never needed it because the subject's present state
|
|
75
|
+
* went into the headline (「폐기 30 EA」); the twin's instruction and its current state are two
|
|
76
|
+
* separate things, and holding them side by side is what this screen is for.
|
|
77
|
+
*/
|
|
78
|
+
ActivityDecisionRole["currentState"] = "currentState";
|
|
79
|
+
/**
|
|
80
|
+
* Whether approving can be undone. Drawn in the frame rather than in the body.
|
|
81
|
+
*
|
|
82
|
+
* Not a separate role for want of a place — it fits consequence well enough — but for want of
|
|
83
|
+
* weight. Listed among the consequences it reads with the same force as "four orders get pushed
|
|
84
|
+
* back", and on
|
|
85
|
+
* the twin actuation, where approving moves equipment, it is the heaviest line on the screen.
|
|
86
|
+
*
|
|
87
|
+
* ── Not the same as rejectionIsFinal ──────────────────────────────────
|
|
88
|
+
* Two "cannot be undone" facts attach to opposite actions, and the twin actuation carries both,
|
|
89
|
+
* which is what makes them look like one:
|
|
90
|
+
*
|
|
91
|
+
* reversibility whether **approving** can be undone (this role, read from the input)
|
|
92
|
+
* rejectionIsFinal whether **rejecting** ends the case (a column on Activity)
|
|
93
|
+
*
|
|
94
|
+
* Merging them in a screen sentence tells the reader that rejection can be taken back.
|
|
95
|
+
*/
|
|
96
|
+
ActivityDecisionRole["reversibility"] = "reversibility";
|
|
97
|
+
/**
|
|
98
|
+
* What the decision was made from — which inspection, against which spec, decided when.
|
|
99
|
+
*
|
|
100
|
+
* Neither consequence nor currentState: consequence is the opposite direction in time, and under
|
|
101
|
+
* currentState a past finding reads as the present state of the subject. plant's disposition
|
|
102
|
+
* approval kept its own screen for exactly these three values, and it survived the comparison not
|
|
103
|
+
* because a slot could not hold them but because no slot existed — those are different reasons,
|
|
104
|
+
* and only the second one means the set is short.
|
|
105
|
+
*
|
|
106
|
+
* plant's case for it: someone approving a concession in a regulated plant who cannot see which
|
|
107
|
+
* inspection produced the finding is approving without grounds.
|
|
108
|
+
*
|
|
109
|
+
* Repeats, because grounds come in several — there were three.
|
|
110
|
+
*/
|
|
111
|
+
ActivityDecisionRole["evidence"] = "evidence";
|
|
112
|
+
})(ActivityDecisionRole || (exports.ActivityDecisionRole = ActivityDecisionRole = {}));
|
|
113
|
+
(0, type_graphql_1.registerEnumType)(ActivityDecisionRole, {
|
|
114
|
+
name: 'ActivityDecisionRole',
|
|
115
|
+
description: 'the part an input value plays on the approval screen'
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* One value the approver reads, and the part it plays.
|
|
119
|
+
*
|
|
120
|
+
* ── Why this points at input rather than at a model item ──────────────────
|
|
121
|
+
* inputPath names a value inside the instance's input and does not go through the activity's model.
|
|
122
|
+
* That is the whole reason it is a separate array: the values an approver most needs are computed by
|
|
123
|
+
* the registering module and put on the input, not declared as model items — plant's `policy` and
|
|
124
|
+
* its `shift.passes` / `shift.passedBy` are exactly that. A role hung on a model item could not
|
|
125
|
+
* reach them.
|
|
126
|
+
*
|
|
127
|
+
* ── inputPath, not inputKey ───────────────────────────────────────────────
|
|
128
|
+
* ActivitySearchKeyItem.inputKey names one top-level key, because its value goes into a searchable
|
|
129
|
+
* column and a path into a list is not something that can be indexed. This field takes a path,
|
|
130
|
+
* because it points at a value to draw. The two do different work, so they carry different names —
|
|
131
|
+
* one word with two meanings would make the wrong one silent, and a name that does not exist is
|
|
132
|
+
* read as a mistake instead. (2026-09-09, architect's ruling)
|
|
133
|
+
*
|
|
134
|
+
* 'policy' → input.policy
|
|
135
|
+
* 'shift.passes' → input.shift.passes
|
|
136
|
+
*
|
|
137
|
+
* Dots only. No array index — drawing a list is the slot's job, not the path's — and no wildcard. A
|
|
138
|
+
* path that leads nowhere resolves to undefined and is not folded into an empty value: a `reason`
|
|
139
|
+
* that is missing and a `reason` someone left blank are different facts, and the screen draws them
|
|
140
|
+
* differently.
|
|
141
|
+
*
|
|
142
|
+
* The two declarations also address different readers. model declares the boxes a performer fills;
|
|
143
|
+
* this declares what an approver reads. Putting both on one item leaves "is this an input or
|
|
144
|
+
* something to judge by" unanswerable.
|
|
145
|
+
*
|
|
146
|
+
* Order matters. plant wrote four of these screens by hand and all four laid the slots out in the
|
|
147
|
+
* same order, which makes the order the screen's hierarchy rather than a preference — so this is an
|
|
148
|
+
* ordered array and not an object keyed by role.
|
|
149
|
+
*/
|
|
150
|
+
let ActivityDecisionKeyItem = class ActivityDecisionKeyItem {
|
|
151
|
+
};
|
|
152
|
+
exports.ActivityDecisionKeyItem = ActivityDecisionKeyItem;
|
|
153
|
+
tslib_1.__decorate([
|
|
154
|
+
(0, type_graphql_1.Field)(type => ActivityDecisionRole),
|
|
155
|
+
tslib_1.__metadata("design:type", String)
|
|
156
|
+
], ActivityDecisionKeyItem.prototype, "role", void 0);
|
|
157
|
+
tslib_1.__decorate([
|
|
158
|
+
(0, type_graphql_1.Field)({ description: "Dotted path to the value inside the instance's input, e.g. 'shift.passes'" }),
|
|
159
|
+
tslib_1.__metadata("design:type", String)
|
|
160
|
+
], ActivityDecisionKeyItem.prototype, "inputPath", void 0);
|
|
161
|
+
tslib_1.__decorate([
|
|
162
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Developer-facing note. Never shown on a screen.' }),
|
|
163
|
+
tslib_1.__metadata("design:type", String)
|
|
164
|
+
], ActivityDecisionKeyItem.prototype, "name", void 0);
|
|
165
|
+
tslib_1.__decorate([
|
|
166
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'i18n key for the label. Without it the screen shows no label.' }),
|
|
167
|
+
tslib_1.__metadata("design:type", String)
|
|
168
|
+
], ActivityDecisionKeyItem.prototype, "tKey", void 0);
|
|
169
|
+
tslib_1.__decorate([
|
|
170
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Unit to print after the value, when the activity fixes the unit' }),
|
|
171
|
+
tslib_1.__metadata("design:type", String)
|
|
172
|
+
], ActivityDecisionKeyItem.prototype, "unit", void 0);
|
|
173
|
+
exports.ActivityDecisionKeyItem = ActivityDecisionKeyItem = tslib_1.__decorate([
|
|
174
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for ActivityDecisionKeyItem' })
|
|
175
|
+
], ActivityDecisionKeyItem);
|
|
176
|
+
//# sourceMappingURL=activity-decision-key-item-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-decision-key-item-type.js","sourceRoot":"","sources":["../../../server/service/activity/activity-decision-key-item-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAkE;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,IAAY,oBAkEX;AAlED,WAAY,oBAAoB;IAC9B,mEAAmE;IACnE,6CAAqB,CAAA;IACrB,mDAAmD;IACnD,2CAAmB,CAAA;IACnB,iGAAiG;IACjG,yCAAiB,CAAA;IACjB;;;;;;;;OAQG;IACH,mDAA2B,CAAA;IAC3B,+DAA+D;IAC/D,yCAAiB,CAAA;IACjB;;;;;;;;;;;;OAYG;IACH,qDAA6B,CAAA;IAC7B;;;;;;;;;;;;;;;;OAgBG;IACH,uDAA+B,CAAA;IAC/B;;;;;;;;;;;;;OAaG;IACH,6CAAqB,CAAA;AACvB,CAAC,EAlEW,oBAAoB,oCAApB,oBAAoB,QAkE/B;AAED,IAAA,+BAAgB,EAAC,oBAAoB,EAAE;IACrC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sDAAsD;CACpE,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CA6BnC,CAAA;AA7BY,0DAAuB;AAElC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAoB,CAAC;;qDACV;AAG1B;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,2EAA2E,EAAE,CAAC;;0DACnF;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;qDAC7E;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+DAA+D,EAAE,CAAC;;qDAC3F;AAiBb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iEAAiE,EAAE,CAAC;;qDAC7F;kCA5BF,uBAAuB;IADnC,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;GACrD,uBAAuB,CA6BnC","sourcesContent":["import { Field, ObjectType, registerEnumType } from 'type-graphql'\n\n/**\n * The part an input value plays on the approval screen.\n *\n * ── The shape of the set: three tenses, and five others ───────────────────\n * Three of the eight say something about the subject at a point in time, and the other five do not:\n *\n * past evidence what the decision was made from (may repeat)\n * present currentState how things stand right now\n * future consequence what approving would change (may repeat)\n *\n * subject what this is about\n * reason what a person wrote\n * policy why it came up for approval at all\n * headline one sentence built from the values\n * reversibility whether approving can be undone\n *\n * Every mis-slotting found so far was the same mistake in that column: currentState under\n * consequence read the present as the future, and evidence under currentState read the past as the\n * present. So when a ninth role is asked for, the first question is whether the value is the\n * subject's past, present or future — if it is, one of those three already holds it. If it is not,\n * whoever asks should be able to say what it is instead. (2026-09-10, architect's ruling)\n *\n * ── Why the keys and the values are spelled the same ──────────────────────\n * type-graphql publishes an enum by its **keys** when the field names the enum type, and by its\n * **values** when the field leaves the type off. One word in a @Field decorator therefore decides\n * what a client receives, and a schema-improving edit far away can flip it. That has already cost\n * this repository twice: ApprovalLineItem.participation arrives as `Reference` and was compared\n * against `reference`, false every time; the catalog page read `NotWorklist` where its selector,\n * i18n key and stage list all said `notworklist`.\n *\n * Writing each key as its own value takes the choice away — either spelling produces the same\n * string. ActivityModelItemInoutType and ActivityModelItemType are written the same way.\n *\n * ── The set is closed, and widening it is the architect's call ────────────\n * Left open as a free string, a convention becomes suffix-appending: every lane invents its own\n * word for the same slot and the screen ends up switching on a dozen spellings, printing the\n * unmatched ones. Adding a role here is an architecture decision, not a lane's. (2026-09-09,\n * architect's ruling)\n */\nexport enum ActivityDecisionRole {\n /** One sentence built from the values: 「폐기 30 EA」, 「3에서 1로 올림」. */\n headline = 'headline',\n /** What the decision is about — one identifier. */\n subject = 'subject',\n /** What the person who raised it wrote. Absent, the screen says so rather than leaving a gap. */\n reason = 'reason',\n /**\n * What changes on approval: 「주문 넷이 뒤로 밀린다」. The only role that may appear more than once.\n *\n * Named consequence rather than effect because TwinCommand.effect already means the opposite in\n * time: { status, at, seen }, what the source reported back after the command was dispatched.\n * That one is an observation and past; this one is a prediction and future. Using a real term for\n * the wrong meaning is worse than coining one, and plant already writes .consequence for exactly\n * this sense in its stop-reason dialog. (2026-09-10, architect's ruling)\n */\n consequence = 'consequence',\n /** Why this came up for approval at all: 「폐기는 100 이상이면 결재」. */\n policy = 'policy',\n /**\n * What is measured to be true right now — about the world, not about the request.\n *\n * The other roles all describe what is being asked for. This one does not, and putting it under\n * consequence made the screen say the opposite of the truth: the twin's current readings would\n * have read as things the approval causes.\n *\n * Not named observed: ops-contract already has observedBy for which observation backs a declared\n * property, and TwinCommand.effect is an observation too, so observed would sit in the most\n * confusable spot between them. (2026-09-10, architect's ruling) plant never needed it because the subject's present state\n * went into the headline (「폐기 30 EA」); the twin's instruction and its current state are two\n * separate things, and holding them side by side is what this screen is for.\n */\n currentState = 'currentState',\n /**\n * Whether approving can be undone. Drawn in the frame rather than in the body.\n *\n * Not a separate role for want of a place — it fits consequence well enough — but for want of\n * weight. Listed among the consequences it reads with the same force as \"four orders get pushed\n * back\", and on\n * the twin actuation, where approving moves equipment, it is the heaviest line on the screen.\n *\n * ── Not the same as rejectionIsFinal ──────────────────────────────────\n * Two \"cannot be undone\" facts attach to opposite actions, and the twin actuation carries both,\n * which is what makes them look like one:\n *\n * reversibility whether **approving** can be undone (this role, read from the input)\n * rejectionIsFinal whether **rejecting** ends the case (a column on Activity)\n *\n * Merging them in a screen sentence tells the reader that rejection can be taken back.\n */\n reversibility = 'reversibility',\n /**\n * What the decision was made from — which inspection, against which spec, decided when.\n *\n * Neither consequence nor currentState: consequence is the opposite direction in time, and under\n * currentState a past finding reads as the present state of the subject. plant's disposition\n * approval kept its own screen for exactly these three values, and it survived the comparison not\n * because a slot could not hold them but because no slot existed — those are different reasons,\n * and only the second one means the set is short.\n *\n * plant's case for it: someone approving a concession in a regulated plant who cannot see which\n * inspection produced the finding is approving without grounds.\n *\n * Repeats, because grounds come in several — there were three.\n */\n evidence = 'evidence'\n}\n\nregisterEnumType(ActivityDecisionRole, {\n name: 'ActivityDecisionRole',\n description: 'the part an input value plays on the approval screen'\n})\n\n/**\n * One value the approver reads, and the part it plays.\n *\n * ── Why this points at input rather than at a model item ──────────────────\n * inputPath names a value inside the instance's input and does not go through the activity's model.\n * That is the whole reason it is a separate array: the values an approver most needs are computed by\n * the registering module and put on the input, not declared as model items — plant's `policy` and\n * its `shift.passes` / `shift.passedBy` are exactly that. A role hung on a model item could not\n * reach them.\n *\n * ── inputPath, not inputKey ───────────────────────────────────────────────\n * ActivitySearchKeyItem.inputKey names one top-level key, because its value goes into a searchable\n * column and a path into a list is not something that can be indexed. This field takes a path,\n * because it points at a value to draw. The two do different work, so they carry different names —\n * one word with two meanings would make the wrong one silent, and a name that does not exist is\n * read as a mistake instead. (2026-09-09, architect's ruling)\n *\n * 'policy' → input.policy\n * 'shift.passes' → input.shift.passes\n *\n * Dots only. No array index — drawing a list is the slot's job, not the path's — and no wildcard. A\n * path that leads nowhere resolves to undefined and is not folded into an empty value: a `reason`\n * that is missing and a `reason` someone left blank are different facts, and the screen draws them\n * differently.\n *\n * The two declarations also address different readers. model declares the boxes a performer fills;\n * this declares what an approver reads. Putting both on one item leaves \"is this an input or\n * something to judge by\" unanswerable.\n *\n * Order matters. plant wrote four of these screens by hand and all four laid the slots out in the\n * same order, which makes the order the screen's hierarchy rather than a preference — so this is an\n * ordered array and not an object keyed by role.\n */\n@ObjectType({ description: 'Entity for ActivityDecisionKeyItem' })\nexport class ActivityDecisionKeyItem {\n @Field(type => ActivityDecisionRole)\n role: ActivityDecisionRole\n\n @Field({ description: \"Dotted path to the value inside the instance's input, e.g. 'shift.passes'\" })\n inputPath: string\n\n @Field({ nullable: true, description: 'Developer-facing note. Never shown on a screen.' })\n name?: string\n\n @Field({ nullable: true, description: 'i18n key for the label. Without it the screen shows no label.' })\n tKey?: string\n\n /**\n * Unit to print after the value, when the activity fixes the unit.\n *\n * Declared once, so it holds for every instance of the activity — 「30 건」 works, and a unit that\n * varies per record does not: plant's disposition carries the unit alongside the quantity, so the\n * same activity produces 「3 EA」 and 「12.5 KG」. Writing one of them here would attach the wrong\n * unit to the other records, with nothing to catch it.\n *\n * A unit that varies belongs in the headline sentence the module builds, which is what plant did:\n * 「LOT-A 3 EA 를 폐기합니다」. Leave this empty then.\n *\n * Delete this field if no activity ever turns out to fix a unit. A field nobody writes stays\n * forever and the next person reads a meaning into it. (2026-09-10, architect's ruling)\n */\n @Field({ nullable: true, description: 'Unit to print after the value, when the activity fixes the unit' })\n unit?: string\n}\n"]}
|
|
@@ -4,11 +4,13 @@ import { ApprovalLineItem } from '@things-factory/organization';
|
|
|
4
4
|
import { Activity, ActivityStartingType, ActivityStatus, ActivityType, ActivityUIType, AssigneeItem, MultipleInstanceType } from './activity.js';
|
|
5
5
|
import { ActivityModelItem } from './activity-model-type.js';
|
|
6
6
|
import { ActivitySearchKeyItem } from './activity-search-key-item-type.js';
|
|
7
|
+
import { ActivityDecisionKeyItem } from './activity-decision-key-item-type.js';
|
|
7
8
|
export declare class NewActivity {
|
|
8
9
|
name: string;
|
|
9
10
|
description?: string;
|
|
10
11
|
activityType?: ActivityType;
|
|
11
12
|
searchKeys?: ActivitySearchKeyItem[];
|
|
13
|
+
decisionKeys?: ActivityDecisionKeyItem[];
|
|
12
14
|
state?: ActivityStatus;
|
|
13
15
|
model?: ActivityModelItem[];
|
|
14
16
|
priority?: number;
|
|
@@ -45,6 +47,7 @@ export declare class ActivityPatch {
|
|
|
45
47
|
description?: string;
|
|
46
48
|
activityType?: ActivityType;
|
|
47
49
|
searchKeys?: ActivitySearchKeyItem[];
|
|
50
|
+
decisionKeys?: ActivityDecisionKeyItem[];
|
|
48
51
|
state?: ActivityStatus;
|
|
49
52
|
model?: ActivityModelItem[];
|
|
50
53
|
priority?: number;
|
|
@@ -25,6 +25,10 @@ tslib_1.__decorate([
|
|
|
25
25
|
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
|
26
26
|
tslib_1.__metadata("design:type", Array)
|
|
27
27
|
], NewActivity.prototype, "searchKeys", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
|
30
|
+
tslib_1.__metadata("design:type", Array)
|
|
31
|
+
], NewActivity.prototype, "decisionKeys", void 0);
|
|
28
32
|
tslib_1.__decorate([
|
|
29
33
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
30
34
|
tslib_1.__metadata("design:type", String)
|
|
@@ -143,6 +147,10 @@ tslib_1.__decorate([
|
|
|
143
147
|
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
|
144
148
|
tslib_1.__metadata("design:type", Array)
|
|
145
149
|
], ActivityPatch.prototype, "searchKeys", void 0);
|
|
150
|
+
tslib_1.__decorate([
|
|
151
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
|
152
|
+
tslib_1.__metadata("design:type", Array)
|
|
153
|
+
], ActivityPatch.prototype, "decisionKeys", void 0);
|
|
146
154
|
tslib_1.__decorate([
|
|
147
155
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
148
156
|
tslib_1.__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-type.js","sourceRoot":"","sources":["../../../server/service/activity/activity-type.ts"],"names":[],"mappings":";;;;AACA,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EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACL;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC3B;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;wBAzFJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CA0FzB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,sBAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\nimport { ApprovalLineItem } from '@things-factory/organization'\n\nimport {\n Activity,\n ActivityStartingType,\n ActivityStatus,\n ActivityType,\n ActivityUIType,\n AssigneeItem,\n MultipleInstanceType\n} from './activity.js'\nimport { ActivityModelItem } from './activity-model-type.js'\nimport { ActivitySearchKeyItem } from './activity-search-key-item-type.js'\n\n@InputType()\nexport class NewActivity {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n activityType?: ActivityType\n\n @Field(type => ScalarObject, { nullable: true })\n searchKeys?: ActivitySearchKeyItem[]\n\n @Field({ nullable: true })\n state?: ActivityStatus\n\n @Field(type => ScalarObject, { nullable: true })\n model?: ActivityModelItem[]\n\n @Field({ nullable: true })\n priority?: number\n\n @Field({ nullable: true })\n startingType?: ActivityStartingType\n\n @Field({ nullable: true })\n multiple?: MultipleInstanceType\n\n @Field({ nullable: true })\n schedule?: string\n\n @Field({ nullable: true })\n timezone?: string\n\n @Field({ nullable: true })\n scheduleId?: string\n\n @Field({ nullable: true })\n standardTime?: number\n\n @Field(type => ObjectRef, { nullable: true })\n issuerRole?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n assigneeRole?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n supervisoryRole?: ObjectRef\n\n @Field(type => ScalarObject, { nullable: true })\n assignees?: AssigneeItem[]\n\n @Field(type => ScalarObject, { nullable: true })\n approvalLine?: ApprovalLineItem[]\n\n /**\n * 반려하면 끝인가 — 참이면 되살릴 수 없다.\n *\n * 되돌릴 수 없는 판정을 다루는 업무(부적합 처분·트윈 조치)는 반려되는 순간 대상이 닫힌다. 그때 결재를\n * 되살리면 사람은 승인할 것이 있다고 보는데 승인에 효력이 없다.\n */\n @Field({ nullable: true, description: 'true when a rejection closes the case for good — it cannot be restarted' })\n rejectionIsFinal?: boolean\n\n @Field({ nullable: true })\n uiType?: ActivityUIType\n\n @Field({ nullable: true })\n uiSource?: string\n\n @Field({ nullable: true })\n viewType?: ActivityUIType\n\n @Field({ nullable: true })\n viewSource?: string\n\n @Field({ nullable: true })\n reportType?: ActivityUIType\n\n @Field({ nullable: true })\n reportSource?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class ActivityPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n activityType?: ActivityType\n\n @Field(type => ScalarObject, { nullable: true })\n searchKeys?: ActivitySearchKeyItem[]\n\n @Field({ nullable: true })\n state?: ActivityStatus\n\n @Field(type => ScalarObject, { nullable: true })\n model?: ActivityModelItem[]\n\n @Field({ nullable: true })\n priority?: number\n\n @Field({ nullable: true })\n startingType?: ActivityStartingType\n\n @Field({ nullable: true })\n multiple?: MultipleInstanceType\n\n @Field({ nullable: true })\n schedule?: string\n\n @Field({ nullable: true })\n timezone?: string\n\n @Field({ nullable: true })\n scheduleId?: string\n\n @Field({ nullable: true })\n standardTime?: number\n\n @Field(type => ObjectRef, { nullable: true })\n issuerRole?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n assigneeRole?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n supervisoryRole?: ObjectRef\n\n @Field(type => ScalarObject, { nullable: true })\n assignees?: AssigneeItem[]\n\n @Field(type => ScalarObject, { nullable: true })\n approvalLine?: ApprovalLineItem[]\n\n /**\n * 반려하면 끝인가 — 참이면 되살릴 수 없다.\n *\n * 되돌릴 수 없는 판정을 다루는 업무(부적합 처분·트윈 조치)는 반려되는 순간 대상이 닫힌다. 그때 결재를\n * 되살리면 사람은 승인할 것이 있다고 보는데 승인에 효력이 없다.\n */\n @Field({ nullable: true, description: 'true when a rejection closes the case for good — it cannot be restarted' })\n rejectionIsFinal?: boolean\n\n @Field({ nullable: true })\n uiType?: ActivityUIType\n\n @Field({ nullable: true })\n uiSource?: string\n\n @Field({ nullable: true })\n viewType?: ActivityUIType\n\n @Field({ nullable: true })\n viewSource?: string\n\n @Field({ nullable: true })\n reportType?: ActivityUIType\n\n @Field({ nullable: true })\n reportSource?: string\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ActivityList {\n @Field(type => [Activity])\n items: Activity[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-type.js","sourceRoot":"","sources":["../../../server/service/activity/activity-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAoE;AAEpE,iDAA+D;AAG/D,+CAQsB;AAMf,IAAM,WAAW,GAAjB,MAAM,WAAW;CA0FvB,CAAA;AA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E,CAAC;;iDACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACC;AAG3B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACL;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC3B;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;wBA5FJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CA6FzB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,sBAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\nimport { ApprovalLineItem } from '@things-factory/organization'\n\nimport {\n Activity,\n ActivityStartingType,\n ActivityStatus,\n ActivityType,\n ActivityUIType,\n AssigneeItem,\n MultipleInstanceType\n} from './activity.js'\nimport { ActivityModelItem } from './activity-model-type.js'\nimport { ActivitySearchKeyItem } from './activity-search-key-item-type.js'\nimport { ActivityDecisionKeyItem } from './activity-decision-key-item-type.js'\n\n@InputType()\nexport class NewActivity {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n activityType?: ActivityType\n\n @Field(type => ScalarObject, { nullable: true })\n searchKeys?: ActivitySearchKeyItem[]\n\n @Field(type => ScalarObject, { nullable: true })\n decisionKeys?: ActivityDecisionKeyItem[]\n\n @Field({ nullable: true })\n state?: ActivityStatus\n\n @Field(type => ScalarObject, { nullable: true })\n model?: ActivityModelItem[]\n\n @Field({ nullable: true })\n priority?: number\n\n @Field({ nullable: true })\n startingType?: ActivityStartingType\n\n @Field({ nullable: true })\n multiple?: MultipleInstanceType\n\n @Field({ nullable: true })\n schedule?: string\n\n @Field({ nullable: true })\n timezone?: string\n\n @Field({ nullable: true })\n scheduleId?: string\n\n @Field({ nullable: true })\n standardTime?: number\n\n @Field(type => ObjectRef, { nullable: true })\n issuerRole?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n assigneeRole?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n supervisoryRole?: ObjectRef\n\n @Field(type => ScalarObject, { nullable: true })\n assignees?: AssigneeItem[]\n\n @Field(type => ScalarObject, { nullable: true })\n approvalLine?: ApprovalLineItem[]\n\n /**\n * 반려하면 끝인가 — 참이면 되살릴 수 없다.\n *\n * 되돌릴 수 없는 판정을 다루는 업무(부적합 처분·트윈 조치)는 반려되는 순간 대상이 닫힌다. 그때 결재를\n * 되살리면 사람은 승인할 것이 있다고 보는데 승인에 효력이 없다.\n */\n @Field({ nullable: true, description: 'true when a rejection closes the case for good — it cannot be restarted' })\n rejectionIsFinal?: boolean\n\n @Field({ nullable: true })\n uiType?: ActivityUIType\n\n @Field({ nullable: true })\n uiSource?: string\n\n @Field({ nullable: true })\n viewType?: ActivityUIType\n\n @Field({ nullable: true })\n viewSource?: string\n\n @Field({ nullable: true })\n reportType?: ActivityUIType\n\n @Field({ nullable: true })\n reportSource?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class ActivityPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n activityType?: ActivityType\n\n @Field(type => ScalarObject, { nullable: true })\n searchKeys?: ActivitySearchKeyItem[]\n\n @Field(type => ScalarObject, { nullable: true })\n decisionKeys?: ActivityDecisionKeyItem[]\n\n @Field({ nullable: true })\n state?: ActivityStatus\n\n @Field(type => ScalarObject, { nullable: true })\n model?: ActivityModelItem[]\n\n @Field({ nullable: true })\n priority?: number\n\n @Field({ nullable: true })\n startingType?: ActivityStartingType\n\n @Field({ nullable: true })\n multiple?: MultipleInstanceType\n\n @Field({ nullable: true })\n schedule?: string\n\n @Field({ nullable: true })\n timezone?: string\n\n @Field({ nullable: true })\n scheduleId?: string\n\n @Field({ nullable: true })\n standardTime?: number\n\n @Field(type => ObjectRef, { nullable: true })\n issuerRole?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n assigneeRole?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n supervisoryRole?: ObjectRef\n\n @Field(type => ScalarObject, { nullable: true })\n assignees?: AssigneeItem[]\n\n @Field(type => ScalarObject, { nullable: true })\n approvalLine?: ApprovalLineItem[]\n\n /**\n * 반려하면 끝인가 — 참이면 되살릴 수 없다.\n *\n * 되돌릴 수 없는 판정을 다루는 업무(부적합 처분·트윈 조치)는 반려되는 순간 대상이 닫힌다. 그때 결재를\n * 되살리면 사람은 승인할 것이 있다고 보는데 승인에 효력이 없다.\n */\n @Field({ nullable: true, description: 'true when a rejection closes the case for good — it cannot be restarted' })\n rejectionIsFinal?: boolean\n\n @Field({ nullable: true })\n uiType?: ActivityUIType\n\n @Field({ nullable: true })\n uiSource?: string\n\n @Field({ nullable: true })\n viewType?: ActivityUIType\n\n @Field({ nullable: true })\n viewSource?: string\n\n @Field({ nullable: true })\n reportType?: ActivityUIType\n\n @Field({ nullable: true })\n reportSource?: string\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ActivityList {\n @Field(type => [Activity])\n items: Activity[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import { Domain } from '@things-factory/shell';
|
|
|
3
3
|
import { OrgMemberTargetType, OrgMemberTarget, ApprovalLineItem } from '@things-factory/organization';
|
|
4
4
|
import { ActivityModelItem } from './activity-model-type.js';
|
|
5
5
|
import { ActivitySearchKeyItem } from './activity-search-key-item-type.js';
|
|
6
|
+
import { ActivityDecisionKeyItem } from './activity-decision-key-item-type.js';
|
|
6
7
|
export declare enum ActivityStatus {
|
|
7
8
|
Draft = "draft",
|
|
8
9
|
Released = "released",
|
|
@@ -49,10 +50,39 @@ export declare class Activity {
|
|
|
49
50
|
domain?: Domain;
|
|
50
51
|
domainId?: string;
|
|
51
52
|
name?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The display name a person reads. `name` is the callback key and renaming it breaks callbacks.
|
|
55
|
+
*
|
|
56
|
+
* ── Why this is a column ──────────────────────────────────────────────────
|
|
57
|
+
* It was declared on InstallableActivity only, and installActivity spread the template onto this
|
|
58
|
+
* row, so a field with no column here was dropped and the save reported success. The result was
|
|
59
|
+
* that 「부적합 처분 승인」 reached exactly one screen — the catalog, which reads the template
|
|
60
|
+
* registry directly — while every screen that reads this row showed the instance name and the
|
|
61
|
+
* instance description instead. The activity's own name appeared nowhere on the approval screen.
|
|
62
|
+
*/
|
|
63
|
+
label?: string;
|
|
52
64
|
description?: string;
|
|
53
65
|
activityType?: ActivityType;
|
|
54
66
|
state?: ActivityStatus;
|
|
55
67
|
searchKeys?: ActivitySearchKeyItem[];
|
|
68
|
+
/**
|
|
69
|
+
* What an approver reads, and the part each value plays.
|
|
70
|
+
*
|
|
71
|
+
* The approval screen has one frame for every activity — ribbon, content, timeline, comment — and
|
|
72
|
+
* the content is drawn by whichever of the six ui types the activity names. Five of the six point
|
|
73
|
+
* at something built by hand; the sixth, `generated`, draws the model as a list of name and value
|
|
74
|
+
* pairs. A list of pairs answers "what are the values" and not "what happens if I approve", which
|
|
75
|
+
* is the only question this screen exists for, so every activity that needed the second answer
|
|
76
|
+
* left `generated` and shipped a custom element. plant wrote four of them and all four laid out
|
|
77
|
+
* the same five slots in the same order.
|
|
78
|
+
*
|
|
79
|
+
* Declaring the slots lets `generated` draw a decision. It also reaches the activity with no
|
|
80
|
+
* screen at all: the twin actuation approval, whose ten values arrive as a flat list today and
|
|
81
|
+
* whose approval is the one that actually moves equipment.
|
|
82
|
+
*
|
|
83
|
+
* Empty means nobody has declared it, and `generated` falls back to the model as before.
|
|
84
|
+
*/
|
|
85
|
+
decisionKeys?: ActivityDecisionKeyItem[];
|
|
56
86
|
model?: ActivityModelItem[];
|
|
57
87
|
priority?: number;
|
|
58
88
|
startingType?: ActivityStartingType;
|
|
@@ -9,6 +9,7 @@ const shell_1 = require("@things-factory/shell");
|
|
|
9
9
|
const organization_1 = require("@things-factory/organization");
|
|
10
10
|
const activity_model_type_js_1 = require("./activity-model-type.js");
|
|
11
11
|
const activity_search_key_item_type_js_1 = require("./activity-search-key-item-type.js");
|
|
12
|
+
const activity_decision_key_item_type_js_1 = require("./activity-decision-key-item-type.js");
|
|
12
13
|
var ActivityStatus;
|
|
13
14
|
(function (ActivityStatus) {
|
|
14
15
|
ActivityStatus["Draft"] = "draft";
|
|
@@ -118,6 +119,11 @@ tslib_1.__decorate([
|
|
|
118
119
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
119
120
|
tslib_1.__metadata("design:type", String)
|
|
120
121
|
], Activity.prototype, "name", void 0);
|
|
122
|
+
tslib_1.__decorate([
|
|
123
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
124
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Display name for a person. `name` is the callback key.' }),
|
|
125
|
+
tslib_1.__metadata("design:type", String)
|
|
126
|
+
], Activity.prototype, "label", void 0);
|
|
121
127
|
tslib_1.__decorate([
|
|
122
128
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
123
129
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -138,6 +144,14 @@ tslib_1.__decorate([
|
|
|
138
144
|
(0, type_graphql_1.Field)(type => [activity_search_key_item_type_js_1.ActivitySearchKeyItem], { nullable: true }),
|
|
139
145
|
tslib_1.__metadata("design:type", Array)
|
|
140
146
|
], Activity.prototype, "searchKeys", void 0);
|
|
147
|
+
tslib_1.__decorate([
|
|
148
|
+
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
149
|
+
(0, type_graphql_1.Field)(type => [activity_decision_key_item_type_js_1.ActivityDecisionKeyItem], {
|
|
150
|
+
nullable: true,
|
|
151
|
+
description: 'Which input values an approver judges by, and the part each one plays'
|
|
152
|
+
}),
|
|
153
|
+
tslib_1.__metadata("design:type", Array)
|
|
154
|
+
], Activity.prototype, "decisionKeys", void 0);
|
|
141
155
|
tslib_1.__decorate([
|
|
142
156
|
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
143
157
|
(0, type_graphql_1.Field)(type => [activity_model_type_js_1.ActivityModelItem], { nullable: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../server/service/activity/activity.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAUgB;AAEhB,yDAAsD;AACtD,iDAA8C;AAC9C,+DAAqG;AAErG,qEAA4D;AAC5D,yFAA0E;AAE1E,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,uCAAqB,CAAA;IACrB,2CAAyB,CAAA;AAC3B,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED,IAAA,+BAAgB,EAAC,cAAc,EAAE;IAC/B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,iCAAiC;CAC/C,CAAC,CAAA;AAEF,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,iCAAS,CAAA;IACT,qCAAa,CAAA;IACb,uCAAe,CAAA;AACjB,CAAC,EAJW,oB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AC,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACvH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAoLpB","sourcesContent":["import { Field, ID, ObjectType, registerEnumType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn,\n VersionColumn\n} from 'typeorm'\n\nimport { Role, User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\nimport { OrgMemberTargetType, OrgMemberTarget, ApprovalLineItem } from '@things-factory/organization'\n\nimport { ActivityModelItem } from './activity-model-type.js'\nimport { ActivitySearchKeyItem } from './activity-search-key-item-type.js'\n\nexport enum ActivityStatus {\n Draft = 'draft',\n Released = 'released',\n Deprecated = 'deprecated'\n}\n\nregisterEnumType(ActivityStatus, {\n name: 'ActivityStatus',\n description: 'state enumeration of a activity'\n})\n\nexport enum ActivityStartingType {\n None = '',\n Post = 'post',\n Issue = 'issue'\n}\n\nregisterEnumType(ActivityStartingType, {\n name: 'ActivityStartingType',\n description: 'whether the purpose of starting the activity is to issue or post'\n})\n\nexport enum ActivityType {\n Task = 'task',\n Service = 'service',\n Send = 'send',\n Receive = 'receive',\n User = 'user',\n Manual = 'manual',\n BusinessRule = 'business-rule',\n Script = 'script',\n Subprocess = 'sub-process',\n Call = 'call'\n}\n\nregisterEnumType(ActivityType, {\n name: 'ActivityType',\n description: 'type enumeration of a activity based on BPMN 2.0'\n})\n\nexport enum MultipleInstanceType {\n Single = 'single',\n Parallel = 'parallel',\n Sequential = 'sequential'\n}\n\nregisterEnumType(MultipleInstanceType, {\n name: 'MultipleInstanceType',\n description: 'type enumeration of a multiple instance property based on BPMN 2.0'\n})\n\nexport enum ActivityUIType {\n Generated = 'generated',\n Template = 'template',\n Board = 'board',\n CustomElement = 'custom-element',\n Page = 'page',\n External = 'external'\n}\n\nregisterEnumType(ActivityUIType, {\n name: 'ActivityUIType',\n description: 'user-interface type enumeration of a activity'\n})\n\n@ObjectType()\nexport class AssigneeItem {\n @Field(type => OrgMemberTargetType, { nullable: true })\n type?: OrgMemberTargetType\n\n @Field({ nullable: true })\n value?: string\n\n @Field(type => OrgMemberTarget, { nullable: true })\n assignee?: OrgMemberTarget\n}\n\n@Entity()\n@Index('ix_activity_0', (activity: Activity) => [activity.domain, activity.name], { unique: true })\n@Index('ix_activity_1', (activity: Activity) => [activity.domain, activity.state, activity.priority], { unique: false })\n@ObjectType({ description: 'Entity for Activity' })\nexport class Activity {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @VersionColumn({ default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n @RelationId((activity: Activity) => activity.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'BPMN 2.0 task type' })\n activityType?: ActivityType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: ActivityStatus\n\n @Column('simple-json', { nullable: true })\n @Field(type => [ActivitySearchKeyItem], { nullable: true })\n searchKeys?: ActivitySearchKeyItem[]\n\n @Column('simple-json', { nullable: true })\n @Field(type => [ActivityModelItem], { nullable: true })\n model?: ActivityModelItem[]\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n priority?: number = 1\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Whether the purpose of starting the activity is to issue or post' })\n startingType?: ActivityStartingType\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description:\n 'Parallel or sequential are properties as a multi-instance activity, otherwise it means a single instance.'\n })\n multiple?: MultipleInstanceType\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Autostart schedule in crontab format' })\n schedule?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'ID of the autostart schedule registered in the schedule service' })\n scheduleId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Time zone to which automatic scheduling is applied' })\n timezone?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Standard time for this activity to be performed' })\n standardTime?: number\n\n @ManyToOne(type => Role, { nullable: true })\n @Field(type => Role, { nullable: true })\n issuerRole?: Role\n\n @RelationId((activity: Activity) => activity.issuerRole)\n issuerRoleId?: string\n\n @ManyToOne(type => Role, { nullable: true })\n @Field(type => Role, { nullable: true, description: 'Roles eligible to pick up activity from the activity bank.' })\n assigneeRole?: Role\n\n @RelationId((activity: Activity) => activity.assigneeRole)\n assigneeRoleId?: string\n\n @ManyToOne(type => Role, { nullable: true })\n @Field(type => Role, { nullable: true, description: 'The final authority on a given activity.' })\n supervisoryRole?: Role\n\n @RelationId((activity: Activity) => activity.supervisoryRole)\n supervisoryRoleId?: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => [AssigneeItem], { nullable: true, description: 'Who to resolve for the activity.' })\n assignees?: AssigneeItem[]\n\n @Column('simple-json', { nullable: true })\n @Field(type => [ApprovalLineItem], {\n nullable: true,\n description: 'Approval line for handling the activity.'\n })\n approvalLine?: ApprovalLineItem[]\n\n /**\n * **반려하면 끝인가.**\n *\n * ── 왜 이 축이 필요한가 ──────────────────────────────────────────────────\n * 반려된 스레드는 `restartActivityThread` 로 되살릴 수 있고, 그러면 다음 차수의 결재가 새로 선다.\n * 휴가 신청처럼 **고쳐서 다시 내는** 업무에는 그것이 맞다.\n *\n * 그런데 되돌릴 수 없는 판정을 다루는 업무가 있다 — 부적합 처분, 트윈 조치. 그런 것은 반려되는\n * 순간 대상이 닫힌다. 그 뒤에 결재를 되살리면 **사람은 승인할 것이 있다고 보는데 승인에 효력이\n * 없다.** 승인해도 아무 일이 일어나지 않고 오류도 안 난다.\n *\n * 참이면 되살리지 못한다. 다시 하려면 새로 낸다.\n *\n * ── 기본값은 거짓이다 ────────────────────────────────────────────────────\n * 지금 있는 업무들은 되살릴 수 있는 것을 전제로 만들어졌다. 기본을 참으로 두면 그 업무들의 거동이\n * 말없이 바뀐다.\n */\n @Column({ type: 'boolean', nullable: true, default: false })\n @Field({ nullable: true, description: 'true when a rejection closes the case for good — it cannot be restarted' })\n rejectionIsFinal?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The type of UI to be shown when a task is performed' })\n uiType?: ActivityUIType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n uiSource?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The type of view to be shown when a task is approved' })\n viewType?: ActivityUIType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n viewSource?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The type of report to be shown when a task is approved' })\n reportType?: ActivityUIType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n reportSource?: string\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, description: 'User assigned to the client application' })\n client?: User\n\n @RelationId((activity: Activity) => activity.client)\n clientId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((activity: Activity) => activity.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((activity: Activity) => activity.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n thumbnail?: string\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../server/service/activity/activity.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAUgB;AAEhB,yDAAsD;AACtD,iDAA8C;AAC9C,+DAAqG;AAErG,qEAA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EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACxB;mBAzNP,QAAQ;IAJpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClG,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACvH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CA0NpB","sourcesContent":["import { Field, ID, ObjectType, registerEnumType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn,\n VersionColumn\n} from 'typeorm'\n\nimport { Role, User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\nimport { OrgMemberTargetType, OrgMemberTarget, ApprovalLineItem } from '@things-factory/organization'\n\nimport { ActivityModelItem } from './activity-model-type.js'\nimport { ActivitySearchKeyItem } from './activity-search-key-item-type.js'\nimport { ActivityDecisionKeyItem } from './activity-decision-key-item-type.js'\n\nexport enum ActivityStatus {\n Draft = 'draft',\n Released = 'released',\n Deprecated = 'deprecated'\n}\n\nregisterEnumType(ActivityStatus, {\n name: 'ActivityStatus',\n description: 'state enumeration of a activity'\n})\n\nexport enum ActivityStartingType {\n None = '',\n Post = 'post',\n Issue = 'issue'\n}\n\nregisterEnumType(ActivityStartingType, {\n name: 'ActivityStartingType',\n description: 'whether the purpose of starting the activity is to issue or post'\n})\n\nexport enum ActivityType {\n Task = 'task',\n Service = 'service',\n Send = 'send',\n Receive = 'receive',\n User = 'user',\n Manual = 'manual',\n BusinessRule = 'business-rule',\n Script = 'script',\n Subprocess = 'sub-process',\n Call = 'call'\n}\n\nregisterEnumType(ActivityType, {\n name: 'ActivityType',\n description: 'type enumeration of a activity based on BPMN 2.0'\n})\n\nexport enum MultipleInstanceType {\n Single = 'single',\n Parallel = 'parallel',\n Sequential = 'sequential'\n}\n\nregisterEnumType(MultipleInstanceType, {\n name: 'MultipleInstanceType',\n description: 'type enumeration of a multiple instance property based on BPMN 2.0'\n})\n\nexport enum ActivityUIType {\n Generated = 'generated',\n Template = 'template',\n Board = 'board',\n CustomElement = 'custom-element',\n Page = 'page',\n External = 'external'\n}\n\nregisterEnumType(ActivityUIType, {\n name: 'ActivityUIType',\n description: 'user-interface type enumeration of a activity'\n})\n\n@ObjectType()\nexport class AssigneeItem {\n @Field(type => OrgMemberTargetType, { nullable: true })\n type?: OrgMemberTargetType\n\n @Field({ nullable: true })\n value?: string\n\n @Field(type => OrgMemberTarget, { nullable: true })\n assignee?: OrgMemberTarget\n}\n\n@Entity()\n@Index('ix_activity_0', (activity: Activity) => [activity.domain, activity.name], { unique: true })\n@Index('ix_activity_1', (activity: Activity) => [activity.domain, activity.state, activity.priority], { unique: false })\n@ObjectType({ description: 'Entity for Activity' })\nexport class Activity {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @VersionColumn({ default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n @RelationId((activity: Activity) => activity.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n /**\n * The display name a person reads. `name` is the callback key and renaming it breaks callbacks.\n *\n * ── Why this is a column ──────────────────────────────────────────────────\n * It was declared on InstallableActivity only, and installActivity spread the template onto this\n * row, so a field with no column here was dropped and the save reported success. The result was\n * that 「부적합 처분 승인」 reached exactly one screen — the catalog, which reads the template\n * registry directly — while every screen that reads this row showed the instance name and the\n * instance description instead. The activity's own name appeared nowhere on the approval screen.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Display name for a person. `name` is the callback key.' })\n label?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'BPMN 2.0 task type' })\n activityType?: ActivityType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: ActivityStatus\n\n @Column('simple-json', { nullable: true })\n @Field(type => [ActivitySearchKeyItem], { nullable: true })\n searchKeys?: ActivitySearchKeyItem[]\n\n /**\n * What an approver reads, and the part each value plays.\n *\n * The approval screen has one frame for every activity — ribbon, content, timeline, comment — and\n * the content is drawn by whichever of the six ui types the activity names. Five of the six point\n * at something built by hand; the sixth, `generated`, draws the model as a list of name and value\n * pairs. A list of pairs answers \"what are the values\" and not \"what happens if I approve\", which\n * is the only question this screen exists for, so every activity that needed the second answer\n * left `generated` and shipped a custom element. plant wrote four of them and all four laid out\n * the same five slots in the same order.\n *\n * Declaring the slots lets `generated` draw a decision. It also reaches the activity with no\n * screen at all: the twin actuation approval, whose ten values arrive as a flat list today and\n * whose approval is the one that actually moves equipment.\n *\n * Empty means nobody has declared it, and `generated` falls back to the model as before.\n */\n @Column('simple-json', { nullable: true })\n @Field(type => [ActivityDecisionKeyItem], {\n nullable: true,\n description: 'Which input values an approver judges by, and the part each one plays'\n })\n decisionKeys?: ActivityDecisionKeyItem[]\n\n @Column('simple-json', { nullable: true })\n @Field(type => [ActivityModelItem], { nullable: true })\n model?: ActivityModelItem[]\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n priority?: number = 1\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Whether the purpose of starting the activity is to issue or post' })\n startingType?: ActivityStartingType\n\n @Column({ nullable: true })\n @Field({\n nullable: true,\n description:\n 'Parallel or sequential are properties as a multi-instance activity, otherwise it means a single instance.'\n })\n multiple?: MultipleInstanceType\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Autostart schedule in crontab format' })\n schedule?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'ID of the autostart schedule registered in the schedule service' })\n scheduleId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Time zone to which automatic scheduling is applied' })\n timezone?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Standard time for this activity to be performed' })\n standardTime?: number\n\n @ManyToOne(type => Role, { nullable: true })\n @Field(type => Role, { nullable: true })\n issuerRole?: Role\n\n @RelationId((activity: Activity) => activity.issuerRole)\n issuerRoleId?: string\n\n @ManyToOne(type => Role, { nullable: true })\n @Field(type => Role, { nullable: true, description: 'Roles eligible to pick up activity from the activity bank.' })\n assigneeRole?: Role\n\n @RelationId((activity: Activity) => activity.assigneeRole)\n assigneeRoleId?: string\n\n @ManyToOne(type => Role, { nullable: true })\n @Field(type => Role, { nullable: true, description: 'The final authority on a given activity.' })\n supervisoryRole?: Role\n\n @RelationId((activity: Activity) => activity.supervisoryRole)\n supervisoryRoleId?: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => [AssigneeItem], { nullable: true, description: 'Who to resolve for the activity.' })\n assignees?: AssigneeItem[]\n\n @Column('simple-json', { nullable: true })\n @Field(type => [ApprovalLineItem], {\n nullable: true,\n description: 'Approval line for handling the activity.'\n })\n approvalLine?: ApprovalLineItem[]\n\n /**\n * **반려하면 끝인가.**\n *\n * ── 왜 이 축이 필요한가 ──────────────────────────────────────────────────\n * 반려된 스레드는 `restartActivityThread` 로 되살릴 수 있고, 그러면 다음 차수의 결재가 새로 선다.\n * 휴가 신청처럼 **고쳐서 다시 내는** 업무에는 그것이 맞다.\n *\n * 그런데 되돌릴 수 없는 판정을 다루는 업무가 있다 — 부적합 처분, 트윈 조치. 그런 것은 반려되는\n * 순간 대상이 닫힌다. 그 뒤에 결재를 되살리면 **사람은 승인할 것이 있다고 보는데 승인에 효력이\n * 없다.** 승인해도 아무 일이 일어나지 않고 오류도 안 난다.\n *\n * 참이면 되살리지 못한다. 다시 하려면 새로 낸다.\n *\n * ── 기본값은 거짓이다 ────────────────────────────────────────────────────\n * 지금 있는 업무들은 되살릴 수 있는 것을 전제로 만들어졌다. 기본을 참으로 두면 그 업무들의 거동이\n * 말없이 바뀐다.\n */\n @Column({ type: 'boolean', nullable: true, default: false })\n @Field({ nullable: true, description: 'true when a rejection closes the case for good — it cannot be restarted' })\n rejectionIsFinal?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The type of UI to be shown when a task is performed' })\n uiType?: ActivityUIType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n uiSource?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The type of view to be shown when a task is approved' })\n viewType?: ActivityUIType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n viewSource?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The type of report to be shown when a task is approved' })\n reportType?: ActivityUIType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n reportSource?: string\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, description: 'User assigned to the client application' })\n client?: User\n\n @RelationId((activity: Activity) => activity.client)\n clientId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((activity: Activity) => activity.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((activity: Activity) => activity.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n thumbnail?: string\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refuses a decisionKeys declaration that cannot draw.
|
|
3
|
+
*
|
|
4
|
+
* Same reasoning as search keys: a declaration that does not work should fail where it arrives, not
|
|
5
|
+
* where someone opens an approval. The difference is what "not working" means here — nothing is
|
|
6
|
+
* dropped by a save, so the failure would be a screen that quietly draws less than it was told to.
|
|
7
|
+
*
|
|
8
|
+
* The shape is spelled out rather than imported. ActivityDecisionKeyItem carries type-graphql
|
|
9
|
+
* decorators and the test runner strips types without reading them, so importing the declared class
|
|
10
|
+
* pulls type-graphql in and the test file fails to load.
|
|
11
|
+
*/
|
|
12
|
+
type DecisionKeyDeclaration = {
|
|
13
|
+
role?: string;
|
|
14
|
+
inputPath?: string;
|
|
15
|
+
};
|
|
16
|
+
/** Roles a screen knows how to draw. Widening this is an architecture decision, not a lane's. */
|
|
17
|
+
export declare const DECISION_ROLES: readonly ["headline", "subject", "reversibility", "reason", "evidence", "currentState", "consequence", "policy"];
|
|
18
|
+
/**
|
|
19
|
+
* The roles that may appear more than once.
|
|
20
|
+
*
|
|
21
|
+
* An approval can change several things at once — plant's priority change pushes some orders back
|
|
22
|
+
* and moves others ahead — and those are separate consequences, not one merged sentence. Grounds
|
|
23
|
+
* come in several the same way: which inspection, against which spec, decided when.
|
|
24
|
+
*
|
|
25
|
+
* Every other role names a single value. Two headlines would leave the screen picking one with
|
|
26
|
+
* nothing to say why.
|
|
27
|
+
*
|
|
28
|
+
* Named consequence, not effect: TwinCommand.effect is what the source reported back after dispatch
|
|
29
|
+
* — an observation, and past — while this is a prediction, and future.
|
|
30
|
+
*/
|
|
31
|
+
export declare const REPEATABLE_ROLES: readonly ["consequence", "evidence"];
|
|
32
|
+
export declare function assertDecisionKeysAreUsable(decisionKeys: DecisionKeyDeclaration[] | undefined, activityName?: string): void;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REPEATABLE_ROLES = exports.DECISION_ROLES = void 0;
|
|
4
|
+
exports.assertDecisionKeysAreUsable = assertDecisionKeysAreUsable;
|
|
5
|
+
/** Roles a screen knows how to draw. Widening this is an architecture decision, not a lane's. */
|
|
6
|
+
exports.DECISION_ROLES = [
|
|
7
|
+
'headline',
|
|
8
|
+
'subject',
|
|
9
|
+
'reversibility',
|
|
10
|
+
'reason',
|
|
11
|
+
'evidence',
|
|
12
|
+
'currentState',
|
|
13
|
+
'consequence',
|
|
14
|
+
'policy'
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* The roles that may appear more than once.
|
|
18
|
+
*
|
|
19
|
+
* An approval can change several things at once — plant's priority change pushes some orders back
|
|
20
|
+
* and moves others ahead — and those are separate consequences, not one merged sentence. Grounds
|
|
21
|
+
* come in several the same way: which inspection, against which spec, decided when.
|
|
22
|
+
*
|
|
23
|
+
* Every other role names a single value. Two headlines would leave the screen picking one with
|
|
24
|
+
* nothing to say why.
|
|
25
|
+
*
|
|
26
|
+
* Named consequence, not effect: TwinCommand.effect is what the source reported back after dispatch
|
|
27
|
+
* — an observation, and past — while this is a prediction, and future.
|
|
28
|
+
*/
|
|
29
|
+
exports.REPEATABLE_ROLES = ['consequence', 'evidence'];
|
|
30
|
+
function assertDecisionKeysAreUsable(decisionKeys, activityName) {
|
|
31
|
+
if (!decisionKeys?.length) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const named = activityName ? `activity "${activityName}"` : 'this activity';
|
|
35
|
+
const unknown = decisionKeys.filter(key => !exports.DECISION_ROLES.includes(String(key?.role ?? '')));
|
|
36
|
+
if (unknown.length) {
|
|
37
|
+
throw new Error(`${named} declares decision keys with a role the approval screen does not know: ` +
|
|
38
|
+
`${unknown.map(key => `"${key?.role ?? ''}"`).join(', ')}. ` +
|
|
39
|
+
`Known roles are ${exports.DECISION_ROLES.join(', ')}. A role outside that set draws nothing.`);
|
|
40
|
+
}
|
|
41
|
+
const pathless = decisionKeys.filter(key => !String(key?.inputPath ?? '').trim());
|
|
42
|
+
if (pathless.length) {
|
|
43
|
+
throw new Error(`${named} declares ${pathless.length} decision key(s) with no inputPath. ` +
|
|
44
|
+
`A decision key names the value it draws; without a path there is nothing to read.`);
|
|
45
|
+
}
|
|
46
|
+
/*
|
|
47
|
+
* An index or a wildcard resolves to nothing at draw time and the slot would report "the path led
|
|
48
|
+
* nowhere" — which reads as a payload that disagrees with the declaration, when the truth is that
|
|
49
|
+
* the declaration used a path language that does not exist. Refusing here says which it was.
|
|
50
|
+
*/
|
|
51
|
+
const notPaths = decisionKeys.filter(key => /[[\]*]/.test(String(key?.inputPath ?? '')));
|
|
52
|
+
if (notPaths.length) {
|
|
53
|
+
throw new Error(`${named} declares decision keys whose inputPath is not a plain dotted path: ` +
|
|
54
|
+
`${notPaths.map(key => `"${key?.inputPath ?? ''}"`).join(', ')}. ` +
|
|
55
|
+
`Dots only — no array index and no wildcard. Point at the list itself; drawing its items is ` +
|
|
56
|
+
`the slot's work.`);
|
|
57
|
+
}
|
|
58
|
+
const repeated = exports.DECISION_ROLES.filter(role => !exports.REPEATABLE_ROLES.includes(role) &&
|
|
59
|
+
decisionKeys.filter(key => key?.role === role).length > 1);
|
|
60
|
+
if (repeated.length) {
|
|
61
|
+
throw new Error(`${named} declares more than one "${repeated.join('", "')}" decision key. ` +
|
|
62
|
+
`Only ${exports.REPEATABLE_ROLES.map(role => `"${role}"`).join(' and ')} may repeat — an approval can ` +
|
|
63
|
+
`change several things at once, and grounds come in several. The screen would draw one of the ` +
|
|
64
|
+
`others and could not say which.`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=decision-key-declaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-key-declaration.js","sourceRoot":"","sources":["../../../server/service/activity/decision-key-declaration.ts"],"names":[],"mappings":";;;AAwCA,kEA2DC;AAtFD,iGAAiG;AACpF,QAAA,cAAc,GAAG;IAC5B,UAAU;IACV,SAAS;IACT,eAAe;IACf,QAAQ;IACR,UAAU;IACV,cAAc;IACd,aAAa;IACb,QAAQ;CACA,CAAA;AAEV;;;;;;;;;;;;GAYG;AACU,QAAA,gBAAgB,GAAG,CAAC,aAAa,EAAE,UAAU,CAAU,CAAA;AAEpE,SAAgB,2BAA2B,CACzC,YAAkD,EAClD,YAAqB;IAErB,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;QAC1B,OAAM;IACR,CAAC;IAED,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,aAAa,YAAY,GAAG,CAAC,CAAC,CAAC,eAAe,CAAA;IAE3E,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAE,sBAAoC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IAEpH,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,yEAAyE;YAC/E,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,EAAE,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAC5D,mBAAmB,sBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,0CAA0C,CACzF,CAAA;IACH,CAAC;I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I,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,gCAAgC;YAC/F,+FAA+F;YAC/F,iCAAiC,CACpC,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["/**\n * Refuses a decisionKeys declaration that cannot draw.\n *\n * Same reasoning as search keys: a declaration that does not work should fail where it arrives, not\n * where someone opens an approval. The difference is what \"not working\" means here — nothing is\n * dropped by a save, so the failure would be a screen that quietly draws less than it was told to.\n *\n * The shape is spelled out rather than imported. ActivityDecisionKeyItem carries type-graphql\n * decorators and the test runner strips types without reading them, so importing the declared class\n * pulls type-graphql in and the test file fails to load.\n */\ntype DecisionKeyDeclaration = { role?: string; inputPath?: string }\n\n/** Roles a screen knows how to draw. Widening this is an architecture decision, not a lane's. */\nexport const DECISION_ROLES = [\n 'headline',\n 'subject',\n 'reversibility',\n 'reason',\n 'evidence',\n 'currentState',\n 'consequence',\n 'policy'\n] as const\n\n/**\n * The roles that may appear more than once.\n *\n * An approval can change several things at once — plant's priority change pushes some orders back\n * and moves others ahead — and those are separate consequences, not one merged sentence. Grounds\n * come in several the same way: which inspection, against which spec, decided when.\n *\n * Every other role names a single value. Two headlines would leave the screen picking one with\n * nothing to say why.\n *\n * Named consequence, not effect: TwinCommand.effect is what the source reported back after dispatch\n * — an observation, and past — while this is a prediction, and future.\n */\nexport const REPEATABLE_ROLES = ['consequence', 'evidence'] as const\n\nexport function assertDecisionKeysAreUsable(\n decisionKeys: DecisionKeyDeclaration[] | undefined,\n activityName?: string\n): void {\n if (!decisionKeys?.length) {\n return\n }\n\n const named = activityName ? `activity \"${activityName}\"` : 'this activity'\n\n const unknown = decisionKeys.filter(key => !(DECISION_ROLES as readonly string[]).includes(String(key?.role ?? '')))\n\n if (unknown.length) {\n throw new Error(\n `${named} declares decision keys with a role the approval screen does not know: ` +\n `${unknown.map(key => `\"${key?.role ?? ''}\"`).join(', ')}. ` +\n `Known roles are ${DECISION_ROLES.join(', ')}. A role outside that set draws nothing.`\n )\n }\n\n const pathless = decisionKeys.filter(key => !String(key?.inputPath ?? '').trim())\n\n if (pathless.length) {\n throw new Error(\n `${named} declares ${pathless.length} decision key(s) with no inputPath. ` +\n `A decision key names the value it draws; without a path there is nothing to read.`\n )\n }\n\n /*\n * An index or a wildcard resolves to nothing at draw time and the slot would report \"the path led\n * nowhere\" — which reads as a payload that disagrees with the declaration, when the truth is that\n * the declaration used a path language that does not exist. Refusing here says which it was.\n */\n const notPaths = decisionKeys.filter(key => /[[\\]*]/.test(String(key?.inputPath ?? '')))\n\n if (notPaths.length) {\n throw new Error(\n `${named} declares decision keys whose inputPath is not a plain dotted path: ` +\n `${notPaths.map(key => `\"${key?.inputPath ?? ''}\"`).join(', ')}. ` +\n `Dots only — no array index and no wildcard. Point at the list itself; drawing its items is ` +\n `the slot's work.`\n )\n }\n\n const repeated = DECISION_ROLES.filter(\n role =>\n !(REPEATABLE_ROLES as readonly string[]).includes(role) &&\n decisionKeys.filter(key => key?.role === role).length > 1\n )\n\n if (repeated.length) {\n throw new Error(\n `${named} declares more than one \"${repeated.join('\", \"')}\" decision key. ` +\n `Only ${REPEATABLE_ROLES.map(role => `\"${role}\"`).join(' and ')} may repeat — an approval can ` +\n `change several things at once, and grounds come in several. The screen would draw one of the ` +\n `others and could not say which.`\n )\n }\n}\n"]}
|
|
@@ -11,9 +11,14 @@ import { Activity } from './activity.js';
|
|
|
11
11
|
* transaction, so a refused model is never half-written.
|
|
12
12
|
*
|
|
13
13
|
* A template carrying such a field is caught here too: installActivity saves an Activity from it.
|
|
14
|
+
*
|
|
15
|
+
* What is refused here are declarations that cannot work — not policy about what an activity may
|
|
16
|
+
* mean. A credential field cannot be stored, and a sixth search key cannot be indexed; both would
|
|
17
|
+
* otherwise be accepted, dropped, and reported as saved.
|
|
14
18
|
*/
|
|
15
|
-
export declare class
|
|
19
|
+
export declare class ActivityDeclarationGuardSubscriber implements EntitySubscriberInterface<Activity> {
|
|
16
20
|
listenTo(): typeof Activity;
|
|
17
21
|
beforeInsert(event: InsertEvent<Activity>): void;
|
|
18
22
|
beforeUpdate(event: UpdateEvent<Activity>): void;
|
|
23
|
+
private assertDeclarable;
|
|
19
24
|
}
|