@things-factory/dataset 8.0.0 → 9.0.0-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist-client/activities/activity-data-review-edit.d.ts +5 -1
- package/dist-client/activities/activity-data-review-edit.js +143 -5
- package/dist-client/activities/activity-data-review-edit.js.map +1 -1
- package/dist-client/pages/data-entry/data-entry-list-page.js +2 -2
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/activities/activity-data-review.js +18 -5
- package/dist-server/activities/activity-data-review.js.map +1 -1
- package/dist-server/activities/activity-ooc-review.js +13 -52
- package/dist-server/activities/activity-ooc-review.js.map +1 -1
- package/dist-server/controllers/create-data-ooc.d.ts +4 -0
- package/dist-server/controllers/create-data-ooc.js +65 -0
- package/dist-server/controllers/create-data-ooc.js.map +1 -0
- package/dist-server/controllers/create-data-sample.js +4 -94
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/controllers/index.d.ts +3 -0
- package/dist-server/controllers/index.js +3 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/issue-ooc-resolve.d.ts +3 -0
- package/dist-server/controllers/issue-ooc-resolve.js +49 -0
- package/dist-server/controllers/issue-ooc-resolve.js.map +1 -0
- package/dist-server/controllers/issue-ooc-review.d.ts +3 -0
- package/dist-server/controllers/issue-ooc-review.js +47 -0
- package/dist-server/controllers/issue-ooc-review.js.map +1 -0
- package/dist-server/service/data-sample/data-sample-query.d.ts +1 -1
- package/dist-server/service/data-sample/data-sample-query.js +3 -3
- package/dist-server/service/data-sample/data-sample-query.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -26
- package/translations/en.json +3 -0
- package/translations/ja.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
- package/client/activities/activity-data-collect-edit.ts +0 -105
- package/client/activities/activity-data-collect-view.ts +0 -91
- package/client/activities/activity-data-review-edit.ts +0 -133
- package/client/activities/activity-data-review-view.ts +0 -145
- package/client/activities/activity-ooc-resolve-edit.ts +0 -195
- package/client/activities/activity-ooc-resolve-view.ts +0 -143
- package/client/activities/activity-ooc-review-edit.ts +0 -173
- package/client/activities/activity-ooc-review-view.ts +0 -129
- package/client/bootstrap.ts +0 -35
- package/client/components/data-entry-form.ts +0 -109
- package/client/index.ts +0 -1
- package/client/pages/data-archive/data-archive-list-page.ts +0 -277
- package/client/pages/data-archive/data-archive-request-popup.ts +0 -177
- package/client/pages/data-entry/data-entry-list-page.ts +0 -464
- package/client/pages/data-key-set/data-key-item-list.ts +0 -183
- package/client/pages/data-key-set/data-key-set-importer.ts +0 -89
- package/client/pages/data-key-set/data-key-set-list-page.ts +0 -413
- package/client/pages/data-ooc/data-ooc-list-page.ts +0 -549
- package/client/pages/data-ooc/data-ooc-page.ts +0 -164
- package/client/pages/data-ooc/data-ooc-view.ts +0 -236
- package/client/pages/data-ooc/data-oocs-page.ts +0 -200
- package/client/pages/data-report/data-report-embed-page.ts +0 -108
- package/client/pages/data-report/data-report-list-page.ts +0 -454
- package/client/pages/data-report/data-report-samples-page.ts +0 -174
- package/client/pages/data-report/jasper-report-oocs-page.ts +0 -110
- package/client/pages/data-report/jasper-report-samples-crosstab-page.ts +0 -110
- package/client/pages/data-report/jasper-report-samples-page.ts +0 -110
- package/client/pages/data-sample/data-sample-list-page.ts +0 -442
- package/client/pages/data-sample/data-sample-page.ts +0 -55
- package/client/pages/data-sample/data-sample-search-page.ts +0 -424
- package/client/pages/data-sample/data-sample-view.ts +0 -292
- package/client/pages/data-sample/data-samples-page.ts +0 -249
- package/client/pages/data-sensor/data-sensor-list-page.ts +0 -456
- package/client/pages/data-set/data-item-list.ts +0 -304
- package/client/pages/data-set/data-set-importer.ts +0 -89
- package/client/pages/data-set/data-set-list-page.ts +0 -1078
- package/client/pages/data-summary/data-summary-list-page.ts +0 -363
- package/client/pages/data-summary/data-summary-period-page.ts +0 -439
- package/client/pages/data-summary/data-summary-search-page.ts +0 -426
- package/client/pages/data-summary/data-summary-view.ts +0 -133
- package/client/route.ts +0 -91
- package/client/tsconfig.json +0 -13
- package/server/activities/activity-data-collect.ts +0 -100
- package/server/activities/activity-data-review.ts +0 -82
- package/server/activities/activity-ooc-resolve.ts +0 -123
- package/server/activities/activity-ooc-review.ts +0 -144
- package/server/activities/index.ts +0 -11
- package/server/controllers/create-data-sample.ts +0 -426
- package/server/controllers/data-use-case.ts +0 -98
- package/server/controllers/finalize-data-collection.ts +0 -388
- package/server/controllers/index.ts +0 -3
- package/server/controllers/issue-data-collection-task.ts +0 -70
- package/server/controllers/jasper-report.ts +0 -186
- package/server/controllers/query-data-summary-by-period.ts +0 -178
- package/server/controllers/shiny-report.ts +0 -54
- package/server/engine/index.ts +0 -1
- package/server/engine/task/create-data-sample.ts +0 -100
- package/server/engine/task/index.ts +0 -2
- package/server/engine/task/issue-collect-data.ts +0 -45
- package/server/index.ts +0 -8
- package/server/routes.ts +0 -188
- package/server/service/data-archive/data-archive-mutation.ts +0 -273
- package/server/service/data-archive/data-archive-query.ts +0 -58
- package/server/service/data-archive/data-archive-type.ts +0 -48
- package/server/service/data-archive/data-archive.ts +0 -69
- package/server/service/data-archive/index.ts +0 -6
- package/server/service/data-key-set/data-key-item-type.ts +0 -31
- package/server/service/data-key-set/data-key-set-mutation.ts +0 -201
- package/server/service/data-key-set/data-key-set-query.ts +0 -68
- package/server/service/data-key-set/data-key-set-type.ts +0 -70
- package/server/service/data-key-set/data-key-set.ts +0 -86
- package/server/service/data-key-set/index.ts +0 -6
- package/server/service/data-ooc/data-ooc-mutation.ts +0 -154
- package/server/service/data-ooc/data-ooc-query.ts +0 -106
- package/server/service/data-ooc/data-ooc-subscription.ts +0 -48
- package/server/service/data-ooc/data-ooc-type.ts +0 -71
- package/server/service/data-ooc/data-ooc.ts +0 -259
- package/server/service/data-ooc/index.ts +0 -7
- package/server/service/data-sample/data-sample-mutation.ts +0 -18
- package/server/service/data-sample/data-sample-query.ts +0 -215
- package/server/service/data-sample/data-sample-type.ts +0 -47
- package/server/service/data-sample/data-sample.ts +0 -193
- package/server/service/data-sample/index.ts +0 -6
- package/server/service/data-sensor/data-sensor-mutation.ts +0 -116
- package/server/service/data-sensor/data-sensor-query.ts +0 -76
- package/server/service/data-sensor/data-sensor-type.ts +0 -104
- package/server/service/data-sensor/data-sensor.ts +0 -126
- package/server/service/data-sensor/index.ts +0 -6
- package/server/service/data-set/data-item-type.ts +0 -155
- package/server/service/data-set/data-set-mutation.ts +0 -552
- package/server/service/data-set/data-set-query.ts +0 -461
- package/server/service/data-set/data-set-type.ts +0 -204
- package/server/service/data-set/data-set.ts +0 -326
- package/server/service/data-set/index.ts +0 -6
- package/server/service/data-set-history/data-set-history-query.ts +0 -126
- package/server/service/data-set-history/data-set-history-type.ts +0 -12
- package/server/service/data-set-history/data-set-history.ts +0 -217
- package/server/service/data-set-history/event-subscriber.ts +0 -17
- package/server/service/data-set-history/index.ts +0 -7
- package/server/service/data-spec/data-spec-manager.ts +0 -21
- package/server/service/data-spec/data-spec-query.ts +0 -21
- package/server/service/data-spec/data-spec.ts +0 -45
- package/server/service/data-spec/index.ts +0 -5
- package/server/service/data-summary/data-summary-mutation.ts +0 -45
- package/server/service/data-summary/data-summary-query.ts +0 -179
- package/server/service/data-summary/data-summary-type.ts +0 -86
- package/server/service/data-summary/data-summary.ts +0 -170
- package/server/service/data-summary/index.ts +0 -7
- package/server/service/index.ts +0 -57
- package/server/tsconfig.json +0 -10
- package/server/utils/config-resolver.ts +0 -29
- package/server/utils/index.ts +0 -1
@@ -1,100 +0,0 @@
|
|
1
|
-
import { In } from 'typeorm'
|
2
|
-
|
3
|
-
import { User } from '@things-factory/auth-base'
|
4
|
-
import {
|
5
|
-
Activity,
|
6
|
-
ActivityInstance,
|
7
|
-
ActivityInstanceStatus,
|
8
|
-
UpdateActivityInstanceStateAddendum
|
9
|
-
} from '@things-factory/worklist'
|
10
|
-
import { NewDataSample } from 'service/data-sample/data-sample-type'
|
11
|
-
import { createDataSample } from '../controllers/create-data-sample'
|
12
|
-
|
13
|
-
async function callback(
|
14
|
-
activityInstance: ActivityInstance,
|
15
|
-
addendum: UpdateActivityInstanceStateAddendum,
|
16
|
-
context: ResolverContext
|
17
|
-
) {
|
18
|
-
const { domain, tx } = context.state
|
19
|
-
const { input, output, state } = activityInstance
|
20
|
-
|
21
|
-
if (state == ActivityInstanceStatus.Ended) {
|
22
|
-
const activity = (await tx.getRepository(Activity).findOneBy({
|
23
|
-
domain: { id: In([domain.id, domain.parentId].filter(Boolean)) },
|
24
|
-
name: 'Collect Data'
|
25
|
-
})) as Activity
|
26
|
-
|
27
|
-
/* collect-data 액티비티는 한명의 assignee(thread)만 수행하는 multiple: false 액티비티이다. 따라서, output에는 assignee key가 없이, 순수한 data만 들어있다. */
|
28
|
-
const data = output
|
29
|
-
|
30
|
-
if (activity) {
|
31
|
-
const dataSample: NewDataSample = {
|
32
|
-
dataSet: {
|
33
|
-
id: input.dataSetId
|
34
|
-
},
|
35
|
-
data
|
36
|
-
}
|
37
|
-
|
38
|
-
await createDataSample(dataSample, context)
|
39
|
-
} else {
|
40
|
-
console.error('Collect Data Activity not installed.')
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
export const ActivityDataCollect = {
|
46
|
-
name: 'Collect Data',
|
47
|
-
description: 'Tasks assigned for data collection',
|
48
|
-
release: '1.0.0',
|
49
|
-
provider: 'hatiolab.com',
|
50
|
-
category: 'quality',
|
51
|
-
activityType: 'user',
|
52
|
-
priority: 1,
|
53
|
-
searchKeys: [
|
54
|
-
{
|
55
|
-
name: 'dataSetName',
|
56
|
-
description: 'DataSet name',
|
57
|
-
inputKey: 'dataSetName',
|
58
|
-
tKey: 'data-set-name'
|
59
|
-
}
|
60
|
-
],
|
61
|
-
startingType: '',
|
62
|
-
multiple: 'single',
|
63
|
-
model: [
|
64
|
-
{
|
65
|
-
name: 'dataSetId',
|
66
|
-
description: 'DataSet Id.',
|
67
|
-
tag: 'dataSetId',
|
68
|
-
hidden: true,
|
69
|
-
mandatory: true,
|
70
|
-
inout: 'in',
|
71
|
-
type: 'string',
|
72
|
-
options: {},
|
73
|
-
unit: null,
|
74
|
-
quantifier: [1],
|
75
|
-
spec: {}
|
76
|
-
},
|
77
|
-
{
|
78
|
-
name: 'dataSetName',
|
79
|
-
description: 'DataSet name',
|
80
|
-
tag: 'dataSetName',
|
81
|
-
hidden: true,
|
82
|
-
mandatory: true,
|
83
|
-
inout: 'in',
|
84
|
-
type: 'string',
|
85
|
-
options: {},
|
86
|
-
unit: null,
|
87
|
-
quantifier: [1],
|
88
|
-
spec: {}
|
89
|
-
}
|
90
|
-
],
|
91
|
-
uiType: 'custom-element',
|
92
|
-
uiSource: 'activity-data-collect-edit',
|
93
|
-
viewType: 'custom-element',
|
94
|
-
viewSource: 'activity-data-collect-view',
|
95
|
-
reportType: 'custom-element',
|
96
|
-
reportSource: 'activity-data-collect-view',
|
97
|
-
thumbnail: '/assets/images/data-collect.png',
|
98
|
-
standardTime: 24 * 60 * 60, // seconds
|
99
|
-
callback /* Called when there is a change in the lifecycle of a task (activity-instance). */
|
100
|
-
}
|
@@ -1,82 +0,0 @@
|
|
1
|
-
import { ActivityInstance, ActivityInstanceStatus, UpdateActivityInstanceStateAddendum } from '@things-factory/worklist'
|
2
|
-
|
3
|
-
import { DataOocStatus } from '../service/data-ooc/data-ooc'
|
4
|
-
import { DataSample } from '../service/data-sample/data-sample'
|
5
|
-
|
6
|
-
async function callback(
|
7
|
-
activityInstance: ActivityInstance,
|
8
|
-
addendum: UpdateActivityInstanceStateAddendum,
|
9
|
-
context: ResolverContext
|
10
|
-
) {
|
11
|
-
const { domain, tx, user } = context.state
|
12
|
-
const { input, output, state } = activityInstance
|
13
|
-
|
14
|
-
if (state == ActivityInstanceStatus.Ended) {
|
15
|
-
var dataSample = await tx.getRepository(DataSample).findOne({
|
16
|
-
where: { domain: { id: domain.id }, id: input?.dataSample?.id }
|
17
|
-
})
|
18
|
-
|
19
|
-
dataSample = await tx.getRepository(DataSample).save({
|
20
|
-
...dataSample,
|
21
|
-
output,
|
22
|
-
state: DataOocStatus.REVIEWED
|
23
|
-
})
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
export const ActivityDataReview = {
|
28
|
-
name: 'Data Review',
|
29
|
-
description: 'Tasks for data review',
|
30
|
-
release: '1.0.0',
|
31
|
-
provider: 'hatiolab.com',
|
32
|
-
category: 'quality',
|
33
|
-
activityType: 'user',
|
34
|
-
priority: 1,
|
35
|
-
searchKeys: [
|
36
|
-
{
|
37
|
-
name: 'dataSetName',
|
38
|
-
description: 'DataSet name',
|
39
|
-
inputKey: 'dataSetName',
|
40
|
-
tKey: 'data-set-name'
|
41
|
-
}
|
42
|
-
],
|
43
|
-
startingType: '',
|
44
|
-
multiple: 'single',
|
45
|
-
model: [
|
46
|
-
{
|
47
|
-
name: 'dataSetId',
|
48
|
-
description: 'DataSet Id.',
|
49
|
-
tag: 'dataSetId',
|
50
|
-
hidden: true,
|
51
|
-
mandatory: true,
|
52
|
-
inout: 'in',
|
53
|
-
type: 'string',
|
54
|
-
options: {},
|
55
|
-
unit: null,
|
56
|
-
quantifier: [1],
|
57
|
-
spec: {}
|
58
|
-
},
|
59
|
-
{
|
60
|
-
name: 'dataSetName',
|
61
|
-
description: 'DataSet name',
|
62
|
-
tag: 'dataSetName',
|
63
|
-
hidden: true,
|
64
|
-
mandatory: true,
|
65
|
-
inout: 'in',
|
66
|
-
type: 'string',
|
67
|
-
options: {},
|
68
|
-
unit: null,
|
69
|
-
quantifier: [1],
|
70
|
-
spec: {}
|
71
|
-
}
|
72
|
-
],
|
73
|
-
uiType: 'custom-element',
|
74
|
-
uiSource: 'activity-data-review-edit',
|
75
|
-
viewType: 'custom-element',
|
76
|
-
viewSource: 'activity-data-review-view',
|
77
|
-
reportType: 'custom-element',
|
78
|
-
reportSource: 'activity-data-review-view',
|
79
|
-
thumbnail: '/assets/images/data-collect.png',
|
80
|
-
standardTime: 24 * 60 * 60, // seconds
|
81
|
-
callback /* Called when there is a change in the lifecycle of a task (activity-instance). */
|
82
|
-
}
|
@@ -1,123 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
ActivityInstance,
|
3
|
-
ActivityInstanceStatus,
|
4
|
-
ActivityThread,
|
5
|
-
ActivityThreadStatus,
|
6
|
-
UpdateActivityInstanceStateAddendum
|
7
|
-
} from '@things-factory/worklist'
|
8
|
-
import { DataOoc, DataOocStatus } from '../service/data-ooc/data-ooc'
|
9
|
-
|
10
|
-
async function callback(
|
11
|
-
activityInstance: ActivityInstance,
|
12
|
-
addendum: UpdateActivityInstanceStateAddendum,
|
13
|
-
context: ResolverContext
|
14
|
-
) {
|
15
|
-
const { tx, user, domain } = context.state
|
16
|
-
const { id, input, output, state, terminatedAt } = activityInstance
|
17
|
-
const { causedBy } = addendum || {}
|
18
|
-
|
19
|
-
/* Resolve Activity가 완료되면, 해당 data-ooc 엔티티의 correctiveAction, correctorId, correctedAt 을 update한다. */
|
20
|
-
if (state == ActivityInstanceStatus.Ended) {
|
21
|
-
const activityThreads = await tx.getRepository(ActivityThread).find({
|
22
|
-
where: {
|
23
|
-
domain: { id: domain.id },
|
24
|
-
activityInstance: { id },
|
25
|
-
state: ActivityThreadStatus.Ended
|
26
|
-
},
|
27
|
-
relations: ['assignee']
|
28
|
-
})
|
29
|
-
|
30
|
-
const corrector = activityThreads[0]?.assignee
|
31
|
-
|
32
|
-
const { dataOocId } = input
|
33
|
-
const correctiveAction = output?.action
|
34
|
-
|
35
|
-
var dataOoc = await tx.getRepository(DataOoc).findOne({
|
36
|
-
where: {
|
37
|
-
domain: { id: domain.id },
|
38
|
-
id: dataOocId
|
39
|
-
},
|
40
|
-
relations: ['dataSet']
|
41
|
-
})
|
42
|
-
|
43
|
-
/* dataOoc Review 결과를 dataOoc 엔티티에 반영한다. */
|
44
|
-
dataOoc = await tx.getRepository(DataOoc).save({
|
45
|
-
...dataOoc,
|
46
|
-
correctedAt: terminatedAt,
|
47
|
-
corrector: corrector,
|
48
|
-
correctiveAction,
|
49
|
-
updater: user,
|
50
|
-
state: DataOocStatus.CORRECTED
|
51
|
-
})
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
export const ActivityOocResolve = {
|
56
|
-
name: 'OOC Resolve',
|
57
|
-
description: 'Task to take remedial action based on Out Of Control data',
|
58
|
-
release: '1.0.0',
|
59
|
-
provider: 'hatiolab.com',
|
60
|
-
category: 'quality',
|
61
|
-
activityType: 'user',
|
62
|
-
priority: 3,
|
63
|
-
searchKeys: [
|
64
|
-
{
|
65
|
-
name: 'dataOocId',
|
66
|
-
description: 'OOC Id.',
|
67
|
-
inputKey: 'dataOocId',
|
68
|
-
tKey: 'data-ooc-id'
|
69
|
-
}
|
70
|
-
],
|
71
|
-
startingType: '',
|
72
|
-
multiple: 'single',
|
73
|
-
model: [
|
74
|
-
{
|
75
|
-
name: 'dataOocId',
|
76
|
-
description: 'OOC id',
|
77
|
-
tag: 'dataOocId',
|
78
|
-
hidden: true,
|
79
|
-
mandatory: true,
|
80
|
-
inout: 'in',
|
81
|
-
type: 'string',
|
82
|
-
options: {},
|
83
|
-
unit: null,
|
84
|
-
quantifier: [1],
|
85
|
-
spec: {}
|
86
|
-
},
|
87
|
-
{
|
88
|
-
name: 'instruction',
|
89
|
-
description: 'Instructions for resolving OOC',
|
90
|
-
tag: 'instruction',
|
91
|
-
hidden: false,
|
92
|
-
mandatory: true,
|
93
|
-
inout: 'in',
|
94
|
-
type: 'textarea',
|
95
|
-
options: {},
|
96
|
-
unit: null,
|
97
|
-
quantifier: [1],
|
98
|
-
spec: {}
|
99
|
-
},
|
100
|
-
{
|
101
|
-
name: 'action',
|
102
|
-
description: 'Action Description',
|
103
|
-
tag: 'action',
|
104
|
-
hidden: false,
|
105
|
-
mandatory: true,
|
106
|
-
inout: 'out',
|
107
|
-
type: 'textarea',
|
108
|
-
options: {},
|
109
|
-
unit: null,
|
110
|
-
quantifier: [1],
|
111
|
-
spec: {}
|
112
|
-
}
|
113
|
-
],
|
114
|
-
uiType: 'custom-element',
|
115
|
-
uiSource: 'activity-ooc-resolve-edit',
|
116
|
-
viewType: 'custom-element',
|
117
|
-
viewSource: 'activity-ooc-resolve-view',
|
118
|
-
reportType: 'custom-element',
|
119
|
-
reportSource: 'data-ooc-report-page',
|
120
|
-
thumbnail: '/assets/images/ooc.png',
|
121
|
-
standardTime: 24 * 60 * 60, // seconds
|
122
|
-
callback /* Called when there is a change in the lifecycle of a task (activity-instance). */
|
123
|
-
}
|
@@ -1,144 +0,0 @@
|
|
1
|
-
import { In } from 'typeorm'
|
2
|
-
import {
|
3
|
-
Activity,
|
4
|
-
ActivityInstance,
|
5
|
-
ActivityInstanceStatus,
|
6
|
-
UpdateActivityInstanceStateAddendum
|
7
|
-
} from '@things-factory/worklist'
|
8
|
-
import { issue } from '@things-factory/worklist/dist-server/controllers/activity-instance/issue'
|
9
|
-
import { Role } from '@things-factory/auth-base'
|
10
|
-
|
11
|
-
import { DataOoc, DataOocStatus } from '../service/data-ooc/data-ooc'
|
12
|
-
|
13
|
-
async function callback(
|
14
|
-
activityInstance: ActivityInstance,
|
15
|
-
addendum: UpdateActivityInstanceStateAddendum,
|
16
|
-
context: ResolverContext
|
17
|
-
) {
|
18
|
-
const { domain, user, tx } = context.state
|
19
|
-
const { input, output, state, terminatedAt } = activityInstance
|
20
|
-
const { causedBy } = addendum || {}
|
21
|
-
|
22
|
-
if (state == ActivityInstanceStatus.Ended) {
|
23
|
-
const activity = (await tx.getRepository(Activity).findOneBy({
|
24
|
-
domain: domain.parentId ? In([domain.id, domain.parentId]) : { id: domain.id },
|
25
|
-
name: 'OOC Resolve'
|
26
|
-
})) as Activity
|
27
|
-
|
28
|
-
if (activity) {
|
29
|
-
const { dataOocId } = input
|
30
|
-
const correctiveInstruction = output?.instruction
|
31
|
-
|
32
|
-
var dataOoc = await tx.getRepository(DataOoc).findOne({
|
33
|
-
where: {
|
34
|
-
domain: { id: domain.id },
|
35
|
-
id: dataOocId
|
36
|
-
},
|
37
|
-
relations: ['dataSet']
|
38
|
-
})
|
39
|
-
|
40
|
-
const dataSet = dataOoc.dataSet
|
41
|
-
const { resolverRoleId, outlierApprovalLine } = dataSet
|
42
|
-
|
43
|
-
/* dataOoc Review 결과를 dataOoc 엔티티에 반영한다. */
|
44
|
-
dataOoc = await tx.getRepository(DataOoc).save({
|
45
|
-
...dataOoc,
|
46
|
-
reviewedAt: terminatedAt,
|
47
|
-
reviewer: user,
|
48
|
-
correctiveInstruction,
|
49
|
-
state: DataOocStatus.REVIEWED
|
50
|
-
})
|
51
|
-
|
52
|
-
const assigneeRole =
|
53
|
-
resolverRoleId &&
|
54
|
-
(await tx.getRepository(Role).findOneBy({
|
55
|
-
domain: { id: In([domain.id, domain.parentId].filter(Boolean)) },
|
56
|
-
id: resolverRoleId
|
57
|
-
}))
|
58
|
-
|
59
|
-
/* 해당 dataset의 작업 담당자(resolverRole)에게 OOC 해결을 위한 태스크를 지시한다. */
|
60
|
-
if (assigneeRole) {
|
61
|
-
const activityInstance = {
|
62
|
-
name: `[OOC 조치] ${dataSet.name}`,
|
63
|
-
description: dataSet.description,
|
64
|
-
activityId: activity.id,
|
65
|
-
dueAt: new Date(terminatedAt.getTime() + (activity.standardTime || 24 * 60 * 60) * 1000),
|
66
|
-
input: {
|
67
|
-
dataOocId,
|
68
|
-
instruction: correctiveInstruction
|
69
|
-
},
|
70
|
-
assigneeRole,
|
71
|
-
threadsMin: 1,
|
72
|
-
threadsMax: 1,
|
73
|
-
approvalLine: outlierApprovalLine
|
74
|
-
}
|
75
|
-
|
76
|
-
dataOoc.resolveActivityInstance = await issue(activityInstance, context)
|
77
|
-
await tx.getRepository(DataOoc).save(dataOoc)
|
78
|
-
} else {
|
79
|
-
console.error(
|
80
|
-
`Assignees are not set. So, Data OOC Resolve task for ${dataOoc.name}(${dataOoc.id}) could not be issued.`
|
81
|
-
)
|
82
|
-
}
|
83
|
-
} else {
|
84
|
-
console.error('OOC Resolve Activity not installed.')
|
85
|
-
}
|
86
|
-
}
|
87
|
-
}
|
88
|
-
|
89
|
-
export const ActivityOocReview = {
|
90
|
-
name: 'OOC Review',
|
91
|
-
description: 'Task to take remedial action based on Out Of Control data',
|
92
|
-
release: '1.0.0',
|
93
|
-
provider: 'hatiolab.com',
|
94
|
-
category: 'quality',
|
95
|
-
activityType: 'user',
|
96
|
-
priority: 2,
|
97
|
-
searchKeys: [
|
98
|
-
{
|
99
|
-
name: 'dataOocId',
|
100
|
-
description: 'OOC Id.',
|
101
|
-
inputKey: 'dataOocId',
|
102
|
-
tKey: 'data-ooc-id'
|
103
|
-
}
|
104
|
-
],
|
105
|
-
startingType: '',
|
106
|
-
multiple: 'single',
|
107
|
-
model: [
|
108
|
-
{
|
109
|
-
name: 'dataOocId',
|
110
|
-
description: 'OOC id',
|
111
|
-
tag: 'dataOocId',
|
112
|
-
hidden: true,
|
113
|
-
mandatory: true,
|
114
|
-
inout: 'in',
|
115
|
-
type: 'string',
|
116
|
-
options: {},
|
117
|
-
unit: null,
|
118
|
-
quantifier: [1],
|
119
|
-
spec: {}
|
120
|
-
},
|
121
|
-
{
|
122
|
-
name: 'Instruction',
|
123
|
-
description: 'Instructions for preventing OOC',
|
124
|
-
tag: 'instruction',
|
125
|
-
hidden: false,
|
126
|
-
mandatory: true,
|
127
|
-
inout: 'out',
|
128
|
-
type: 'textarea',
|
129
|
-
options: {},
|
130
|
-
unit: null,
|
131
|
-
quantifier: [1],
|
132
|
-
spec: {}
|
133
|
-
}
|
134
|
-
],
|
135
|
-
uiType: 'custom-element',
|
136
|
-
uiSource: 'activity-ooc-review-edit',
|
137
|
-
viewType: 'custom-element',
|
138
|
-
viewSource: 'activity-ooc-review-view',
|
139
|
-
reportType: 'custom-element',
|
140
|
-
reportSource: 'data-ooc-report-page',
|
141
|
-
thumbnail: '/assets/images/ooc.png',
|
142
|
-
standardTime: 24 * 60 * 60, // seconds
|
143
|
-
callback /* Called when there is a change in the lifecycle of a task (activity-instance). */
|
144
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { ActivityInstallations } from '@things-factory/worklist'
|
2
|
-
|
3
|
-
import { ActivityDataCollect } from './activity-data-collect'
|
4
|
-
import { ActivityDataReview } from './activity-data-review'
|
5
|
-
import { ActivityOocResolve } from './activity-ooc-resolve'
|
6
|
-
import { ActivityOocReview } from './activity-ooc-review'
|
7
|
-
|
8
|
-
/* activity templates installation */
|
9
|
-
;[ActivityOocReview, ActivityOocResolve, ActivityDataCollect, ActivityDataReview].forEach(template => {
|
10
|
-
ActivityInstallations.installActivityTemplate(template as any)
|
11
|
-
})
|