@dssp/supervision 1.0.0-alpha.0 → 1.0.0-alpha.14
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/pages/action-plan/action-plan-importer.js.map +1 -1
- package/dist-client/pages/action-plan/action-plan-list-page.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +0 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +16 -11
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-list.d.ts +2 -2
- package/dist-client/pages/building-inspection/building-inspection-list.js +2 -1
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js +3 -3
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
- package/dist-client/pages/building-inspection/inspection-create-popup.js +8 -5
- package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +46 -0
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +930 -0
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.d.ts +2 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +736 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -0
- package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.d.ts +1 -0
- package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js +304 -0
- package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js.map +1 -0
- package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.d.ts +15 -0
- package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js +430 -0
- package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js.map +1 -0
- package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/checklist-view.d.ts +6 -0
- package/dist-client/pages/checklist/checklist-view.js +291 -185
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/file-preview-popup.js.map +1 -1
- package/dist-client/pages/checklist-template/checklist-template-item.js +8 -3
- package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -1
- package/dist-client/pages/checklist-template/checklist-template-list.js +1 -1
- package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
- package/dist-client/pages/checklist-template/checklist-type-management.d.ts +2 -2
- package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -1
- package/dist-client/pages/issue/issue-importer.js.map +1 -1
- package/dist-client/pages/issue/issue-list-page.js.map +1 -1
- package/dist-client/pages/project-report/project-report-importer.js.map +1 -1
- package/dist-client/pages/project-report/project-report-list-page.js.map +1 -1
- package/dist-client/pages/supervisor/supervisor-importer.js.map +1 -1
- package/dist-client/pages/supervisor/supervisor-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/stt/speech-to-text.d.ts +36 -0
- package/dist-client/stt/speech-to-text.js +89 -0
- package/dist-client/stt/speech-to-text.js.map +1 -0
- package/dist-client/stt/stt-utils.d.ts +28 -0
- package/dist-client/stt/stt-utils.js +146 -0
- package/dist-client/stt/stt-utils.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/middlewares/index.js +1 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/service/action-plan/action-plan-mutation.js +2 -2
- package/dist-server/service/action-plan/action-plan-mutation.js.map +1 -1
- package/dist-server/service/action-plan/action-plan-query.js +2 -2
- package/dist-server/service/action-plan/action-plan-query.js.map +1 -1
- package/dist-server/service/action-plan/action-plan-type.js +6 -6
- package/dist-server/service/action-plan/action-plan-type.js.map +1 -1
- package/dist-server/service/action-plan/action-plan.js +3 -3
- package/dist-server/service/action-plan/action-plan.js.map +1 -1
- package/dist-server/service/action-plan/index.d.ts +0 -1
- package/dist-server/service/action-plan/index.js +1 -2
- package/dist-server/service/action-plan/index.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-history.js +2 -2
- package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +1 -0
- package/dist-server/service/building-inspection/building-inspection-mutation.js +91 -14
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-query.d.ts +2 -1
- package/dist-server/service/building-inspection/building-inspection-query.js +33 -4
- package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-type.d.ts +10 -3
- package/dist-server/service/building-inspection/building-inspection-type.js +45 -20
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection.d.ts +9 -0
- package/dist-server/service/building-inspection/building-inspection.js +43 -5
- package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
- package/dist-server/service/building-inspection/index.d.ts +2 -4
- package/dist-server/service/building-inspection/index.js +2 -4
- package/dist-server/service/building-inspection/index.js.map +1 -1
- package/dist-server/service/checklist/checklist-history.d.ts +8 -0
- package/dist-server/service/checklist/checklist-history.js +38 -2
- package/dist-server/service/checklist/checklist-history.js.map +1 -1
- package/dist-server/service/checklist/checklist-mutation.js +2 -2
- package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
- package/dist-server/service/checklist/checklist-query.js +2 -2
- package/dist-server/service/checklist/checklist-query.js.map +1 -1
- package/dist-server/service/checklist/checklist-type.js +6 -6
- package/dist-server/service/checklist/checklist-type.js.map +1 -1
- package/dist-server/service/checklist/checklist.d.ts +19 -1
- package/dist-server/service/checklist/checklist.js +78 -7
- package/dist-server/service/checklist/checklist.js.map +1 -1
- package/dist-server/service/checklist/index.d.ts +0 -2
- package/dist-server/service/checklist/index.js +1 -3
- package/dist-server/service/checklist/index.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item-mutation.js +2 -2
- package/dist-server/service/checklist-item/checklist-item-mutation.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item-query.js +2 -2
- package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item-type.js +2 -2
- package/dist-server/service/checklist-item/checklist-item-type.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item.js +3 -3
- package/dist-server/service/checklist-item/checklist-item.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js +2 -2
- package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +2 -2
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js +2 -2
- package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js +6 -6
- package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment.js +2 -2
- package/dist-server/service/checklist-item-comment/checklist-item-comment.js.map +1 -1
- package/dist-server/service/checklist-item-comment/index.d.ts +0 -2
- package/dist-server/service/checklist-item-comment/index.js +1 -3
- package/dist-server/service/checklist-item-comment/index.js.map +1 -1
- package/dist-server/service/checklist-template/checklist-template-mutation.js +2 -2
- package/dist-server/service/checklist-template/checklist-template-mutation.js.map +1 -1
- package/dist-server/service/checklist-template/checklist-template-query.js +2 -2
- package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -1
- package/dist-server/service/checklist-template/checklist-template-type.js +4 -4
- package/dist-server/service/checklist-template/checklist-template-type.js.map +1 -1
- package/dist-server/service/checklist-template/checklist-template.js +2 -2
- package/dist-server/service/checklist-template/checklist-template.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +2 -2
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item-query.js +2 -2
- package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js +4 -4
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item.js +4 -6
- package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
- package/dist-server/service/checklist-type/checklist-type-mutation.js +2 -2
- package/dist-server/service/checklist-type/checklist-type-mutation.js.map +1 -1
- package/dist-server/service/checklist-type/checklist-type-query.js +2 -2
- package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -1
- package/dist-server/service/checklist-type/checklist-type-type.js +4 -4
- package/dist-server/service/checklist-type/checklist-type-type.js.map +1 -1
- package/dist-server/service/checklist-type/checklist-type.js +3 -3
- package/dist-server/service/checklist-type/checklist-type.js.map +1 -1
- package/dist-server/service/index.d.ts +0 -1
- package/dist-server/service/index.js +1 -11
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/issue/index.d.ts +0 -1
- package/dist-server/service/issue/index.js +1 -2
- package/dist-server/service/issue/index.js.map +1 -1
- package/dist-server/service/issue/issue-mutation.js +2 -2
- package/dist-server/service/issue/issue-mutation.js.map +1 -1
- package/dist-server/service/issue/issue-query.js +2 -2
- package/dist-server/service/issue/issue-query.js.map +1 -1
- package/dist-server/service/issue/issue-type.js +6 -6
- package/dist-server/service/issue/issue-type.js.map +1 -1
- package/dist-server/service/issue/issue.js +3 -3
- package/dist-server/service/issue/issue.js.map +1 -1
- package/dist-server/service/project-report/index.d.ts +0 -1
- package/dist-server/service/project-report/index.js +1 -2
- package/dist-server/service/project-report/index.js.map +1 -1
- package/dist-server/service/project-report/project-report-mutation.js +2 -2
- package/dist-server/service/project-report/project-report-mutation.js.map +1 -1
- package/dist-server/service/project-report/project-report-query.js +2 -2
- package/dist-server/service/project-report/project-report-query.js.map +1 -1
- package/dist-server/service/project-report/project-report-type.js +6 -6
- package/dist-server/service/project-report/project-report-type.js.map +1 -1
- package/dist-server/service/project-report/project-report.js +3 -3
- package/dist-server/service/project-report/project-report.js.map +1 -1
- package/dist-server/service/supervisor/index.d.ts +0 -1
- package/dist-server/service/supervisor/index.js +1 -2
- package/dist-server/service/supervisor/index.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-mutation.js +2 -2
- package/dist-server/service/supervisor/supervisor-mutation.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-query.js +2 -2
- package/dist-server/service/supervisor/supervisor-query.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-type.js +6 -6
- package/dist-server/service/supervisor/supervisor-type.js.map +1 -1
- package/dist-server/service/supervisor/supervisor.js +3 -3
- package/dist-server/service/supervisor/supervisor.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/things-factory.config.js +3 -1
- package/client/bootstrap.ts +0 -1
- package/client/index.ts +0 -0
- package/client/pages/action-plan/action-plan-importer.ts +0 -94
- package/client/pages/action-plan/action-plan-list-page.ts +0 -340
- package/client/pages/building-inspection/building-inspection-detail-camera.ts +0 -277
- package/client/pages/building-inspection/building-inspection-detail-checklist.ts +0 -258
- package/client/pages/building-inspection/building-inspection-detail-drawing.ts +0 -288
- package/client/pages/building-inspection/building-inspection-list.ts +0 -565
- package/client/pages/building-inspection/component/building-inspection-detail-header.ts +0 -123
- package/client/pages/building-inspection/component/inspection-event-provider.ts +0 -81
- package/client/pages/building-inspection/inspection-create-popup.ts +0 -785
- package/client/pages/checklist/attachment-list-popup.ts +0 -301
- package/client/pages/checklist/checklist-view.ts +0 -581
- package/client/pages/checklist/comment-list-popup.ts +0 -328
- package/client/pages/checklist/file-preview-popup.ts +0 -70
- package/client/pages/checklist-template/checklist-template-item.ts +0 -240
- package/client/pages/checklist-template/checklist-template-list.ts +0 -368
- package/client/pages/checklist-template/checklist-type-management.ts +0 -262
- package/client/pages/issue/issue-importer.ts +0 -94
- package/client/pages/issue/issue-list-page.ts +0 -340
- package/client/pages/project-report/project-report-importer.ts +0 -94
- package/client/pages/project-report/project-report-list-page.ts +0 -340
- package/client/pages/supervisor/supervisor-importer.ts +0 -94
- package/client/pages/supervisor/supervisor-list-page.ts +0 -340
- package/client/route.ts +0 -27
- package/client/tsconfig.json +0 -11
- package/dist-server/service/building-inspection/event-subscriber.d.ts +0 -7
- package/dist-server/service/building-inspection/event-subscriber.js +0 -21
- package/dist-server/service/building-inspection/event-subscriber.js.map +0 -1
- package/dist-server/service/checklist/event-subscriber.d.ts +0 -7
- package/dist-server/service/checklist/event-subscriber.js +0 -21
- package/dist-server/service/checklist/event-subscriber.js.map +0 -1
- package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +0 -7
- package/dist-server/service/checklist-item-comment/event-subscriber.js +0 -21
- package/dist-server/service/checklist-item-comment/event-subscriber.js.map +0 -1
- package/server/controllers/index.ts +0 -0
- package/server/index.ts +0 -4
- package/server/middlewares/index.ts +0 -3
- package/server/migrations/index.ts +0 -9
- package/server/routes.ts +0 -28
- package/server/service/action-plan/action-plan-mutation.ts +0 -198
- package/server/service/action-plan/action-plan-query.ts +0 -62
- package/server/service/action-plan/action-plan-type.ts +0 -61
- package/server/service/action-plan/action-plan.ts +0 -103
- package/server/service/action-plan/index.ts +0 -7
- package/server/service/building-inspection/building-inspection-history.ts +0 -72
- package/server/service/building-inspection/building-inspection-mutation.ts +0 -276
- package/server/service/building-inspection/building-inspection-query.ts +0 -242
- package/server/service/building-inspection/building-inspection-type.ts +0 -145
- package/server/service/building-inspection/building-inspection.ts +0 -108
- package/server/service/building-inspection/event-subscriber.ts +0 -20
- package/server/service/building-inspection/index.ts +0 -11
- package/server/service/checklist/checklist-history.ts +0 -96
- package/server/service/checklist/checklist-mutation.ts +0 -103
- package/server/service/checklist/checklist-query.ts +0 -58
- package/server/service/checklist/checklist-type.ts +0 -49
- package/server/service/checklist/checklist.ts +0 -127
- package/server/service/checklist/event-subscriber.ts +0 -17
- package/server/service/checklist/index.ts +0 -9
- package/server/service/checklist-item/checklist-item-mutation.ts +0 -5
- package/server/service/checklist-item/checklist-item-query.ts +0 -84
- package/server/service/checklist-item/checklist-item-type.ts +0 -12
- package/server/service/checklist-item/checklist-item.ts +0 -103
- package/server/service/checklist-item/index.ts +0 -7
- package/server/service/checklist-item-comment/checklist-item-comment-history.ts +0 -69
- package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +0 -80
- package/server/service/checklist-item-comment/checklist-item-comment-query.ts +0 -36
- package/server/service/checklist-item-comment/checklist-item-comment-type.ts +0 -32
- package/server/service/checklist-item-comment/checklist-item-comment.ts +0 -56
- package/server/service/checklist-item-comment/event-subscriber.ts +0 -17
- package/server/service/checklist-item-comment/index.ts +0 -9
- package/server/service/checklist-template/checklist-template-mutation.ts +0 -66
- package/server/service/checklist-template/checklist-template-query.ts +0 -39
- package/server/service/checklist-template/checklist-template-type.ts +0 -23
- package/server/service/checklist-template/checklist-template.ts +0 -71
- package/server/service/checklist-template/index.ts +0 -6
- package/server/service/checklist-template-item/checklist-template-item-mutation.ts +0 -64
- package/server/service/checklist-template-item/checklist-template-item-query.ts +0 -44
- package/server/service/checklist-template-item/checklist-template-item-type.ts +0 -39
- package/server/service/checklist-template-item/checklist-template-item.ts +0 -68
- package/server/service/checklist-template-item/index.ts +0 -6
- package/server/service/checklist-type/checklist-type-mutation.ts +0 -66
- package/server/service/checklist-type/checklist-type-query.ts +0 -39
- package/server/service/checklist-type/checklist-type-type.ts +0 -26
- package/server/service/checklist-type/checklist-type.ts +0 -64
- package/server/service/checklist-type/index.ts +0 -6
- package/server/service/index.ts +0 -88
- package/server/service/issue/index.ts +0 -7
- package/server/service/issue/issue-mutation.ts +0 -198
- package/server/service/issue/issue-query.ts +0 -62
- package/server/service/issue/issue-type.ts +0 -61
- package/server/service/issue/issue.ts +0 -100
- package/server/service/project-report/index.ts +0 -7
- package/server/service/project-report/project-report-mutation.ts +0 -198
- package/server/service/project-report/project-report-query.ts +0 -62
- package/server/service/project-report/project-report-type.ts +0 -61
- package/server/service/project-report/project-report.ts +0 -113
- package/server/service/supervisor/index.ts +0 -7
- package/server/service/supervisor/supervisor-mutation.ts +0 -198
- package/server/service/supervisor/supervisor-query.ts +0 -62
- package/server/service/supervisor/supervisor-type.ts +0 -61
- package/server/service/supervisor/supervisor.ts +0 -108
- package/server/tsconfig.json +0 -10
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
|
|
2
|
-
import { In } from 'typeorm'
|
|
3
|
-
|
|
4
|
-
import { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'
|
|
5
|
-
|
|
6
|
-
import { ActionPlan } from './action-plan'
|
|
7
|
-
import { NewActionPlan, ActionPlanPatch } from './action-plan-type'
|
|
8
|
-
|
|
9
|
-
@Resolver(ActionPlan)
|
|
10
|
-
export class ActionPlanMutation {
|
|
11
|
-
@Directive('@transaction')
|
|
12
|
-
@Mutation(returns => ActionPlan, { description: 'To create new ActionPlan' })
|
|
13
|
-
async createActionPlan(@Arg('actionPlan') actionPlan: NewActionPlan, @Ctx() context: ResolverContext): Promise<ActionPlan> {
|
|
14
|
-
const { domain, user, tx } = context.state
|
|
15
|
-
|
|
16
|
-
const result = await tx.getRepository(ActionPlan).save({
|
|
17
|
-
...actionPlan,
|
|
18
|
-
domain,
|
|
19
|
-
creator: user,
|
|
20
|
-
updater: user
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
if (actionPlan.thumbnail) {
|
|
24
|
-
await createAttachment(
|
|
25
|
-
null,
|
|
26
|
-
{
|
|
27
|
-
attachment: {
|
|
28
|
-
file: actionPlan.thumbnail,
|
|
29
|
-
refType: ActionPlan.name,
|
|
30
|
-
refBy: result.id
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
context
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return result
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@Directive('@transaction')
|
|
41
|
-
@Mutation(returns => ActionPlan, { description: 'To modify ActionPlan information' })
|
|
42
|
-
async updateActionPlan(
|
|
43
|
-
@Arg('id') id: string,
|
|
44
|
-
@Arg('patch') patch: ActionPlanPatch,
|
|
45
|
-
@Ctx() context: ResolverContext
|
|
46
|
-
): Promise<ActionPlan> {
|
|
47
|
-
const { domain, user, tx } = context.state
|
|
48
|
-
|
|
49
|
-
const repository = tx.getRepository(ActionPlan)
|
|
50
|
-
const actionPlan = await repository.findOne({
|
|
51
|
-
where: { domain: { id: domain.id }, id }
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
const result = await repository.save({
|
|
55
|
-
...actionPlan,
|
|
56
|
-
...patch,
|
|
57
|
-
updater: user
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
if (patch.thumbnail) {
|
|
61
|
-
await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)
|
|
62
|
-
await createAttachment(
|
|
63
|
-
null,
|
|
64
|
-
{
|
|
65
|
-
attachment: {
|
|
66
|
-
file: patch.thumbnail,
|
|
67
|
-
refType: ActionPlan.name,
|
|
68
|
-
refBy: result.id
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
context
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return result
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@Directive('@transaction')
|
|
79
|
-
@Mutation(returns => [ActionPlan], { description: "To modify multiple ActionPlans' information" })
|
|
80
|
-
async updateMultipleActionPlan(
|
|
81
|
-
@Arg('patches', type => [ActionPlanPatch]) patches: ActionPlanPatch[],
|
|
82
|
-
@Ctx() context: ResolverContext
|
|
83
|
-
): Promise<ActionPlan[]> {
|
|
84
|
-
const { domain, user, tx } = context.state
|
|
85
|
-
|
|
86
|
-
let results = []
|
|
87
|
-
const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
|
|
88
|
-
const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
|
|
89
|
-
const actionPlanRepo = tx.getRepository(ActionPlan)
|
|
90
|
-
|
|
91
|
-
if (_createRecords.length > 0) {
|
|
92
|
-
for (let i = 0; i < _createRecords.length; i++) {
|
|
93
|
-
const newRecord = _createRecords[i]
|
|
94
|
-
|
|
95
|
-
const result = await actionPlanRepo.save({
|
|
96
|
-
...newRecord,
|
|
97
|
-
domain,
|
|
98
|
-
creator: user,
|
|
99
|
-
updater: user
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
if (newRecord.thumbnail) {
|
|
103
|
-
await createAttachment(
|
|
104
|
-
null,
|
|
105
|
-
{
|
|
106
|
-
attachment: {
|
|
107
|
-
file: newRecord.thumbnail,
|
|
108
|
-
refType: ActionPlan.name,
|
|
109
|
-
refBy: result.id
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
context
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
results.push({ ...result, cuFlag: '+' })
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (_updateRecords.length > 0) {
|
|
121
|
-
for (let i = 0; i < _updateRecords.length; i++) {
|
|
122
|
-
const updateRecord = _updateRecords[i]
|
|
123
|
-
const actionPlan = await actionPlanRepo.findOneBy({ id: updateRecord.id })
|
|
124
|
-
|
|
125
|
-
const result = await actionPlanRepo.save({
|
|
126
|
-
...actionPlan,
|
|
127
|
-
...updateRecord,
|
|
128
|
-
updater: user
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
if (updateRecord.thumbnail) {
|
|
132
|
-
await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)
|
|
133
|
-
await createAttachment(
|
|
134
|
-
null,
|
|
135
|
-
{
|
|
136
|
-
attachment: {
|
|
137
|
-
file: updateRecord.thumbnail,
|
|
138
|
-
refType: ActionPlan.name,
|
|
139
|
-
refBy: result.id
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
context
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
results.push({ ...result, cuFlag: 'M' })
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return results
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
@Directive('@transaction')
|
|
154
|
-
@Mutation(returns => Boolean, { description: 'To delete ActionPlan' })
|
|
155
|
-
async deleteActionPlan(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {
|
|
156
|
-
const { domain, tx } = context.state
|
|
157
|
-
|
|
158
|
-
await tx.getRepository(ActionPlan).delete({ domain: { id: domain.id }, id })
|
|
159
|
-
await deleteAttachmentsByRef(null, { refBys: [id] }, context)
|
|
160
|
-
|
|
161
|
-
return true
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
@Directive('@transaction')
|
|
165
|
-
@Mutation(returns => Boolean, { description: 'To delete multiple ActionPlans' })
|
|
166
|
-
async deleteActionPlans(
|
|
167
|
-
@Arg('ids', type => [String]) ids: string[],
|
|
168
|
-
@Ctx() context: ResolverContext
|
|
169
|
-
): Promise<boolean> {
|
|
170
|
-
const { domain, tx } = context.state
|
|
171
|
-
|
|
172
|
-
await tx.getRepository(ActionPlan).delete({
|
|
173
|
-
domain: { id: domain.id },
|
|
174
|
-
id: In(ids)
|
|
175
|
-
})
|
|
176
|
-
|
|
177
|
-
await deleteAttachmentsByRef(null, { refBys: ids }, context)
|
|
178
|
-
|
|
179
|
-
return true
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
@Directive('@transaction')
|
|
183
|
-
@Mutation(returns => Boolean, { description: 'To import multiple ActionPlans' })
|
|
184
|
-
async importActionPlans(
|
|
185
|
-
@Arg('actionPlans', type => [ActionPlanPatch]) actionPlans: ActionPlanPatch[],
|
|
186
|
-
@Ctx() context: ResolverContext
|
|
187
|
-
): Promise<boolean> {
|
|
188
|
-
const { domain, tx } = context.state
|
|
189
|
-
|
|
190
|
-
await Promise.all(
|
|
191
|
-
actionPlans.map(async (actionPlan: ActionPlanPatch) => {
|
|
192
|
-
const createdActionPlan: ActionPlan = await tx.getRepository(ActionPlan).save({ domain, ...actionPlan })
|
|
193
|
-
})
|
|
194
|
-
)
|
|
195
|
-
|
|
196
|
-
return true
|
|
197
|
-
}
|
|
198
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
|
|
2
|
-
import { Attachment } from '@things-factory/attachment-base'
|
|
3
|
-
import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
|
|
4
|
-
import { User } from '@things-factory/auth-base'
|
|
5
|
-
import { ActionPlan } from './action-plan'
|
|
6
|
-
import { ActionPlanList } from './action-plan-type'
|
|
7
|
-
|
|
8
|
-
@Resolver(ActionPlan)
|
|
9
|
-
export class ActionPlanQuery {
|
|
10
|
-
@Query(returns => ActionPlan!, { nullable: true, description: 'To fetch a ActionPlan' })
|
|
11
|
-
async actionPlan(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<ActionPlan> {
|
|
12
|
-
const { domain } = context.state
|
|
13
|
-
|
|
14
|
-
return await getRepository(ActionPlan).findOne({
|
|
15
|
-
where: { domain: { id: domain.id }, id }
|
|
16
|
-
})
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@Query(returns => ActionPlanList, { description: 'To fetch multiple ActionPlans' })
|
|
20
|
-
async actionPlans(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ActionPlanList> {
|
|
21
|
-
const { domain } = context.state
|
|
22
|
-
|
|
23
|
-
const queryBuilder = getQueryBuilderFromListParams({
|
|
24
|
-
domain,
|
|
25
|
-
params,
|
|
26
|
-
repository: await getRepository(ActionPlan),
|
|
27
|
-
searchables: ['name', 'description']
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
const [items, total] = await queryBuilder.getManyAndCount()
|
|
31
|
-
|
|
32
|
-
return { items, total }
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@FieldResolver(type => String)
|
|
36
|
-
async thumbnail(@Root() actionPlan: ActionPlan): Promise<string | undefined> {
|
|
37
|
-
const attachment: Attachment = await getRepository(Attachment).findOne({
|
|
38
|
-
where: {
|
|
39
|
-
domain: { id: actionPlan.domainId },
|
|
40
|
-
refType: ActionPlan.name,
|
|
41
|
-
refBy: actionPlan.id
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
return attachment?.fullpath
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@FieldResolver(type => Domain)
|
|
49
|
-
async domain(@Root() actionPlan: ActionPlan): Promise<Domain> {
|
|
50
|
-
return await getRepository(Domain).findOneBy({ id: actionPlan.domainId })
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@FieldResolver(type => User)
|
|
54
|
-
async updater(@Root() actionPlan: ActionPlan): Promise<User> {
|
|
55
|
-
return await getRepository(User).findOneBy({ id: actionPlan.updaterId })
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@FieldResolver(type => User)
|
|
59
|
-
async creator(@Root() actionPlan: ActionPlan): Promise<User> {
|
|
60
|
-
return await getRepository(User).findOneBy({ id: actionPlan.creatorId })
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'
|
|
2
|
-
import GraphQLUpload from 'graphql-upload/GraphQLUpload.js'
|
|
3
|
-
import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'
|
|
4
|
-
|
|
5
|
-
import { ObjectRef, ScalarObject } from '@things-factory/shell'
|
|
6
|
-
|
|
7
|
-
import { ActionPlan, ActionPlanStatus } from './action-plan'
|
|
8
|
-
|
|
9
|
-
@InputType()
|
|
10
|
-
export class NewActionPlan {
|
|
11
|
-
@Field()
|
|
12
|
-
name: string
|
|
13
|
-
|
|
14
|
-
@Field({ nullable: true })
|
|
15
|
-
description?: string
|
|
16
|
-
|
|
17
|
-
@Field(type => ActionPlanStatus, { nullable: true })
|
|
18
|
-
state?: ActionPlanStatus
|
|
19
|
-
|
|
20
|
-
@Field({ nullable: true })
|
|
21
|
-
active?: boolean
|
|
22
|
-
|
|
23
|
-
@Field({ nullable: true })
|
|
24
|
-
params?: string
|
|
25
|
-
|
|
26
|
-
@Field(type => GraphQLUpload, { nullable: true })
|
|
27
|
-
thumbnail?: FileUpload
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@InputType()
|
|
31
|
-
export class ActionPlanPatch {
|
|
32
|
-
@Field(type => ID, { nullable: true })
|
|
33
|
-
id?: string
|
|
34
|
-
|
|
35
|
-
@Field({ nullable: true })
|
|
36
|
-
name?: string
|
|
37
|
-
|
|
38
|
-
@Field({ nullable: true })
|
|
39
|
-
description?: string
|
|
40
|
-
|
|
41
|
-
@Field(type => ActionPlanStatus, { nullable: true })
|
|
42
|
-
state?: ActionPlanStatus
|
|
43
|
-
|
|
44
|
-
@Field({ nullable: true })
|
|
45
|
-
active?: boolean
|
|
46
|
-
|
|
47
|
-
@Field(type => GraphQLUpload, { nullable: true })
|
|
48
|
-
thumbnail?: FileUpload
|
|
49
|
-
|
|
50
|
-
@Field({ nullable: true })
|
|
51
|
-
cuFlag?: string
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@ObjectType()
|
|
55
|
-
export class ActionPlanList {
|
|
56
|
-
@Field(type => [ActionPlan])
|
|
57
|
-
items: ActionPlan[]
|
|
58
|
-
|
|
59
|
-
@Field(type => Int)
|
|
60
|
-
total: number
|
|
61
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CreateDateColumn,
|
|
3
|
-
UpdateDateColumn,
|
|
4
|
-
DeleteDateColumn,
|
|
5
|
-
Entity,
|
|
6
|
-
Index,
|
|
7
|
-
Column,
|
|
8
|
-
RelationId,
|
|
9
|
-
ManyToOne,
|
|
10
|
-
PrimaryGeneratedColumn,
|
|
11
|
-
VersionColumn
|
|
12
|
-
} from 'typeorm'
|
|
13
|
-
import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
|
|
14
|
-
|
|
15
|
-
import { Domain } from '@things-factory/shell'
|
|
16
|
-
import { User } from '@things-factory/auth-base'
|
|
17
|
-
import { Issue } from '../issue/issue'
|
|
18
|
-
|
|
19
|
-
export enum ActionPlanStatus {
|
|
20
|
-
STATUS_A = 'STATUS_A',
|
|
21
|
-
STATUS_B = 'STATUS_B'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
registerEnumType(ActionPlanStatus, {
|
|
25
|
-
name: 'ActionPlanStatus',
|
|
26
|
-
description: 'state enumeration of a actionPlan'
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
@Entity()
|
|
30
|
-
@Index('ix_action_plan_0', (actionPlan: ActionPlan) => [actionPlan.domain, actionPlan.name], {
|
|
31
|
-
unique: true,
|
|
32
|
-
where: '"deleted_at" IS NULL'
|
|
33
|
-
})
|
|
34
|
-
@ObjectType({ description: 'Entity for ActionPlan' })
|
|
35
|
-
export class ActionPlan {
|
|
36
|
-
@PrimaryGeneratedColumn('uuid')
|
|
37
|
-
@Field(type => ID)
|
|
38
|
-
readonly id: string
|
|
39
|
-
|
|
40
|
-
@ManyToOne(type => Domain)
|
|
41
|
-
@Field({ nullable: true })
|
|
42
|
-
domain?: Domain
|
|
43
|
-
|
|
44
|
-
@RelationId((actionPlan: ActionPlan) => actionPlan.domain)
|
|
45
|
-
domainId?: string
|
|
46
|
-
|
|
47
|
-
@Column()
|
|
48
|
-
@Field({ nullable: true })
|
|
49
|
-
name?: string
|
|
50
|
-
|
|
51
|
-
@Column({ nullable: true })
|
|
52
|
-
@Field({ nullable: true })
|
|
53
|
-
description?: string
|
|
54
|
-
|
|
55
|
-
@Column({ nullable: true })
|
|
56
|
-
@Field({ nullable: true })
|
|
57
|
-
active?: boolean
|
|
58
|
-
|
|
59
|
-
@Column({ nullable: true })
|
|
60
|
-
@Field({ nullable: true })
|
|
61
|
-
state?: ActionPlanStatus
|
|
62
|
-
|
|
63
|
-
@Column({ nullable: true })
|
|
64
|
-
@Field({ nullable: true })
|
|
65
|
-
params?: string
|
|
66
|
-
|
|
67
|
-
@Field(() => Issue)
|
|
68
|
-
@ManyToOne(() => Issue, issue => issue.actionPlans)
|
|
69
|
-
issue: Issue
|
|
70
|
-
|
|
71
|
-
@Column({ nullable: true })
|
|
72
|
-
@Field({ nullable: true })
|
|
73
|
-
content: string
|
|
74
|
-
|
|
75
|
-
@CreateDateColumn()
|
|
76
|
-
@Field({ nullable: true })
|
|
77
|
-
createdAt?: Date
|
|
78
|
-
|
|
79
|
-
@UpdateDateColumn()
|
|
80
|
-
@Field({ nullable: true })
|
|
81
|
-
updatedAt?: Date
|
|
82
|
-
|
|
83
|
-
@DeleteDateColumn()
|
|
84
|
-
@Field({ nullable: true })
|
|
85
|
-
deletedAt?: Date
|
|
86
|
-
|
|
87
|
-
@ManyToOne(type => User, { nullable: true })
|
|
88
|
-
@Field(type => User, { nullable: true })
|
|
89
|
-
creator?: User
|
|
90
|
-
|
|
91
|
-
@RelationId((actionPlan: ActionPlan) => actionPlan.creator)
|
|
92
|
-
creatorId?: string
|
|
93
|
-
|
|
94
|
-
@ManyToOne(type => User, { nullable: true })
|
|
95
|
-
@Field(type => User, { nullable: true })
|
|
96
|
-
updater?: User
|
|
97
|
-
|
|
98
|
-
@RelationId((actionPlan: ActionPlan) => actionPlan.updater)
|
|
99
|
-
updaterId?: string
|
|
100
|
-
|
|
101
|
-
@Field(type => String, { nullable: true })
|
|
102
|
-
thumbnail?: string
|
|
103
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionPlan } from './action-plan'
|
|
2
|
-
import { ActionPlanQuery } from './action-plan-query'
|
|
3
|
-
import { ActionPlanMutation } from './action-plan-mutation'
|
|
4
|
-
|
|
5
|
-
export const entities = [ActionPlan]
|
|
6
|
-
export const resolvers = [ActionPlanQuery, ActionPlanMutation]
|
|
7
|
-
export const subscribers = []
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Field, ID, ObjectType } from 'type-graphql'
|
|
2
|
-
import { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'
|
|
3
|
-
import { HistoryActionColumn, HistoryActionType, HistoryEntityInterface, HistoryOriginalIdColumn } from '@operato/typeorm-history'
|
|
4
|
-
import { User } from '@things-factory/auth-base'
|
|
5
|
-
import { config } from '@things-factory/env'
|
|
6
|
-
import { BuildingInspection, BuildingInspectionStatus } from './building-inspection'
|
|
7
|
-
import { BuildingLevel } from '@dssp/building-complex'
|
|
8
|
-
|
|
9
|
-
const ORMCONFIG = config.get('ormconfig', {})
|
|
10
|
-
const DATABASE_TYPE = ORMCONFIG.type
|
|
11
|
-
|
|
12
|
-
@Entity()
|
|
13
|
-
@Index('ix_buildingInspection_history_0', (buildingInspectionHistory: BuildingInspectionHistory) => [
|
|
14
|
-
buildingInspectionHistory.originalId
|
|
15
|
-
])
|
|
16
|
-
@ObjectType({ description: 'History Entity of BuildingInspection' })
|
|
17
|
-
export class BuildingInspectionHistory implements HistoryEntityInterface<BuildingInspection> {
|
|
18
|
-
@PrimaryGeneratedColumn('uuid')
|
|
19
|
-
@Field(type => ID)
|
|
20
|
-
readonly id: string
|
|
21
|
-
|
|
22
|
-
@HistoryOriginalIdColumn()
|
|
23
|
-
public originalId!: string
|
|
24
|
-
|
|
25
|
-
@Column({
|
|
26
|
-
nullable: false,
|
|
27
|
-
comment:
|
|
28
|
-
'상태(WAIT: 검측 대기, OVERALL_WAIT: 총괄자 검측 대기, REQUEST: 검측 요청, OVERALL_REQUEST: 총괄자 검측 요청, PASS: 합격, FAIL: 불합격)'
|
|
29
|
-
})
|
|
30
|
-
@Field({ nullable: true })
|
|
31
|
-
status?: BuildingInspectionStatus
|
|
32
|
-
|
|
33
|
-
// 층 정보 (1:1 테이블 참조)
|
|
34
|
-
@ManyToOne(type => BuildingLevel)
|
|
35
|
-
@Field({ nullable: true })
|
|
36
|
-
buildingLevel?: BuildingLevel
|
|
37
|
-
|
|
38
|
-
@RelationId((buildingInspectionHistory: BuildingInspectionHistory) => buildingInspectionHistory.buildingLevel)
|
|
39
|
-
buildingLevelId?: string
|
|
40
|
-
|
|
41
|
-
@Column({ type: 'date', nullable: true, comment: '검측 요청일' })
|
|
42
|
-
@Field(type => String, { nullable: true })
|
|
43
|
-
requestDate?: string
|
|
44
|
-
|
|
45
|
-
// 체크리스트 ID (1:1 테이블 참조)
|
|
46
|
-
@Field({ nullable: true })
|
|
47
|
-
@Column({ nullable: true, comment: '체크리스트 ID' })
|
|
48
|
-
checklistId: string
|
|
49
|
-
|
|
50
|
-
@Column({ nullable: true })
|
|
51
|
-
@Field({ nullable: true })
|
|
52
|
-
createdAt?: Date
|
|
53
|
-
|
|
54
|
-
@ManyToOne(type => User, { nullable: true })
|
|
55
|
-
@Field(type => User, { nullable: true })
|
|
56
|
-
creator?: User
|
|
57
|
-
|
|
58
|
-
@RelationId((buildingInspectionHistory: BuildingInspectionHistory) => buildingInspectionHistory.creator)
|
|
59
|
-
creatorId?: string
|
|
60
|
-
|
|
61
|
-
@HistoryActionColumn({
|
|
62
|
-
nullable: false,
|
|
63
|
-
type:
|
|
64
|
-
DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
65
|
-
? 'enum'
|
|
66
|
-
: DATABASE_TYPE == 'oracle'
|
|
67
|
-
? 'varchar2'
|
|
68
|
-
: 'smallint',
|
|
69
|
-
enum: HistoryActionType
|
|
70
|
-
})
|
|
71
|
-
public action!: HistoryActionType
|
|
72
|
-
}
|