@things-factory/dataset 6.2.58 → 6.2.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/client/activities/activity-data-collect-edit.ts +1 -0
  2. package/client/activities/activity-data-collect-view.ts +1 -0
  3. package/client/activities/activity-ooc-resolve-edit.ts +1 -0
  4. package/client/activities/activity-ooc-resolve-view.ts +1 -0
  5. package/client/activities/activity-ooc-review-edit.ts +1 -0
  6. package/client/activities/activity-ooc-review-view.ts +1 -0
  7. package/client/pages/data-entry/data-entry-list-page.ts +1 -0
  8. package/client/pages/data-report/data-report-list-page.ts +1 -0
  9. package/client/pages/data-set/data-item-list.ts +9 -0
  10. package/client/pages/data-set/data-set-list-page.ts +1 -0
  11. package/client/pages/data-summary/data-summary-period-page.ts +1 -0
  12. package/client/pages/data-summary/data-summary-search-page.ts +1 -0
  13. package/client/pages/data-summary/data-summary-view.ts +1 -0
  14. package/dist-client/activities/activity-data-collect-edit.js +1 -0
  15. package/dist-client/activities/activity-data-collect-edit.js.map +1 -1
  16. package/dist-client/activities/activity-data-collect-view.js +1 -0
  17. package/dist-client/activities/activity-data-collect-view.js.map +1 -1
  18. package/dist-client/activities/activity-ooc-resolve-edit.js +1 -0
  19. package/dist-client/activities/activity-ooc-resolve-edit.js.map +1 -1
  20. package/dist-client/activities/activity-ooc-resolve-view.js +1 -0
  21. package/dist-client/activities/activity-ooc-resolve-view.js.map +1 -1
  22. package/dist-client/activities/activity-ooc-review-edit.js +1 -0
  23. package/dist-client/activities/activity-ooc-review-edit.js.map +1 -1
  24. package/dist-client/activities/activity-ooc-review-view.js +1 -0
  25. package/dist-client/activities/activity-ooc-review-view.js.map +1 -1
  26. package/dist-client/pages/data-entry/data-entry-list-page.js +1 -0
  27. package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
  28. package/dist-client/pages/data-report/data-report-list-page.js +1 -0
  29. package/dist-client/pages/data-report/data-report-list-page.js.map +1 -1
  30. package/dist-client/pages/data-set/data-item-list.js +9 -0
  31. package/dist-client/pages/data-set/data-item-list.js.map +1 -1
  32. package/dist-client/pages/data-set/data-set-list-page.js +1 -0
  33. package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
  34. package/dist-client/pages/data-summary/data-summary-period-page.js +1 -0
  35. package/dist-client/pages/data-summary/data-summary-period-page.js.map +1 -1
  36. package/dist-client/pages/data-summary/data-summary-search-page.js +1 -0
  37. package/dist-client/pages/data-summary/data-summary-search-page.js.map +1 -1
  38. package/dist-client/pages/data-summary/data-summary-view.js +1 -0
  39. package/dist-client/pages/data-summary/data-summary-view.js.map +1 -1
  40. package/dist-client/tsconfig.tsbuildinfo +1 -1
  41. package/dist-server/controllers/create-data-sample.js +22 -24
  42. package/dist-server/controllers/create-data-sample.js.map +1 -1
  43. package/dist-server/service/data-set/data-item-type.js +46 -20
  44. package/dist-server/service/data-set/data-item-type.js.map +1 -1
  45. package/dist-server/service/data-set/data-set.js +54 -30
  46. package/dist-server/service/data-set/data-set.js.map +1 -1
  47. package/dist-server/tsconfig.tsbuildinfo +1 -1
  48. package/helps/dataset/data-set.ja.md +103 -0
  49. package/helps/dataset/data-set.ko.md +101 -0
  50. package/helps/dataset/data-set.md +103 -43
  51. package/helps/dataset/data-set.ms.md +103 -0
  52. package/helps/dataset/data-set.zh.md +103 -0
  53. package/helps/dataset/ui/data-item-list.ja.md +91 -0
  54. package/helps/dataset/ui/data-item-list.ko.md +90 -0
  55. package/helps/dataset/ui/data-item-list.md +88 -26
  56. package/helps/dataset/ui/data-item-list.ms.md +90 -0
  57. package/helps/dataset/ui/data-item-list.zh.md +88 -0
  58. package/package.json +2 -2
  59. package/server/controllers/create-data-sample.ts +23 -25
  60. package/server/service/data-set/data-item-type.ts +48 -20
  61. package/server/service/data-set/data-set.ts +56 -30
  62. package/translations/en.json +3 -2
  63. package/translations/ja.json +1 -0
  64. package/translations/ko.json +3 -2
  65. package/translations/ms.json +1 -0
  66. package/translations/zh.json +3 -2
@@ -171,8 +171,7 @@ async function createDataSample(dataSample, context) {
171
171
  dataOocId: dataOoc.id
172
172
  },
173
173
  assignees,
174
- approvalLine: [],
175
- outlierApprovalLine: []
174
+ approvalLine: []
176
175
  };
177
176
  await (0, issue_1.issue)(activityInstance, context);
178
177
  }
@@ -212,7 +211,7 @@ async function createDataSample(dataSample, context) {
212
211
  const assignee = dataSet.supervisoryRoleId &&
213
212
  (await tx.getRepository(auth_base_1.Role).findOneBy({ domain: { id: domain.id }, id: dataSet.supervisoryRoleId }));
214
213
  const assignees = dataSet.supervisoryRoleId ? [{ type: 'Role', value: dataSet.supervisoryRoleId, assignee }] : [];
215
- /* 해당 dataset의 supervisor로 하여금, OOC를 리뷰하고 instruction을 작성해서, OOC 해결을 위한 태스크를 dataset assignees에게 지시하도록 한다. */
214
+ /* 해당 dataset의 supervisor로 하여금, data를 리뷰하고 instruction을 작성해서, approvalLine을 이용 해서 승인을 한다. */
216
215
  if (assignees && assignees instanceof Array && assignees.length > 0) {
217
216
  result.dataItems = dataItems;
218
217
  const activityInstance = {
@@ -224,10 +223,28 @@ async function createDataSample(dataSample, context) {
224
223
  dataSample: result
225
224
  },
226
225
  assignees,
227
- approvalLine: [],
228
- outlierApprovalLine: []
226
+ approvalLine: dataSet.reviewApprovalLine
229
227
  };
230
228
  await (0, issue_1.issue)(activityInstance, context);
229
+ try {
230
+ shell_1.pubsub.publish('data-set', {
231
+ dataSet,
232
+ supervisoryRoleId: dataSet.supervisoryRoleId
233
+ });
234
+ shell_1.pubsub.publish('notification', {
235
+ notification: {
236
+ domain,
237
+ type: 'info',
238
+ title: `[Data Review] ${dataSet.name}`,
239
+ body: `Data Review occurred on '${dataSet.name}'`,
240
+ url: (0, shell_1.getRedirectSubdomainPath)(context, domain.subdomain, `/data-set/${dataSet.id}`),
241
+ timestamp: collectedAt
242
+ }
243
+ });
244
+ }
245
+ catch (err) {
246
+ env_1.logger.error('Notification', err);
247
+ }
231
248
  }
232
249
  else {
233
250
  console.error(`Assignees are not set. So Data Review task for ${dataSet.name}(${dataSet.id}) could not be issued.`);
@@ -236,25 +253,6 @@ async function createDataSample(dataSample, context) {
236
253
  else {
237
254
  console.error('Data Review Activity not installed.');
238
255
  }
239
- try {
240
- shell_1.pubsub.publish('data-set', {
241
- dataSet,
242
- supervisoryRoleId: dataSet.supervisoryRoleId
243
- });
244
- shell_1.pubsub.publish('notification', {
245
- notification: {
246
- domain,
247
- type: 'info',
248
- title: `[Data Review] ${dataSet.name}`,
249
- body: `Data Review occurred on '${dataSet.name}'`,
250
- url: (0, shell_1.getRedirectSubdomainPath)(context, domain.subdomain, `/data-set/${dataSet.id}`),
251
- timestamp: collectedAt
252
- }
253
- });
254
- }
255
- catch (err) {
256
- env_1.logger.error('Notification', err);
257
- }
258
256
  }
259
257
  return result;
260
258
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-data-sample.js","sourceRoot":"","sources":["../../server/controllers/create-data-sample.ts"],"names":[],"mappings":";;;;AAAA,8EAAoC;AACpC,qCAA4B;AAE5B,qEAA8E;AAC9E,yDAAgD;AAChD,6CAA4C;AAC5C,iDAAwE;AACxE,2DAAgE;AAChE,uDAAmD;AACnD,oGAAgG;AAEhG,2DAAqE;AACrE,oEAA+D;AAE/D,2DAAsD;AACtD,mDAA6C;AAE7C,mCAAmC;AACnC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,CAAA;AAEtB,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE;IACxC,MAAM,IAAI,GAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,YAAY,KAAI,EAAE,CAAA;IAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,GAAG,CAAC,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C,CAAA;SACH;QAAC,OAAO,GAAG,EAAE;YACZ,YAAM,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAA;SAClC;KACF;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AA7QD,4CA6QC","sourcesContent":["import moment from 'moment-timezone'\nimport { In } from 'typeorm'\n\nimport { Attachment, createAttachment } from '@things-factory/attachment-base'\nimport { Role } from '@things-factory/auth-base'\nimport { logger } from '@things-factory/env'\nimport { getRedirectSubdomainPath, pubsub } from '@things-factory/shell'\nimport { getWorkDateAndShift } from '@things-factory/work-shift'\nimport { Activity } from '@things-factory/worklist'\nimport { issue } from '@things-factory/worklist/dist-server/controllers/activity-instance/issue'\n\nimport { DataOoc, DataOocStatus } from '../service/data-ooc/data-ooc'\nimport { DataSample } from '../service/data-sample/data-sample'\nimport { NewDataSample } from '../service/data-sample/data-sample-type'\nimport { DataSet } from '../service/data-set/data-set'\nimport { DataUseCase } from './data-use-case'\n\n// See README.md at ## Data Samples\nprocess.env.TZ = 'UTC'\n\nconst fillDataKeys = (dataKeySet, data) => {\n const keys = dataKeySet?.dataKeyItems || []\n return keys.reduce((sum, key, index) => {\n const value = data[key.dataKey]\n if (value != null) {\n sum[`key0${index + 1}`] = value instanceof Array ? value[0] : value\n }\n return sum\n }, {})\n}\n\n// parse variable javascript string pattern\nconst replaceVariables = (keys, dic) => {\n for (const k in keys) {\n const matches = keys[k].match(/\\$\\{\\w*\\}/g)\n matches &&\n matches.forEach(m => {\n keys[k] = keys[k].replace(m, dic[m.slice(2, -1)])\n })\n }\n return keys\n}\n\n// It is required UTC date for Partitioning File System like AWS S3 from Athena.\n// ex) %YYYY, %MM, %DD\nconst formatDate = (keys, _moment) => {\n for (const k in keys) {\n const matches = keys[k].match(/%\\w*/g)\n matches &&\n matches.forEach(m => {\n keys[k] = keys[k].replace(m, _moment.format(m.substr(1)))\n })\n }\n return keys\n}\n\nexport async function createDataSample(dataSample: NewDataSample, context: ResolverContext): Promise<DataSample> {\n const { domain, user, tx } = context.state\n\n const dataSet = await tx.getRepository(DataSet).findOne({\n where: { domain: { id: In([domain.id, domain.parentId].filter(Boolean)) }, id: dataSample.dataSet.id },\n relations: ['dataKeySet']\n })\n\n const dataItems = dataSet.dataItems\n const collectedAt = dataSample.collectedAt || new Date()\n\n const timezone = dataSet.timezone || domain.timezone || 'UTC'\n const format = 'YYYY-MM-DD'\n\n // workDate ex) 2022-04-04\n const { workDate, workShift } = await getWorkDateAndShift(domain, collectedAt, { timezone, format })\n\n // local time dataSet timezone or domain timezone or default 'UTC'\n\n const localDateTz = moment(collectedAt).tz(timezone)\n const defaultPartitionKeys = {\n domain: domain.subdomain,\n datasetid: dataSample.dataSet.id /* It should not be 'data_set_id' as column name duplicated for Glue */,\n date: localDateTz.format(format) /* local time date */,\n workdate: workDate /* working date */,\n workshift: workShift\n }\n\n var partitionKeys = {\n ...defaultPartitionKeys,\n ...dataSet.partitionKeys\n }\n\n partitionKeys = formatDate(partitionKeys, localDateTz)\n partitionKeys = replaceVariables(partitionKeys, dataSample.data)\n\n const dataKeys = fillDataKeys(dataSet?.dataKeySet, dataSample.data)\n\n const { ooc, oos, judgment } = DataUseCase.evaluate(dataSet, dataItems, dataSample.data) || {}\n\n const old = await tx.getRepository(DataSample).findOne({\n where: {\n domain: { id: domain.id },\n dataSet: { id: dataSet.id },\n collectedAt,\n ...dataKeys\n }\n })\n\n /* \n pre-processing for file attachment.\n currently only support type of [FileUpload].\n If [FileUpload[]] type needed, add 'files' type for dataset\n */\n\n const data = dataSample.data\n const attachments = []\n\n for (let dataItem of dataItems) {\n if (dataItem.type == 'file') {\n const tag = dataItem.tag\n const filesArray = data[tag]\n\n if (tag && filesArray && filesArray.length > 0) {\n let pathsArray = []\n\n for (let files of filesArray) {\n let paths = []\n\n if (files instanceof Array) {\n for (let file of files) {\n if (file) {\n const attachment = await createAttachment(\n null,\n {\n attachment: {\n file: file.file,\n refType: DataSample.name\n }\n },\n context\n )\n\n const fetched = await tx.getRepository(Attachment).findOneBy({ id: attachment.id })\n if (fetched) {\n attachments.push(fetched)\n paths.push({\n id: fetched.id,\n mimetype: fetched.mimetype,\n name: fetched.name,\n fullpath: fetched.fullpath\n })\n } else {\n throw `Failed to save file(${attachment.name})`\n }\n } else {\n paths.push(null)\n }\n }\n }\n\n pathsArray.push(paths)\n }\n\n data[tag] = pathsArray\n }\n }\n }\n\n const result = await tx.getRepository(DataSample).save({\n ...old,\n name: dataSet.name,\n description: dataSet.description,\n useCase: dataSet.useCase,\n type: dataSet.type,\n ...dataSample,\n ...dataKeys,\n dataSetVersion: dataSet.version,\n domain,\n partitionKeys,\n ooc,\n oos,\n judgment,\n collectedAt,\n workDate,\n workShift,\n creator: user,\n updater: user\n })\n\n /* post-process for for file attachment. */\n if (attachments.length > 0) {\n attachments.forEach(attachment => (attachment.refId = result.id))\n tx.getRepository(Attachment).save(attachments)\n }\n\n if (ooc || oos) {\n const dataOoc = await tx.getRepository(DataOoc).save({\n ...result,\n history: [\n {\n user: {\n id: user?.id,\n name: user?.name\n },\n state: DataOocStatus.ISSUED,\n timestamp: collectedAt\n }\n ],\n state: DataOocStatus.ISSUED\n })\n\n const activity = (await tx.getRepository(Activity).findOneBy({\n domain: { id: domain.id },\n name: 'OOC Review'\n })) as Activity\n\n if (activity) {\n const assignee =\n dataSet.supervisoryRoleId &&\n (await tx.getRepository(Role).findOneBy({ domain: { id: domain.id }, id: dataSet.supervisoryRoleId }))\n\n const assignees = dataSet.supervisoryRoleId ? [{ type: 'Role', value: dataSet.supervisoryRoleId, assignee }] : []\n\n /* 해당 dataset의 supervisor로 하여금, OOC를 리뷰하고 instruction을 작성해서, OOC 해결을 위한 태스크를 dataset assignees에게 지시하도록 한다. */\n if (assignees && assignees instanceof Array && assignees.length > 0) {\n const activityInstance = {\n name: `[OOC 검토] ${dataSet.name}`,\n description: dataSet.description,\n activityId: activity.id,\n dueAt: new Date(collectedAt.getTime() + 24 * 60 * 60 * 1000),\n input: {\n dataOocId: dataOoc.id\n },\n assignees,\n approvalLine: [],\n outlierApprovalLine: []\n }\n\n await issue(activityInstance, context)\n } else {\n console.error(\n `Assignees are not set. So Data OOC Review task for ${dataOoc.name}(${dataOoc.id}) could not be issued.`\n )\n }\n } else {\n console.error('OOC Review Activity not installed.')\n }\n\n try {\n pubsub.publish('data-ooc', {\n dataOoc,\n supervisoryRoleId: dataSet.supervisoryRoleId\n })\n\n pubsub.publish('notification', {\n notification: {\n domain,\n type: 'error',\n title: `[OOC] ${dataSet.name}`,\n body: `Data OOC occurred on '${dataSet.name}'`,\n url: getRedirectSubdomainPath(context, domain.subdomain, `/data-ooc/${dataOoc.id}`),\n timestamp: collectedAt\n }\n })\n } catch (err) {\n logger.error('Notification', err)\n }\n } else if (dataSet.requiresReview) {\n const activity = (await tx.getRepository(Activity).findOneBy({\n domain: { id: domain.id },\n name: 'Data Review'\n })) as Activity\n\n if (activity) {\n const assignee =\n dataSet.supervisoryRoleId &&\n (await tx.getRepository(Role).findOneBy({ domain: { id: domain.id }, id: dataSet.supervisoryRoleId }))\n\n const assignees = dataSet.supervisoryRoleId ? [{ type: 'Role', value: dataSet.supervisoryRoleId, assignee }] : []\n\n /* 해당 dataset의 supervisor로 하여금, OOC를 리뷰하고 instruction을 작성해서, OOC 해결을 위한 태스크를 dataset assignees에게 지시하도록 한다. */\n if (assignees && assignees instanceof Array && assignees.length > 0) {\n result.dataItems = dataItems\n const activityInstance = {\n name: `[Data 검토] ${dataSet.name}`,\n description: dataSet.description,\n activityId: activity.id,\n dueAt: new Date(collectedAt.getTime() + 24 * 60 * 60 * 1000),\n input: {\n dataSample: result\n },\n assignees,\n approvalLine: [],\n outlierApprovalLine: []\n }\n\n await issue(activityInstance, context)\n } else {\n console.error(\n `Assignees are not set. So Data Review task for ${dataSet.name}(${dataSet.id}) could not be issued.`\n )\n }\n } else {\n console.error('Data Review Activity not installed.')\n }\n\n try {\n pubsub.publish('data-set', {\n dataSet,\n supervisoryRoleId: dataSet.supervisoryRoleId\n })\n\n pubsub.publish('notification', {\n notification: {\n domain,\n type: 'info',\n title: `[Data Review] ${dataSet.name}`,\n body: `Data Review occurred on '${dataSet.name}'`,\n url: getRedirectSubdomainPath(context, domain.subdomain, `/data-set/${dataSet.id}`),\n timestamp: collectedAt\n }\n })\n } catch (err) {\n logger.error('Notification', err)\n }\n }\n\n return result\n}\n"]}
1
+ {"version":3,"file":"create-data-sample.js","sourceRoot":"","sources":["../../server/controllers/create-data-sample.ts"],"names":[],"mappings":";;;;AAAA,8EAAoC;AACpC,qCAA4B;AAE5B,qEAA8E;AAC9E,yDAAgD;AAChD,6CAA4C;AAC5C,iDAAwE;AACxE,2DAAgE;AAChE,uDAAmD;AACnD,oGAAgG;AAEhG,2DAAqE;AACrE,oEAA+D;AAE/D,2DAAsD;AACtD,mDAA6C;AAE7C,mCAAmC;AACnC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,CAAA;AAEtB,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE;IACxC,MAAM,IAAI,GAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,YAAY,KAAI,EAAE,CAAA;IAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;SACpE;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAE,CAAC,CAAA;AACR,CAAC,CAAA;AAED,2CAA2C;AAC3C,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACrC,KAAK,MAA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AAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;oBAC5D,KAAK,EAAE;wBACL,UAAU,EAAE,MAAM;qBACnB;oBACD,SAAS;oBACT,YAAY,EAAE,OAAO,CAAC,kBAAkB;iBACzC,CAAA;gBAED,MAAM,IAAA,aAAK,EAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;gBAEtC,IAAI;oBACF,cAAM,CAAC,OAAO,CAAC,UAAU,EAAE;wBACzB,OAAO;wBACP,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;qBAC7C,CAAC,CAAA;oBAEF,cAAM,CAAC,OAAO,CAAC,cAAc,EAAE;wBAC7B,YAAY,EAAE;4BACZ,MAAM;4BACN,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,iBAAiB,OAAO,CAAC,IAAI,EAAE;4BACtC,IAAI,EAAE,4BAA4B,OAAO,CAAC,IAAI,GAAG;4BACjD,GAAG,EAAE,IAAA,gCAAwB,EAAC,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,OAAO,CAAC,EAAE,EAAE,CAAC;4BACnF,SAAS,EAAE,WAAW;yBACvB;qBACF,CAAC,CAAA;iBACH;gBAAC,OAAO,GAAG,EAAE;oBACZ,YAAM,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAA;iBAClC;aACF;iBAAM;gBACL,OAAO,CAAC,KAAK,CACX,kDAAkD,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE,wBAAwB,CACrG,CAAA;aACF;SACF;aAAM;YACL,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAA;SACrD;KACF;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AA3QD,4CA2QC","sourcesContent":["import moment from 'moment-timezone'\nimport { In } from 'typeorm'\n\nimport { Attachment, createAttachment } from '@things-factory/attachment-base'\nimport { Role } from '@things-factory/auth-base'\nimport { logger } from '@things-factory/env'\nimport { getRedirectSubdomainPath, pubsub } from '@things-factory/shell'\nimport { getWorkDateAndShift } from '@things-factory/work-shift'\nimport { Activity } from '@things-factory/worklist'\nimport { issue } from '@things-factory/worklist/dist-server/controllers/activity-instance/issue'\n\nimport { DataOoc, DataOocStatus } from '../service/data-ooc/data-ooc'\nimport { DataSample } from '../service/data-sample/data-sample'\nimport { NewDataSample } from '../service/data-sample/data-sample-type'\nimport { DataSet } from '../service/data-set/data-set'\nimport { DataUseCase } from './data-use-case'\n\n// See README.md at ## Data Samples\nprocess.env.TZ = 'UTC'\n\nconst fillDataKeys = (dataKeySet, data) => {\n const keys = dataKeySet?.dataKeyItems || []\n return keys.reduce((sum, key, index) => {\n const value = data[key.dataKey]\n if (value != null) {\n sum[`key0${index + 1}`] = value instanceof Array ? value[0] : value\n }\n return sum\n }, {})\n}\n\n// parse variable javascript string pattern\nconst replaceVariables = (keys, dic) => {\n for (const k in keys) {\n const matches = keys[k].match(/\\$\\{\\w*\\}/g)\n matches &&\n matches.forEach(m => {\n keys[k] = keys[k].replace(m, dic[m.slice(2, -1)])\n })\n }\n return keys\n}\n\n// It is required UTC date for Partitioning File System like AWS S3 from Athena.\n// ex) %YYYY, %MM, %DD\nconst formatDate = (keys, _moment) => {\n for (const k in keys) {\n const matches = keys[k].match(/%\\w*/g)\n matches &&\n matches.forEach(m => {\n keys[k] = keys[k].replace(m, _moment.format(m.substr(1)))\n })\n }\n return keys\n}\n\nexport async function createDataSample(dataSample: NewDataSample, context: ResolverContext): Promise<DataSample> {\n const { domain, user, tx } = context.state\n\n const dataSet = await tx.getRepository(DataSet).findOne({\n where: { domain: { id: In([domain.id, domain.parentId].filter(Boolean)) }, id: dataSample.dataSet.id },\n relations: ['dataKeySet']\n })\n\n const dataItems = dataSet.dataItems\n const collectedAt = dataSample.collectedAt || new Date()\n\n const timezone = dataSet.timezone || domain.timezone || 'UTC'\n const format = 'YYYY-MM-DD'\n\n // workDate ex) 2022-04-04\n const { workDate, workShift } = await getWorkDateAndShift(domain, collectedAt, { timezone, format })\n\n // local time dataSet timezone or domain timezone or default 'UTC'\n\n const localDateTz = moment(collectedAt).tz(timezone)\n const defaultPartitionKeys = {\n domain: domain.subdomain,\n datasetid: dataSample.dataSet.id /* It should not be 'data_set_id' as column name duplicated for Glue */,\n date: localDateTz.format(format) /* local time date */,\n workdate: workDate /* working date */,\n workshift: workShift\n }\n\n var partitionKeys = {\n ...defaultPartitionKeys,\n ...dataSet.partitionKeys\n }\n\n partitionKeys = formatDate(partitionKeys, localDateTz)\n partitionKeys = replaceVariables(partitionKeys, dataSample.data)\n\n const dataKeys = fillDataKeys(dataSet?.dataKeySet, dataSample.data)\n\n const { ooc, oos, judgment } = DataUseCase.evaluate(dataSet, dataItems, dataSample.data) || {}\n\n const old = await tx.getRepository(DataSample).findOne({\n where: {\n domain: { id: domain.id },\n dataSet: { id: dataSet.id },\n collectedAt,\n ...dataKeys\n }\n })\n\n /* \n pre-processing for file attachment.\n currently only support type of [FileUpload].\n If [FileUpload[]] type needed, add 'files' type for dataset\n */\n\n const data = dataSample.data\n const attachments = []\n\n for (let dataItem of dataItems) {\n if (dataItem.type == 'file') {\n const tag = dataItem.tag\n const filesArray = data[tag]\n\n if (tag && filesArray && filesArray.length > 0) {\n let pathsArray = []\n\n for (let files of filesArray) {\n let paths = []\n\n if (files instanceof Array) {\n for (let file of files) {\n if (file) {\n const attachment = await createAttachment(\n null,\n {\n attachment: {\n file: file.file,\n refType: DataSample.name\n }\n },\n context\n )\n\n const fetched = await tx.getRepository(Attachment).findOneBy({ id: attachment.id })\n if (fetched) {\n attachments.push(fetched)\n paths.push({\n id: fetched.id,\n mimetype: fetched.mimetype,\n name: fetched.name,\n fullpath: fetched.fullpath\n })\n } else {\n throw `Failed to save file(${attachment.name})`\n }\n } else {\n paths.push(null)\n }\n }\n }\n\n pathsArray.push(paths)\n }\n\n data[tag] = pathsArray\n }\n }\n }\n\n const result = await tx.getRepository(DataSample).save({\n ...old,\n name: dataSet.name,\n description: dataSet.description,\n useCase: dataSet.useCase,\n type: dataSet.type,\n ...dataSample,\n ...dataKeys,\n dataSetVersion: dataSet.version,\n domain,\n partitionKeys,\n ooc,\n oos,\n judgment,\n collectedAt,\n workDate,\n workShift,\n creator: user,\n updater: user\n })\n\n /* post-process for for file attachment. */\n if (attachments.length > 0) {\n attachments.forEach(attachment => (attachment.refId = result.id))\n tx.getRepository(Attachment).save(attachments)\n }\n\n if (ooc || oos) {\n const dataOoc = await tx.getRepository(DataOoc).save({\n ...result,\n history: [\n {\n user: {\n id: user?.id,\n name: user?.name\n },\n state: DataOocStatus.ISSUED,\n timestamp: collectedAt\n }\n ],\n state: DataOocStatus.ISSUED\n })\n\n const activity = (await tx.getRepository(Activity).findOneBy({\n domain: { id: domain.id },\n name: 'OOC Review'\n })) as Activity\n\n if (activity) {\n const assignee =\n dataSet.supervisoryRoleId &&\n (await tx.getRepository(Role).findOneBy({ domain: { id: domain.id }, id: dataSet.supervisoryRoleId }))\n\n const assignees = dataSet.supervisoryRoleId ? [{ type: 'Role', value: dataSet.supervisoryRoleId, assignee }] : []\n\n /* 해당 dataset의 supervisor로 하여금, OOC를 리뷰하고 instruction을 작성해서, OOC 해결을 위한 태스크를 dataset assignees에게 지시하도록 한다. */\n if (assignees && assignees instanceof Array && assignees.length > 0) {\n const activityInstance = {\n name: `[OOC 검토] ${dataSet.name}`,\n description: dataSet.description,\n activityId: activity.id,\n dueAt: new Date(collectedAt.getTime() + 24 * 60 * 60 * 1000),\n input: {\n dataOocId: dataOoc.id\n },\n assignees,\n approvalLine: []\n }\n\n await issue(activityInstance, context)\n } else {\n console.error(\n `Assignees are not set. So Data OOC Review task for ${dataOoc.name}(${dataOoc.id}) could not be issued.`\n )\n }\n } else {\n console.error('OOC Review Activity not installed.')\n }\n\n try {\n pubsub.publish('data-ooc', {\n dataOoc,\n supervisoryRoleId: dataSet.supervisoryRoleId\n })\n\n pubsub.publish('notification', {\n notification: {\n domain,\n type: 'error',\n title: `[OOC] ${dataSet.name}`,\n body: `Data OOC occurred on '${dataSet.name}'`,\n url: getRedirectSubdomainPath(context, domain.subdomain, `/data-ooc/${dataOoc.id}`),\n timestamp: collectedAt\n }\n })\n } catch (err) {\n logger.error('Notification', err)\n }\n } else if (dataSet.requiresReview) {\n const activity = (await tx.getRepository(Activity).findOneBy({\n domain: { id: domain.id },\n name: 'Data Review'\n })) as Activity\n\n if (activity) {\n const assignee =\n dataSet.supervisoryRoleId &&\n (await tx.getRepository(Role).findOneBy({ domain: { id: domain.id }, id: dataSet.supervisoryRoleId }))\n\n const assignees = dataSet.supervisoryRoleId ? [{ type: 'Role', value: dataSet.supervisoryRoleId, assignee }] : []\n\n /* 해당 dataset의 supervisor로 하여금, data를 리뷰하고 instruction을 작성해서, approvalLine을 이용 해서 승인을 한다. */\n if (assignees && assignees instanceof Array && assignees.length > 0) {\n result.dataItems = dataItems\n const activityInstance = {\n name: `[Data 검토] ${dataSet.name}`,\n description: dataSet.description,\n activityId: activity.id,\n dueAt: new Date(collectedAt.getTime() + 24 * 60 * 60 * 1000),\n input: {\n dataSample: result\n },\n assignees,\n approvalLine: dataSet.reviewApprovalLine\n }\n\n await issue(activityInstance, context)\n\n try {\n pubsub.publish('data-set', {\n dataSet,\n supervisoryRoleId: dataSet.supervisoryRoleId\n })\n \n pubsub.publish('notification', {\n notification: {\n domain,\n type: 'info',\n title: `[Data Review] ${dataSet.name}`,\n body: `Data Review occurred on '${dataSet.name}'`,\n url: getRedirectSubdomainPath(context, domain.subdomain, `/data-set/${dataSet.id}`),\n timestamp: collectedAt\n }\n })\n } catch (err) {\n logger.error('Notification', err)\n }\n } else {\n console.error(\n `Assignees are not set. So Data Review task for ${dataSet.name}(${dataSet.id}) could not be issued.`\n )\n }\n } else {\n console.error('Data Review Activity not installed.')\n }\n }\n\n return result\n}\n"]}
@@ -37,31 +37,41 @@ var DataItemStatType;
37
37
  let DataItem = class DataItem {
38
38
  };
39
39
  tslib_1.__decorate([
40
- (0, type_graphql_1.Field)(),
40
+ (0, type_graphql_1.Field)({ description: 'The name of the data item' }),
41
41
  tslib_1.__metadata("design:type", String)
42
42
  ], DataItem.prototype, "name", void 0);
43
43
  tslib_1.__decorate([
44
- (0, type_graphql_1.Field)({ nullable: true }),
44
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A description of the data item' }),
45
45
  tslib_1.__metadata("design:type", String)
46
46
  ], DataItem.prototype, "description", void 0);
47
47
  tslib_1.__decorate([
48
- (0, type_graphql_1.Field)({ nullable: true }),
48
+ (0, type_graphql_1.Field)({
49
+ nullable: true,
50
+ description: 'Specifies a key name to be used as a property in a JSON-like object, representing a subfield of a dataset record.'
51
+ }),
49
52
  tslib_1.__metadata("design:type", String)
50
53
  ], DataItem.prototype, "tag", void 0);
51
54
  tslib_1.__decorate([
52
- (0, type_graphql_1.Field)({ nullable: true }),
55
+ (0, type_graphql_1.Field)({
56
+ nullable: true,
57
+ description: 'Specifies a grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'
58
+ }),
59
+ tslib_1.__metadata("design:type", String)
60
+ ], DataItem.prototype, "group", void 0);
61
+ tslib_1.__decorate([
62
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the data item is active' }),
53
63
  tslib_1.__metadata("design:type", Boolean)
54
64
  ], DataItem.prototype, "active", void 0);
55
65
  tslib_1.__decorate([
56
- (0, type_graphql_1.Field)({ nullable: true }),
66
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the data item is hidden' }),
57
67
  tslib_1.__metadata("design:type", Boolean)
58
68
  ], DataItem.prototype, "hidden", void 0);
59
69
  tslib_1.__decorate([
60
- (0, type_graphql_1.Field)({ nullable: true }),
70
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The type of the data item' }),
61
71
  tslib_1.__metadata("design:type", String)
62
72
  ], DataItem.prototype, "type", void 0);
63
73
  tslib_1.__decorate([
64
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
74
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'Options associated with the data item type' }),
65
75
  tslib_1.__metadata("design:type", Object)
66
76
  ], DataItem.prototype, "options", void 0);
67
77
  tslib_1.__decorate([
@@ -72,15 +82,18 @@ tslib_1.__decorate([
72
82
  tslib_1.__metadata("design:type", String)
73
83
  ], DataItem.prototype, "stat", void 0);
74
84
  tslib_1.__decorate([
75
- (0, type_graphql_1.Field)({ nullable: true }),
85
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The unit of measurement for the data item' }),
76
86
  tslib_1.__metadata("design:type", String)
77
87
  ], DataItem.prototype, "unit", void 0);
78
88
  tslib_1.__decorate([
79
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
89
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The maximum number of data values allowed for this field' }),
80
90
  tslib_1.__metadata("design:type", Number)
81
91
  ], DataItem.prototype, "quota", void 0);
82
92
  tslib_1.__decorate([
83
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
93
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, {
94
+ nullable: true,
95
+ description: 'Specifies the valid ranges and parameters for this data item.'
96
+ }),
84
97
  tslib_1.__metadata("design:type", Object)
85
98
  ], DataItem.prototype, "spec", void 0);
86
99
  DataItem = tslib_1.__decorate([
@@ -90,23 +103,33 @@ exports.DataItem = DataItem;
90
103
  let DataItemPatch = class DataItemPatch {
91
104
  };
92
105
  tslib_1.__decorate([
93
- (0, type_graphql_1.Field)({ nullable: true }),
106
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The name of the data item' }),
94
107
  tslib_1.__metadata("design:type", String)
95
108
  ], DataItemPatch.prototype, "name", void 0);
96
109
  tslib_1.__decorate([
97
- (0, type_graphql_1.Field)({ nullable: true }),
110
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A description of the data item' }),
98
111
  tslib_1.__metadata("design:type", String)
99
112
  ], DataItemPatch.prototype, "description", void 0);
100
113
  tslib_1.__decorate([
101
- (0, type_graphql_1.Field)({ nullable: true }),
114
+ (0, type_graphql_1.Field)({
115
+ nullable: true,
116
+ description: 'Specifies a key name to be used as a property in a JSON-like object, representing a subfield of a dataset record.'
117
+ }),
102
118
  tslib_1.__metadata("design:type", String)
103
119
  ], DataItemPatch.prototype, "tag", void 0);
104
120
  tslib_1.__decorate([
105
- (0, type_graphql_1.Field)(type => DataItemType, { nullable: true }),
121
+ (0, type_graphql_1.Field)({
122
+ nullable: true,
123
+ description: 'Specifies a grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'
124
+ }),
125
+ tslib_1.__metadata("design:type", String)
126
+ ], DataItemPatch.prototype, "group", void 0);
127
+ tslib_1.__decorate([
128
+ (0, type_graphql_1.Field)(type => DataItemType, { nullable: true, description: 'The type of the data item' }),
106
129
  tslib_1.__metadata("design:type", String)
107
130
  ], DataItemPatch.prototype, "type", void 0);
108
131
  tslib_1.__decorate([
109
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
132
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'Options associated with the data item type' }),
110
133
  tslib_1.__metadata("design:type", Object)
111
134
  ], DataItemPatch.prototype, "options", void 0);
112
135
  tslib_1.__decorate([
@@ -117,23 +140,26 @@ tslib_1.__decorate([
117
140
  tslib_1.__metadata("design:type", String)
118
141
  ], DataItemPatch.prototype, "stat", void 0);
119
142
  tslib_1.__decorate([
120
- (0, type_graphql_1.Field)({ nullable: true }),
143
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The unit of measurement for the data item' }),
121
144
  tslib_1.__metadata("design:type", String)
122
145
  ], DataItemPatch.prototype, "unit", void 0);
123
146
  tslib_1.__decorate([
124
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
147
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The maximum number of data values allowed for this field' }),
125
148
  tslib_1.__metadata("design:type", Number)
126
149
  ], DataItemPatch.prototype, "quota", void 0);
127
150
  tslib_1.__decorate([
128
- (0, type_graphql_1.Field)({ nullable: true }),
151
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the data item is active' }),
129
152
  tslib_1.__metadata("design:type", Boolean)
130
153
  ], DataItemPatch.prototype, "active", void 0);
131
154
  tslib_1.__decorate([
132
- (0, type_graphql_1.Field)({ nullable: true }),
155
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the data item is hidden' }),
133
156
  tslib_1.__metadata("design:type", Boolean)
134
157
  ], DataItemPatch.prototype, "hidden", void 0);
135
158
  tslib_1.__decorate([
136
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
159
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, {
160
+ nullable: true,
161
+ description: 'Specifies the valid ranges and parameters for this data item.'
162
+ }),
137
163
  tslib_1.__metadata("design:type", Object)
138
164
  ], DataItemPatch.prototype, "spec", void 0);
139
165
  DataItemPatch = tslib_1.__decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"data-item-type.js","sourceRoot":"","sources":["../../../server/service/data-set/data-item-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAkF;AAElF,iDAAoD;AAEpD,IAAY,YAQX;AARD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;IACb,qCAAqB,CAAA;IACrB,6BAAa,CAAA;AACf,CAAC,EARW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAQvB;AAED,IAAA,+BAAgB,EAAC,YAAY,EAAE;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,iCAAiC;CAC/C,CAAC,CAAA;AAEF,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,iCAAa,CAAA;IACb,qCAAiB,CAAA;IACjB,yCAAqB,CAAA;IACrB,+BAAW,CAAA;IACX,+BAAW,CAAA;IACX,mCAAe,CAAA;IACf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sCAAa","sourcesContent":["import { Field, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\n\nimport { ScalarObject } from '@things-factory/shell'\n\nexport enum DataItemType {\n number = 'number',\n text = 'text',\n boolean = 'boolean',\n select = 'select',\n date = 'date',\n datetime = 'datetime',\n file = 'file'\n}\n\nregisterEnumType(DataItemType, {\n name: 'DataItemType',\n description: 'type enumeration of a data-item'\n})\n\nexport enum DataItemStatType {\n sum = 'sum',\n mean = 'mean',\n stddev = 'stddev',\n variance = 'variance',\n min = 'min',\n max = 'max',\n range = 'range',\n median = 'median',\n mode = 'mode'\n}\n\nregisterEnumType(DataItemStatType, {\n name: 'DataItemStatType',\n description: 'stat type enumeration of a data-item'\n})\n\n@ObjectType({ description: 'Entity for DataItem' })\nexport class DataItem {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n tag?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n hidden?: boolean\n\n @Field({ nullable: true })\n type?: DataItemType\n\n @Field(type => ScalarObject, { nullable: true })\n options?: { [option: string]: any }\n\n @Field({\n nullable: true,\n description: 'The grouping logic for data summarization in the given field during periodic task deadlines.'\n })\n stat?: DataItemStatType\n\n @Field({ nullable: true })\n unit?: string\n\n @Field(type => Int, { nullable: true })\n quota?: number\n\n @Field(type => ScalarObject, { nullable: true })\n spec?: { [key: string]: any }\n}\n\n@InputType()\nexport class DataItemPatch {\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n tag?: string\n\n @Field(type => DataItemType, { nullable: true })\n type?: DataItemType\n\n @Field(type => ScalarObject, { nullable: true })\n options?: { [option: string]: any }\n\n @Field({\n nullable: true,\n description: 'The grouping logic for data summarization in the given field during periodic task deadlines.'\n })\n stat?: DataItemStatType\n\n @Field({ nullable: true })\n unit?: string\n\n @Field(type => Int, { nullable: true })\n quota?: number\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n hidden?: boolean\n\n @Field(type => ScalarObject, { nullable: true })\n spec?: { [key: string]: any }\n}\n"]}
1
+ {"version":3,"file":"data-item-type.js","sourceRoot":"","sources":["../../../server/service/data-set/data-item-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAkF;AAElF,iDAAoD;AAEpD,IAAY,YAQX;AARD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;IACb,qCAAqB,CAAA;IACrB,6BAAa,CAAA;AACf,CAAC,EARW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAQvB;AAED,IAAA,+BAAgB,EAAC,YAAY,EAAE;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,iCAAiC;CAC/C,CAAC,CAAA;AAEF,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,iCAAa,CAAA;IACb,qCAAiB,CAAA;IACjB,yCAAqB,CAAA;IACrB,+BAAW,CAAA;IACX,+BAAW,CAAA;IACX,mCAAe,CAAA;IACf,qCAAiB,CAAA;IACjB,iCAAa,CAAA;AACf,CAAC,EAVW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAU3B;AAED,IAAA,+BAAgB,EAAC,gBAAgB,EAAE;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,sCAAsC;CACpD,CAAC,CAAA;AAGK,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAkDpB,CAAA;AAjDC;IAAC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;sCACxC;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;6CACrD;AAEpB;IAAC,IAAA,oBAAK,EAAC;QACL,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,mHAAmH;KAC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,EAAE,CAAC;;6CAC/D;AAEhB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE;QAC3B,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,+DAA+D;KAC7E,CAAC;;2CAC2B;AAjDlB,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAkDzB;AAlDY,sCAAa","sourcesContent":["import { Field, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\n\nimport { ScalarObject } from '@things-factory/shell'\n\nexport enum DataItemType {\n number = 'number',\n text = 'text',\n boolean = 'boolean',\n select = 'select',\n date = 'date',\n datetime = 'datetime',\n file = 'file'\n}\n\nregisterEnumType(DataItemType, {\n name: 'DataItemType',\n description: 'type enumeration of a data-item'\n})\n\nexport enum DataItemStatType {\n sum = 'sum',\n mean = 'mean',\n stddev = 'stddev',\n variance = 'variance',\n min = 'min',\n max = 'max',\n range = 'range',\n median = 'median',\n mode = 'mode'\n}\n\nregisterEnumType(DataItemStatType, {\n name: 'DataItemStatType',\n description: 'stat type enumeration of a data-item'\n})\n\n@ObjectType({ description: 'Entity for DataItem' })\nexport class DataItem {\n @Field({ description: 'The name of the data item' })\n name: string\n\n @Field({ nullable: true, description: 'A description of the data item' })\n description?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a key name to be used as a property in a JSON-like object, representing a subfield of a dataset record.'\n })\n tag?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n group?: string\n\n @Field({ nullable: true, description: 'Indicates if the data item is active' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Indicates if the data item is hidden' })\n hidden?: boolean\n\n @Field({ nullable: true, description: 'The type of the data item' })\n type?: DataItemType\n\n @Field(type => ScalarObject, { nullable: true, description: 'Options associated with the data item type' })\n options?: { [option: string]: any }\n\n @Field({\n nullable: true,\n description: 'The grouping logic for data summarization in the given field during periodic task deadlines.'\n })\n stat?: DataItemStatType\n\n @Field({ nullable: true, description: 'The unit of measurement for the data item' })\n unit?: string\n\n @Field(type => Int, { nullable: true, description: 'The maximum number of data values allowed for this field' })\n quota?: number\n\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'Specifies the valid ranges and parameters for this data item.'\n })\n spec?: { [key: string]: any }\n}\n\n@InputType()\nexport class DataItemPatch {\n @Field({ nullable: true, description: 'The name of the data item' })\n name?: string\n\n @Field({ nullable: true, description: 'A description of the data item' })\n description?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a key name to be used as a property in a JSON-like object, representing a subfield of a dataset record.'\n })\n tag?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n group?: string\n\n @Field(type => DataItemType, { nullable: true, description: 'The type of the data item' })\n type?: DataItemType\n\n @Field(type => ScalarObject, { nullable: true, description: 'Options associated with the data item type' })\n options?: { [option: string]: any }\n\n @Field({\n nullable: true,\n description: 'The grouping logic for data summarization in the given field during periodic task deadlines.'\n })\n stat?: DataItemStatType\n\n @Field({ nullable: true, description: 'The unit of measurement for the data item' })\n unit?: string\n\n @Field(type => Int, { nullable: true, description: 'The maximum number of data values allowed for this field' })\n quota?: number\n\n @Field({ nullable: true, description: 'Indicates if the data item is active' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Indicates if the data item is hidden' })\n hidden?: boolean\n\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'Specifies the valid ranges and parameters for this data item.'\n })\n spec?: { [key: string]: any }\n}\n"]}
@@ -92,12 +92,12 @@ let DataSet = class DataSet {
92
92
  };
93
93
  tslib_1.__decorate([
94
94
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
95
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
95
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'The unique identifier of the dataset' }),
96
96
  tslib_1.__metadata("design:type", String)
97
97
  ], DataSet.prototype, "id", void 0);
98
98
  tslib_1.__decorate([
99
99
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
100
- (0, type_graphql_1.Field)({ nullable: true }),
100
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The domain to which the dataset belongs' }),
101
101
  tslib_1.__metadata("design:type", shell_1.Domain)
102
102
  ], DataSet.prototype, "domain", void 0);
103
103
  tslib_1.__decorate([
@@ -106,27 +106,27 @@ tslib_1.__decorate([
106
106
  ], DataSet.prototype, "domainId", void 0);
107
107
  tslib_1.__decorate([
108
108
  (0, typeorm_1.Column)(),
109
- (0, type_graphql_1.Field)(),
109
+ (0, type_graphql_1.Field)({ description: 'The name of the dataset' }),
110
110
  tslib_1.__metadata("design:type", String)
111
111
  ], DataSet.prototype, "name", void 0);
112
112
  tslib_1.__decorate([
113
113
  (0, typeorm_1.Column)({ nullable: true }),
114
- (0, type_graphql_1.Field)({ nullable: true }),
114
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A description of the dataset' }),
115
115
  tslib_1.__metadata("design:type", String)
116
116
  ], DataSet.prototype, "description", void 0);
117
117
  tslib_1.__decorate([
118
118
  (0, typeorm_1.VersionColumn)({ nullable: true, default: 1 }),
119
- (0, type_graphql_1.Field)({ nullable: true }),
119
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The version of the dataset' }),
120
120
  tslib_1.__metadata("design:type", Number)
121
121
  ], DataSet.prototype, "version", void 0);
122
122
  tslib_1.__decorate([
123
123
  (0, typeorm_1.Column)({ nullable: true }),
124
- (0, type_graphql_1.Field)({ nullable: true }),
124
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates whether the dataset is currently active or in use.' }),
125
125
  tslib_1.__metadata("design:type", Boolean)
126
126
  ], DataSet.prototype, "active", void 0);
127
127
  tslib_1.__decorate([
128
128
  (0, typeorm_1.ManyToOne)(type => data_key_set_1.DataKeySet, { nullable: true }),
129
- (0, type_graphql_1.Field)(type => data_key_set_1.DataKeySet, { nullable: true }),
129
+ (0, type_graphql_1.Field)(type => data_key_set_1.DataKeySet, { nullable: true, description: 'The key set used for this dataset' }),
130
130
  tslib_1.__metadata("design:type", data_key_set_1.DataKeySet)
131
131
  ], DataSet.prototype, "dataKeySet", void 0);
132
132
  tslib_1.__decorate([
@@ -171,112 +171,136 @@ tslib_1.__decorate([
171
171
  (0, typeorm_1.Column)('simple-json', { nullable: true }),
172
172
  (0, type_graphql_1.Field)(type => [organization_1.ApprovalLineItem], {
173
173
  nullable: true,
174
- description: 'Approval line for handling OOC issues for that dataset'
174
+ description: 'Approval line for handling abnormal data occurance issues for that dataset'
175
175
  }),
176
176
  tslib_1.__metadata("design:type", Array)
177
177
  ], DataSet.prototype, "outlierApprovalLine", void 0);
178
178
  tslib_1.__decorate([
179
179
  (0, typeorm_1.Column)({ nullable: true }),
180
- (0, type_graphql_1.Field)({ nullable: true }),
180
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The type of the dataset' }),
181
181
  tslib_1.__metadata("design:type", String)
182
182
  ], DataSet.prototype, "type", void 0);
183
183
  tslib_1.__decorate([
184
184
  (0, typeorm_1.Column)({ nullable: true }),
185
- (0, type_graphql_1.Field)({ nullable: true }),
185
+ (0, type_graphql_1.Field)({
186
+ nullable: true,
187
+ description: `Specifies the method of data entry for the dataset. If set to "generated", data entry screens are automatically generated based on the defined data items. For other types, specific entry screens are configured for each type and specified in the "entryView" field.`
188
+ }),
186
189
  tslib_1.__metadata("design:type", String)
187
190
  ], DataSet.prototype, "entryType", void 0);
188
191
  tslib_1.__decorate([
189
192
  (0, typeorm_1.Column)({ nullable: true }),
190
- (0, type_graphql_1.Field)({ nullable: true }),
193
+ (0, type_graphql_1.Field)({
194
+ nullable: true,
195
+ description: `Specifies the custom data entry screen or view for the dataset. When "entryType" is not "generated", this field indicates the screen to be used for data entry. When "entryType" is "generated", this field may not apply.`
196
+ }),
191
197
  tslib_1.__metadata("design:type", String)
192
198
  ], DataSet.prototype, "entryView", void 0);
193
199
  tslib_1.__decorate([
194
200
  (0, typeorm_1.Column)({ nullable: true }),
195
- (0, type_graphql_1.Field)({ nullable: true }),
201
+ (0, type_graphql_1.Field)({
202
+ nullable: true,
203
+ description: `Specifies the method of data monitoring for the dataset. If set to "generated", monitoring screens are automatically generated based on the dataset configuration. For other types, specific monitoring screens are configured for each type and specified in the "monitorView" field.`
204
+ }),
196
205
  tslib_1.__metadata("design:type", String)
197
206
  ], DataSet.prototype, "monitorType", void 0);
198
207
  tslib_1.__decorate([
199
208
  (0, typeorm_1.Column)({ nullable: true }),
200
- (0, type_graphql_1.Field)({ nullable: true }),
209
+ (0, type_graphql_1.Field)({
210
+ nullable: true,
211
+ description: `Specifies the custom data monitoring screen or view for the dataset. When "monitorType" is not "generated", this field indicates the screen to be used for data monitoring. When "monitorType" is "generated", this field may not apply.`
212
+ }),
201
213
  tslib_1.__metadata("design:type", String)
202
214
  ], DataSet.prototype, "monitorView", void 0);
203
215
  tslib_1.__decorate([
204
216
  (0, typeorm_1.Column)({ nullable: true }),
205
- (0, type_graphql_1.Field)({ nullable: true }),
217
+ (0, type_graphql_1.Field)({
218
+ nullable: true,
219
+ description: `Specifies the method of reporting for the dataset. If set to "generated", report templates are automatically generated based on the dataset configuration. For other types, specific report templates are configured for each type and specified in the "reportView" field.`
220
+ }),
206
221
  tslib_1.__metadata("design:type", String)
207
222
  ], DataSet.prototype, "reportType", void 0);
208
223
  tslib_1.__decorate([
209
224
  (0, typeorm_1.Column)({ nullable: true }),
210
- (0, type_graphql_1.Field)({ nullable: true }),
225
+ (0, type_graphql_1.Field)({
226
+ nullable: true,
227
+ description: `Specifies the custom report template or view for the dataset. When "reportType" is not "generated", this field indicates the report template or view to be used for reporting. When "reportType" is "generated", this field may not apply.`
228
+ }),
211
229
  tslib_1.__metadata("design:type", String)
212
230
  ], DataSet.prototype, "reportView", void 0);
213
231
  tslib_1.__decorate([
214
- (0, type_graphql_1.Field)({ nullable: true }),
232
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The report template of the dataset' }),
215
233
  tslib_1.__metadata("design:type", String)
216
234
  ], DataSet.prototype, "reportTemplate", void 0);
217
235
  tslib_1.__decorate([
218
236
  (0, typeorm_1.Column)({ nullable: true }),
219
- (0, type_graphql_1.Field)({ nullable: true }),
237
+ (0, type_graphql_1.Field)({
238
+ nullable: true,
239
+ description: 'Specifies the intended purpose or role of the dataset within the system. It helps users understand why the dataset was created and guides the specification of data items accordingly. Common use case options may include "QA," "CCP," "SPC," and others.'
240
+ }),
220
241
  tslib_1.__metadata("design:type", String)
221
242
  ], DataSet.prototype, "useCase", void 0);
222
243
  tslib_1.__decorate([
223
244
  (0, typeorm_1.Column)('simple-json', { nullable: true }),
224
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
245
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, {
246
+ nullable: true,
247
+ description: "Specifies the partition keys used to distribute and organize the dataset's data. Partition keys are properties or attributes that determine how data is logically grouped, stored, and retrieved. They enable efficient data management and querying by allowing data to be organized into smaller, manageable partitions or segments."
248
+ }),
225
249
  tslib_1.__metadata("design:type", Object)
226
250
  ], DataSet.prototype, "partitionKeys", void 0);
227
251
  tslib_1.__decorate([
228
252
  (0, typeorm_1.Column)('simple-json', { nullable: true }),
229
- (0, type_graphql_1.Field)(type => [data_item_type_1.DataItem], { nullable: true }),
253
+ (0, type_graphql_1.Field)(type => [data_item_type_1.DataItem], { nullable: true, description: 'Data items for the dataset' }),
230
254
  tslib_1.__metadata("design:type", Array)
231
255
  ], DataSet.prototype, "dataItems", void 0);
232
256
  tslib_1.__decorate([
233
257
  (0, typeorm_1.Column)({ nullable: true }),
234
- (0, type_graphql_1.Field)({ nullable: true }),
258
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The schedule of the dataset' }),
235
259
  tslib_1.__metadata("design:type", String)
236
260
  ], DataSet.prototype, "schedule", void 0);
237
261
  tslib_1.__decorate([
238
262
  (0, typeorm_1.Column)({ nullable: true }),
239
- (0, type_graphql_1.Field)({ nullable: true }),
263
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The timezone of the dataset' }),
240
264
  tslib_1.__metadata("design:type", String)
241
265
  ], DataSet.prototype, "timezone", void 0);
242
266
  tslib_1.__decorate([
243
267
  (0, typeorm_1.Column)({ nullable: true }),
244
- (0, type_graphql_1.Field)({ nullable: true }),
268
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the dataset requires review' }),
245
269
  tslib_1.__metadata("design:type", Boolean)
246
270
  ], DataSet.prototype, "requiresReview", void 0);
247
271
  tslib_1.__decorate([
248
272
  (0, typeorm_1.Column)({ nullable: true }),
249
- (0, type_graphql_1.Field)({ nullable: true }),
273
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The schedule ID of the dataset' }),
250
274
  tslib_1.__metadata("design:type", String)
251
275
  ], DataSet.prototype, "scheduleId", void 0);
252
276
  tslib_1.__decorate([
253
277
  (0, typeorm_1.Column)({ nullable: true }),
254
- (0, type_graphql_1.Field)({ nullable: true }),
278
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The summary period of the dataset' }),
255
279
  tslib_1.__metadata("design:type", String)
256
280
  ], DataSet.prototype, "summaryPeriod", void 0);
257
281
  tslib_1.__decorate([
258
282
  (0, typeorm_1.Column)({ nullable: true }),
259
- (0, type_graphql_1.Field)({ nullable: true }),
283
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The summary schedule of the dataset' }),
260
284
  tslib_1.__metadata("design:type", String)
261
285
  ], DataSet.prototype, "summarySchedule", void 0);
262
286
  tslib_1.__decorate([
263
287
  (0, typeorm_1.Column)({ nullable: true }),
264
- (0, type_graphql_1.Field)({ nullable: true }),
288
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The summary schedule ID of the dataset' }),
265
289
  tslib_1.__metadata("design:type", String)
266
290
  ], DataSet.prototype, "summaryScheduleId", void 0);
267
291
  tslib_1.__decorate([
268
292
  (0, typeorm_1.CreateDateColumn)(),
269
- (0, type_graphql_1.Field)({ nullable: true }),
293
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time the dataset was created' }),
270
294
  tslib_1.__metadata("design:type", Date)
271
295
  ], DataSet.prototype, "createdAt", void 0);
272
296
  tslib_1.__decorate([
273
297
  (0, typeorm_1.UpdateDateColumn)(),
274
- (0, type_graphql_1.Field)({ nullable: true }),
298
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time the dataset was last updated' }),
275
299
  tslib_1.__metadata("design:type", Date)
276
300
  ], DataSet.prototype, "updatedAt", void 0);
277
301
  tslib_1.__decorate([
278
302
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
279
- (0, type_graphql_1.Field)({ nullable: true }),
303
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The user who created the dataset' }),
280
304
  tslib_1.__metadata("design:type", auth_base_1.User)
281
305
  ], DataSet.prototype, "creator", void 0);
282
306
  tslib_1.__decorate([
@@ -285,7 +309,7 @@ tslib_1.__decorate([
285
309
  ], DataSet.prototype, "creatorId", void 0);
286
310
  tslib_1.__decorate([
287
311
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
288
- (0, type_graphql_1.Field)({ nullable: true }),
312
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The user who last updated the dataset' }),
289
313
  tslib_1.__metadata("design:type", auth_base_1.User)
290
314
  ], DataSet.prototype, "updater", void 0);
291
315
  tslib_1.__decorate([